Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #160573

Re: How to configure cron (and pam?) to allow mail from cron?

From Gene Heskett <gheskett@shentel.net>
Newsgroups linux.debian.user
Subject Re: How to configure cron (and pam?) to allow mail from cron?
Date 2015-11-15 02:40 +0100
Message-ID <quUsp-3gM-1@gated-at.bofh.it> (permalink)
References <quRXA-1zA-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Saturday 14 November 2015 17:58:59 Kynn Jones wrote:

> I'm trying to set up a `cron` job that will send me mail for some
> outputs.
>
> In my `crontab` I have the `MAILTO` variable set to my email address,
> as well as the directives
>
> * * * * * /bin/date >> /tmp/debug_cron
> * * * * * /bin/date >&2
On the machine, MAILTO: is not normally to your email address, but 
usually is username@localhost.

> as a test (i.e. a proxy for the command I eventually want to run), but
> I'm getting no mail from `cron`.  (I do get outptu in the
> `/tmp/debug_cron` file.)
>
> My `/var/log/auth.log` file shows many pairs of lines of the form:
>
> Nov 14 17:25:01 myhost CRON[29571]: pam_unix(cron:session): session
> opened for user myusername by (uid=0)
> Nov 14 17:25:01 myhost CRON[29571]: pam_unix(cron:session): session
> closed for user myusername
>
> A new pair of such lines gets added every minute, which coincides with
> the timing of my crontab commands.  Therefore, it may be that
> `pam_unix` is blocking `cron`'s attempt to send me mail?  I don't know
> how to pursue this possibility further.  (I have never done any
> PAM-related configuration in my life, so whatever configuration I have
> is either what "came out of the box" when I installed Debian, or was
> carried out by some program without my intervention.)
>
> (BTW, aside from what I've described above, nothing else in the logs
> appears relevant to this question, even remotely so.)
>
> How can I troubleshoot this problem further?
>
> Thanks in advance for any advice!
>
> kj
>
> PS: FWIW, my `/etc/pam.conf` file contains only comments and
> whitespace, and here are the contents (excluding comments and
> whitespace) of other `pam` relevant config files:
>
>     # /etc/pam.d/cron
>     @include common-auth
>     session    required     pam_loginuid.so
>     session       required   pam_env.so
>     session       required   pam_env.so envfile=/etc/default/locale
>     @include common-account
>     @include common-session-noninteractive
>     session    required   pam_limits.so
>
>     # /etc/pam.d/common-auth
>     auth    [success=1 default=ignore]    pam_unix.so nullok_secure
>     auth    requisite            pam_deny.so
>     auth    required            pam_permit.so
>     auth    optional            pam_cap.so
>
>     # /etc/pam.d/common-account
>     account    [success=1 new_authtok_reqd=done default=ignore]   
> pam_unix.so account    requisite            pam_deny.so
>     account    required            pam_permit.so
>
>     # /etc/pam.d/common-session-noninteractive
>     session    [default=1]            pam_permit.so
>     session    requisite            pam_deny.so
>     session    required            pam_permit.so
>     session    required    pam_unix.so


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to configure cron (and pam?) to allow mail from cron? Kynn Jones <kynnjo@gmail.com> - 2015-11-15 00:00 +0100
  Re: How to configure cron (and pam?) to allow mail from cron? Gene Heskett <gheskett@shentel.net> - 2015-11-15 02:40 +0100
    Re: How to configure cron (and pam?) to allow mail from cron? Kynn Jones <kynnjo@gmail.com> - 2015-11-15 03:30 +0100
      Re: How to configure cron (and pam?) to allow mail from cron? Gene Heskett <gheskett@shentel.net> - 2015-11-15 04:10 +0100
      Re: How to configure cron (and pam?) to allow mail from cron? David Wright <deblis@lionunicorn.co.uk> - 2015-11-17 16:10 +0100
        Re: How to configure cron (and pam?) to allow mail from cron? Chris Bannister <cbannister@slingshot.co.nz> - 2015-11-17 19:10 +0100
          Re: How to configure cron (and pam?) to allow mail from cron? <tomas@tuxteam.de> - 2015-11-17 19:20 +0100
            Re: How to configure cron (and pam?) to allow mail from cron? Chris Bannister <cbannister@slingshot.co.nz> - 2015-11-18 10:40 +0100

csiph-web