LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-01-2010, 07:33 AM   #1
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
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?
 
Old 08-01-2010, 08:09 AM   #2
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
Quote:
Originally Posted by genogebot View Post
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.
 
Old 08-01-2010, 09:13 AM   #3
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
Quote:
Originally Posted by zirias View Post
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 View Post
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.
 
Old 08-01-2010, 09:34 AM   #4
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Rep: Reputation: 30
Hello genogebot, may i know how you got your mail working? I mean, the steps. I tried to install and configure postfix, but it ain't working.

Thanks.
 
Old 08-01-2010, 10:38 AM   #5
themanwhowas
Member
 
Registered: Nov 2005
Distribution: CentOS 5, Fedora 23
Posts: 218

Rep: Reputation: 29
Xanios: http://www.howtoforge.com/sitemap/email/postfix
 
Old 08-01-2010, 04:18 PM   #6
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
Quote:
Originally Posted by Xanios View Post
Hello genogebot, may i know how you got your mail working? I mean, the steps. I tried to install and configure postfix, but it ain't working.

Thanks.
Ok the fixes I applied to get the mail working in Ubuntu Server were at the end of each of the pages I linked to above. Specifically:

Quote:
sudo apt-get remove postfix
sudo dpkg --purge postfix
sudo apt-get -V install postfix

no reboot needed
then

Quote:
cd /etc
postfix stop
newaliases
postfix start
Hope this helps. I still haven't worked out whether this is relevant for Linux Mint 9.

Last edited by genogebot; 08-01-2010 at 04:20 PM.
 
Old 08-01-2010, 04:25 PM   #7
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
... 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.
 
Old 08-01-2010, 06:54 PM   #8
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
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.
 
Old 08-01-2010, 07:57 PM   #9
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Rep: Reputation: 30
But, how do you know your mail is working? For me, at the last step i reloaded postfix, as given in the link above:

Code:
xanios@ubuntu:~$ sudo /etc/init.d/postfix reload
 * Reloading Postfix configuration...                                [ OK ]
And for /etc/postfix/main.cf, not sure if it's written correctly:

Code:
myhostname = ubuntu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, $mydomain, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
myorigin = /etc/mailname
inet_protocols = ipv4
myorigin=$mydomain
 
Old 08-01-2010, 09:37 PM   #10
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
Quote:
Originally Posted by zirias View Post
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 View Post
But, how do you know your mail is working?
Quote:
Originally Posted by genogebot View Post
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.
 
Old 08-01-2010, 10:02 PM   #11
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Rep: Reputation: 30
Oh i see. Too bad my linux (ubuntu 9.10) doesn't support smartmontools.
 
Old 08-01-2010, 10:27 PM   #12
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
Quote:
Originally Posted by Xanios View Post
Oh i see. Too bad my linux (ubuntu 9.10) doesn't support smartmontools.
Are you sure?

From the Wikipedia entry for smartmontools (http://en.wikipedia.org/wiki/Smartmontools) :

Quote:
Initial release October 2002
Quote:
All Linux distributions provide the smartmontools package

Last edited by genogebot; 08-01-2010 at 10:43 PM. Reason: typo
 
Old 08-02-2010, 12:46 AM   #13
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Rep: Reputation: 30
Hi,

Ya.

i typed this to see if the "drive supports SMART"

Code:
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:~$
 
Old 08-02-2010, 12:54 AM   #14
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
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: Reputation: 20
Quote:
Originally Posted by Xanios View Post
Device: VMware, VMware Virtual S Version: 1.0
Ah, ok you're running Ubuntu in a virtual machine - that's why smartmontools won't work for you.
 
Old 08-02-2010, 01:37 AM   #15
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Rep: Reputation: 30
Oh i see. No wonder.
 
  


Reply



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
What is /var/mail Directory? carlosinfl Linux - Server 2 06-20-2009 08:19 AM
read mail from /var/mail/user with thunderbird cccc Debian 4 09-11-2006 07:53 AM
spam_buttons move from /var/spool/mail/user to $HOME/mail/Junk paul_mat Linux - Software 0 05-25-2006 02:07 AM
Deleted /var/mail/user directory Maeltor *BSD 2 05-20-2006 02:03 PM
Mail going to /var/spool/mail/user and not to Thunderbird pracslipkerm Linux - Newbie 4 06-21-2005 05:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration