Operating System - HP-UX
1825731 Members
2539 Online
109687 Solutions
New Discussion

mailx uses assigned mail server -- can I?

 
SOLVED
Go to solution
ran_li
Regular Advisor

mailx uses assigned mail server -- can I?

Can I assign a specific mail server for mailx to use? and how. Thanks.

7 REPLIES 7
Ivan Ferreira
Honored Contributor

Re: mailx uses assigned mail server -- can I?

I think that you can't, but you can use the sendmail command to send mails also like mailx, and you can specify a different configuration file indicating a different relay for the message using the -C option.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Ferreira
Honored Contributor

Re: mailx uses assigned mail server -- can I?

You can always use perl also, see:

http://www.cs.cf.ac.uk/Dave/PERL/node180.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
ran_li
Regular Advisor

Re: mailx uses assigned mail server -- can I?

Thanks for the reply.

I modified the sendmail.cf, provide the smart host at ^DS line, but still when I used sendmail command it did not use the mailhost that I assigned. Did I do this wrong?

Regards!
ran_li
Regular Advisor

Re: mailx uses assigned mail server -- can I?

one more question is ... how does mailx lookup the mail host? Thanks.
Peter Nikitka
Honored Contributor
Solution

Re: mailx uses assigned mail server -- can I?

Hi,

mailx does not lookup for mailhost and so on, sendmail does it.

Concerning the DS macro change:
Check the value of the macros DR and DH as well.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Steven E. Protter
Exalted Contributor

Re: mailx uses assigned mail server -- can I?

Shalom,

mailx uses your default MTA, which is sendmail.

All you need to is set up sendmail.cf with a DS directive to choose your relay 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
ran_li
Regular Advisor

Re: mailx uses assigned mail server -- can I?

Thanks, I ve already put a mail server(FQDN e.g. mailhost1.domain2.com) at DS directive but it always use another mailhost(mailhost2.domain2.com) instead of this one, that host(mailhost2) seems to be the default one.

Besides sendmail.cf anywhere else I should check for a clue? I don't think this unix host has the configuration for mailhost2.domain2.com, how come it became the default one.

/etc/rc.config.d/mailservs
export SENDMAIL_SERVER=1
export SENDMAIL_SERVER_NAME=