Solved

Sendmail Relaying to wrong host

Posted on 2009-07-07
6
906 Views
Last Modified: 2013-12-18
We have a problem with sendmail relaying to the wrong host. Some how it is relaying to "gateway.domain.com" instead of "mail.domain.com"

The smart host is "mail.domain.com" there is no mention of gateway. The only thing I can think of is that gateway.domain.com is the MX record for mail.domain.com

This works fine obviously for mail going to our domain from this server, but it tries to relay all mail - even to other domains - to gateway.domain.com.

Any suggestions on where to start looking? I am completely lost. Let me know if you need more info. Two typical log entries are below. One to our domain and one to another domain. Obviously the second one to the other domain is rejected by our gateway server as an invalid domain.

Our Domain:
Jul  6 14:38:06 quark sendmail[1578]: n66FKT1Q005730: to=<lindamagazzine@domain.com>, ctladdr=<root@quark.corp.domain> (0/0), delay=04:16:57, xdelay=00:00:00, mailer=relay, pri=1020500, relay=gateway.domain.com. [174.46.11.166], dsn=2.0.0, stat=Sent (Ok: queued as 40C9914A9C5D)


Other Domain:
Jul  6 14:38:06 quark sendmail[1578]: n66FF71Q005698: to=<billiearnold817@domain.com>, ctladdr=<root@quark.corp.ebby> (0/0), delay=04:22:19, xdelay=00:00:00, mailer=relay, pri=1020500, relay=gateway.ebby.com. [174.46.11.166], dsn=5.1.1, stat=User unknown
0
Comment
Question by:chuckbeats
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:Siridivi
ID: 24795982
Check the /etc/mail/relay-domains file to see if relaying is setup for your domain
Check the /etc/sendmail/access file to see if you have relaying rules setup

Unless you have an old version of Sendmail, relaying should be disabled by defualt, review the following page and see if you are allowing relaying for a reason and perhaps it just needs to be reconfigured.

http://www.sendmail.org/m4/anti_spam.html
0
 

Author Comment

by:chuckbeats
ID: 24797548
All of this looks good. It is just emails sent from the local root using Perl cronjobs.

All of a sudden, they are all relaying to our MX record which is nowhere to be found in any configuration. It is connecting to our gateway (MX) directly from this server, so it is almost like this server is acting as its own MTA, which would be fine, but it cannot send to any domain but ours.

Any other suggestions? Thanks for the help
0
 
LVL 26

Expert Comment

by:jar3817
ID: 24797810
"This works fine obviously for mail going to our domain from this server, but it tries to relay all mail - even to other domains - to gateway.domain.com."

That is exactly how the smart host setting works. You'll probably want to look into use the /etc/mail/mailertable database and ditch the smarthost option. This allows you specify a domain (yours) and tell it exactly what IP/host to send to regardless of the MX record:

yourdomain.com     esmtp:[10.1.1.1]

Just change the IP to that of the server you want it to relay to for that domain. You can do as many domains as you want, if you have more than 1. You can use a DNS name there too, but try to avoid it if possible to save yourself a lookup every time. Don't forget to rebuild the map and restart sendmail.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:chuckbeats
ID: 24797897
OK, I looked and that seems to be the right track, but this fires off email to all kinds of different domains. They are for customer reports, so there is no way me to enter all the domains.

What could have happened that all of a sudden yahoo.com emails are being relayed to our MX record. More importantly, how can I change that. Thanks in advance
0
 
LVL 26

Accepted Solution

by:
jar3817 earned 500 total points
ID: 24798036
How about you just remove the smart host setting? Then email to yahoo will go directly to them and mail to your domains will go to the host in their mx record.

Do you have a reason for the smart host?
0
 

Author Comment

by:chuckbeats
ID: 24798378
No I didn't know what SMART_HOST was until about 4 hours ago :) I've removed it and we are looking better. I'll need to setup something to keep these from getting trapped by spam filters (since it is not one of our mail servers ) - but at least we are back up and sending. Thanks for your help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Import PST to Exchange using Power Shell new-mailboximportrequest command, you can simply import the PST file into Exchange mailbox or archived. To know How to import PST into Exchange  2013 read the complete article.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now