postfix forward mail to multiple recipients

Questions related to the Postfix mail server
Post Reply
mister_v
Posts: 188
Joined: Thu Mar 04, 2010 9:19 pm

postfix forward mail to multiple recipients

Post by mister_v »

Hi,
Is it possible to setup postfix with a "general" email-address
that forwards the mails to multiple email-addresses ?
Like a group-email-address ?
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: postfix forward mail to multiple recipients

Post by chris »

Yes it possible.
Separate the emails with comas.

Edit the file /etc/postfix/vmail_aliases

Code: Select all

group@domain.com bob@domain.com,alice@domain.com
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: postfix forward mail to multiple recipients

Post by chris »

Be careful to which email-address you forward.
For example;
if you forward an email coming from gmail to gmail,
It will probably be flagged as spam. Because gmail knows that your server should not send email coming from gmail
(or any other known email-providers).

To prevent this you could do it all with procmail
and change the from: email address.

Below the .procmail-code:

Code: Select all

# change from header
:0fhw
| formail -i "From: fakefromaddress@yoursystem.com"

# forward the mail
:0
! forward@address.com
You should be able the forward to multiple in one line:

Code: Select all

# forward the mail
:0
! bob@domain.com,alice@domain.com
But I never got it to work
and do it on 2 lines.

Code: Select all

:0c
! bob@domain.com
:0
! alice@domain.com
Post Reply