[ILUG] postfix mail duplication

Philip Reynolds phil at Redbrick.DCU.IE
Tue Dec 31 14:55:04 GMT 2002


Paolo Marchiori's [paolo at marchiori.net] 28 lines of wisdom included:
> bryan hunt, Mon, Dec 30, 2002 at 05:47:12PM +0000:
> > I was planning on redirecting the firewall port 25 to an AV proxy which 
> > forwards the mail to a postfix server.
> > Just for the next couple of days I want to set up postfix so that every mail 
> > it recieves is duplicated to a second ( existing windowz )server. Is there a 
> > quick and dirty way to do this ? I seem to remember it was easy to do with 
> > sendmail but I haven't seen anything nice yet.
> 
> the funnier way is to modify master.cf so it doesn't call smtpd for
> connections over port 25, but rather something, say a shell script, who
> does forward a copy to the port 25 of the other server (eg using netcat)
> and to smtpd, sort of
> 
> #!/bin/sh
> otherserver=your.other.mail.server.ie
> $(postconf | grep program_directory)
> tmpf=/tmp/received-mail.$$
> tee $tmpf | $program_directory/smtpd
> (cat $tmpf | nc $otherserver -p 25) && rm $tmpf

A much better way of implementing that little hack is use
``always_bcc'' to bcc all of the mail to one account. Then use some
sort of mail filter (e.g. procmail) to deliver the mail onto your
Exchange server.

-- 
  Philip Reynolds        
   RFC Networks          tel: 01 8832063
www.rfc-networks.ie      fax: 01 8832041



More information about the ILUG mailing list