we use qmail for our small MTA at work, and management requires that all email messages (incoming and outgoing) are logged. by changing a couple of lines in extra.h you can add said logging abilities though /var/qmail/alias/.qmail-log by adding a logallmail use flag this patch can optionally be disabled. in the ebuild modification, i've added a URL to instructions on this feature. This is my first contribution to portage, so i apologize for any mistakes in the patches, and appreciate feedback Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 57397 [details, diff] Logall Patch
Created attachment 57398 [details, diff] requested qmail ebuild modification
Why don't you use the QMAILQUEUE variable with a perl script? tcp.smtp: 1.2.3.4:allow,QMAILQUEUE="/usr/local/bin/qmail-log.pl"
we use qmail-scanner for content filtering, and i couldn't figure out how to pass email through both, and when i googled for logging mail, this is what came up. but i wanted to keep my solution as "standard" as possible, and if other people need to implement this functionality this would be an easy way for them. it's also what (in my opinion) a use flag is _great_ for. it adds optional extra functionality, with just a simple configuration change to the user. the .qmail-log file works that same as any other alias/mailbox, so it makes it real simple.
Ok, ironically someone on the qmail mailing list just asked about this and there came an URL along (http://cr.yp.to/qmail/faq/admin.html#copies) which just describes the same as you. I think we can integrate this in some way into the -r16 ebuild.
please see the submitted patch and ebuild modification? i used my portage overlay to install this, and it works like a charm for me all i did was put the archive email address into the /var/qmail/alias/.qmail-log and bingo, every email in and out went to the archive account. it would be prudent to add to the end of the ebuild something like if use logall einfo "edit the /var/qmail/alias/.qmail-log file to tell" einfo "qmail what to do with copies of messages" einfo "it behaves the same as any other .qmail file" fi
also, in the supplied ebuild patch, i added the following website to the homepages area: http://www.cyber-sentry.com/index.php?id=35 it contains the same instructions, and a nice little overview of how to use the .qmail-log file, as well as ahandy rotation shell script.
Yes, it'll be integrated into the -r16 ebuild. Don't stress, please.
sorry, didn't mean to come across as stressed. i'm just excited to have contributed back to portage in some small way :)
It's implemented in qmail-1.03-r16 with the USE flag logmail. Can you test it, please?
seems to be acting strange: whatever i put in the /var/qmail/alias/.qmail-log get ignored, and every message comes back with a bounce saying that log@domain.com does not exist. if i create a log@domain.com alias, the message goes to the log address about 65 million times.
Further reseach has uncovered another method to create copies, made the the good folks at inter7 http://inter7.com/?page=qmailtap
Created attachment 58077 [details, diff] Inter7 qmail-tap patch Inter7 Qmail-Tap patch minus the qmail-regex stuff that gets applied with another patch. tested for sucessful compile.
Please provide a rediffed patch which applies to qmail-1.03-r16 where currently qmail-logmail.patch is applied. Thanks. Btw., I've tried ~alias/.qmail-log -- it works. You just have to do it right.
Would it be ok if the ebuild'd provided an example of ~alias/.qmail-log?
i think an example would be great since i'm not sure where i'm going wrong with the original log patch. i'm sorry i don't quite understand what you want when you ask for a rediffed patch that appies. doesn't the included qmail-tap apply?
If you now do "ebuild .../qmail-1.03-r16.ebuild config" and have USE=logmail, a ~alias/.qmail-log file is created. Is this better now?
Closing, because it's basically working. Doing more examples isn't hard.