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?
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?
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
"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.
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:
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
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 ]
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)