procmail
[Top] [All Lists]

Re: Handling multiple domains

1996-06-11 08:42:23
I want to setup a single computer to act as if it were several different
companies.  I want mail to be able to come in to user(_at_)companya(_dot_)com 
and
to user(_at_)companyb(_dot_)com(_dot_) (the same user) This is easy I think.  
Sendmail will
handle this.  The trick I want is that when mail comes in to
user(_at_)companya(_dot_)com, I want it to go out as 
user(_at_)companya(_dot_)com(_dot_)  And likewise
for companyb.com.  I would like it to be the same username, but I guess
if it's impossible to do it this way, I could make it different user names.

Can Procmail do this for me?  If so, how.

If you need any more information please drop me a note.  I'm trying to
get this working ASAP.  Our ips isn't the greatest and currently we are
not getting email that comes in to one of our company names.  Bummer.

Check out:

http://rclsgi.eng.ohio-state.edu/~glaze/sendmail.html
 and
http://rclsgi.eng.ohio-state.edu/~glaze/sendmail2.html

The second URL will tell you how to get mail to work for 
user(_at_)comp1(_dot_)com and
user(_at_)comp2(_dot_)com(_dot_)  The first URL will tell you how to rewrite 
the headers
such that mail from user(_at_)realhost(_dot_)com looks like 
user(_at_)virtualhost(_dot_)com(_dot_)  My
example only deals with changing *just* the domain, however, the rules
are set up such that the value that gets inserted via the rules is the
*entire* address, not just the fqdn.  Therefore, you can use this to do 
what you want as well.  One thing you should know, user(_at_)comp1(_dot_)com and
user(_at_)comp2(_dot_)com still have to be separate accounts.  The patch 
basically
does a redirect of the mail.  So user(_at_)comp1(_dot_)com mail will get 
redirected to
someuser(_at_)realhost(_dot_)com and user(_at_)comp2(_dot_)com mail will get 
redirected to
someotheruser(_at_)realhost(_dot_)com (although, you can effectively use this 
method
as a forwarder also and send mail to 
someotheruser(_at_)someotherplace(_dot_)com instead
of an account on your local machine).  To get what you want you will have
to use both of these (works, I am using it on a machine right now) and
set up your 2 databases to correspond.  Below is a quick example...

Map what looks like the same user to different users based on the domain
info via a domainid database file:
user(_at_)companya(_dot_)com    user1(_at_)realhost(_dot_)com
user(_at_)companyb(_dot_)com    user2(_at_)realhost(_dot_)com

Rewrite headers to mail doesn't look like it came from the real host, but
the virtual one via a mailid database file:
user1                   user(_at_)companya(_dot_)com
user2                   user(_at_)companyb(_dot_)com

If you need more help then just send me mail. Also, the rules may not be
optimized as much as they could be.  If anyone sees a way to improve them
then please let me know.  The 2 web pages go into much more detail than this
so you should be able to figure it out with them.

Larry
-- 
------------------------------------------------------------------------------
|Larry Glaze                            |       "...Life's a bummer..."      |
|System Administrator                   |               --Smashing Pumpkins  |
|The Ohio State University              |                                    |
|http://rclsgi.eng.ohio-state.edu/~glaze|   
glaze(_at_)rclsgi(_dot_)eng(_dot_)ohio-state(_dot_)edu  |
------------------------------------------------------------------------------
|                All opinions are my own, as they should be.                 |
------------------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>