System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

sendmail configured to use a relay node

SOLVED
Go to solution
Jdamian
Respected Contributor

sendmail configured to use a relay node

Hi

The sendmail daemon in my node (redhat 5.3 64-bit) is configured to use a relay server (other node), i.e., any e-mail message sent (to a non-local recipient) from my node is re-sent to the relay node in order to be successfully delivered --- This behaviour is the required...

my problem is that I cannot find the sendmail config file where this feature is found, i.e., the DS directive in the /etc/mail/sendmail.cf is empty...

Are there other files where relay may be configured?

Thanx in advance
5 REPLIES
Matti_Kurkela
Honored Contributor
Solution

Re: sendmail configured to use a relay node

There are many ways to do this; some of them could have been done even "outside the box".

It might be configured using /etc/mail/mailertable. (If it's done this way, then the previous admin probably did not know about the DS setting of sendmail.)

Or your server might have iptables redirection rules to force all outgoing connections to port TCP/25 to the relay server.

Run:
iptables -L -v -t nat

If you see rules with target "DNAT" and destination is something like "anywhere tcp dpt:smtp --to-destination ", then mail is probably redirected this way.

The cause might even be external to your server: your site's DNS server might be configured to respond to all requests for remote domains' MX records with the address of the relay server.

Test using "dig" and the domain name of a non-local email recipient. For example, if the recipient was "someone@nonlocal.com.example", you might run:

dig nonlocal.com.example mx

If this returns records pointing to your relay node, then the DNS server is causing the redirection.

Another way to enforce such a redirection externally would be to use transparent proxying technology in your site's outgoing router.

MK
MK
Stuart Browne
Honored Contributor

Re: sendmail configured to use a relay node

Another possiblity is that you aren't using sendmail, but another MTA on the box.

Use 'alternatives --display mta' to confirm that sendmail is the configured MTA.
One long-haired git at your service...
Jdamian
Respected Contributor

Re: sendmail configured to use a relay node

Hi

# ll /etc/mail/mailertable
-rw-r--r-- 1 root root 0 Nov 28 2006 /etc/mail/mailertable

# iptables -L -v -t nat
Chain PREROUTING (policy ACCEPT 29952 packets, 4128K bytes)
pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 1022 packets, 88837 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 1022 packets, 88837 bytes)
pkts bytes target prot opt in out source destination


# dig nonlocal.com.example mx

; <<>> DiG 9.3.4-P1 <<>> nonlocal.com.example mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 63476
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;nonlocal.com.example. IN MX

;; AUTHORITY SECTION:
. 10800 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2010111500 1800 900 604800 86400

;; Query time: 32 msec
;; SERVER: 10.9.236.7#53(10.9.236.7)
;; WHEN: Tue Nov 16 07:51:07 2010
;; MSG SIZE rcvd: 113

# alternatives --display mta
mta - status is auto.
link currently points to /usr/sbin/sendmail.sendmail
/usr/sbin/sendmail.sendmail - priority 90
slave mta-mailq: /usr/bin/mailq.sendmail
slave mta-newaliases: /usr/bin/newaliases.sendmail
slave mta-rmail: /usr/bin/rmail.sendmail
slave mta-sendmail: /usr/lib/sendmail.sendmail
slave mta-pam: /etc/pam.d/smtp.sendmail
slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
slave mta-mailqman: /usr/share/man/man1/mailq.sendmail.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
Current `best' version is /usr/sbin/sendmail.sendmail.
Stuart Browne
Honored Contributor

Re: sendmail configured to use a relay node

Huh, fun.

Double check the virtusertable (makemap -u hash /etc/mail/virtusertable.db), see if that has any mappings.

If that doesn't show anything, then you're down to manual runnings of sendmail with high levels of logging or debugging to find out where it's coming from :(
One long-haired git at your service...
Jdamian
Respected Contributor

Re: sendmail configured to use a relay node

Matti suggested an issue about MX records from DNS... he is right.

My DNS provides a MX record:

mydomain.com mail exchanger = 10 myrelay.mydomain.com.

Thank everyone