FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-05-2008, 03:24 PM
Grant Edwards
 
Default vixie-cron not sending mail

I've set the MAILTO env variable in my crontab, but vixie-cron
still isn't sending e-mails. I've verfied that I'm able to
send email with /usr/sbin/sendmail (both with and without -t).

I re-emerged vixie-cron with the debug USE flag, but it didn't
seem to produce any debug info that I can find anywhere.

How do I convince vixie-cron to produce some debug output
so that I can figure out why it's not sending e-mails?

--
Grant Edwards grante Yow! Are you mentally here
at at Pizza Hut??
visi.com
 
Old 09-05-2008, 04:09 PM
Grant Edwards
 
Default vixie-cron not sending mail

On 2008-09-05, Grant Edwards <grante@visi.com> wrote:
> I've set the MAILTO env variable in my crontab, but vixie-cron
> still isn't sending e-mails. I've verfied that I'm able to
> send email with /usr/sbin/sendmail (both with and without -t).
>
> I re-emerged vixie-cron with the debug USE flag, but it didn't
> seem to produce any debug info that I can find anywhere.
>
> How do I convince vixie-cron to produce some debug output
> so that I can figure out why it's not sending e-mails?

I've narrowed it down a little. I'm using msmtp as an MTA. I
normally don't have a global /etc/msmtprc configuration file --
I have per-user ~/.msmtprc files. I first assumed that cron
was sending mail as the owner of the cron file (that owner has
a working msmtp config file). That appears not to be true.

Next, I tried setting up msmtp config files for users root and
cron. Both those configurations work fine. But, cron still
can't send mail.

If I set up a globally readable msmtp config file in /etc, then
cron can send mail. That's not really acceptible, since here
is sensitive information in that config file, and I don't want
just any random user account to be able to send mail.

I'm rather baffled as to what user and home directory cron is
running with when it tries to send mail. It's neither the
crontab owner, nor root, nor cron. I've been able to find very
little documentation on vixie-cron other than a superficial man
page.

--
Grant Edwards grante Yow! Did YOU find a
at DIGITAL WATCH in YOUR box
visi.com of VELVEETA?
 
Old 09-05-2008, 04:55 PM
Grant Edwards
 
Default vixie-cron not sending mail

On 2008-09-05, Grant Edwards <grante@visi.com> wrote:
> On 2008-09-05, Grant Edwards <grante@visi.com> wrote:
>> I've set the MAILTO env variable in my crontab, but vixie-cron
>> still isn't sending e-mails. I've verfied that I'm able to
>> send email with /usr/sbin/sendmail (both with and without -t).
>>
>> I re-emerged vixie-cron with the debug USE flag, but it didn't
>> seem to produce any debug info that I can find anywhere.
>>
>> How do I convince vixie-cron to produce some debug output
>> so that I can figure out why it's not sending e-mails?
>
> I've narrowed it down a little. I'm using msmtp as an MTA. I
> normally don't have a global /etc/msmtprc configuration file
> -- I have per-user ~/.msmtprc files. I first assumed that
> cron was sending mail as the owner of the cron file (that
> owner has a working msmtp config file). That appears not to
> be true.
>
> Next, I tried setting up msmtp config files for users root and
> cron. Both those configurations work fine. But, cron still
> can't send mail.

It turns out that cron is attempting to send e-mail with
uid/gid of crontab file owner, but it has USER=root and
HOME=/root. That breaks /usr/sbin/sendmail (msmtp) since it
can't read /root/.msmtprc when it's run as the crontab file
owner.

I tried setting HOME appropriately in the crontab file, but
that didn't do anything -- HOME as seen by /usr/sbin/sendmail
is still always /root. [IMO, this is a bug in vixie-cron.]

A paritial work-around is to create a new user and group (I
called it "msmtp". The msmtp binary is set to run suid as the
msmtp user, and the global config file /etc/msmtprc is readable
only by user msmtp. /usr/bin/msmtp is then set to be
executable only by users in the msmtp group, and users who are
allowed to send mail are added to the msmtp group.

This isn't really a general solution since when user FOO runs
msmtp, it won't be able to read ~FOO/.msmtprc as it should
unless ~FOO/.msmtprc is made readible to the msmtp user or
group.

--
Grant Edwards grante Yow! Somewhere in Tenafly,
at New Jersey, a chiropractor
visi.com is viewing "Leave it to
Beaver"!
 

Thread Tools




All times are GMT. The time now is 12:06 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org