Operating System - HP-UX
1833700 Members
2998 Online
110062 Solutions
New Discussion

Re: Mailx out from the server

 
SOLVED
Go to solution
Jie Li
Frequent Advisor

Mailx out from the server

Good morning:

Can someone share with me how to set the system up to allow email out from the server?

Thanks in advance
12 REPLIES 12
Geoff Wild
Honored Contributor

Re: Mailx out from the server

It just works by itself - though, you need DNS working properly...

Depending on internal environment, you may have to configure sendmail:

In /etc/mail/sendmail.cf

Setup a smart relay:

DSyourrelayserver

Masquerade?

DMyourdomain.com


Stop/start sendmail.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Luk Vandenbussche
Honored Contributor

Re: Mailx out from the server

Add your nailhost in /etc/mail/sendmail.cf

DSyourhost.yourcompany.com

Restart sendmail
jpcast_real
Regular Advisor

Re: Mailx out from the server

Hello,

you do not need to have running the sendmail daemon to send a mail . The easiest way is to use the executable sendmail , it has the same name as the daemon but it is not the same. If you want to use the sendmail daemon you must have a /etc/mail/sendmail.cf configuration file correctly configured and sometimes it is a bit complicated. You will be able to find in docs.hp.com lots of information about how to configure internet services and sendmail too . When you have configured the sendmail.cf file you just need to execute

sendmail -v dkjldfjl@kk.com

Thats all
Here rests one who was not what he wanted and didn't want what he was
Muthukumar_5
Honored Contributor
Solution

Re: Mailx out from the server

We can do with mailx (or mail or sendmail ) service easily as,

-- /etc/nsswitch.conf ---
hosts: dns hosts

-- /etc/resolv.conf --
domain yourdomain.com
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx
-----------------------

Check resolvation as,

nslookup hostname.domainname.com
example:
nslookup test.testdom.com

or nsquery hosts test.testdom.com "dns hosts"

It has to be resoled there.

Sending mails:

echo "Test mail on $(date)" | mailx -s "test mail from `hostname`" loginuser@domainname.com

It will send your mails.
Easy to suggest when don't know about the problem!
Prashant Zanwar_4
Respected Contributor

Re: Mailx out from the server

You have to have relayserver configured in sendmail.cf and also mention the same in host file. This shall let you mail across with correct nsswitch.conf and resolv.conf.

Thanks
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Prashant Zanwar_4
Respected Contributor

Re: Mailx out from the server

# Relay all non-local mail to the "Smart" relay host (DS) via smtp:#to a smart relay via SMTP just set macro S (DS) to the name of the #
# Relay all non-local mail to the "Smart" relay host (DS) via UUCP: #
# make two chnages to this file. First, set macro S (DS) to the name #
DS

Hope this helps
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Jie Li
Frequent Advisor

Re: Mailx out from the server

Prashant:

I did exactly what you said. It worked.

Thank you. Will it creat any security hole?
Prashant Zanwar_4
Respected Contributor

Re: Mailx out from the server

I am sure what seuciry implementation you have in your company.
I have tightined security in my company, but due to some reasons we have just stopped sendmail daemon, while still I can send mails across. We did not de-configure sendmail.
Hope this helps
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Prashant Zanwar_4
Respected Contributor

Re: Mailx out from the server

http://www.sendmail.com/support/download/patch_page.shtml

http://www.coker.com.au/~russell/sendmail.html

https://www.sendmail.com/timeout.html

Hope the above urls help you in determining what you expect exactly
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Geoff Wild
Honored Contributor

Re: Mailx out from the server

There is no security hole from running mailx...as Javier states, you don't need sendmail running at all - unless you need to receive email on the HPUX server.

What we do is:

/sbin/init.d/sendmail stop

modify /etc/rc.config.d/mailsvrs file to not start sendmail

Then in root's cron:

# Make sure any queued mail is delivered, as sendmail isn't a daemon anymore
0,30 * * * * /usr/sbin/sendmail -q

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Jie Li
Frequent Advisor

Re: Mailx out from the server

Geoff:

How to modify mailservs file to preven sendmail daemon from start?

Thanks
Geoff Wild
Honored Contributor

Re: Mailx out from the server

Just set:

export SENDMAIL_SERVER=0

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.