On Sunday, January 18, 2009 at 09:55 CET,
Luigi Rosa <[email protected]> wrote:
> Is there a command line way to put temporary Postfix smtpd on hold,
> that is forcing it to reply "4xx Come back soon" to every incoming
> connection?
While you could use smtpd_xxx_restrictions for this, it's better to use
the transport table since that method applies to all messages and not
just those submitted via SMTP. The special error(8) transport is your
friend. Untested, but should work with Postfix 2.4+:
main.cf:
transport_maps = pcre:/path/to/file
/path/to/file:
/^/ retry:4.3.2 Server currently not accepting messages.
http://www.postfix.org/error.8.html
http://tools.ietf.org/html/rfc3463#section-3.4
> It could be useful (for me) during weekly backup/maintenance/whatever
> operations.
But why not just defer the *delivery* of the messages rather than block
the *reception* of messages? If you want to do maintenance of the
Postfix queue directories etc (i.e. something that would make message
reception a bad idea) you probably don't want Postfix to be running at
all. Use defer_transports, for example like this to block deliveries
with local(8) and virtual(8):
defer_transports = local, virtual
[...]
--
Magnus Bäck
[email protected]