1

I have two postfix instances on the same machine (Ubuntu 18.04) managed with postmulti. One instance accepts incoming mail from MUAs and from other mailservers on the internet. Mail is delivered to mailboxes with virtual_mailbox_maps and aliases are defined in virtual_alias_maps and also virtual_mailbox_domains is configured.

What I want to do: if a mail is not delivered to a mailbox, but an alias points to another domain not hosted on this machine, the external delivery should be done by the other postfix instance. How can I do that?

The reason is, that I want to deliver detected spam (by spamassassin in an after-queue inspection) to mailboxes (moved to the Junk folder by a sieve script, that works already), but I do not want to relay spam to external domains. So I want to use header_checks on the outbound postfix instance to discard those mails.

UPDATE:

I think I figured it out: in the main.cf of the inbound instance I configured

relayhost = [localhost]:10026

and in the master.cf of the outbound instance

127.0.0.1:10026 inet n - n - - smtpd

Is that the correct way to do it?

dr fu manchu
  • 141
  • 4
  • Can someone confirm that the answer to the 10 years old question https://serverfault.com/questions/39826/let-postfix-handle-spam-in-two-ways is still valid and that it can be handled within a single postfix instance, simply with a process defined in master.cf? In that case this question could be flagged as duplicate of 39826 – dr fu manchu Dec 30 '19 at 12:38

0 Answers0