Bernd Wurst writes:

Hi.

Is there a simple way to reject incoming mail sent to a particular local
recipient?

We run courier MTA with a virtual (hosted domains) setup without
maildrop or another generic SMTP mail filter. There are customers that
want to give up a particular address and then place an autoresponder on
the mailbox. As autoresponders are evil, we'd like to replace this with
a SMTP reject.

I found "spamtrap" in the "bofh" file but is seems this cannot be set up
with an individual notice. Is there another simple way without external
filter software?

No, you have to use an external filter software, of some kind. maildrop would be easiest, since it already knows how to talk to Courier, but, in theory, even a shell script can be used.

You could set the contents of the maildropfilter to point to a shell script, rather than maildrop.

The shell script would get invoked in the manner described in the localmailfilter man apge:

HOME=$HOME <pathname> -D uid/gid -M filter

So, the nondeliverable account gets set up as a pseudo account with a home directory. The shell script needs to parse its command line arguments. If <filter> begins with 'rcptfilter', exit with status code 0 unless $HOME is the pseudo account, in which case the exit code is 99.

If <filter> begins with smtpfilter, the script prints your custom error message and exits with a non-0 exit code.

Another way to do this would be with a Perl filter, which works differently. Perl might be easier, but it'll have the disadvantage of having to choose between rejecting the entire message addressed to multiple local recipients, because of this one recipient, or silently accepting the message without an error message, but not delivering it to that one recipient.

Attachment: pgp3miE8INc5z.pgp
Description: PGP signature

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to