Jump to content

sendmail not working


javaguy
 Share

Recommended Posts

When I send a message via sendmail it never arrives. I get the following in the syslog:

 

sendmail[10331]: My unqualified host name (localhost) unknown; sleeping for retry

 

I use DHCP and don't really have a host name--my /etc/hosts just says

127.0.0.1 localhost

 

I'm not exactly sure what it's looking for.

 

Any suggestions?

Link to comment
Share on other sites

I use DHCP and don't really have a host name--my /etc/hosts just says

127.0.0.1 localhost

 

I'm not exactly sure what it's looking for.

 

Any suggestions?

 

You could set a qualified hostname in /etc/hosts simply by adding an alias for your localhost:

 

127.0.0.1 localhost myprettymachine

 

A better solution is to set a DHCP hostname using MCC/Networking/Reconfigure Network Interface/DHCP. Without a qualified hostname (localhost is always the local machine) you would not be able to use sendmail. There are millions of computers in the world. If every single one would just be named localhost, how could sendmail know where to send it's data to?

Link to comment
Share on other sites

I followed those instructions, and everything looked okay, but I still get

May 3 20:00:25 localhost sendmail[21693]: My unqualified host name (localhost) unknown; sleeping for retry

 

:(

 

Incidentally, I'm not married to sendmail. It's just the one I'm familiar with. If anybody can suggest another simple mail-sending utility, I'm all ears. I just don't want to set up a mail server; I want to send messages not become a mail admin. :)

Link to comment
Share on other sites

Wise you chose not to build a full server ;-)

 

Okay, some thoughts for going on with sendmail:

 

- Does the local test perform successfully? ( /usr/sbin/sendmail -bv root@localhost )

 

- What's in /etc/hosts now? Was it updated now reflecting your new hostname? If not, I'd add your chosen name here as an alias

 

- Can you see some helpful error message/hints in the logs ( i.e. "tail -200 /var/log/maillog | more" )

 

After applying any changes I'd restart subsystems ("service network restart"; "service sendmail restart")

 

HTH,

 

scoonma

Link to comment
Share on other sites

/etc/hosts is:

127.0.0.1 javaguyhost.localhost javaguyhost

 

I get a returned mail saying:

 

----- The following addresses had permanent fatal errors -----

<javaguy@sammckee.com>

(reason: 550-Verification failed for <javaguy@javaguyhost.localhost>)

 

----- Transcript of session follows -----

... while talking to sammckee.com.:

>>> DATA

<<< 550-Verification failed for <javaguy@javaguyhost.localhost>

<<< 550-unrouteable mail domain "javaguyhost.localhost"

<<< 550 Sender verify failed

550 5.1.1 <javaguy@sammckee.com>... User unknown

<<< 503 valid RCPT command must precede DATA

 

The message is address to javaguy@sammckee.com, not @javaguyhost.localhost.

Link to comment
Share on other sites

the server at sammckee is rejecting your message because it comes from an invalid domain

 

change you host file to something that looks like a real domain

127.0.0.1 home.mydomain.com localhost

 

this is normal behaviour for mail servers, is one of the tools that is used for anti-spamming

Link to comment
Share on other sites

Here's my /etc/hosts now:

127.0.0.1 home.sammckee.com localhost

 

Now the tail of my syslog looks like this:

 

May 4 20:58:04 localhost sendmail[30877]: l450w4Zh030877: from=javaguy, size=13, class=0, nrcpts=1, msgid=<200705050058.l450w4Zh030877@javaguyhost>, relay=javaguy@localhost

May 4 20:58:04 localhost sendmail[30878]: l450w4WZ030878: from=<javaguy@javaguyhost>, size=287, class=0, nrcpts=1, msgid=<200705050058.l450w4Zh030877@javaguyhost>, proto=ESMTP, daemon=MTA, relay=home.sammckee.com [127.0.0.1]

May 4 20:58:04 localhost sendmail[30878]: l450w4WZ030878: to=<javaguy@sammckee.com>, delay=00:00:00, mailer=esmtp, pri=30287, dsn=4.4.3, stat=queued

May 4 20:58:04 localhost sendmail[30877]: l450w4Zh030877: to=javaguy@sammckee.com, ctladdr=javaguy (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30013, relay=home.sammckee.com. [127.0.0.1], dsn=2.0.0, stat=Sent (l450w4WZ030878 Message accepted for delivery)

 

 

...but the message never arrives.

Link to comment
Share on other sites

what response do you get if you do this:

dig sammckee.com MX

; <<>> DiG 9.3.2 <<>> sammckee.com MX
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35940
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;sammckee.com.				  IN	  MX

;; ANSWER SECTION:
sammckee.com.		   14400   IN	  MX	  0 sammckee.com.

;; AUTHORITY SECTION:
sammckee.com.		   86400   IN	  NS	  ns1.snhdns.com.
sammckee.com.		   86400   IN	  NS	  ns2.snhdns.com.

;; ADDITIONAL SECTION:
sammckee.com.		   14400   IN	  A	   72.18.130.77

;; Query time: 681 msec
;; SERVER: 192.168.1.2#53(192.168.1.2)
;; WHEN: Sat May  5 14:20:30 2007
;; MSG SIZE  rcvd: 105

 

looks to me like 1 of perhaps 2 things

1. your local machine can't resolve the MX record for sammckee.com

2. sammckee.com is reject mail for some reason.

 

do you have access to the log files at sammckee.com ?

 

try doing a manual email send:

telnet sammckee.com 25
HELO home.sammckee.com
MAIL FROM: javaguy@home.sammckee.com
RCPT TO: javaguy@sammckee.com
DATA
Subject:-My test message- (note:then press enter twice (these are needed to conform to RFC 882))
this is my test message, you are reading the body of the message
. 
(note: To tell the mail server that you have completed the message enter a single "." on a line on it's own.)
QUIT

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...