unified tld - joe at example.com, joe at example.net, joe at example.org to the same cyrus user.joe mailboxes

Jorey Bump list at joreybump.com
Tue Jul 17 17:32:07 EDT 2007


Maulvi Bakar wrote:
> Hi all
> 
> I have a system which accepts mails for example.com, example.net and 
> example.org.  Rather than creating 3 differing mailboxes on cyrus, it
>  is decided to create 1 mailbox for all the TLDs, since all the 
> domains involved refers to the same entity.
> 
> Right now, I can receive mails for joe at example.com which will be
> delivered to cyrus user.joe mailbox.  I would appreciate if some kind
> soul would be explain howto deliver mails for joe at example.net and 
> joe at example.org to cyrus user.joe mailbox as well.
> 
> My setup is currently as thus -
> 
> CentOS 5 Postfix Cyrus OpenLDAP

I configure all of my domains as virtual_alias_domains in Postfix:

  virtual_alias_domains = /etc/postfix/vhosts

/etc/postfix/vhosts is simply a text file listing my domains:

  example.com
  example.net
  example.org

Then I explicitly map all addresses for each domain in virtual_alias_maps:

  virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual maps each address to unique users (or aliases in 
alias_maps):

  postmaster at example.com	admin
  joe at example.com	joe
  sales at example.com	joe

  postmaster at example.net	admin
  joe at example.net	joe
  joe.smith at example.net	joe

  postmaster at example.org	admin
  joe at example.org	joe
  joseph at example.org	joe
  jane at example.org	jane

In this example, joe corresponds to the Cyrus mailbox user.joe, but 
admin is expanded in /etc/mail/aliases to other users (both local and 
external). Final delivery is done via LMTP to Cyrus:

  mailbox_transport = lmtp:unix:/var/imap/socket/lmtp

Sorry, I don't use LDAP, I use sasldb2 for authentication. To simplify 
things, I put all users in the same realm, regardless of the email 
domain(s) they belong to:

  smtpd_sasl_local_domain = mail.example.net

Note that I'm using a generic realm that is portable between machines. 
This is *not* necessarily the local machine's hostname (and it doesn't 
even need to be a hostname, you can use just about anything you want). 
One advantage of using a single realm is that I can support bare 
username logins by making it the defaultdomain in /etc/imapd.conf:

  defaultdomain: mail.example.net

Finally, be sure to support delivery of mixed-case addresses in 
/etc/imapd.conf:

  lmtp_downcase_rcpt: true

Aside from not using LDAP, my standard setup sounds identical to what 
you're trying to achieve. Hopefully, this is enough to get you started.



More information about the Info-cyrus mailing list