Operating System - HP-UX
1752795 Members
5769 Online
108789 Solutions
New Discussion юеВ

the different mailx and sendmail

 
SOLVED
Go to solution
Isacc
Occasional Advisor

the different mailx and sendmail

Hi experts,
what is the different sendmail and mailx??

I have a server with hpu11.31 installed,I want to send an email to internal email company using exchange server, what should I do??Only configure sendmail.cf or I must configure something else??

Thanks,

Isacc
5 REPLIES 5
Matti_Kurkela
Honored Contributor
Solution

Re: the different mailx and sendmail

Welcome to the ITRC Forums!

Mailx is just a "front-end" program for sending and receiving email. It allows the user to access his/her mailbox and edit messages before sending, but another program (often sendmail) will do the actual mail delivery. Programs like mailx are classified as Mail User Agents (MUAs).

Sendmail, on the other hand, is a fully-functional email server program, or a Mail Transfer Agent (MTA). It is possible to feed an email directly to sendmail for sending it, but this is intended mainly to be used by other programs and scripts.

Usually, all that is needed for reliable outgoing mail transmission is to configure the name of your outgoing email server (SMTP server) to the /etc/mail/sendmail.cf file. Sendmail uses the term "smarthost" for this.
Search for a line in /etc/mail/sendmail.cf that begins with capital letters "DS".
Add the name (or IP address) of your SMTP server after those letters.

For example, if your SMTP server is named exchangeserver.company.example, you should change the line

DS

to:

DSexchangeserver.company.example

Of course, the Exchange server must be configured to accept incoming email from your HP-UX server. For email traffic, a valid DNS registration is very important: most spam filters make a "reverse DNS query" to find out if the IP address the message is coming from matches the name claimed by the sending server. If the result of IP address lookup does not match the hostname of your server, the Exchange server is very likely to flag your message as a forgery and possible spam.

Remember that mail delivery errors are reported as mail messages too. If you are sending email from your server, you should at least consider making some arrangements to receive any possible error messages coming back your way. Without the information in the error messages, troubleshooting email problems becomes much harder.

MK
MK
Isacc
Occasional Advisor

Re: the different mailx and sendmail

Hi MK,
what kind of arrangements should I have to know that I can receive any error message??
if I send an email,can I saw anything of log about sending this email(success or error sending) by OS log like syslog??

In the other thread I saw that they must configure the mailserv in /etc/rc.config.d/mailserv, should I configure it too?? or only configure in sendmail.cf after that I could send an email from my server.

Thanks,

Isacc
Matti_Kurkela
Honored Contributor

Re: the different mailx and sendmail

To receive the error messages, you must either allow your HP-UX server receive emails, or you could ask the Exchange administrator to redirect any email returning to the HP-UX sender address to some Exchange mailbox instead. (For example, your inbox, or some other mailbox dedicated to this purpose.)

If you are not familiar with the details of Internet mail routing and you are sending to company internal addresses only, the latter alternative may be preferable.

You're correct in that you should check /etc/rc.config.d/mailservs too. My mistake was because older releases of HP-UX usually have sendmail enabled by default. If you make arrangements to redirect the error messages at the Exchange server, you can enable the SENDMAIL_SEND_ONLY option and disable the other sendmail-related options.

You should stop sendmail using "sh /sbin/init.d/sendmail stop" before editing the mailservs file, and restart it afterwards with "sh /sbin/init.d/sendmail start"

Nevertheless, even without configuring /etc/rc.config.d/mailservs, mail sending may *seem* to work just fine... if *and only if* the Exchange server is always willing and able to handle any mails you'll send. But if there is e.g. a network problem, sendmail will store the email into its processing queue at /var/spool/mqueue... and if no sendmail functionality is enabled at /etc/rc.config.d/mailservs, it will stay there forever. (Or, until the sysadmin wonders why /var is getting full and discovers several years' worth of stuck emails...)

SENDMAIL_SEND_ONLY will enable sendmail's queue processor functionality, which will periodically check /var/spool/mqueue and make another attempt to deliver any mails stuck in the queue. This way the system will not immediately lose emails if there is an error, but will recover from the error when the Exchange server becomes usable again.

If the Exchange server absolutely refuses to receive mail from your HP-UX, the error message will eventually be stored at the sending user's local inbox on the HP-UX, because it really cannot go anywhere else in that case. The local inboxes are stored in /var/mail directory.

Of course, there is a log file too: /var/adm/syslog/mail.log. But it can only tell of events up to the point where the Exchange server has received the message and acknowledged that it will try to deliver the message onward. After that, the Exchange server will be responsible for the next delivery step, and sendmail on HP-UX has no way of knowing what happens to the email next. Any errors after that are reported by returning the mail message to the sender address with an error report attached.

If the error report is not available, the only alternative way to find out what went wrong is to examine the logs of *all* the mail servers the message has passed through. If the Exchange server handles a lot of traffic, this could be a lot of work, with special security/confidentiality restrictions. The error report will neatly avoid all that.

MK
MK
Isacc
Occasional Advisor

Re: the different mailx and sendmail

sorry for very late respons.
Finally I can configure it.
Thanks for MK for the share...

Isacc
Isacc
Occasional Advisor

Re: the different mailx and sendmail

This thread been closed.