LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Sending root mail to an external mail account (https://www.linuxquestions.org/questions/debian-26/sending-root-mail-to-an-external-mail-account-684733/)

aquaboot 11-19-2008 05:45 PM

Sending root mail to an external mail account
 
Hi All,

I was just thinking that it would be very convenient to have system mail for root, sent to an external pop account. I've been looking online but haven't come up with much. Help much appreciated. I have exim4 installed by default (sid).

Thanks,

ab

aquaboot 11-19-2008 05:58 PM

Ok, I found this:

1) forward root's mail to your local mailbox
2) create /home/yourusername/.forward
3) add the external email address to this file and finish with an empty line.
this works on my box.

But there is no mailbox in /root, /home/my_user, or /var/mail

Confused,

ab

aquaboot 11-19-2008 06:17 PM

More:

I found that the mailbox files are created at first email. I used:

mail -s "test mail" root </dev/null

to send a test mail to the user listed in /etc/aliases (root: basic_user and then changed it to root: root and resent the test). Now I have a "mail" file and a "basic_user" file which both received the test mail. With it set to "basic_user" I created a .forward file in /home/basic_user with my pop address: basic_user@email.com

No mail was rceived by that external pop account. (yes the account works and receives other mail ;-)

-ab

AlucardZero 11-19-2008 06:22 PM

/etc/aliases:

root: you@example.com

then run newaliases

aquaboot 11-19-2008 06:30 PM

Thanks for the reply. I checked running processes to make sure that exim4 is running. It is:

102 2890 0.0 0.0 6296 928 ? Ss 16:22 0:00 /usr/sbin/exim4 -bd -q30m


Then followed your directions to edit the aliases file, making sure to run newaliases when finished.

# more /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: chris@example.com


I resent the test mail to root:

mail -s "test mail" root </dev/null

but still get nothing in my pop account.

-ab

billymayday 11-19-2008 06:36 PM

I'd take that email address out of the previous post if I were you (or make it example.com).

Is anything showing up in your maillogs when this happens?

aquaboot 11-19-2008 06:47 PM

Nothing in the following /var/logs logs:

mail.log
mail.error
mail.info
mail.warn

all blank files

Thanks,

ab

aquaboot 11-19-2008 06:52 PM

found this line in the exim4 log:

2008-11-19 16:08:08 1L2x5c-0006BM-IT ** chris@example.com <root@example.com> R=nonlocal: Mailing to remote domains not supported


I guess that's the problem.

Now I need to figure out if there is a way to enable support.

-ab

billymayday 11-19-2008 06:56 PM

Sounds exim specific, and I can't help there. Note your root email address is showing above.

Quick question though - can you send any external mail or is it just aliases?

Try mail -s "test mail" chris@example.com </dev/null

aquaboot 11-19-2008 06:59 PM

Thanks for the help and the security tips. ;-)

-ab

makuyl 11-20-2008 01:05 PM

Did you choose local delivery only when configuring exim for the first time?
"dpkg-reconfigure exim4-config" and choose another profile.

aquaboot 11-20-2008 04:38 PM

Thanks for the reconfig tip. I'll give that a try.

-ab

landysaccount 01-09-2009 07:04 PM

Quote:

Originally Posted by makuyl (Post 3348960)
Did you choose local delivery only when configuring exim for the first time?
"dpkg-reconfigure exim4-config" and choose another profile.

Did this work for you?

I'm trying to do the same thing and can't get any mail sent out externally, I guess all the other mail servers are blocking it.

aquaboot 01-09-2009 07:23 PM

Well, I tried to reconfigure but got bogged down in options that I wasn't exactly clear on. Not to say that you shouldn't give dpkg-reconfigure exim4-config a try, just hope you have better luck than I did. If you get it working, will you please post your results?

Many Thanks,

ab


All times are GMT -5. The time now is 03:10 AM.