All,

Found out postfix can do exactly what I wanted.... I did:

In /etc/postfix/main.cf I added the line:

transport_maps = hash:/etc/postfix/transport

Then in the file /etc/postfix/transport I put the line:

mycompany.com   smtp:[smtp-relay_inside_host:25]

then I ran the command:

postmap /etc/postfix/transport

All is working just lovely, mail for mycompany.com gets relayed to the 
inside host, and all other mail is delivered as normal.

A gotcha, In the file /etc/postfix/transport, The square brackets 
arround the hostname tell postfix to ignore the MX records for 
mycompany.com.

Life with linux is good. :)

Robert Toole
Sr. Systems Engineer
KN Logistics / Calgary

Adil Kodian wrote:
> you could always do procmail. procmail can do a certain activity based 
> on some pattern matching rules to incoming mail.
> 
> On 11/26/05, *Robert Toole* < [EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     Bogi,
> 
>     I agree that would be the best, unfortunately I do not control the dns
>     for my company's domain, for that to work, I would need to duplicate
>     manually the whole DNS zone for mycompany.com
>     <http://mycompany.com>, so I could alter the MX
>     records. Not very easy I think...
> 
> 
>     bogi wrote:
>      > Hi Robert.
>      > I think, it would be a good idea, to setup an internal dns, that
>     way you can
>      > have postfix look at the mx records , yada yada and work
>     properly. And yes
>      > you can safely use relay_domains and relay_host at that point.
>     You can also
>      > glob [EMAIL PROTECTED] and foreword to that, there are 2 problems, if
>     you foreword
>      > like that a spoofer to the domain would get foreworded. And yes,
>     with the
>      > internal dns, you can foreword using the internal network (lots
>     faster) .
>      > Cheers
>      > Szemir
>      >
>      > On November 26, 2005 06:49, Robert Toole wrote:
>      >
>      >>All, Sorry for the long post, but I just want to be clear...
>      >>
>      >>Googled for this, but I just can't seem to find a specific answer...
>      >>
>      >>Is it possible to get postfix to relay mail to a specific host, but
>      >>*only* for a single destination domain?
>      >>
>      >>My company has a global e-mail system that sucks. (slow, looses
>     mail,
>      >>yada yada) However, and now they are making a change that will
>     not allow
>      >>it to accept mail from the public internet where the From header
>     is the
>      >>company domain. example:
>      >>
>      >>If I want to send mail from [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]> to [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>,
>      >>the global mail server will only accept this mail if it arrives from
>      >>inside the private company network.
>      >>
>      >>My solution in the past has been to run my own mail server that sends
>      >>all mail directly to the destination domains thru the public
>      >>internet.... so at least mail sent from my site gets where it is
>     going
>      >>in a timely fashion.
>      >>
>      >>My Problem:
>      >>
>      >>My mail server does an MX lookup for mycompany.com
>     <http://mycompany.com>, and gets the
>      >>external public internet ip address. This won't work, as my box then
>      >>sends the mail to the company server the wrong way. (Through the
>     public
>      >>internet instead of the internal network) and the mail gets rejected.
>      >>This is a good thing actually, for spam and security purposes)
>      >>
>      >>I need my server to relay messages going to mycompany.com
>     <http://mycompany.com> to a specific
>      >>inside host (ignoring the MX record) and then send all other mail
>      >>directly by itself to all other destination domains.
>      >>
>      >>Can Postfix do that with the relay_host and relay_domains parameters?
>      >>The documentation is a bit confusing to me...
>      >>
>      >>Thanks,
>      >>
>      >>-
>      >>Robert Toole
>      >>Sr. Systems Engineer
>      >>KN Logistics / Calgary
>      >>[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>      >>(403) 717-8463
>      >>
>      >>_______________________________________________
>      >>clug-talk mailing list
>      >>[email protected] <mailto:[email protected]>
>      >>http://clug.ca/mailman/listinfo/clug-talk_clug.ca
>     <http://clug.ca/mailman/listinfo/clug-talk_clug.ca>
>      >>Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
>      >>**Please remove these lines when replying
>      >
>      >
>      >
>      > _______________________________________________
>      > clug-talk mailing list
>      > [email protected] <mailto:[email protected]>
>      > http://clug.ca/mailman/listinfo/clug-talk_clug.ca
>      > Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
>      > **Please remove these lines when replying
>      >
> 
>     _______________________________________________
>     clug-talk mailing list
>     [email protected] <mailto:[email protected]>
>     http://clug.ca/mailman/listinfo/clug-talk_clug.ca
>     Mailing List Guidelines ( http://clug.ca/ml_guidelines.php)
>     **Please remove these lines when replying
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> clug-talk mailing list
> [email protected]
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to