Sendmail configuration

I'm running sendmail 8.8.6 on a Slackware Linux box which is serving as a mail server (i.e. several DNS MX records) for multiple domains.  All has been fine in the setup for some time.

I've now run into a situation that needs some help.  Currently, the usernames are common between the different domains served.  For example, john@domaina.com is equivalent to john@domainb.com and so on. They both end up in the mail inbox for john on the server.

The need now is to be able to map each of the above to DIFFERENT mail boxes on the server.  So:

john@domaina.com --> Maps to john_a
john@domainb.com --> Maps to john_b

of similar.

(BTW, please don't supply answers using the M4 configuration for sendmail.cf.  It's too cryptic and we don't use it.)
LVL 32
jhanceAsked:
Who is Participating?
 
roaldConnect With a Mentor Commented:
You will have to use the virtusertable-feature. Read about it at http://www.sendmail.org/virtual-hosting.html

I know you said you don't use the m4 configuration tools, but there is really no way around it in this case. And it's only about 25 lines of code?? I have a similar server with 15 doamins getting mail by ETRN and 15 domains getting it by POP, and several of the users have the same usernames.

It's hard setting it up the first time, but then it just works.

You're welcome to mail me at ee@nont.cx, if you want to test it further or get more help.

0
 
ahoffmannCommented:
how about using /etc/aliases
Do I understand right that the MX record for both domains point to the same server (sendmail)?
0
 
jhanceAuthor Commented:
ahoffman,

I guess I don't see how /etc/aliases can help here.  Since the domain name is already stripped off by the time the address gets to /etc/aliases, there is no useful effect there.

You are correct that there are MX records for multiple domain names that point to the same mail server.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ahoffmannCommented:
I'm not shure about sendmail 8.8.6, but sendmail 8.9.x can use mailertables for this purpose.
The trick is FEATURE(mailertable), see the docs for details, sounds simple (didn't test it).
0
 
mohammedgCommented:
just add the line

john: john_a@domaina.com, john_b@domainb.com

to /etc/alias
0
 
jhanceAuthor Commented:
mohammedg,

Please read my question more closely.

Your suggestion just does what I currently have a different way.  I want these two addresses to be directed to separate email addresses.

The aliases line:

john: john_a@domaina.com, john_b@domainb.com

will cause incoming mail for john to be directed at both john_a and john_b.  This is not what I want.
0
 
jhanceAuthor Commented:
Adjusted points to 150
0
 
ahoffmannCommented:
you also may use procmail to what you want, it can setup filters to deliver mail into different mailboxfiles
procmail is under the user's (john) control, and does not need any changes in sendmail (or any other MTA)
0
 
jhanceAuthor Commented:
Too bad you got the points for this wrong answer.  I must have missed your posting this answer and the autograder got to this question.

Virtual Hosting is _NOT_ the solution to this problem, it's the solution to the inverse of this problem.  I already have the mail server operating as a virtual host but what I want is the ability to have sendmail differentiate between identical user names sent to different hosts that the mail server.

Virtual hosting does this:

user1@domainA.com --->  user1
user2@domainB.com --->  user2

What I want it:

user1@domainA.com ---> user1
user1@domainB.com ---> user2

See the difference?
0
All Courses

From novice to tech pro — start learning today.