Results 1 to 2 of 2

Thread: sendmail internal forwarding to different domain

  1. #1
    msmcknight is offline Senior Member
    Join Date
    May 2009
    Posts
    56
    Rep Power
    5

    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 (mailhost.domain.com) 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 mailhost.domain.com in /etc/aliases, I have lines similar to this:

    joe: /var/mai/joe, joe@xmail.domain.com
    sue: /var/mai/sue, suesmith@xmail.domain.com

    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 domain.com, this doesn't seem to be a problem. Mail for joe@domain.com and sue@domain.com 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, fred@123mail.example.com

    Where fred's address is fred@example.com. 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.

    123mail.example.com is fully resolvable from mailhost.domain.com -- 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.

    123mail.example.com is not reachable from the internet, nor is it resolvable from the internet. This causes all mail for this user to bounce with:

    "host 123mail.example.com 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 user@example.com 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 mailhost.domain.com, pass through /etc/mail/aliases for local file handling, and allow delivery to internal 123mail.example.com without using the smarthost.

    In this particular case, 123mail.example.com 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,
    Michael

  2. #2
    msmcknight is offline Senior Member
    Join Date
    May 2009
    Posts
    56
    Rep Power
    5

    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:
    123mail.example.com esmtp:123mail.example.com
    . esmtp:[smtp-server.myisp.com]

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

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

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

    -Michael

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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, 11:52 AM
  4. Replies: 4
    Last Post: 12-21-2007, 06: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
  •