Lindsay Haisley writes:
> If I reject an email using ~/.mailfilters/rcptfilter I can include and
> error code in the echo'd message and this will be used as the error code
> in a rejection notice returned to a corresponding SMTP server. Is there
> any way to do this for the content filter, ~/.mailfilters/smtpfilter?
> It seems that the error returned is always an error code 558. e.g.:
Yes. The problem is that the smtpfilter is, like rcptfilter, is per-
recipient. But this SMTP transaction error code is for the entire message.
You can only return a single error code. And if different recipients'
smtpfilters return different error codes, then what?
So, Courier returns this "compound" 558 error code. Only Courier really
understands what it means, all other mail servers just see it as any other
5xx error code in response to a SMTP DATA.
Several years after I struggled with this hole in the SMTP specification,
and, by trial and error, chose to deal with it in such manner – I recall
reading some boring IETF draft allegedly addressing the same issue. Of
course, it had some other way of dealing with this, because, predictably, an
existing working implementation just wouldn't cut it, because it's NIH.
> I want to mimic as closely as possible a 550 5.1.1 "User unknown" error
That's in response to a RCPT TO, to smtpfilter.
> I seem to have gotten onto an exceptionally obnoxious spam list which
> sends me 5 or 10 spams every hour most of which, for some reason, get by
> SpamAssassin. The one characteristic of all of these, for which my
> smtpfilter rule tests, is that my email address is always spec'd in all
> caps. Few if any legitimate correspondents ever do this, and rejecting
> such email with "I don't exist" seems appropriate. I'd like the
> rejection message to resemble a standard 550 5.1.1 error as closely as
> possible.
Spamware will not pay attention to this. Spamware will generally interpret
any rejection to a SMTP DATA as coming from a content filter of a valid
email address.
Unless this is rising to a level of a DOS attack, and 5-10 an hour is not
quite there yet, just let it beat its head against your wall, like that, and
ignore it.