Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I administer one mail server that hosts several domains in it. I.E.

  • Mail Server: supermailserver.mydomain.com

Hosting mail for domains:

  • domain1.com
  • domain2.com
  • domain3.com
  • domain4.com
  • domain5.com

I have my user database with OpenLDAP. The server works just fine. There is only one thing I would like to tweak which is the following:

Right now, if I add a user "username" to OpenLDAP and the CyrusMail backend, then "username" gets mail through the following addresses:

  • username@domain1.com
  • username@domain2.com
  • username@domain3.com
  • username@domain4.com
  • username@domain5.com

The tweak I would like to make is to allow "username" to get emails only from selected domains. What's the best (and easiest) way to do this?

Thanks a lot in advance.

share|improve this question
Switch to Postfix? ;-) (seriously though, if at any point it is feasible to switch... Postfix configuration is easier to understand and probably easier to get help with) –  David Z May 14 '09 at 21:16

2 Answers 2

We setup explicit entries in virtusertable for domains that we accept mail for:

@domain1.com         error: 5.1.1:550 User %1@domain1.com unknown
user1@domain1.com    %1+%2
user2@domain1.com    %1+%2

@domain2.com         error: 5.1.1:550 User %1@domain2.com unknown
user3@domain2.com    %1+%2
user4@domain2.com    %1+%2

This forces you to list out every mail address that you accept (which can be interpreted as either bad or good)

share|improve this answer
great. is there an easy way to administer that table other tan manually editing the file and restarting sendmail? for example, can I put that info on a MySQL database to build a proper Mail Administration Web Frontend? –  Pablo Santa Cruz May 14 '09 at 21:24

I believe that you could use the M4 macro FEATURE(virtusertable',dbtype') where dbtype can be ldap or dbm as an example to use a database instead of a file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.