My Mageia 4 system had two issues. There was some missing software, and some files that were awkward to deal with.
I installed dma (Dragonfly Mail Agent), configured a dma alias to put root's emails in my default mbox mail file, and configured my kmail to look at /var/spool/mail/hank for an mbox mail file.
[hank is my user id on the system.] Now the emails come to me to deal with.
The files awkward to deal with, dead.letter, contained old undelivered emails. I used vim to look at the files, and just dealt with the issues described in the messages.
--- A more programmatic approach to dead.letter files.
A script could add header lines to the dead.letter file at the beginning of each email message, and the result could be concatenated to the end of an mbox mail file for a user.
It could go to my default mbox mail file, and I would read the messages using my kmail.
It could go to the root user's mbox mail file. Here are the commands to find the default root user's mbox mail file.
- Code: Select all
[hank@HIvyTower ~]$ sudo su - root
[root@HIvyTower ~]# env | grep -i mail
MAIL=/var/spool/mail/root
[root@HIvyTower ~]#
If you want a command line email client to read root's email, then "mutt" is a good application to use.
Each of the email messages started like this:
- Code: Select all
Date: Sun, 05 Jul 2015 14:44:19 -0500
To: root
Subject: [msec] *** Security Check on HIvyTower, Jul 05 14:44:18 ***
The script would add header lines to look like this:
- Code: Select all
From root@HIvyTower Mon Jul 6 04:02:05 2015
Received: from root (uid 0)
(envelope-from root@HIvyTower)
id 400d7
by HIvyTower (DragonFly Mail Agent 0.9);
Mon, 06 Jul 2015 04:02:05 -0500
Date: Mon, 06 Jul 2015 04:02:05 -0500
To: root
Subject: [msec] *** Diff Check on HIvyTower, Jul 06 04:02:03 ***
You can find the pathname of the default mbox mail file of the root user with commands like this:
- Code: Select all
[hank@HIvyTower ~]$ sudo su - root
[root@HIvyTower ~]# env | grep -i mail
MAIL=/var/spool/mail/root
[root@HIvyTower ~]#