[Solved] mailx : unknown user issue

Hi all,

I know this issues has been discussed multiple times, i have gone through many such discussion but unfortunately i am still not able to solve the issue being faced.

I have configured the sendmail.cf with the smtp host name (Editing the entry starting with DS...)

Post that restarted the sendmail services. When executed the mailx command to send the mail to an external mail id , i am getting below error. Please help

   ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <TestId@TestSMTP.com>... User unknown
550 5.1.1 TestId@TestSMTP.com... User unknown
<<< 503 5.0.0 Need RCPT (recipient)

--q5QCa5kc021344.1340714165/aixsrv.localadmin
Content-Type: message/delivery-status

Reporting-MTA: dns; aixsrv.localadmin
Arrival-Date: Tue, 26 Jun 2012 18:06:05 +0530 (IST)

Final-Recipient: RFC822; TestId@TestSMTP.com
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [127.0.0.1]
Diagnostic-Code: SMTP; 550 5.1.1 <TestId@TestSMTP.com>... User unknown

Please post what Operating System and version you have and what Shell you use.

Please post the mailx command line you typed (obliterating anything confidential with X's) .

What do you get for nslookup on the name of the mailserver you put into the DS line in sendmail.cf ?
How exactly did you restart sendmail?

What (non-comment) entries are there in /etc/mail/service.switch ?
What (non-comment) entries are there in /etc/mail/sendmail.cw ? Should be "localhost" and the name of the sending server .

OS : HP-UX B.11.31 U ia64 2819354210 unlimited-user license

Shell : /sbin/sh

mailx command used:

sh ServerStatus.sh| mailx -s "Server Status mail - DEV_SERVER" Dev_Admin@XXXXXXX.com

nslookup output:

looking up FILES
Name: smtphostname
Address: xx.xxx.xx.43

restart:
I restarted using below commands.

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

there is no file "service.switch" in /etc/mail

there are many server names which are non-commented in /etc/mail/sendmail.cw

Please let me know if any other info is needed. Please guide me.

I think its working correctly, and that it is the email address you sent that is giving you trouble, have you tried with a known valid address?

while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <TestId@TestSMTP.com>... User unknown

Suggests that in your /etc/mail/sendmail.cf, your relay is wrong: It should be your mail server and so you should not have 127.0.0.1 but the name of the mail server with whom your host is "chatting" with...

1 Like

Make sure that the SMTP relay server itself knows about you and can do a reverse DNS lookup on your IP address.

The SMTP relay name would normally be a fully qualified host name such that the line reads something like:

DS smtphostname.domain.com

And the entry (or alias) in /etc/hosts should be the fully qualified host name.

I'd only expect localhost and the fully qualified name of the local server unless you are the mail relay server yourself. If the SMTP mail relay server is in the list, that might explain it.

What else? Make sure that nobody has deleted the localhost entry in /etc/hosts and check the system mail log for error messages.
Quick check of the SMTP relay server with telnet to port 25 to make sure that it is listening.

1 Like

Hi vbe, methyl,

Thanks very much for your inputs. Issue is resolved. I replaced smtphost name with full qualified name , now it is delivering mail. Thanks again.

2 Likes

Thanks for keeping us informed...