Solved

Sendmail Relaying to wrong host

Posted on 2009-07-07
6
931 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

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.
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 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