You’ve got mail? February 6, 2008
Posted by gnukathryn in Fundamentals, Nifty!, Terminal.trackback
I recently found out that the system sends various emails to the root account. And darn it, I want to read them. In theory, all I need to do is have those emails automatically forward to my own user account (and I guess it’s also possible to have them forwarded to a regular email account). Supposedly it’s as easy as creating a file called /root/.forward with the user name of the account you want to have the mails forwarded to.
I always get sort of suspicious when someone says “It should be as easy as…”. Because, it doesn’t seem to matter how easy it is, I still have problems with it. And yes, mail didn’t disappoint.
I have two user accounts on my machine, mine (Kathryn) and BOINC’s (boinc). I can send mail to boinc and root, boinc can send mail to root and root can send mail to boinc. But neither boinc nor root can send mail to Kathryn. Apparently, I don’t exist.
[Galaxy:~]$ mail -v Kathryn
Subject: test
testing
Cc:
Kathryn... Connecting to [127.0.0.1] via relay...
220 Galaxy.Fedora ESMTP Sendmail 8.14.1/8.14.1; Wed, 6 Feb 2008 09:09:50 +0900
>>> EHLO Galaxy.Fedora
250-Galaxy.Fedora Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<boinc@Galaxy.Fedora> SIZE=35 AUTH=boinc@Galaxy.Fedora
250 2.1.0 <boinc@Galaxy.Fedora>... Sender ok
>>> RCPT To:<Kathryn@Galaxy.Fedora>
>>> DATA
550 5.1.1 <Kathryn@Galaxy.Fedora>... User unknown
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
/var/lib/boinc/dead.letter... Saved message in /var/lib/boinc/dead.letter
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 Galaxy.Fedora closing connection
I’ve jumped through a bunch of hoops trying to get this to work. I’ve tried sending to Kathryn@localhost. Nope. No dice. I’ve checked the contents of /etc/hosts. Everything is fine there. I’ve added the host name to /etc/mail/local-host-names. Nope. No dice. On advice from my tutor I’ve done `make` in /etc/mail and `newaliases` (for luck of course). No dice. I’ve even restarted the sendmail service. I must be a figment of my own imagination.
All this to read messages that look like
From root@Galaxy.Fedora Tue Feb 5 04:17:03 2008
Date: Tue, 5 Feb 2008 04:15:39 +0900
From: root@Galaxy.Fedora (Cron Daemon)
To: root@Galaxy.Fedora
Subject: Cron <root@Galaxy> run-parts /etc/cron.daily
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
/etc/cron.daily/logrotate:
[ OK ] BOINC client daemon: [ OK ]
Starting BOINC client as a daemon: [ OK ]
[ OK ] BOINC client daemon: [ OK ]
Starting BOINC client as a daemon: [ OK ]
or
From root@Galaxy.Fedora Tue Feb 5 04:15:28 2008
Date: Tue, 5 Feb 2008 04:15:28 +0900
To: root@Galaxy.Fedora
From: logwatch@Galaxy.Fedora
Subject: Logwatch for galaxy.fedora (Linux)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=”iso-8859-1″
######### Logwatch 7.3.4 (02/17/07) ##########
Processing Initiated: Tue Feb 5 04:15:27 2008
Date Range Processed: yesterday
( 2008-Feb-04 )
Period is day.
Detail Level of Output: 0
Type of Output: unformatted
Logfiles for Host: galaxy.fedora
#########################################
———– pam_unix Begin ————–
su:
Authentication Failures:
Kathryn(500) -> root: 1 Time(s)
Sessions Opened:
(uid=0) -> boinc: 5 Time(s)
Kathryn(uid=500) -> root: 5 Time(s)
———— pam_unix End —————
———– XNTPD Begin ————–
Total synchronizations 2 (hosts: 2)
———— XNTPD End —————-
———– Disk Space Begin ————–
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 9.9G 3.8G 6.1G 39% /
/dev/sda8 4.0G 73M 3.7G 2% /tmp
/dev/sda7 4.0G 855M 3.0G 23% /home
/dev/sda2 60G 18G 43G 30% /Data
/dev/sda1 41G 24G 17G 59% /Vista
———— Disk Space End —————
############ Logwatch End ###############






Comments»
No comments yet — be the first.