Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [HOWTO] Forward root's mail to your inbox

  1. #1
    Join Date
    Oct 2004
    Location
    Mobile, AL, USA
    Beans
    337
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Smile [HOWTO] Forward root's mail to your inbox

    Occasionally, certain system daemons and utilities will send local Unix mail to root's local email inbox, /var/mail/root . Well, it doesn't do you much good there!

    If you want to read these system messages, you can always do sudo mutt -f /var/mail/root if you are familiar with mutt. However, an easier and more efficient way to check this mail would be to have it forwarded to your user's local inbox, and then read it with your favorite email reader.

    Throughout this HOWTO, replace username with your account name.

    First, you need a mailbox, preferably with all of root's old mail already in it.

    Code:
    cd /var/mail
    sudo cp root username
    sudo chown username username
    sudo chgrp username mail
    That creates a mailbox for your username with the appropriate user and group permissions. The contents of the mailbox are a copy of root's mailbox.

    Now, it's time to forward all of root's incoming mail to your inbox.

    Code:
    sudo gedit /root/.forward
    Put this line in the file:
    Code:
    username@localhost
    Now, you will receive any mail sent to root. To make things more convenient, let's set up Evolution to read the mail.

    (Note: I use Thunderbird as my email client, and it required me to change the permissions of the /var/mail directory. I don't know if Evolution also requires this. If you get some sort of permission errors, you may need to sudo chmod 777 /var/mail , which is what Thunderbird wanted me to do.)

    Open up Evolution. In Tools -> Settings -> Mail Accounts, click Add. Enter your Full Name if you wish, and your local mail address username@localhost, then click Forward.

    For server type, select "Standard Unix mbox spool or directory." For Path, enter /var/mail/username , then click Forward.

    The options on the next screen are optional. Moving right along!

    On the next screen, select Sendmail for the Server Type, then click Forward. Name the account however you wish. I would recommend username@localhost, Local Mail, or something similar. Now you're finished!

    To test, compose a mail to root@localhost and send it. Then click Send/Receive. You should see the new mail pop up in your inbox.


    I am quite new to this, so if there are any errors in here, please feel free to tell me so I can edit this post for accuracy!
    $ whatis themeaningoflife
    themeaningoflife: not found

  2. #2
    Join Date
    Mar 2005
    Location
    The Netherlands
    Beans
    16

    Re: [HOWTO] Forward root's mail to your inbox

    Quote Originally Posted by HungSquirrel
    Occasionally, certain system daemons and utilities will send local Unix mail to root's local email inbox, /var/mail/root . Well, it doesn't do you much good there!

    If you want to read these system messages, you can always do sudo mutt -f /var/mail/root if you are familiar with mutt. However, an easier and more efficient way to check this mail would be to have it forwarded to your user's local inbox, and then read it with your favorite email reader.

    Throughout this HOWTO, replace username with your account name.

    First, you need a mailbox, preferably with all of root's old mail already in it.

    Code:
    cd /var/mail
    sudo cp root username
    sudo chown username username
    sudo chgrp username mail
    That creates a mailbox for your username with the appropriate user and group permissions. The contents of the mailbox are a copy of root's mailbox.

    Now, it's time to forward all of root's incoming mail to your inbox.

    Code:
    sudo gedit /root/.forward
    Put this line in the file:
    Code:
    username@localhost
    Now, you will receive any mail sent to root. To make things more convenient, let's set up Evolution to read the mail.

    (Note: I use Thunderbird as my email client, and it required me to change the permissions of the /var/mail directory. I don't know if Evolution also requires this. If you get some sort of permission errors, you may need to sudo chmod 777 /var/mail , which is what Thunderbird wanted me to do.)

    Open up Evolution. In Tools -> Settings -> Mail Accounts, click Add. Enter your Full Name if you wish, and your local mail address username@localhost, then click Forward.

    For server type, select "Standard Unix mbox spool or directory." For Path, enter /var/mail/username , then click Forward.

    The options on the next screen are optional. Moving right along!

    On the next screen, select Sendmail for the Server Type, then click Forward. Name the account however you wish. I would recommend username@localhost, Local Mail, or something similar. Now you're finished!

    To test, compose a mail to root@localhost and send it. Then click Send/Receive. You should see the new mail pop up in your inbox.


    I am quite new to this, so if there are any errors in here, please feel free to tell me so I can edit this post for accuracy!
    Can you explain how you have setup thunderbird to get this mail?

    I do not wanna use two different mail clients

  3. #3
    Join Date
    Jun 2005
    Beans
    2

    Re: [HOWTO] Forward root's mail to your inbox


  4. #4
    Join Date
    Jun 2006
    Location
    Groningen
    Beans
    835
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: [HOWTO] Forward root's mail to your inbox

    hi
    i found this howto very useful. however, i want to forward the root mail to an external mail account (gmail). postfix seems to block this.
    has anyone any clue how to let postfix send mail to an external account?
    cheers

  5. #5
    Join Date
    Jul 2005
    Location
    Seattle, WA
    Beans
    280
    Distro
    Kubuntu 5.10

    Re: [HOWTO] Forward root's mail to your inbox

    thewizzart - i am also interesting in forwarding it to an external account. since this thread is in warty i'll start a new thread in dapper. if i can find an answer, i'll post a howto in the howtos section. also, please let me know if you've found a solution.
    My Blog.

  6. #6
    Join Date
    Jan 2007
    Beans
    3

    Re: [HOWTO] Forward root's mail to your inbox

    Thanks a lot .. very clar and very simple.

  7. #7
    Join Date
    Jun 2006
    Location
    Groningen
    Beans
    835
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: [HOWTO] Forward root's mail to your inbox

    Quote Originally Posted by jetpeach View Post
    thewizzart - i am also interesting in forwarding it to an external account. since this thread is in warty i'll start a new thread in dapper. if i can find an answer, i'll post a howto in the howtos section. also, please let me know if you've found a solution.
    sorry i didn't reply to this earlier.
    i found something:
    - forward roots mail to gmail directly doesn't work
    - forward roots mail to personal account and then forward to gmail works.

  8. #8
    Join Date
    Dec 2007
    Beans
    7
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: [HOWTO] Forward root's mail to your inbox

    This post is a while ago, but I tried to get it to work in Ubuntu 8.04 and Evolution.

    I found out there is no root emailbox in /var/mail on my pc, but I found my username emailbox filled with e-mail from root@localhost.

    So no need to chmod anything nor forward e-mail, it's my own mailbox

    I configured evolution as told in the first post. It did not work. But I needed to change only one thing:

    "For server type, select "Standard Unix mbox spool or directory.""
    to:
    For server type, select "local delivery."

    That's all!

    By the way, thanks for this nice howto!
    Last edited by Robb987; June 7th, 2008 at 01:00 PM.

  9. #9
    Join Date
    Apr 2009
    Beans
    Hidden!

    Re: [HOWTO] Forward root's mail to your inbox

    Would this not be more simple if you used Exim4.

    Code:
    sudo aptitude install exim4
    There is no further set up required and the root mail is automatically delivered to the first user account. Also for Thunderbird it's real easy.

    Code:
    sudo adduser USERNAME mail
    This will very nicely set up the proper permissions for Thunderbird. Chown 777 is too ugly.

  10. #10
    Join Date
    Apr 2009
    Location
    Saitama, Japan
    Beans
    132
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Forward root's mail to your inbox

    I know it's an old thread, but I couldn't find my answer. How do I setup with thunderbird?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •