Sendmail to duplicate messages

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue Jul 21 10:12:47 UTC 2009


Olivier Nicole wrote:
> Hi,
> 
> What rule, in what file should I set-up to have my mail sendmail mail
> server duplicate all messages to another mail server?
> 
> I am in the proces sof setting-up a new mail server; in the meantime I
> want all messages arriving to my current mail server under sendmail to
> be duplicated to the new mail server (under postfix, for all it
> matters); so the mailboxes are keept in sync.
> 
> How can I do that with sendmail?

I believe you should be able to do this with virtusertable.  You will need to
configure the new machine to accept e-mail using a distinct domain so the old
server  can route e-mail to it, and the new server would need to accept your
actual domain name for delivery too.

Then you need is a /etc/mail/virtusertable file with contents like so:

@your-domain.com	%@new.your-domain.com
@your-domain.com	%

This should have the effect that e-mail for 'foo at your-domain.com' is
delivered to 'foo at new.your-domain.com' (your new mail server) and to
'foo' -- a local username on the old server.  This should only modify the
envelope addresses, not rewrite the headers in the message itself.

You might need to add 

VIRTUSER_DOMAIN(`your-domain.com')

to your  $(hostname).mc file, but it should just work with the standard
freebsd.mc configuration, so long as 'your-domain.com' appears in /etc/mail/local-host-names.  For more information see entries matching 
virtusertable in /usr/share/sendmail/cf/README

Alternately, if your back-end mail store is using IMAP, then you can use
imapsync (ports: mail/imapsync) to duplicate mail account contents from the
old server to the new one.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090721/e6150284/signature.pgp


More information about the freebsd-questions mailing list