On Sep 22, 2003, at 8:44 AM, Oliver Lehmann wrote:


Hi Oliver,

(cc'ing the qpsmtpd list; please direct questions there in the future :-) )

I'm searching for a way to immediatly close the smtp connection if for
example the SUbject: header is matching a Regular expression (atm
./^Subject:[ ]*((Current|Last|New(est)?)
?)(Critical|(Internet|Microsoft|Net(work)?)( Critical|Security)?)
(Pack|Patch|Upgrade) *$/ would be nice ;) Does qpsmtpd provide such a
feature? I would like to save traffic at my side....

Usually you want to receive the whole thing to properly reject it as SMTP clients otherwise will just try again and again and again. I see why you'd want to do it here though as the viruses are unlikely to check the result anyway.


For now search for "$header->extract([EMAIL PROTECTED]);" in lib/Qpsmtpd/SMTP.pm. Add something like the following right after that line:

 if ($header->get('Subject') =~ m/regexp/) {
  $self->reset_transaction;
  $self->disconnect;
}

Maybe it'd be worthwhile to add a plugin hook for "headers received" in the future. But the we'd want a hook for "line received" too I guess and that might look unhealthy for the performance. Any opinions?

- ask

--
http://www.askbjoernhansen.com/



Reply via email to