# Vixie-cron email stopped working

## Akaihiryuu

In the past couple of weeks, somehow on two of my machines, vixie-cron stopped sending emails properly.  I have 3 machines...my server (which runs postfix...cron on this machine continues to email properly), a laptop, and another desktop (both using SSMTP to forward email to the server).  The laptop and the desktop are both failing to send mail (it does end up in dead.letter though).  I checked my /var/log/messages on both of those machines, and I'm getting the same error on both.  I don't have access to the error log right now, but it says something like "SSMTP: connection died during processing".  Cron is definitely trying to send the emails...it looks like SSMTP is where the problem is.  However, if I mail root@triforce (the address it should be sending to, just using mail from the command line), the mail goes through and is delivered to postfix on my server.  This error only comes up when cron tries to send email.  This just mysteriously started 2 weeks ago, everything had been working fine for a year prior to that, and I haven't touched any of the config files for a long time.  I'll post my /var/log/messages, crontab, and SSMTP configs when I get home, but in the meantime has anyone encountered an issue like this?

----------

## madcow3891

Just so you don't feel alone, I am having the same problem. I administrate 12 Gentoo boxes here at work and of the 12, 4 stopped sending me e-mails from my cron jobs.

/etc/crontab MAILTO is set

Trying 'echo "hello!"' as a cronjob that runs once every hour has yielded nothing thus far.

I see cron running the process in my logs, just have no e-mail output.

I've tried restarting both postfix and vixie-cron to no avail.

So far the only successful answer I can find is "install dcron" but as I manage 12 boxes that have to be similar, that would be a PITA.

Anyone- help? I'll post if I find anything...

----------

## madcow3891

...

Perhaps I don't have the same issue as you. The restart of vixie-cron actually fixes the problem. I had said in my previous post that I restarted the process, but this simply was not the case. I did it and now cron is e-mailing just fine. I confirmed this on all four boxes. Give that a shot?   :Confused: 

----------

## Akaihiryuu

That's a thought...but cron is actually attempting to send the email, it's SSMTP that's failing.  Plus, one of these machines is a laptop which does not run all the time, thus cron has been restarted many times.

----------

## Akaihiryuu

Here's the relevant portion of /var/log/messages:

```
Oct 22 02:24:05 samus sSMTP[6126]: Connection lost in middle of processing

Oct 22 02:24:33 samus cron[6117]: (root) MAIL (mailed 13995 bytes of output but got status 0x0001 )

Oct 22 03:12:41 samus login(pam_unix)[8334]: session opened for user root by (uid=0)

Oct 22 03:12:42 samus login[17815]: ROOT LOGIN  on `tty1'

Oct 22 03:13:10 samus login(pam_unix)[8335]: session opened for user akai by (uid=0)

Oct 22 03:13:18 samus sSMTP[17880]: Sent mail for akai@samus (221 Bye)
```

Cron did attempt to send the mail, SSMTP is complaining about connection lost.  I immediately logged in and send a mail using mail from the command line, and it worked fine.  It seems only cron emails are failing.  Here's my crontab:

```
# DO NOT EDIT THIS FILE - edit the master and reinstall.

# (root.cron installed on Wed Sep  6 06:48:41 2006)

# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)

# Global variables

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root@internal.lan

HOME=/
```

Everything there is correct as well.  This is happening anytime cron tries to send an email from any machine EXCEPT for the main one which is running postfix...that one works.  It's just SSMTP.

----------

## shmakes

I am still having problems with ssmtp on one of my computers.  (Same error as original post.)

A cron job that sends intrusion detection alerts works fine using ssmtp, however, my nightly backup cron job fails using ssmpt every night.

Any further insights?

Thanks

Steve

----------

## Darknight

In my case I checked mail logs in my mail server.

It looked like vixie-cron was sending mail to root@hostname which the mailserver interpreted in root@fully.qualified.hostname and the proceeded to try to send it back to the original machine, failing miserably.

I added an alias for root@fully.qualified.hostname on the mailserver pointing to my root email address and now it's working. The matter is, ssmtp can't handle anything in the form of "user@host", it only understands "user" so the change in config has to be made on the mail server.

----------

