Results 1 to 2 of 2

Thread: sendmail internal forwarding to different domain

Hybrid View

  1. #1
    Join Date
    May 2009
    Rep Power

    Default sendmail internal forwarding to different domain

    Hi everyone,

    I wasn't sure where else to go for this issue, so I hope this question isn't too inappropriate for this forum.

    I have an internal mail server ( that receives all mail for several domains. It is behind a firewall and uses my ISP's smarthost for outbound mail. Nothing too special here and it is working just fine.

    I have the situation where for *some* users I need to be able to keep a copy of their inbound mail while at the same time forwarding their mail to another host. As an example, on in /etc/aliases, I have lines similar to this:

    joe: /var/mai/joe,
    sue: /var/mai/sue,

    These entries allow the mail to be written locally as would normally happen and also be sent to specified accounts on another host. As long as the host is in, this doesn't seem to be a problem. Mail for and gets written to the file and forwarded as expected.

    The issue is that I need to have an entry like this:

    fred: /var/mail/fred,

    Where fred's address is It gets handled by the main mailhost as normal, but I need to send it elsewhere internally as well. A separate host in a separate domain. is fully resolvable from -- meaning, nslookup sees the host and the appropriate MX records using our internal DNS. The problem is that sendmail doesn't seem to pay any attention to the local lookups and sends the mail out to the internet via the smarthost. is not reachable from the internet, nor is it resolvable from the internet. This causes all mail for this user to bounce with:

    "host not found"

    I think what I need is a way to tell sendmail not to use the smarthost for specific host delivery. But it must still handle outbound mail from and pass it to the internet via the smarthost.

    I know I can use mailertable to send the mail to the other domains, but that affects all users. What I need is a way for mail to hit the primary, pass through /etc/mail/aliases for local file handling, and allow delivery to internal without using the smarthost.

    In this particular case, is a ZCS host. Mail within ZCS domains is working fine. It's just getting the primary mailhost to send specific messages to the ZCS host that's causing me trouble.

    I am at a complete loss as to how to do this and any help would be appreciated.

    Thanks to all in advance,

  2. #2
    Join Date
    May 2009
    Rep Power

    Default [SOLVED] Re: sendmail internal forwarding to different domain

    Hi everyone,

    The trick, thanks to John B. at Sun, was to remove the use of smarthost from the sendmail configuration and move all routing to the mailertable function.

    Basically, smarthost is an all-or-nothing switch and this is what was causing my problem. By switching to the mailertable, sendmail will process the domains locally. By adding the smarthost machine as the last entry in the mailertable as a wildcard entry, anything that doesn't match a locally managed domain will be sent out via the smarthost.

    For example:
    . esmtp:[]

    The dot (.) is the wildcard symbol in the mailertable.

    Be sure to remove the SMARTHOST entry from the file and the resulting file and restart sendmail.

    I hope others find this helpful. Again, all the credit goes to John B. at Sun.


Similar Threads

  1. Replies: 7
    Last Post: 04-27-2009, 02:49 AM
  2. Replies: 20
    Last Post: 03-18-2008, 05:37 AM
  3. Internal + External Domain Questions
    By Markus23 in forum Installation
    Replies: 1
    Last Post: 01-22-2008, 10:52 AM
  4. Replies: 4
    Last Post: 12-21-2007, 05:43 AM
  5. 3.0 to 4.5.3 Upgrade failed (mysql error)
    By dealt in forum Installation
    Replies: 35
    Last Post: 03-19-2007, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts