Sendmail to duplicate messages

Matthew Seaman m.seaman at
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:	%

This should have the effect that e-mail for 'foo at' is
delivered to 'foo at' (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 


to your  $(hostname).mc file, but it should just work with the standard configuration, so long as '' 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.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     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 :

More information about the freebsd-questions mailing list