Mail command confusion


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Mail command confusion
# 8  
Old 03-18-2008
thanks. can you guide me here, please don't get angry but your help is very much needed for me to go ahead to resolve this. what are possibe scenarios when a mail commad does not error out..... but the mail does nor reach recipient. Any config file i need to change?
# 9  
Old 03-18-2008
Depends a lot on your set-up. Can you telnet localhost 25? Can you see the status of the mail spool (something like mailq)? Can you read mail server logs?
era
# 10  
Old 03-19-2008
Mailq generated the mail that i sent during this period that did not reach sandeep@mysym.com

mailq
/var/spool/mqueue (3 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------

m2ID2oJb006079 1 Tue Mar 18 18:32 <root@blr.xyz.com>
(Deferred: Name server: blr.xyz.com: host name loo)
<sandeep@mysym.com>
m2IAB5Jb004895 1073 Tue Mar 18 15:41 <root@blr.xyz.com>
(Deferred: Name server: blr.xyz.com: host name loo)
<sandeep@mysym.com>
m2I9ZqJb004730 1073 Tue Mar 18 15:05 <root@blr.xyz.com>
(Deferred: Name server: blr.xyz.com: host name loo)
<sandeep@mysym.com>
Total requests: 3


Telnet results


telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 blr.xyz.com ESMTP Sendmail 8.12.8/8.12.8; Wed, 19 Mar 2008 12:44:33 +0530


THis hangs and no results appear


Please review and let me know

Regards,
Sandeep
# 11  
Old 03-23-2008
"Host name lookup failed" means that the host you are trying to send mail to does not exist. (You have to pass an option to mailq to see the full, untruncated error message.)

The mail is submitted, but Sendmail is sitting on it, because the mail routing is wrong.

Basically, when you send mail to the Internet, a DNS lookup against the receiving domain's "MX" record takes place. This instructs your MTA to contact a particular host which handles mail (Mail eXchanger) for this domain. This indirection exists so that large domains can centralize and manage their email infrastructure on one server, or a small set of servers; it also enables a fallback, because a domain's MX record can include one or more secondary entries in case the primary is down.

The MX for blr.xyz.com points to a host which does not exist, or blr.xyz.com simply does not exist in the DNS. Fix the DNS problem(s), and/or send the email to a domain which exists in reality, and has working email. (Try a sacrificial Hotmail or Gmail account if you just want to check that it works.) Or simply don't use a domain name, which will send the message to a local account (on most architectures I have seen; but some are set up to send even mail without a domain name to an upstream "smarthost").

... The log files reveal the real domain name you are using, which is not xyz.com, and it does indeed seems to have DNS issues.

Code:
vnix$ host -t ns mysym.com
Host mysym.com not found: 2(SERVFAIL)

I tried to look up the NS (name server) record for this domain, and got nothing. I cannot proceed.

If this is a domain name you use on your intranet, and you don't even mean to reach the "real" mysym.com, then your name server set-up is probably screwed; see if your /etc/resolv.conf is different than on other machines in your neighborhood.

For comparison, here's unix.com:

Code:
vnix$ host -t ns unix.com
unix.com name server ns2.sitelutions.com.
unix.com name server ns3.sitelutions.com.
unix.com name server ns4.sitelutions.com.
unix.com name server ns5.sitelutions.com.
unix.com name server ns1.sitelutions.com.

vnix$ host -t mx unix.com  # basically gets the answer from one of the NS hosts listed above
unix.com mail is handled by 10 ASPMX3.GOOGLEMAIL.com.
unix.com mail is handled by 10 ASPMX4.GOOGLEMAIL.com.
unix.com mail is handled by 10 ASPMX5.GOOGLEMAIL.com.
unix.com mail is handled by 1 ASPMX.L.GOOGLE.com.
unix.com mail is handled by 5 ALT1.ASPMX.L.GOOGLE.com.
unix.com mail is handled by 5 ALT2.ASPMX.L.GOOGLE.com.
unix.com mail is handled by 10 ASPMX2.GOOGLEMAIL.com.

This says that DNS for unix.com is handled by sitesolutions.com, and mail for unix.com is handled by ASMPX.L.GOOGLE.com -- the others are secondary fallback hosts in case the primary cannot be reached. This sort of set-up is atypical, although an increasing number of domains are moving to Googlemail for their email handling, so this might be becoming the norm actually. Anyway, this aside was just for educational purposes.

Sorry for the long delay; I was having the flu for a few days.

Last edited by era; 03-23-2008 at 12:41 PM.. Reason: Add code examples with lookups for mysym.com and unix.com
# 12  
Old 03-26-2008
Hi era,

Sorry about being late in my reply. I was held up with some work and i could not reply you back.

First thing is that i did not provide you the correct domain name (mysym.com) in first case as i thought it would inappropriate for me to give for security reasons.Sorry about this. I ran the same as you said in you reply and got the below results( note that domain is dummy as i said i am not supposed to give this out).
------------------------------------------------------------------
$ host -t ns mysym.com

mysym.com name server xyz.domaincontrol.com.
mysym.com name server xyw.domaincontrol.com.


$ host -t mx mysym.com

mysym.com mail is handled by 10 xx3.mysym.com.
mysym.com mail is handled by 20 xx4.mysym.com.


$ cat /etc/resolv.conf



$ vi /etc/resolv.conf

domain mysym.com
nameserver 10.10.10.1

$ /etc/init.d/sendmail restart
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]


[root@blr080cmgcv02 root]# sendmail -v sandy@mysym.com


WARNING: local host name is not qualified; fix $j in config file

----------------------------------------------------------------------
I followed the below document on the net :

Sendmail and SMTP AUTH on RedHat Linux 9 - Part 1 - Installing Sendmail

and did as specified in the doc , but i get the same error

WARNING: local host name is not qualified; fix $j in config file

Please help

Thanks,
Sandeep
# 13  
Old 03-26-2008
I'm not really qualified to say if the Sendmail $j problem has any meaning here (my Sendmail book is at work, and I'm out of the office this week).

Can you connect to xx3.mysym.com and/or xx4.mysym.com? The error message basically means that these hosts did not resolve.
# 14  
Old 03-26-2008
era,

No problem I can wait till you are back. I will check what you asked tmr .Thanks for all your help

Thanks,
Sandeep
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. UNIX for Advanced & Expert Users

Unable to send mail with 'mail' command

I am unable to cause the 'mail' command to send mail from my linux ubuntu 15.10 computer. File 'mail.log' typically reports Connection timed out. I issue the command: mail -s "my subject" recipient@domain.com < filenamewhere filename is a file containing my message. Specifically, the... (3 Replies)
Discussion started by: tcnm
3 Replies

3. Homework & Coursework Questions

Creating a function that sends a mail using mail command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies

4. UNIX for Dummies Questions & Answers

Confusion with echo command under csh shell

HI, guys, I am having some problem with the echo command, so I want to echo some text to a file name loginFile, the result inside the loginFile should looks like: expect ">" so what I did is: echo "expect "">""" >> $loginFile but it just gave out: expect > The thing is I still need... (2 Replies)
Discussion started by: warmboy610
2 Replies

5. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s “Hello world” abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

6. Fedora

Need to send mail using mail command

Hi Guys, Am tried with the mail & mailx command to send mail to other localhost machine, Which are all connected in a LAN. I can not able to send, Either it wont display any error message at that time and later am receiving a failure mail.. But i can send and receive (from-to) in my machine..... (28 Replies)
Discussion started by: Adhi
28 Replies

7. UNIX for Dummies Questions & Answers

[Query] Confusion of the Swap when using 'free -m' command

Hi All, I have just installed my first Linux server ( Ubuntu 11.10 ). I am sure I didn't allocate /swap , and double check by 'df -h', yes really no /swap but when I use 'free -m' , returned a "Swap" line as below. total used free shared buffers cached Mem: ... (3 Replies)
Discussion started by: joaming
3 Replies

8. Shell Programming and Scripting

Not able to receive mail using mail command

Hi all, I have written a script which supposed send a mail. For testing I am just sending mails to my ID. script I have written to send mail is- #!/usr/bin/ksh MAIL_FILE="$HOME/MAIL_FILE" MAILOUT_LIST="milindb@example.com" mail -s "Subject" $MAILOUT_LIST < $MAIL_FILE if then echo... (6 Replies)
Discussion started by: milindb
6 Replies

9. Solaris

identify the mail server for mail command

Hi , I am new to unix , i am using the mail and mailx command to send the mail .How come i will know the my mail command using which server as mail box.. Please help me .. Thanks in advance (1 Reply)
Discussion started by: julirani
1 Replies

10. UNIX for Dummies Questions & Answers

wc command confusion

Can somebody explain it to me that why wc gives more chars suppose Ab.txt have two lines qwer qasd then wc -c ab.txt will give 10.why not 8.okay may be it is taking count one for each line just in case but why echo "qwer"|wc -C gives 5. Ok with \c it is returning 4. :) (6 Replies)
Discussion started by: Dhruva
6 Replies
Login or Register to Ask a Question