2

How to configure postfix to only receive mails and put them into local queue but not actually forwarding mails so they keep inside /var/spool/postfix

frlan
  • 573
  • 1
  • 8
  • 27
  • Is there a reason you can't use a tool like MailHog or MailCatcher if you don't actually intend to send the emails? Such tools are explicitly designed to do what you want - catch all sent mail and display it. – Moshe Katz Aug 17 '16 at 12:46
  • My goal was to just temp. forward mails — so like a postsuper -h ALL for future incoming mails – frlan Aug 17 '16 at 13:01

1 Answers1

2

Try adding the following:

/etc/postfix/main.cf:

smtpd_recipient_restrictions = 
...
check_recipient_access regexp:/etc/postfix/hold.regexp

/etc/postfix/hold.regexp:

/^/   HOLD

If you want to release all messages on hold, use postsuper:

postsuper -H ALL