Lindsay Haisley writes:

I have a .courier-postmaster file in the alias directory for my domain
name which handles mail to postmaster at my domain.  This works as
expected if the .courier-postmaster file contains only an address to
which to forward the postmaster email, in this case "fmouse-postmaster"
at my domain name.

If, on the other hand, I include a directive to run an external program
one of two things happens.  If the external program exits with an exit
code of 0, the next delivery instruction is read and executed, in this
case simple delivery to the mail account noted above.

If the external program returns an exit code of 100, however, the SMTP
dialog with the sender shows the message to be successfully delivered,
however courierlocal records a "failure" for the message in mail.log and
the postmaster address is disabled, requiring a "courier clear ..." to
re-enable it.

I would expect handling in the latter case to be according to the
dot-courier(5) man page, showing "undeliverable" in the SMTP dialog,
rejecting the email at the front door.

What am I missing here?  Does the fact that processing of dot-courier
files in the <virtual-domain>/alias/.courier-postmaster is a two step
process, invoking courierlocal twice mean that I can't do this?

.courier files do not get executed during an SMTP transfer.

Mail received via SMTP gets dropped into the mail queue, and delivery to local mailboxes occurs from there.

As an aside: the overall consensus, over the last decade, has turned to any kind of mail filtering during post-delivery post-processing to be a Very Bad Idea, because any bounces will likely go to a third party victim of a forged spam run.

Now, the direct issue here is that the man page is out of date as a result of changes that were introduced to implement that. So, basically you want to use only exit code 70, or EX_SOFTWARE, which will result in a real bounce that you wanted; as long as you're fully aware that you might be participating in a proxy mailbomb against a third party. All other error code listed explicitly in that man page are basically for a situation where you would consider yourself to be at fault; you screwed up, so you're going to eat crow, and, in the meantime, want Courier to reject all further mail to the broken mailbox. And all other exit codes would be to keep the message in the queue, and have another delivery attempt done later.

Now, if you want to filter something during SMTP, you'll need to use the smtpfilter hooks. You can install something that runs during SMTP for the postmaster address, but it's a bit of hard work, and some trial-and-error type of a deal.

Attachment: pgpQnP2p_cF9S.pgp
Description: PGP signature

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to