1

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.

Pablo Santa Cruz
  • 1,144
  • 4
  • 18
  • 25
  • 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 Answers2

1

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)

MikeyB
  • 39,291
  • 10
  • 105
  • 189
  • 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
1

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.

mdpc
  • 11,856
  • 28
  • 53
  • 67