[BUGS] Sendmail as forwarder

Jerahmy Pocott quakenet1 at optusnet.com.au
Wed Jan 2 11:31:46 EST 2008


On 02/01/2008, at 8:11 AM, John Marshall wrote:

> Jerahmy Pocott wrote:
>> Is there any simple way to set sendmail to forward out going mail to
>> an upstream relay if it's not destined for the local host/domain,
>> rather than it trying to deliver the mail directly? I know the usual
>> recommendation for this is to replace sendmail with something like
>> ssmtp because sendmail is too complicated, but I'm not afraid of
>> complicated and I want to use sendmail for intranet mail. Which means
>> that if the address is outside the intranet it gets rejected because
>> the server doesn't actually map to any dns name externally.
>
> I *think* I know what you mean.
> - You want to deliver local mail to the local machine
> - You want to deliver user at my.internal.domain inside
> - You want everything else to relay via (e.g. your ISP's) outbound  
> relay)

Yes, that is exactly what I was trying to say!


> FEATURE(`mailertable')
> with a /etc/mail/mailertable that looks like this:
>
> my.local.domain		esmtp:[mail-hub.my.local.domain]
> .			esmtp:[mail.myisp.com]
>
> The "." is a catch-all for any domain not already listed in  
> mailertable.
> You can use the mailertable to direct mail for different domains to
> different hosts.
>
> ...and don't forget to build the mailertable.db file with makemap:
>  cd /etc/mail
>  makemap hash mailertable < mailertable

I decided to go with this option, since my sendmail.cf already  
included the mailertable feature.. To test it I added 2 entries:

localmachine.local.domain esmtp:[localmachine.local.domain]
.						  esmtp:[mail.isp.net]

and build the db file, on testing mail sent to an external domain the  
mail is now sitting in the queue not going anywhere, mail to local  
users is working fine. Mailq is showing:

(Deferred: 450 4.1.8 <user at localmachine.local.domain>: Sender ad)

Any idea what's going on here? Thanks!
J.


More information about the BUGS mailing list