Receive - scan and forward to other domain name

Kevin Miller Kevin_Miller at ci.juneau.ak.us
Wed Oct 31 15:24:48 GMT 2007


Paul Bernal wrote:
> Hi everyone,
> 
> I readed this
>
http://wiki.mailscanner.info/doku.php?id=documentation:configuration:mta
:sendmail:how_to:setup_a_gateway
> setup a gateway explanation on how to receive - scan and forward an
> email sent to some domain...
> 
> But what I need is:
> 
> * Receive an email to sameuser at onedomain.com on a MailScanner box
> * MailScan this message
> * Forward it to sameuser at otherdomain.com where otherdomain.com it's an
> extra local-box expecting to receive emails to anyuser at otherdomain.com
> 
> There's a way to do this ?
> 
> Thank's in advance

Hi Don,

Hmmm.  I do something similar, but not exactly the same.  I'm using
sendmail, so don't know the drill on other email systems, but I accept
mail for several different domains.  What I did was this:

1: Publish the appropriate MX record so mail knows to come to your mail
server
2: Edit /etc/mail/mailertable so sendmail knows where to send mail after
it's done with it. Something like: 
    mydomain1.com         esmtp:[192.168.1.100]
    mydomain2.com         esmtp:[192.168.2.101]
   Don't forget to do the makemap thing on mailertable
3: Edit relay-domains so it knows what domains it's OK to relay to:
    mydomain1.com
    mydomain2.com

I think that should about do it.  You may have to edit /etc/mail/access
too, but I'm not sure.

On my setup, mail will come in any of several domains, sendmail accepts
the mail, MailScanner scans it, hands it back to sendmail which then
forwards it to the appropriate internal email server.  I'm not actually
rewriting the to address.  
Since you want to have the MailScanner box change the address from
sameuser at onedomain.com to sameuser at otherdomain.com I think I'd look at
the aliases file, or possibly virtuser and genericstable files.  I
haven't used those though, so can't provide details.  Hope this helps...


...Kevin
-- 
Kevin Miller                Registered Linux User No: 307357
CBJ MIS Dept.               Network Systems Admin., Mail Admin.
155 South Seward Street     ph: (907) 586-0242
Juneau, Alaska 99801        fax: (907 586-4500


More information about the MailScanner mailing list