# dead.letter file after cron (SOLVED)

## Akaihiryuu

I'm using vixie-cron on 3 systems.  My server is the only one that's not leaving dead.letter files in root's home directory after it runs something.  I'm not sure what to check for this...I made sure mailbase was installed on all the systems.  The mail command works.  ssmtp is installed on all the machines as well.  Is there something else I need to do to get rid of this?  Also, if it goes in a dead.letter file, does that mean that something tried to email it to root and failed?Last edited by Akaihiryuu on Sat Dec 31, 2005 10:11 pm; edited 1 time in total

----------

## adaptr

What it means is exactly that, and usually signifies that the MAILTO and/or HOME variables were not set properly for the process that failed to send the mail.

Check the crontabs for those variables.

----------

## Akaihiryuu

MAILTO is set to root, and HOME is set to / in /etc/crontab.  I checked all 3 systems and it's set the same way on all of them.  My server doesn't have any dead.letter files, and it just got done with some cron stuff earlier today.

----------

## adaptr

Do you have mailx emerged on the system ?

Many programs fail to send mail if you don't.

Also take a look at the mail(1) man page.

----------

## Akaihiryuu

Yes, I do have mailx on all the systems.  However, I think I just found the problem.  I checked my /etc/ssmtp/ssmtp.conf file.  On my server, it was set to a valid email address, but on the other systems it was set to postmaster.  I'm changing that now to see if that fixes it.  I think that was the problem.  Can ssmtp deliver mail locally without something like postfix running?

----------

## adaptr

Yes, it can write directly to an mbox.

----------

## Akaihiryuu

Okay...I've got ssmtp configured on all 3 systems...configured the exact same way actually.  However, 2 of the systems are still leaving dead.letter files in root's home directory after cron jobs run.  The only difference is, the server (the one that's not having the problem) has postfix installed...but I haven't configured it or started it.  I have no idea what I need to do to fix this.

----------

## Akaihiryuu

Here's my ssmtp.conf file.  I was hoping the settings in here would just have it drop the mail in the local spool, but that doesn't seem to work.  Alternatively, since I don't have a mail server set up yet, I was thinking of having it send somehwere else.  In that case, I'm wondering if root=akai@linearspace.net and mailhub=mail.linearspace.net would work.

#

# /etc/ssmtp.conf -- a config file for sSMTP sendmail.

#

# The person who gets all mail for userids < 1000

# Make this empty to disable rewriting.

root=root

# The place where the mail goes. The actual machine name is required

# no MX records are consulted. Commonly mailhosts are named mail.domain.com

# The example will fit if you are in domain.com and your mailhub is so named.

mailhub=localhost

# Example for SMTP port number 2525

# mailhub=mail.your.domain:2525

# Example for SMTP port number 25 (Standard/RFC)

# mailhub=mail.your.domain

# Example for SSL encrypted connection

# mailhub=mail.your.domain:465

# Where will the mail seem to come from?

rewriteDomain=

# The full hostname

# Gentoo bug #47562

# Commenting the following line will force ssmtp to figure

# out the hostname itself.

# hostname=_HOSTNAME_

# Set this to never rewrite the "From:" line (unless not given) and to

# use that address in the "from line" of the envelope.

#FromLineOverride=YES

# Use SSL/TLS to send secure messages to server.

#UseTLS=YES

# Use SSL/TLS certificate to authenticate against smtp host.

#UseTLSCert=YES

# Use this RSA certificate.

#TLSCert=/etc/ssl/certs/ssmtp.pem

----------

## DNAspark99

personally, i got fed up with dead.letter files, ssmtp always gave me trouble 'out of the box', so I'm now in the habit of removing it, and replacing it with postfix. Seems to behave better, for me anyways, no more dead.letter files.

----------

## Akaihiryuu

The weird thing is...my main server isn't giving me dead.letter files.  It does have postfix installed, but I have not yet configured it or even started it.  I don't have it in any runlevels...I plan on setting it up when I get a chance, but until I get my own domain there isn't much point.

----------

## Akaihiryuu

Okay...I've got no problem with getting rid of ssmtp and using postfix.  I don't really need a full MTA on my systems, but I don't have a problem with using postfix to handle mail on my LAN.  Right now, my server has both ssmtp and postfix.  Postfix is in the world file (I emerged it manually as I plan to eventually have it handle mail for my domain, once I get one), ssmtp is not.  This means that ssmtp must've been installed as a dependency.  However, I did equery depends ssmtp, and it comes up with nothing.  emerge -p depclean also does not list ssmtp.  I assume that postfix is my virtual MTA now, and ssmtp is not required, but since there is no virtuals file for me to look at in the current version of portage, I don't know how to tell...but I don't want to emerge -C ssmtp without knowing why it was installed.  Something must be depending on it, because otherwise emerge depclean would remove it since it's not in the world file.  Any help would be appreciated.

----------

## Akaihiryuu

Done some more checking, I shouldn't need to remove ssmtp, only set up postfix on my server and tell ssmtp to deliver to that.  My concern now is with my other systems.  I'd like to set up something on them to deliver to the local spool, and it seems that ssmtp can't do this, it can only send to a mailhub.  I don't really want to set up postfix on my other two systems, so I'm looking for a simpler MTA that will just deliver mail locally.  Would maildrop be a decent solution, or is there something simpler?  I'd prefer it if ssmtp could just deliver to the local spool, but I can't figure out how to make it do this.  I'm also wondering if procmail could substitute for postfix in delivering mail to just the local spool.

----------

## Akaihiryuu

Solved by setting up postfix on my server to deliver mail locally.  That way I can use ssmtp on the other machines in the house, they can forward to the server and I can get all cron-related emails in a central location.

----------

