Solved

Sendmail Relaying to wrong host

Posted on 2009-07-07
6
956 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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…

751 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