Me and U(buntu)

My Ubuntu Experience!

Checking System Mail in Thunderbird

Posted by ushimitsudoki on January 17, 2009

nerdtuxIf you drop down into the terminal from time to time, you might see a message like:

You have new mail in /var/mail

or language to that effect. I got tired of seeing that so I wanted to set up Thunderbird, my email client of choice, to handle system mail. Here’s how I did it!

You get system mail for lots of reasons, but one of the most important ones is feedback from scheduled jobs in cron – at least that’s one reason that is important to me.

You got to be in the “in” group.

Check out the permissions on the mail directory:

jason@apollo:~$ ls -l /var | grep mail
drwxrwsr-x  2 root  mail   4096 2009-01-17 18:27 mail

Because Thunderbird will want to create a locking file, it is necessary to add yourself to the mail group:

sudo usermod -a -G mail username

Check the man page for usermod if you want details, but this basically adds username as a member of the “mail” group.

Set up Thunderbird

From here on out, it is pretty simple. You just need to create a “unix movemail” account in Thunderbird. Walk through the wizard, and you should end up with something like:

System mail account settings

System mail account settings

You probably are not going to be sending system mail – this is from the perspective of a home user, after all – so you should be good to go. You will also probably get failures to create the lock file until you logout and log back in.

Results

And tah-dah! I got all my system mails, and discovered I had a mistake in my cron! Hooray!

Success! System mail in Thunderbird!

Success! System mail in Thunderbird!

5 Responses to “Checking System Mail in Thunderbird”

  1. christopherolah said

    Neat.

    I wonder if there’s some way to play around with the “you’ve got mail” message (without playing around with login’s source…). Same with last login. Theoretically you could color them by leaving a trailing escape in /etc/motd… (It is a raw text file, see my blog entry)

  2. Christopher,
    That’s an interesting thought, but I don’t know what program is generating that message. A wild guess would be the shell itself (bash), but I just don’t know.

  3. Wynneth said

    You need to edit the part of the post telling people to sudo usermod -G mail username
    I just spent a good dose of time restoring group shadow and gshadow from a backup because I didn’t notice the lack of a -a there means it removed my username from ALL OTHER GROUPS. Some poor sap without backups or any system knowledge is going to do that and end up reinstalling.

  4. Wynneth,

    Wow! My bad – thanks for the catch!

  5. Johnraff said

    You can also use sudo adduser username mail
    It might be a little safer.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>