Sendmail outbound mail routing according to sender

Discussion in 'Server Operation' started by mecca, Feb 8, 2008.

  1. mecca

    mecca New Member


    First post - hope I dropped it in the right place :D

    OK, we're using Sendmail on RHAS 4 and all of the mail up till now has been local / internal only; this has negated the need to pass it through our spam filter/mail gateway etc. We now need to route some mail to external domains, which means it must go through the filter; similarly all messages originating from localhost address should continue to use the current configuration.

    So, my question is this.....

    Can we configure Sendmail to send mail that originates from a particular address out via a specific smarthost/relay? The from address would be formatted as a valid internet mail address (e.g. [email protected]).

    If (and I really hope the answer is yes) this is possible, what is the best/easiest/safest/quickest way of achieving this? I'm not very familiar with syntax etc., so answers in "configuring sendmail for dummies" format would be greatly appreciated!!

    Thanks in advance for any help,

  2. topdog

    topdog Active Member HowtoForge Supporter

    The way i see it is that all your intranet mail is being handled by the sendmail server so there is no need for it to leave your network may destined for any other addresses is the one that will go out of the smarthost.

    For the sendmail cf you need this
    DS smart_host_name
    You can also use the sendmail mc system which is easier
    define(`SMART_HOST', `smtp.your.provider')dnl
    Then type make inside /etc/mail
  3. mecca

    mecca New Member

    Thanks for the reply!

    We eventually got it working by adding the "from" addresses to the file :-
    ..and also by adding the relay host in the mailertable file along with the allowed external domains :-
    Code:    (for NDR's etc!)
    Obviously, if we need to allow additional external domains, we've gotta add them verbatim to the mailertable file, but hey, it's a step in the right direction (and a solution had to be in place by Monday, so we were pretty close to the wire ;)).



Share This Page