LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 11-19-2008, 06:45 PM   #1
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Rep: Reputation: 31
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

Last edited by aquaboot; 11-19-2008 at 06:54 PM.
 
Old 11-19-2008, 06:58 PM   #2
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
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
 
Old 11-19-2008, 07:17 PM   #3
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
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
 
Old 11-19-2008, 07:22 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,650

Rep: Reputation: 525Reputation: 525Reputation: 525Reputation: 525Reputation: 525Reputation: 525
/etc/aliases:

root: you@example.com

then run newaliases
 
Old 11-19-2008, 07:30 PM   #5
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
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

Last edited by aquaboot; 11-19-2008 at 07:42 PM.
 
Old 11-19-2008, 07:36 PM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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?
 
Old 11-19-2008, 07:47 PM   #7
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
Nothing in the following /var/logs logs:

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

all blank files

Thanks,

ab
 
Old 11-19-2008, 07:52 PM   #8
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
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

Last edited by aquaboot; 11-19-2008 at 07:58 PM.
 
Old 11-19-2008, 07:56 PM   #9
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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

Last edited by billymayday; 11-19-2008 at 07:57 PM.
 
Old 11-19-2008, 07:59 PM   #10
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
Thanks for the help and the security tips. ;-)

-ab
 
Old 11-20-2008, 02:05 PM   #11
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 53
Did you choose local delivery only when configuring exim for the first time?
"dpkg-reconfigure exim4-config" and choose another profile.
 
Old 11-20-2008, 05:38 PM   #12
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
Thanks for the reconfig tip. I'll give that a try.

-ab
 
Old 01-09-2009, 08:04 PM   #13
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian Squeeze
Posts: 177

Rep: Reputation: 17
Quote:
Originally Posted by makuyl View Post
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.
 
Old 01-09-2009, 08:23 PM   #14
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 465

Original Poster
Rep: Reputation: 31
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure sendmail only to send mail to external mail account Nivix Linux - Newbie 2 10-23-2008 01:46 AM
Sending system mail to other account phatboyz Linux - General 0 09-08-2005 10:17 AM
Sending output to mail account through cron. gian2oo1 Slackware 2 01-18-2005 01:54 PM
Sending system log files to an e-mail account darkbluex Linux - Security 1 10-27-2004 08:37 AM
Problem sending mail to verizon.net account sethen Linux - Networking 4 01-15-2004 08:50 AM


All times are GMT -5. The time now is 12:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration