Checking System Mail in Thunderbird
Posted by ushimitsudoki on January 17, 2009
If 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:
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!



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)
ushimitsudoki said
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.
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.
ushimitsudoki said
Wynneth,
Wow! My bad – thanks for the catch!
Johnraff said
You can also use
sudo adduser username mailIt might be a little safer.