Solved

Sendmail Relaying to wrong host

Posted on 2009-07-07
6
888 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How does your email signature look on mobiles?

Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In this video we show how to create a Shared Mailbox 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 Recipients >> Sha…
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…

758 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

20 Experts available now in Live!

Get 1:1 Help Now