Steve wrote:
Hi List,

What is the quickest, easiest (and scriptable) way to have Postfix defer
everything with a 4xx error. It's an extension to my 'after midnight'
tests. Not allowing any connections is fine, but I would prefer to
reject with a custom 4xx message such as "GO AWAY - IT'S AFTER MIDNIGHT
-- COME BACK IN THE MORNING"

It's an odd request to be able to 'offline' with a defer so I won't be
surprised if I can't do it, but I would be Cindy Ecstacy Ecstatic if I
could.

TIA.
Steve.



# /etc/postfix/deferall.regexp
/^/  DEFER Please try again during business hours

(this assumes you aren't using "smtpd_client_restrictions" in your current main.cf. You can substitute any smtpd_*_restrictions section you aren't currently using)
two commands to defer everyone with a custom message:
postconf -e 'smtpd_client_restrictions=regexp:/etc/postfix/deferall.regexp'
postfix reload

two commands to enable mail:
postconf -e 'smtpd_client_restrictions='
postfix reload

and you can skip the "postfix reload" if you don't mind "lazy" implementation. Postfix will pick up the changes to smtpd_client_restrictions as smtpd processes are replaced.


Some notes:
- this should be effective in stopping most "botnet" spam, but no more so than greylisting. - this will delay legit mail that arrives during the "after hours" timeframe. The length of delay is controlled by the sender, and could be significant. - this won't have any effect on spammers that retry; it will just delay their delivery along with the legit mail.

My recommendation is to just implement greylisting and skip this nonsense.


  -- Noel Jones

Reply via email to