[SOLVED] Command line mail taking too long to send; unable to qualify my own domain name


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [SOLVED] Command line mail taking too long to send; unable to qualify my own domain name
# 1  
Old 02-05-2010
[SOLVED] Command line mail taking too long to send; unable to qualify my own domain name

Hello,

I'm having a problem with my mail. When I send mail, it takes a long time for the send to complete.

In the below, datestamp is just a simple script to put in a no-white-space date/time stamp.

Code:
$ datestamp ; mail woodnt; datestamp
02-05-10@193844
Subject: test
timer
Cc: 
02-05-10@193956

a tail -50 /var/log/syslog shows a problem with :

Code:
Feb  5 19:38:56 toshiba-laptop sendmail[10772]: My unqualified host name (toshiba-laptop) unknown; sleeping for retry
Feb  5 19:38:59 toshiba-laptop ypbind[1512]: broadcast: RPC: Timed out.
Feb  5 19:39:56 toshiba-laptop sendmail[10772]: unable to qualify my own domain name (toshiba-laptop) -- using short name
Feb  5 19:39:56 toshiba-laptop sendmail[10772]: o161duSX010772: from=woodnt, size=32, class=0, nrcpts=1, msgid=<201002060139.o161duSX010772@toshiba-laptop>, relay=woodnt@localhost
Feb  5 19:39:56 toshiba-laptop sm-mta[10774]: o161duNP010774: from=<woodnt@toshiba-laptop>, size=321, class=0, nrcpts=1, msgid=<201002060139.o161duSX010772@toshiba-laptop>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  5 19:39:56 toshiba-laptop sendmail[10772]: o161duSX010772: to=woodnt, ctladdr=woodnt (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30032, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o161duNP010774 Message accepted for delivery)

Here is my /etc/hosts file:

Code:
$ cat /etc/hosts
127.0.0.1    localhost
#127.0.0.1    toshiba-laptop
192.168.1.50    dell-desktop
192.168.1.51    gateway
192.168.1.52    woodnt-laptop
192.168.1.53    fujitsu
192.168.1.54    toshiba-laptop
192.168.1.61    krista-netbook
192.168.1.62    luke-netbook
192.168.1.63    beth-netbook

# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts

Here is my ifconfig output showing the correct ip:

Code:
$ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:1e:65:07:72:c6  
          inet addr:192.168.1.54  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:65ff:fe07:72c6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:131563 errors:0 dropped:0 overruns:0 frame:0
          TX packets:122576 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:127932916 (127.9 MB)  TX bytes:18785169 (18.7 MB)

Please note the lag between timestamp 19:38:59 and 19:39:56 where broadcast RCP timed out and it was unable to qualify my own domain name. Any idea how to fix this?

With thanks,
Narnie

---------- Post updated at 08:09 PM ---------- Previous update was at 08:02 PM ----------

Well, I figured it out just now after I posted this.

The last thing I tried was commenting out my hostname listing in /etc/hosts like so:
Code:
#192.168.1.54    toshiba-laptop

This is an auto-generated hosts file from a script I wrote to make sure all computers have the same hosts-file on my home network.

Evidently, it is not good to have your own hostname in the hosts file like this.

If any networking guru might want to comment on why this is so, this may help us mere amateurs learn from my mistake.

Hope this might help someone else that might ever have this problems.

Yours,
Narnie

---------- Post updated at 08:18 PM ---------- Previous update was at 08:09 PM ----------

I take it back. It isn't a fix.

When I commented out the computer in /etc/hosts, then the system gave this:

Code:
$ sudo su
sudo: unable to resolve host toshiba-laptop

and this:

Code:
$ ssh -p 50505 toshibia-laptop
ssh: Could not resolve hostname toshibia-laptop: Name or service not known

Now back to square one. How to resolve the original issue.

Narnie

---------- Post updated at 09:18 PM ---------- Previous update was at 08:18 PM ----------

OK, here's the "partial fix."

sendmail MUST have a fully qualified domain name or it gives this error. So "tweak" the /etc/hosts file like so:

Code:
127.0.0.1    localhost localhost.localdomain toshiba-laptop toshiba-laptop.foobar

That fixed both problems. mail now sends quickly and I can ssh to toshiba-laptop without error and do a sudo su without an error report.

The problem now is that I don't get mail. Hehe. Oh the joys ! Any ideas how to fix all these issues at once?

Cheerio,
Narnie

---------- Post updated at 09:31 PM ---------- Previous update was at 09:18 PM ----------

Ok, here is the real fix.

Code:
$ cat /etc/hosts
127.0.0.1    localhost localhost. toshiba-laptop toshiba-laptop.
192.168.1.50    dell-desktop
192.168.1.51    gateway
192.168.1.52    woodnt-laptop
192.168.1.53    fujitsu
192.168.1.54    toshiba-laptop.
192.168.1.61    krista-netbook
192.168.1.62    luke-netbook
192.168.1.63    beth-netbook

Note periods at the end the hosts of the 127.0.0.1 line and 192.158.1.54 as in:

localhost.
toshiba-laptop.

That satisfied sendmail and mail works immediately with no sleeping and actually delivers the mail !!! ssh'ing works as well now.

That problem is now solved. YEA! Now on to others Smilie

Cheerio all,
Narnie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Script taking more time to send report to mail

Hi, I schedule a script on linux server and it is taking more time say "30 minutes" to send the report via mail. Could you please suggest a way to speed up sending report to mail? OS version -- Red Hat Enterprise Linux Server release 6.5 (Santiago) Regards, Maddy (2 Replies)
Discussion started by: Maddy123
2 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. UNIX for Dummies Questions & Answers

Configure sendmail to Only send mail to one domain

On both Solaris 10 and RHEL, we would like to configure sendmail in such a way that the email sent from the server should only go to a particular domain. For eg. We want our server to ONLY send the mail to <user_name>@abc.com. All other domains should be blocked/restricted. The server should not... (0 Replies)
Discussion started by: sk2code
0 Replies

4. Shell Programming and Scripting

Unable to set end of line in mail command

Hi , Am trying to send mail using the mail command, but the mail command is working but its not sending automatically after pressing .(dot) in the command prompt it sends . How to achieve that. Also it showing the below line after pressing the dot . /home/abc1/dead.letter... Saved message in... (5 Replies)
Discussion started by: rogerben
5 Replies

5. Shell Programming and Scripting

Send mail from command line

Hi All; I need to send emails from command line in some of my shell scripts. I tried : mail -s "Subject" member@body.com < testfile where test file contains body of the mail This work on my mac computer at work BUT not on my mac laptop. Does anyone have any ideas why? Thanks Walforum (1 Reply)
Discussion started by: walforum
1 Replies

6. AIX

I Need to send mail to 2 domain

Hi, I need to send alert mail from AIX to mail server. My mail server IP is 192.168.0.10 so I've add /etc/hosts as below 192.168.0.10 mydomain1.com the I try to send mail to myname@mydomain1.com it's OK Then I need to send mail to myname@mydomain2.com too. so I've... (1 Reply)
Discussion started by: oakmojo
1 Replies

7. Solaris

unable to qualify my own domain name

Dear All, I have machine SUNW,Sun-Fire-V240 with SunOS built there,everyday while I check messages,I found like below: Jul 7 19:41:00 pssk sendmail: unable to qualify my own domain name (pub-pssk) -- using short name Can any body help me to know and stop all messages,thank's for your... (3 Replies)
Discussion started by: fredginting
3 Replies

8. Shell Programming and Scripting

How can i send mail to multiple addresses in same domain in bash?

Suppose i have a txt file that is the list of the addresses,something like: lala0045 john james lala0234 george james and i want to send an email to lala0045@blabla.com and lala0234@blabla.com,the same domain...what is the exact syntax i should use in my script? there is a command... (10 Replies)
Discussion started by: bashuser2
10 Replies

9. UNIX for Dummies Questions & Answers

Unable to send e-mail using mailx command

Hi All, Can you please help me in solving this. I am facing some problem sending mails. If I use like this, I am able to send mail the mail echo "This is an automated e-mail; please do not reply." | mailx -s "Good Morning ." 'abc@xys.com' But if I use like this, then I am unable to send... (1 Reply)
Discussion started by: manas6
1 Replies

10. UNIX for Dummies Questions & Answers

command line send mail

Hi, I am trying to send mail in ubuntu. I have installed postfix. In Redhat I could just type: mail name@domain.com I get the error that the command mail is not found. Does anyone know if there is a different command line to send mail? Can I install the command? Thanks, Eric (1 Reply)
Discussion started by: ejbrever
1 Replies
Login or Register to Ask a Question