Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sendmail Relaying to wrong host

Posted on 2009-07-07
6
Medium Priority
?
1,070 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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 

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 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
Phishing emails are a popular malware delivery vehicle for attack.  While there are many ways for an attacker to increase the chances of success for their phishing emails, one of the most effective methods involves spoofing the message to appear to …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

773 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