1832934 Members
2951 Online
110048 Solutions
New Discussion

Re: mailx

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

mailx

We use mailx to send out some info to customers: email-cmd = "mailx -s TAW-Order -r " + userid("ptdb9") + "@tawinc.com" + frpl-email + " < fpl-job.eml".
Is there any why with unix of tracking that email, verify whether it went out or not? Or does that have to be done on the exchange side?
6 REPLIES 6
Uday_S_Ankolekar
Honored Contributor

Re: mailx

You can check in /var/adm/syslog/mail.log file about the status. You will see "sent" if it's gone out from your server
-USA..
Good Luck..
Steven E. Protter
Exalted Contributor
Solution

Re: mailx

Jeff everything you need will be in the mail.log file.

You can run diagnistics with sendmail'

sendmail -v -d8.99 -d38.99 someone@some.net

type text

.


You will get full diagnostics on screen.

sendmail and mailx both use the sendmail daemon to exchange messages.

If its passed on to exchange okay, you'll see that. If not, look at the relay settings on the Exchange Server.

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
Bill Hassell
Honored Contributor

Re: mailx

You can check on all unsent messages with mailq (which is really: sendmail -bp).


Bill Hassell, sysadmin
Mic V.
Esteemed Contributor

Re: mailx

If your UNIX sends to Exchange, and Exchange is what talks to the outside world, then I would say yes -- you can find out some things by querying the UNIX side, but the Exchange server will give more authoritative info.

If the mail is truly going "outside your company" (some depends on your config), then AFAIK Exchange will only tell you it if passed to the next mail host, not whether it was delivered. (But maybe that wasn't your concern and some mailers/mail can be configured to tell you if/when something lands.)
What kind of a name is 'Wolverine'?
Klaas D. Eenkhoorn
Regular Advisor

Re: mailx

If sendmail finished to send the mail you can keep track of the mail by watching /var/adm/syslog/mail.log.
If the message is send you will find it there.
Place a grep on the e-mail adres for example and whenever you will find a line with 'stat=Sent' the message is gone.
Also in this line you will find the status of the host the message has been send to.

example:

Jan 22 05:31:45 hp3 sendmail[7522]: FAA07522: from=root, size=259, class=0, pri=
30259, nrcpts=1, msgid=<200401220431.FAA07522@source.foo.com>, relay=root@l
ocalhost

sendmail has accepted the message from mailx, send to unixbeheer@dest.foo.com by root, on the localhost.

Jan 22 05:31:45 hp3 sendmail[7524]: FAA07522: to=unixbeheer@dest.foo.com, ctladdr
=root (0/3), delay=00:00:00, xdelay=00:00:00, mailer=relay, relay=exchange.foo.com [10.100.1.4], stat=Sent (2.6.0 <200401220431.FAA07522@source.foo.com> )

Queued mail for delivery
Sendmail relayed the message to exchange.foo.com.

Stat=sent, answered by sendmail, and exchange.foo.com replied with a status message 'Queued mail for delivery'

So, send the message to the user and wait till you see stat=sent for that message.

Kl@@s
Kasper Haitsma
Trusted Contributor

Re: mailx

Hello,

It is not entirely clear (to me) what you would like to know.

If you want to verify, if the message left your company succesfully, this can/needs_to be verified on every host the message was handled on, inside your company. hp-ux's mail.log will tell you which host it has delivered it too. Then you look on the next host, in it's log area for mail, and so on. On MS Exchange, I am not sure where to look, but according to M.Vening (above) it should be possible.

If you want to know if the message was received by the intended receipient, one has to set a delivery or read notification. mailx(1) is NOT capable to set such a notification. You need a smarter mail client for that. I am unaware of a commandline mailclient (elm/mailx/mail/mutt) that can set delivery acknowledgements. If you need it, you need to write more or less your own mailclient, add the necessary headerlines youself in your message, and spool it into sendmail directly.

HTH
Kasper
HP support engineer for sendmail, OpenMail, OVO/u
It depends