System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Send emails when smtp gateway is not configured

Fenglin
Regular Advisor

Send emails when smtp gateway is not configured

Hi

Is there a way to send emails using the mailx command if the smtp gateway is not configured properly?

Server is HP-UX.

Regards
Feng Lin
2 REPLIES
Matti_Kurkela
Honored Contributor

Re: Send emails when smtp gateway is not configured

On HP-UX, mailx uses sendmail to actually transfer the email.

If sendmail on HP-UX is not configured to use a particular SMTP gateway (known as the "smarthost" configuration), sendmail will attempt to use DNS to find the recipient's public mail server (or one of its alternates, using DNS MX records) and will try to connect to the destination server's SMTP port (TCP/25) directly to transfer the email.

If this is not successful (maybe because the system has limited access to Internet DNS or outgoing SMTP traffic is blocked by a firewall), the message remains in a local mail queue and sendmail will attempt to re-send it for a while (usually several days).

Because MS-Windows machines are often plagued by malware that attempts to send junk email, many enterprise firewall administrators will limit outgoing SMTP access to legitimate mail servers only.

MK
MK
Barakati
Frequent Advisor

Re: Send emails when smtp gateway is not configured

you have to disable the Locally DNS Resolve for recipent mail and add the SMTP relay to the
/etc/mail/sendmail.cf file

here are the Steps

1. vi /etc/mail/sendmail.cf file
2.# "Smart" relay host (may be null)
DS ==> you have to enter the IP address of the SMTP relay that you have after DS.
3. In vi, do the following to get to the right place:
/^S96 [Return]
You should be at the top of Ruleset 96
4. Scroll down and comment out the following line:
# pass to name server to make hostname canonical
R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4

It should now be:

# pass to name server to make hostname canonical
#R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4

Stop and Start the Sendmail service

wish you the best