At 14:42 +0200 30-08-2004, l'Alessio wrote:
I'd like my qmail-scanner to rejecet email with no Subject: field and no Date:
filed in the header.

I'm not a programmer and I don't know perl, can anyone help me please?


Hi Alessio

You will need to add some code to do that (you also will update from 1.16 to 1.23..).

Edit /var/qmail/bin/qmail-scanner-queue.pl and after this code:

#This SMTP session is incomplete until we see dem envelope headers!
&grab_envelope_hdrs;
&debug("from=$headers{'from'},subj=$headers{'subject'}, $qsmsgid=$headers{$qsmsgid} $smtp_sender");




Add these lines:

# Maybe it is better a restrictive condition ('and') than...
# if ( ! exists $headers{'subject'} || ! exists $headers{'date'} ) {
if ( ! exists $headers{'subject'} && ! exists $headers{'date'} ) {
&cleanup;
($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
$nowtime = sprintf "%02d/%02d/%02d %02d:%02d:%02d", $mday, $mon+1, $year+1900, $hour, $min, $sec;
&debug("w_c: Missing subject and date headers, dropping");
&debug("--- all finished. Total of ",tv_interval ($start_time, [gettimeofday])," secs");
# To drop the mail
exit 0;
# Or if you want to reject the mail
# exit 31;
}




You will test it before using it in a productions server.

Ciao

Salvatore


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Qmail-scanner-general mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to