Question : Sendmail - Several local domains delivering to 1 local domain - alias vs. virtusertable

Let's say I own the domains, A.com, B.com, C.com, D.com, E.com and F.com.

Let's also say that our internal networks are listed as Z.local in the internal DNS. Let's also assume that the DNS is perfect... it's not 100% in real life, but the only issues I have are with my ISP and reverse lookups (doesn't affect the mail).

Now, adding to our scenario, let's say that all 6 domains work on the same server. (I just have LOCAL_DOMAIN done for each domain name inside of the sendmail.mc file). The local domain also works by way of the MASQUERADE_AS(A.com).

Now for the fun part. I want to ease the setup involved in adding a user. I use FireTrust's MailWasher server instead of spamassassin because I have to deal with end users who know nothing... they see a button they click it. Thus, I have my mailwasher setup and I have listed the local email address as the main address for each user. Then I added ALL 6 DOMAINS into the list of additional email addresses for each user in MailWasher. THEN, because each of the domains is for a different division in the company (I work in the corporate office, so I have to support essentially 6 different businesses on 1 server... can we say stupid!) anyway... since all 6 domains represent a different division of the company and users are constantly shifting from one company to another to follow a particular project, I have to constantly juggle the domain names/email address combinations to ensure that email comes and goes to an email address at the right domain.

To make it worse, I'm required to setup individual email accounts in thunderbird for each domain... the users want to be able to send under the domain for which they are working at that time.

Sound complicated enough?!? Well that isn't important. What I am looking to do is either put the 6 domains under some virtual domain type setup or possibly under the alias file (is it legal?) so that all users have ONE (1) email address.... their local address. So when an email is received it is brought in and altered so that mailwasher sees the local address, not the particular domain name that was sent to. Also, when an email is sent out, all I have to do is tell the user to select the proper account under thunderbird... even though ALL accounts under thunderbird will be pulling from the local account - they would be separated by what email domain was used for sending.

Hopefully this makes sense.  I've already gotten it to work by removing the LOCAL_DOMAIN macros and putting in the virtual domain file macros - and the virual domain file contains a line for each of A-F.com domains. Then, the only local domain left is the Z.local. But the email comes through as it did before... yous end to [email protected], the user's local account receives an email with the headers saying [email protected] instead of [email protected]. If I send to [email protected], I want to see the header say [email protected] but instead I see [email protected].

I'm gonna add more detail to this question in case it isn't clear. If you have an alias called "alien" that is an alias for "dude" then you can send email to [email protected] and it will be delivered to "[email protected]". The maillog even states "alien is an alias for dude." I want to do the same thing for the DOMAIN side of the (at) symbol. I want to make an alias for [email protected] called "[email protected]". That way in the maillog I will see "[email protected] is an alias for [email protected]" and when I read the header I will see the email was sent to [email protected] instead of seeing the [email protected].

I guess I really just want to  do to the recipient email address what a router does to an IP packet during NAT translation. I want to see if sendmail can literally alter the header so that the email even goes to the mailwasher milter as the local domain account.

Hopefully that isn't too confusing and I've given enough info. I'm not including my sendmail.mc because as it is right now, it is nothing like I want it to be! So clean slate. Is this sort of "translation" possible... and if so, how do I do it?

Answer : Sendmail - Several local domains delivering to 1 local domain - alias vs. virtusertable

(continued from previously)
So now... 2 scendarios.
 1) Someone wants to send mail to Jim Bob and they send to [email protected], [email protected], [email protected], [email protected], [email protected] or [email protected] => The domaintable maps all the B.com entries to A.com entries and the normal alias file translates jim_bob, jbob, and jim.bob to just jbob (the local username). Bingo.

Similarly if someone wants to send mail to Joe Dunn, they can send to [email protected], [email protected], [email protected] or joe_dunn or joe.dunn at any of those three .coms.

2) But what about joe dunn!? What if he sets up his own IMAP account that will make a connection to the mail server to send mail out and he puts his email ass [email protected]? Number one, joe_dunn, though in the alias file... isn't an alias in the FROM address! So assuming he passes the AUTH part of sendmail.... his email will go out FROM [email protected]... right?! Nope. The genericstable lists the "reverse aliases" for joe. And the macro GENERIC_DOMAIN listings in sendmail.mc mean that each domain listed there will be passed through to find user matches in the genericstable. So no matter which joe sends out as: [email protected], [email protected], whaterver, it will be mapped to the user [email protected] sending it out.

This also works in the event an employee moves from one department to another. So if joe_dunn gets moved from the F department to the A department, all I have to do is change his genericstable entry to mapp to [email protected] and ALL mail will go there. Even if he sends out as [email protected] or [email protected]. It will all be mapped.


This is the sort of thing I wanted. Now all I have to play with is the darn order of milters and some antivirus / antispam stuff and things are perfect!

razorwoods was the one to help me. So I'm giving you the points.

Random Solutions  
 
programming4us programming4us