Operating System - HP-UX
1833988 Members
1587 Online
110063 Solutions
New Discussion

Re: mailx cannot send mail to my e-mail address

 
Kenn Chen
Advisor

mailx cannot send mail to my e-mail address

I've configured the sendmail.cf but the mailx function is not working. How could I make it work. Command : mailx -s "Testing" simon@kk.co.kr
Cyber Zen
9 REPLIES 9
Matt Livingston
Valued Contributor

Re: mailx cannot send mail to my e-mail address

The command you cite above expects a -terminated input stream from STDIN. If it looks like it is hanging, it may just waiting for you to type something. You could also get your STDIN from a file or a pipe as usual.

Also, how is your sendmail.cf configured? Are you forwarding mail to a 'SmartHost'? If so, you may need to specify a valid return address on the mailx command line.

Like so:

mailx -s "test" -rvaliduser@host.subdomain.domain otheruser@host.subdomain.domain < mailmsg.txt
Dan Hetzel
Honored Contributor

Re: mailx cannot send mail to my e-mail address

Hi,

As said before, the command you are using expects you to type the message text, ending with a .

If your message text is already contained in a file, you may use redirection instead of typing the message. In this case, no is needed.

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
CHRIS_ANORUO
Honored Contributor

Re: mailx cannot send mail to my e-mail address

You command is not complete. Do this mailx -s "Testing" simon@kk.co.kr < filename.

If you have updated /etc/mail/sendmail.cf with the MS exchange server name i.e. DS(exchangeservername)
Restart sendmail(sbin/init.d/sendmail stop/start)
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Kenn Chen
Advisor

Re: mailx cannot send mail to my e-mail address

I mean even I press Ctr D after message, i still cannot receive from the server. Why ?
Cyber Zen
Rainer_1
Honored Contributor

Re: mailx cannot send mail to my e-mail address

check with

mailq

what is in the mail queue
Douglas Cromby_1
Valued Contributor

Re: mailx cannot send mail to my e-mail address

Hello,

Before testing with mailx, you could try using sendmail itself. I always use the -v option so you can see what is going on, as follows:

sendmail -v abc@xyz.com

This will test the changes to sendmail.cf. Once you are happy with this, you can test with mailx.
Rita C Workman
Honored Contributor

Re: mailx cannot send mail to my e-mail address

I agree with Douglas' test. I have found when mail isn't going...running this helps find the answer.

You may need to check your /etc/nsswitch.conf and /etc/resolv.conf files and see that they are configured right and pointing to the DNS server.

Just a thought,
Tim O'Connell
Regular Advisor

Re: mailx cannot send mail to my e-mail address

Many thanks for the help. I have just had the same problem. I have two HP servers running HPUX11 and mailx worked fine from one but not from the second one. These are new servers. After about half a day testing I turned to the forum & found the solution. Check the files. resolv.conf had been renamed on one of my servers to resolv.bak. Renaming it back solved the problem but I can't understand why it didn't have the correct name in the first place. Maybe the support engineer we had on site for setting up the machines renamed it for some good reason!.

Many Thanks,

Tim
Steven E. Protter
Exalted Contributor

Re: mailx cannot send mail to my e-mail address

Douglas's test will work.

For added diagnostic information(probably too much)

sendmail -v -d8.99 -d38.99 abc@xyz.com
type some text

.


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com