Operating System - HP-UX
1834461 Members
3334 Online
110067 Solutions
New Discussion

Re: Send email from HP-UX

 
Teodoro Ríos
Occasional Contributor

Send email from HP-UX

Hello everyone,

I'm trying to send a file from a HP-UX 11.1 server to an email account. I run:
mailx -s "test" user@company.com < file
but nothing happens. I have been researching on man for mailx and on several web pages but I didn´t find the solution. Could anybody help me?

Thanks and regards
Teo
10 REPLIES 10
Rick Garland
Honored Contributor

Re: Send email from HP-UX

Has mail been configured on this system before?

Has this system ever sent email to an outside address?

harry d brown jr
Honored Contributor

Re: Send email from HP-UX


uuencode file file.txt |mailx -m -s "Heading for email" user@company.com


live free or die
harry d brown jr
Live Free or Die
Robert-Jan Goossens
Honored Contributor

Re: Send email from HP-UX

Hi Teo,

Could you post the result of next command.

# grep DS /etc/mail/sendmail.cf
DSwebmail.$m

In my case the webmail is an internal windows mailserver.

Regards,
Robert-Jan
Teodoro Ríos
Occasional Contributor

Re: Send email from HP-UX

No, this is the problem, the system isnâ t configured for sending email to an outside address. The result of grep DS /etc/mail/sendmail.cf is:
# 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
# noreceipts Don't return success DSN's

Thak y
Rick Garland
Honored Contributor

Re: Send email from HP-UX

You have no SMART HOST relay setup. No place to send the mail to.

What is the name or IP address of the system that handles the email for your location?

Example;
Is it an Exchange server? What is the Exchange server's name/IP? Use this name in the DS setting in the sendmail.cf file. Ensure the Exchange server will accept relay mail coming from your internal systems.

Is the sendmail process on HPUX configured to run? Check /etc/rc.config.d/mailsvrs:export SENDMAIL_SERVERS=1 Must be 1 to run the mail daemon.

Start the process with /sbin/init.d/sendmail start

Geoff Wild
Honored Contributor

Re: Send email from HP-UX

Just to clarify - you don't need the sendmail daemon running in order to send email...

In order to sendmail - you do need DNS functioning...a smart relay can help - for central email forwarding...

Try this:

nslookup -q=MX company.com

Does that work?

if yes - telnet to port 25:

telnet server.company.com 25

does that work?

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.
Kent Ostby
Honored Contributor

Re: Send email from HP-UX

Teo -- You can probably get a jumpstart going on this box if you were to pull a sendmail.cf file from a machine where email is working and use that as a template for your sendmail.cf on this box.

That is what I did recently to get mail running on my test system here.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Bill Hassell
Honored Contributor

Re: Send email from HP-UX

First, are you directtly connected to the Internet, or is there a firewall in place? Do you have a company email server such as Exchange? In order to send email, sendmail must be able to talk directly to the destination using port 25 or use a relay (your company's email server). Each requires several steps to configure. If you type the command:

mailq

You'll probably see the messages waiting to be sent. To see the reason for the failure, use the command:

tail /var/adm/syslog/mail.log

Once configured, you can trace the mail processing with:

/usr/sbin/sendmail -v -s "test msg" name@someplace.com < /etc/issue

As mentioned, you need a working DNS server that can resolve the remote destination using MX records (see man nslookup) or let your email relay host handle all of it.


Bill Hassell, sysadmin
Bejoy C Alias
Respected Contributor

Re: Send email from HP-UX

To whom u want to send the mails , is it a local user or some one outside of ur domain ?
Be Always Joy ......
Teodoro Ríos
Occasional Contributor

Re: Send email from HP-UX

I've configured both /etc/hosts and /etc/mail/sendmail.cf files with the IP and the name of my email server but now I think I have problems with the conection with my company's email server so I'm going to speak with my the email server system administrator.

Thank you everyone for your help.