I've found a need to have a log of all the mail qmail-scanner sees, but I don't need something as verbose as DEBUG. A co-worker and I wrote a patch against qmail-scanner-queue.template (1.25) that allows per-message logging, recording sender, recipient, subject, and attachment name (if there is one).
This has proved useful when tracking down specific emails which were relayed to our exchange server that I would really rather have been quarantined. Does anyone have feedback on this? 147a148,150 > #Name of file in $scandir where logged message content goes > my $msg_log="msg.log"; > 268a272,273 > my $MSG_DEBUG='DEBUG_LEVEL'; > 357a363,368 > if ($MSG_DEBUG ) { > open(MSG_LOG,">>$scandir/msg.log"); > select(MSG_LOG);$|=1; > &msg_debug("+++ starting message logging for process $$ by uid=$real_uid"); > } > 426a438 > &msg_debug("from=$headers{'MAILFROM'},rcpto=$headers{'RCPTTO'},subj=$headers{'subject'}"); 427a440 > 522a536,540 > sub msg_debug { > my $dnowtime = strftime("%a, %d %b %Y %H:%M:%S %Z", localtime(time)); > print MSG_LOG "$dnowtime:$$: ",@_,"\n" if ($MSG_DEBUG); > } > 729a748 > &msg_debug("w_c: a found a Content-Type attachment filename of \"$ct_attachment_filename\""); 742a762 > &msg_debug("attachment \"$cd_attachment_filename\""); ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Qmail-scanner-general mailing list Qmail-scanner-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general