LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 01-19-2010, 06:19 PM   #1
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,053

Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
Mail not being delivered by the standard mail program


Whenever Debian is installed, a mail client is also installed. I don't have the faintest idea what is happening below the surface, but if something happens with the system, like a failed cronjob, a mail is sent to my account on that computer.

I can't recall it exactly, but I think during Debian installation I had to specify where system mail has to go to. In my case I am installing as jlinkels, so all mail directed to root goes to jlinkels. I am not sure if that redirection is still asked, on older versions I know it was, but I can't remember I had to tell that while installing newer versions.

Anyway, on all boxes, automagically a folder /home/jlinkels/Maildir is created and within that the subfolders new cur and tmp. Whenever I log in in such a box mail is checked, and when I run mail I get a listing and can read the mail.

However, now I am running a server for which it is extremely important that I get the mail if there is something exceptional, and this mail does not function.

That is, I don't have the ~/Maildir/new ~/Maildir/cur etc, but for some reason I do have ~/new, ~/cur etc. Now when something happens, root receives a mail. This mail is placed in ~/new. But when I run mail I see that there is no new mail for me. Still there is new and unread mail in ~/new.

Installed Debian Lenny on this box and did nothing unusual. I have installed tens of Lenny boxes and run thru the installation procedure almost with my eyes closed so I am pretty sure I did not do anything out of the ordinary on this box. Still the mail is screwed up.

Now even more than how this happened, I am wondering how to fix it, but I have no idea at all how to start it.

A few observations:
- the system (programs like cron) know they should send mail to root. This happens. I see in the header the mail is sent to root.
- the mail system (whatever that is) knows that mail to root should be sent to jlinkels
- the mail system even knows where to find the mailboxes of jlinkels
- the mail client does not know where to find new mail for jlinkels

I have seen that exim4 is running on the box. Is exim4 responsible for forwarding and dropping the mail in ~/new?

Any pointers to how this mail is produced, how it is dropped in my mailbox, and how the mail client can find this is highly welcomed.

jlinkels

Edit: I see the title should have been "mail not being read by the client" Apparently it is begin delivered.

Last edited by jlinkels; 01-19-2010 at 06:21 PM.
 
Old 01-20-2010, 11:02 AM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 115Reputation: 115
The simple answer:

You are running an MTA a.k.a. Message Transfer Agent a.k.a. Mail Server daemon. I don't know about Debian's defaults, Slackware uses sendmail as the default, it seems you are running Exim (given the exim4 binary being loaded). In their default configuration these MTAs use system accounts (i.e. your passwd file) to determine who users are and where their home directory is so that it may deliver their mail to them via an MDA (mail delivery agent). In order to handle mail sent to special accounts such as root, aliases are set up in /etc/aliases or /etc/mail/aliases that tell it when and where to redirect mail.

When it decides a local account exists that mail should be delivered to it passes the message off to the MDA for delivery which actually creates the necessary file(s) in the local users' home directories. By default this is usually ~/Maildir for Maildir storage or ~/mail for mbox storage.

Your local MUA a.k.a. Mail User Agent a.k.a. E-Mail Client knows about these defaults and tries to find your e-mail where it would normally be expected in your home directory.

In your case it seems that for some reason your MTA/MDA have been configured to deliver to ~ rather than ~/Maildir which is why new, cur and tmp have been put one level too high. Correct this with the Exim config files in /etc/mail. Alternatively, start your mail client by telling it your Maildir is your home directory not ~/Maildir, e.g. "mutt ~" (IIRC).

For more information there are several hundred thousand howtos out there that explain every last detail of how e-mail works.
 
Old 01-20-2010, 11:32 AM   #3
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,053

Original Poster
Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
Thanks for you detailed explanation.

About your last, somewhat educational statement: I know that Google exists. Problem is that there are so many articles, and many of them explain exactly the same. That how a mail agent works, should work, how it has to be configured, but NOT how to solve problems.

I am equally irritated as you by people too lazy to read, therefor as a matter of fact my request was to point me to an article with -- more or less the contents and clarity of your post.

I am grateful that you took the time to write it all down, and I will report back as I proceed.

jlinkels
 
Old 01-22-2010, 06:10 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,053

Original Poster
Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
At least I found the cause. I copied (by accident) a .procmail file from another installation. This procmail file contains an invalid mail directory, but the mail is still delivered in Maildir format, which cannot be handled by mailx.

jlinkels

Last edited by jlinkels; 01-22-2010 at 08:19 PM.
 
Old 01-30-2010, 07:06 AM   #5
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,053

Original Poster
Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
Zordrak,

Your answer and explanation gave just enough information to perform a better Google search for articles. However, I still have to state that it is not easy to find an informative article which a overall explanation.

But it helped to search for terms a MUA/MTA/MDA.

In the mean time, I have been able to set up this trio on one of my servers, and what is equally important, on one of my clients I can make that this server is used for delivering local mail to me. In other words, I am now able to have all machines on the network send the mail to the server so everything ends up in a single mail box which I can check in my regular mail client.

On the server I have Postfix installed as MTA, Procmail as MDA, and Dovecot as IMAP server. (Doesn't the IMAP server have a TLA?)

On the client I reconfigured Exim4 to deliver the mail to the server MTA. I choose the easy way, dpkg-reconfigure exim4 to change the settings. This enabled me to specify that mail for root must be forwarded to me and that transfer was to be performed by my server.

Being motivated by this succes I also installed Postfix to the server which I was to use as my real server. On this server I had installed Fetchmail/Procmail/Dovecot for a number of users, excluding myself. Fetchmail produces an (innocent) warning each time it ran. Before, all those messages where handled by the local MUA never to be seen by these users. However after installing Postfix the messages were suddenly delivered correctly to the user's mailboxes in Dovecot. They were not amused, and I was embarrased That has been solved now as well.

jlinkels

Last edited by jlinkels; 01-30-2010 at 07:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mail not delivered maniannam Linux - Server 1 01-08-2009 09:58 AM
[SOLVED] sendmail, mail is not getting delivered, getting an return mail procfs Linux - Newbie 2 05-22-2007 11:49 PM
Mail not being delivered liquidcool Linux - Software 4 10-17-2004 03:44 PM
qmail log says mail delivered, mail nowhere to be found svartrev Linux - Software 0 03-24-2004 05:12 PM
mail is not delivered thru the mail command aadilkhan Linux - General 1 11-18-2003 05:37 PM


All times are GMT -5. The time now is 11:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration