Visit Our UNIX and Linux User Community


Debugging a "sendmail" issue


 
Thread Tools Search this Thread
Operating Systems AIX Debugging a "sendmail" issue
# 8  
Old 08-19-2009
Cheers I will have a look when I get in tomorrow, any additional light bulb moments are welcome, more things I can try the better :-)
# 9  
Old 08-19-2009
Quote:
however there is a problem which one recipient (lets say hick@jimbob.com) is not getting the emails.
Do sendmail tries to *send* it? You should be able to check that on the /var/log/mail* (last resort tcpdump -i if -n port 25 on the server or the equivalent snoop)
Do others users on the jimbob.com get their email?

Quote:
Something to note, when I tried pinging jimbob.com (domain used in the
How did you ping it? ping jimbob.com ? It might not be the correct ip.
When an MTA tries to send an email, it asks for the MX dns record.
It usually points to smtp||mail.domain.tld, but could be any other name/address
Try something like
dig domain.tld MX
to ask for the MaileXchanger.

For instance:
seba@asterix:~$ dig google.com MX
;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 900 IN MX 10 smtp1.google.com.
google.com. 900 IN MX 10 smtp2.google.com.
google.com. 900 IN MX 10 smtp3.google.com.
google.com. 900 IN MX 10 google.com.s9a1.psmtp.com.
google.com. 900 IN MX 100 google.com.s9a2.psmtp.com.

;; AUTHORITY SECTION:
google.com. 172800 IN NS ns4.google.com.
google.com. 172800 IN NS ns1.google.com.
google.com. 172800 IN NS ns2.google.com.
google.com. 172800 IN NS ns3.google.com.

;; ADDITIONAL SECTION:
smtp1.google.com. 3600 IN A 74.125.45.25
smtp2.google.com. 3600 IN A 74.125.65.25
smtp3.google.com. 3600 IN A 209.85.137.25

This tells us that if you
seba@asterix:~$ telnet smtp1.google.com. 25
Trying 74.125.45.25...
Connected to smtp1.google.com.
Escape character is '^]'.
help220 smtp.google.com ESMTP

214-2.0.0 This is sendmail version 8.13.8
214-2.0.0 Topics:
214-2.0.0 HELO EHLO MAIL RCPT DATA
214-2.0.0 RSET NOOP QUIT HELP VRFY
214-2.0.0 EXPN VERB ETRN DSN AUTH
214-2.0.0 STARTTLS
214-2.0.0 For more info use "HELP <topic>".
214-2.0.0 To report bugs in the implementation see
214-2.0.0 Contact Us - Support - sendmail.org
214-2.0.0 For local information send email to Postmaster at your site.
214 2.0.0 End of HELP info
help

So, the server is able to communicate with the domain.tld MX

email address) it does not give any results. However the internet browser is able to open the website of jimbob.com, and outlook is able to successfully send to hick@jimbob.com.

Quote:
Which makes me think this is down to a problem within sendmail. Anyone idea's on how to diagnose this issue?

Appreciate any helpful replies.
If you can connect to the destination MX, then you would like to check the logs. A lot of wisedom is hidden there Smilie

Regards
Sebastian
# 10  
Old 08-19-2009
If you have a smarthost defined, the email will be sent to your smarthost then on to the destination. If you are sending directly to the other host there are ways to debug it. First, do a lookup to find the MX (Mail eXchange) record for the domain.

dig -t mx jimbob.com.

Once you find out who the mail exchanger is, you could try to telnet to port 25 of that host which is the SMTP port and see if it responds.

You should also be able to look at the sendmail logs '/var/log/maillog' to see what is going on with the jimbob.com emails. See if they were sent on or if they are still sitting on your host waiting to be delivered.

I did have an instance a while back where a business changed ISPs. Any customer using the old ISP, still was getting the old MX record back instead of the current one. This is because the ISP did not delete the old MX record once the domain left their control.

You may also have a routing problem where you just can't get to the destination SMTP server. You may also have a case where the destination server is using anti-spam protection and your server or the range of IP addresses it uses were defined as SPAM senders and the destination server is not accepting a connection from you.

You might also try traceroute to the destination SMTP server to see if that works.
# 11  
Old 08-20-2009
Quote:
Originally Posted by jim mcnamara
Code:
ping -p 25 jimbob.com

This doesn't test TCP port 25 on the mail server. Ping is not the right command.

This does:
Code:
dig mx jimbob.com

Now get IP address shown.
Code:
telnet <IP address> 25

# 12  
Old 08-20-2009
Quote:
Originally Posted by tristezo2k
Do sendmail tries to *send* it? You should be able to check that on the /var/log/mail* (last resort tcpdump -i if -n port 25 on the server or the equivalent snoop)
Quote:
Originally Posted by EarleAke
You should also be able to look at the sendmail logs '/var/log/maillog' to see what is going on with the jimbob.com emails. See if they were sent on or if they are still sitting on your host waiting to be delivered.
It doesn't appear there is any log file for sendmail, I have checked the sendmail.cf and it doesn't appear there either. I'm wondering if I can possibly produce a log file on the fly which does the same thing?

I noticed the flag -X in the man pages:
-X LogFile Logs all traffic in and out of sendmail in LogFile for debugging
mailer problems. Use this flag sparingly, since it produces a lot of data very
quickly. This flag applies only to 4.2 or later.
However I'm not sure how to use it, when I try excuting:
$ sendmail -X blah.dat
Cannot chdir(/var/spool/mqueue): The file access permissions do not allow the specified action.
Not sure if there is anything better available either.

Quote:
Originally Posted by tristezo2k
How did you ping it? ping jimbob.com ? It might not be the correct ip.
When an MTA tries to send an email, it asks for the MX dns record.
It usually points to smtp||mail.domain.tld, but could be any other name/address

<snip>

So, the server is able to communicate with the domain.tld MX
Quote:
Originally Posted by EarleAke
Once you find out who the mail exchanger is, you could try to telnet to port 25 of that host which is the SMTP port and see if it responds.
I followed your steps, but it hanged:
Trying...
telnet: connect: A remote host did not respond within the timeout period.

What I did.... I obtained the MX record and used the mail server it listed. Tested for not just jimbob.com, but also gmail.com, hotmail.com and yahoo.com - they all hanged. So I'm guessing it is a security restriction blocking the telnet session for external sites.

---------- Post updated at 05:27 PM ---------- Previous update was at 06:23 AM ----------

Apologies for bringing this back into light, but has anyone else got any more ideas? Kinda struggling to find a resolution to this one.

I will get the mail log working tomorrow, but there doesn't seem an awful lot of information going into it.

Unfortunately I can't test the connection by telneting to the mail server (as stated above), must be getting blocked when attempting to telnet into the external site.

Helpful replies so far though, but need moooOOORRRE! :-)

Last edited by neil_is_ere; 08-20-2009 at 08:28 AM..
# 13  
Old 08-24-2009
Tools

Quote:
I followed your steps, but it hanged:
Trying...
telnet: connect: A remote host did not respond within the timeout period.

What I did.... I obtained the MX record and used the mail server it listed. Tested for not just jimbob.com, but also gmail.com, hotmail.com and yahoo.com - they all hanged. So I'm guessing it is a security restriction blocking the telnet session for external sites.


This should be answered by the network admin.
As a way to test, try other tcp services befor yelling the netadmin.
For instance, 21 - ftp, 22 - ssh, 80 - http, etc

telnet someotherhostyouknowisrunningssh 22
and see if it connects.
On most networks tcp/25 si denied because of the windows worms. Usually there is a so called "smart host" that receives the email from the network, and forwars it to the final destination. Get this information from the netadmin, too. If that is the case you will need a some special sendmail config.

---------- Post updated at 05:27 PM ---------- Previous update was at 06:23 AM ----------

Quote:
I will get the mail log working tomorrow, but there doesn't seem an awful lot of information going into it.
If it is not, it should be. Set it up.
# 14  
Old 08-24-2009
Some ISPs also block port 25 traffic, only allowing smtp traffic to be relayed to their own mail servers. Its suppose to help cut down on spam. Most times you have the ISP add an exception for you, or change your smart host setting in sendmail to point to your ISP's mail server.

Previous Thread | Next Thread
Test Your Knowledge in Computers #4
Difficulty: Medium
The UNIX and Linux Forums was one of the first forums on the Internet to have a strong moderation policy to encourage users of all skill levels to participate without fear of being bullied.
True or False?

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

5. Shell Programming and Scripting

""Help Me!""Beginner awk learning issue

Hi All, I have just now started learning awk from the source - Awk - A Tutorial and Introduction - by Bruce Barnett and the bad part is that I am stuck on the very first example for running the awk script. The script is as - #!/bin/sh # Linux users have to change $8 to $9 awk ' BEGIN ... (6 Replies)
Discussion started by: csrohit
6 Replies

6. UNIX for Advanced & Expert Users

Sendmail: how to restrict delivery based on "to" or "from"?

Hello, I manage a large sendmail server that handles more than 20,000 pieces of mail per day. It's a bit unusual in that all this mail is only being sent to and from 4 local accounts. (It's an automated transaction processing system, whereby users submit a transaction via email attachment). ... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. Solaris

sendmail "root... User address required." error

I'm running sendmail (8.13.8+Sun/8.13.8/Submit) solaris 10. When I send mail to root at the command line (whether I use a full-qualified address or just root), I get the error message root... User address required. Sending mail to root (either at the command line or in a cron job),... (10 Replies)
Discussion started by: csgonan
10 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

Featured Tech Videos