[SOLVED] Where's the mail? No <user> directory in /var/mail
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146
Rep:
Where's the mail? No <user> directory in /var/mail
I've got Linux Mint 9 as my desktop system, and yesterday I installed Ubuntu Server 10.04 as a file server and backup storage.
I've read (and been told in forums) that I should have received system mail in the /var/mail/<user> directory - but in both systems the /var/mail/ directory is empty.
I set up smartmontools on Ubuntu Server with a configuration option to send me a test mail each time it starts, but again I have received no mail.
Has the sending of system mail been removed from recent linux releases, or is there something wrong with the both of my systems? Do I need to configure something to make it work?
Has the sending of system mail been removed from recent linux releases, or is there something wrong with the both of my systems? Do I need to configure something to make it work?
First please understand email is not a /Linux/ feature so can't be added or removed. Most distributions will include an MTA (Mail Transport Agent) in their default installations -- this normally includes an MDA (Mail Delivery Agent) that is responsible to store incoming mail -- uhm -- somewhere
So, first thing if you THINK there should be mail for you: Find out what MTA/MDA is installed on your system. Popular choices are postfix, exim or sendmail. All of them are heavily configurable. /var/mail/$user is the /traditional/ location for mailboxes in mbox format, but it is not obligatory. Many mail systems nowadays use something like $HOME/.mail/ instead and there are several newer formats like e.g. mdir or maildir. As soon as you know which MTA/MDA is installed on your system, you can examine its configuration to find out.
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146
Original Poster
Rep:
Quote:
Originally Posted by zirias
First please understand email is not a /Linux/ feature so can't be added or removed.
Ok thanks I didn't realise that - I assumed they were all pretty much the same in that regard.
Quote:
Originally Posted by zirias
As soon as you know which MTA/MDA is installed on your system, you can examine its configuration to find out.
Hunting around I discovered that Ubuntu Server uses the postfix mail system, which I remember seeing during the installation process.
Searching further I discovered that postfix writes logs into /var/log/, and looking at the mail.err log file showed a couple of different errors. Still more searching on those errors led me to find that there are some longstanding configuration problems that can happen with postfix (https://bugs.launchpad.net/ubuntu/+s...fix/+bug/42947 and http://ubuntuforums.org/archive/index.php/t-6392.html). I didn't find any explanation for the bugs, but by following the suggested fixes I got my mail working.
I assumed that Linux Mint, being derived from Ubuntu, would use the same system, but postfix isn't installed on Mint so maybe it uses a different system, or maybe none at all. It's after midnight here so I'm not doing any more searching tonight to find out.
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146
Original Poster
Rep:
... and it turns out the /var/mail/<user> entry is a file, not a directory. It's a text file in which new mail is appended to the file. Presumably there are utilities to read and manage this file, but I'm just opening it in a text editor and deleting the contents when I've read it.
That's NOT a good idea. If you want to read mail from an mbox file directly, use for example mutt. As an alternative, there are several IMAP servers available that can serve mail from mbox files, for example dovecot.
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146
Original Poster
Rep:
Quote:
Originally Posted by zirias
That's NOT a good idea.
Why? Does it damage something? I've done it several times with a few computer shutdowns in between and so far everything still seems to be working. But thanks, I'll hunt around for info on mutt.
Quote:
Originally Posted by Xanios
But, how do you know your mail is working?
Quote:
Originally Posted by genogebot
I set up smartmontools on Ubuntu Server with a configuration option to send me a test mail each time it starts
... and I have now received mail messages from smartmontools.
xanios@ubuntu:~$ sudo smartctl -i /dev/sda
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Device: VMware, VMware Virtual S Version: 1.0
Device type: disk
Local Time is: Sun Aug 1 20:03:08 2010 PDT
Device does not support SMART
xanios@ubuntu:~$
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.