On 16 Jan 2019, at 4:15, Pali Rohár wrote:

Hello, it is possible to accept emails with 5xx status code?

Why such behavior? I want to return 5xx status codes when email is
reject (to prevent sending bounces), but I would like to store copy of
rejected emails in case some inspection would be needed in future.
Storing copy of those emails into one "shared" mailbox is enough (no
need to properly deliver these emails into local accounts).

Warning: this is a tactic that many people believe that they want before they have implemented it but never actually use once it has been implemented.

For example, I ran a system with that sort of "quarantine" for ~5000 business users for 5 years where no user ever touched it or asked for help with its very clear and accessible documentation.

I have configured spamassassin via milter, so if spamd mark email as
spam, then postfix reject it via 5xx status code and does not produce
any bounce. Similarly, I have configured some header_checks for
rejecting emails to prevent generating bounces.

If you can make that milter save the message but tell Postfix to reject it, your problem is solved. I do this with the MIMEDefang milter on a limited basis on a small system solely to have samples of the spam which I reject for research purposes.

I do not believe that it is possible to make header_checks both reject the message and save a copy of it.

Reply via email to