Virtual Domains and aliases.

Mike O'Rourke mjoop at
Fri Jan 9 17:01:34 EST 2004

>>> Oliver Jones <oliver at> 01/08/04 03:41 AM >>>
Hi guys.

I have a question regarding mail aliases, virtual users and cyrus
virtual domains.  

I have configured my Cyrus IMAPD 2.2.2 install to deliver mail using
virtual domains.  It does this by relaying the received messages into
the cyrus mailer using Sendmail's "mailertable".  Ie the domain is not
in /etc/mail/local-host-names, but is instead in /etc/mail/access as
"domain RELAY".  However, sendmail does not reference the
virtualusertable or aliases databases when relaying mail.  

I want to create 'aliases' like sales at domain & accounts at domain that
deliver to user1 at domain.  How can I do this with sendmail and cyrus
configured to support virtual domains??  Is there a way of doing it with
LDAP mail routing?

Or will I have to hack sendmail to treat the Cyrus mailer as "local" and
yet still pass the domain portion of the email address when trying to
deliver mail to the LMTP socket.  If I set cyrus to be the local mailer
sendmail seems to strip the @domain before delivering and so lmtpd can
not find the user's mailbox.

Is there something special I need to do in the Mailer def in

Oliver Jones » Director » oliver.jones at » +64 (21) 41
Deeper Design Limited » +64 (7) 377 3328 »


Hi Oliver,

I do what you want using LDAP Routing with sendmail. An ldif such as:

dn: cn=user1,dc=domain,o=com
objectClass: top
objectClass: inetOrgPerson
objectClass: inetLocalMailRecipient
mailLocalAddress: user1 at
mailLocalAddress: sales at
mailLocalAddress: accounts at
mailRoutingAddress: user1 at
cn: user1

would do what you want. Since mailLocalAddress is not a single-value in
LDAP, you can send as many "aliases" as you want to the
mailRoutingAddress. It works fine for my installation with Cyrus IMAP
and Virtual Domains.

As far as sending the full address (with the @domain), you will find a
line in the cyrus mailer in that reads:
S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrToSMTP, E=\r\n,
simply changing it to:
S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n,
should take care of that. There are instructions in the archives for
this also.


More information about the Info-cyrus mailing list