2

I'm setting up a forwarding only email server. I want to apply some static forwarding rules to all incoming emails and bounce all other incoming emails (and not store them locally).

/etc/postfix/main.cf

myhostname = sputnik.*domain*.com
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
myorigin = /etc/mailname
mydestination = sputnik.*domain*.com, localhost.*domain*.com, , localhost
relayhost = 
mynetworks = 127.0.0.0/8 10.0.0.0/24 [::1]/128 [fe80::%eth0]/64
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual

domain1.com anything
@domain1.com [email protected]
[email protected] [email protected]

domain3.com anything
[email protected] [email protected]

Example outcomes:

Currently instead of bouncing the emails they are getting stored at /var/mail/*username* and the sender isn't alerted that the email didn't go through.

1 Answer 1

1

The Postfix documentation has an example of this under mail forwarding domains. I'm not sure what's going on with your mydestination line (Postfix doesn't seem to support wildcards here), but you need to list domain1.com and domain3.com under virtual_alias_domains (and not under mydestination). Also make sure that you've run postmap on /etc/postfix/virtual.

virtual_alias_domains = domain1.com, domain3.com

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .