Operating System - HP-UX
1833757 Members
3020 Online
110063 Solutions
New Discussion

Email messages to root, and other users sent to outside mailbox

 
Mike Barnes_1
Occasional Advisor

Email messages to root, and other users sent to outside mailbox

Hi all,

I want to know if it's possible to have messages sent to a system user (such as root, or applvis) sent/forwarded to an outside email box, which in this case would be my own company email account.

Another suggestion i got was to enable pop3 server on the box, and then access it using a client directly. That would be fine, but does HP-UX 11i come with a pop3 server as part of the OS or would i have to install some third party software?

Thanks,
Mike
4 REPLIES 4
Mark Fenton
Esteemed Contributor

Re: Email messages to root, and other users sent to outside mailbox

Actually, Mike, it's extremely easy.

Couple of ways, but the easiest that comes to mind is to use:

/etc/mail/aliases

edit this file to include the address(es) you want the mails forwarded to, e.g:
root : rootmail@mydomain.com,someoneelse@mydomain.com

Run newaliases afterwards and voila! mail to root gets forwarded to specified users. (assuming that the 11.x box is allowed to talk SMTP with your other mail server.)

hth

Mark
Steven Sim Kok Leong
Honored Contributor

Re: Email messages to root, and other users sent to outside mailbox

Hi,

Yes, it's possible to have messages sent to a system user (such as root, or applvis) sent/forwarded to an outside email box.

As long as the MX records in your DNS server have been defined properly, you should not face any issues sending messages to an outside mailbox such as your own company email account.

1) In your /etc/resolv.conf, insert the entry:

domain abc.com

where abc.com is the domain name of your company.

2) The default /etc/sendmail/sendmail works. Ensure that nothing is specified or uncommented here:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM

3) Verify that the MX records are inside the DNS entries:

# nslookup -query=mx abc.com
abc.com preference = 20, mail exchanger = mail4.abc.com
abc.com preference = 10, mail exchanger = mail1.abc.com
abc.com nameserver = dns1.abc.com
mail4.abc.com internet address = 1.2.3.4
mail1.abc.com internet address = 5.6.7.8
dns.abc.com internet address = 10.11.12.13

4) Modify your $HOME/.forward in your eg. root account to ensure that all root emails are forwarded to your company account. Insert this line in your .forward:

mike@abc.com

Hope this helps. Regards.

Steven Sim Kok Leong
Mike Barnes_1
Occasional Advisor

Re: Email messages to root, and other users sent to outside mailbox

thanks Mark.

one more question. is there a way to mask the root@server.domain.com part of messages coming from the server? we have an outside hosted mail server which a cannot change any settings on. it does not accept mail unless the sender is an account on the domain.

so when i send the messages, the server returns:

'root@server.domain.com is not a valid user of this server' and mail does not make it through.

this would be helpful for our application monitoring scripts as well, which use sendmail/mailx to notify us of application events.

Thanks,

Mike
Mike Barnes_1
Occasional Advisor

Re: Email messages to root, and other users sent to outside mailbox

Answered my own question.

I made these changes to /etc/mail/sendmail.cf:

#CE root (comment out CE line)

DM validaccount@domain.com

Now it works!! thanks all for the help.

Mike