Operating System - Linux
1819681 Members
3721 Online
109605 Solutions
New Discussion юеВ

Configure sendmail to relay domain1.com and locally deliver domain2.com

 
John C_4
New Member

Configure sendmail to relay domain1.com and locally deliver domain2.com

I have sendmail running on a GNU/Debian linux box. We relay all mails for the target domain to an exchange server behind a firewall. This is all working. In order to submit junk mail that passes the filter, we need to send emails back to the spam filter app(Mail Washer Server). We created a second domain(since an address in the target domain would be delivered to exchange and then returned as undeliverable) to use for junkmail submissions. I need sendmail to continue relaying the target domain while locally delivering emails to the submission domain. I will include my sendmail.cf

Thanks in advance for any assistance.

John
8 REPLIES 8
Ivan Ferreira
Honored Contributor

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

I think that what you want to do can be achieved using mailertable:

A mailertable is a database which maps certain hosts or domains to a mailer:host pair. It is used for redirecting mail addressed to a certain host or domain to a specific destination host using a specific mailer.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rick Garland
Honored Contributor

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

A couple of ways to do it.

The default sendmail file does not come with the H directive active. Would need to use the m4 compiler to make a new sendmail.cf file do the you can specify a value in the H directive.

The L directive says "names to deliver locally even if there is a relay"

If you are using DNS you could configure the MX records.

Examples can be found on the http://www.sendmail.org site.

Bejoy C Alias
Respected Contributor

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

It seems you have not enabled the feature mailertable in ur sendmail.cf file . You can solve ur pblm using mailertable . First create the sendmail.cf file after including FEATURE(mailertable) in ur sendmail.mc file . Then u need to create the file /etc/mail/mailertable which contains
domain2.comlocal:spamuser
This will deliver all the mails destined to the domain domain2.com to the localuser spamuser .

Another option is u can use virualusertable to map the entire domain domain2.com to a local user . For this also u need to create the new sendmail.cf file by including FEATURE(virtusertable) in the sendmail.mc file . This /etc/mail/virtusertable should contain
@domain2.comspamuser

Hope this will help u
Be Always Joy ......
John C_4
New Member

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

I have added in the mailertable text file and icluded FEATURE('mailertable') to sendmail.mc, run make and restart sendmail. Grep the binary db file to verify ridofpsm.net is in there, but still get the following message --

Aug 24 12:54:08 spamklr sm-mta[7474]: j7OHs7nV007474: ruleset=check_rcpt, arg1=, relay=h216-170-136-152.216-170.unk.tds.net [216.170.136.152], reject=550 5.7.1 ... Relaying denied
Aug 24 12:54:08 spamklr sm-mta[7475]: j7OHs7Vn007475: ruleset=check_rcpt, arg1=, relay=h216-170-136-152.216-170.unk.tds.net [216.170.136.152], reject=550 5.7.1 ... Relaying denied
Aug 24 12:54:08 spamklr sm-mta[7475]: j7OHs7Vn007475: from=, size=2449, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=h216-170-136-152.216-170.unk.tds.net [216.170.136.152]
Aug 24 12:54:08 spamklr sm-mta[7474]: j7OHs7nV007474: from=, size=2315, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=h216-170-136-152.216-170.unk.tds.net [216.170.136.152]

in var/log/mail.log

I am using the smarthost option -- is that my issue?
Ivan Ferreira
Honored Contributor

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

In other distributions, you may get that error messages if you did not specified the domains in the /etc/mail/local-host-names or /etc/mail/relay-domains.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Bejoy C Alias
Respected Contributor

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

add the second domain to ur local-host-names file
Be Always Joy ......
John C_4
New Member

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

Thanks to everyone who posted --
Creating the file /etc/mail/mailertable with domain1.comesmtp:hostname
domain2.comlocal:

turned of the smarthost in sendmail.mc
ran make
restarted sendmail -- works now!!


Thanks again
John C_4
New Member

Re: Configure sendmail to relay domain1.com and locally deliver domain2.com

see last reply - all is working. I would suggest the Mailwasher spam server to anyone!!!
It is a plugin to sendmail-milter, add clamav and some trusted black-list servers and it is off and running!!