Re: Cron Not Sending Mail

2009-03-10 Thread APseudoUtopia
On Wed, Mar 4, 2009 at 11:38 AM, Morgan Wesström
freebsd-questi...@pp.dyndns.biz wrote:
 Yeah, I am aware what dnl does. The reason I commented that stuff
 out is because I have no use for any of it - all those files (access,
 local-host-names, mailertable, virtusertable, etc) are all empty by
 default and I had no reason to add anything to them.  I'll try going
 back to the default config and putting the RELAY line in the access
 file.

 Thanks once again for the help. I really do appreciate the time.

 Sendmail is not an open relay by default so you need at least one RELAY
 entry in /etc/mail/access for it to forward mail externally. I'm still
 curious of where it picks up that w...@localhost but chances are it will
 disappear as soon as you have a valid access config.
 /Morgan
 ___

I still can't figure this whole issue out. I've tried everything
suggested in this thread, including reverting back to the default
sendmail config files.

I created a work-around by just piping all my crontabs into
/usr/bin/mail and sending output using that method. It doesn't solve
it, but it works for now.

Thanks for all the help.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-04 Thread Morgan Wesström
APseudoUtopia wrote:
 In my case I only see either local there or my smart host as defined
 in /var/mail/{hostname}.mc
 Can you provide a diff -u between /etc/mail/freebsd.mc and
 /etc/mail/{hostname}.mc ?

 /Morgan
 
 I'd switch over to postfix, but I'm only using this to send output
 from cron and the daily security run scripts. I don't receive any mail
 over the network, so I think it'd be pointless to go through the
 effort of switching and configuring another MTA.
 
 Here's the diff. I figured it was too long to include in the email
 (word wrap will make it hard to read :-P)
 http://pastebin.ca/1352338
 


I'm no expert on Sendmail but you are aware that dnl is Sendmail's way
of commenting out a line, aren't you? In your config you have disabled
pretty much every configuration file in /etc/mail, especially
/etc/mail/access which defines who can relay mail through the local MTA.
I'm pretty sure this isn't a good idea. Apart from this I couldn't see
any major differences between your config and FreeBSD's default. Why not
try to use the default config and make sure to populate /etc/mail/access
with at least 127.0.0.1 RELAY and try again?
/Morgan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-04 Thread APseudoUtopia
On Wed, Mar 4, 2009 at 5:36 AM, Morgan Wesström
freebsd-questi...@pp.dyndns.biz wrote:
 APseudoUtopia wrote:
 In my case I only see either local there or my smart host as defined
 in /var/mail/{hostname}.mc
 Can you provide a diff -u between /etc/mail/freebsd.mc and
 /etc/mail/{hostname}.mc ?

 /Morgan

 I'd switch over to postfix, but I'm only using this to send output
 from cron and the daily security run scripts. I don't receive any mail
 over the network, so I think it'd be pointless to go through the
 effort of switching and configuring another MTA.

 Here's the diff. I figured it was too long to include in the email
 (word wrap will make it hard to read :-P)
 http://pastebin.ca/1352338



 I'm no expert on Sendmail but you are aware that dnl is Sendmail's way
 of commenting out a line, aren't you? In your config you have disabled
 pretty much every configuration file in /etc/mail, especially
 /etc/mail/access which defines who can relay mail through the local MTA.
 I'm pretty sure this isn't a good idea. Apart from this I couldn't see
 any major differences between your config and FreeBSD's default. Why not
 try to use the default config and make sure to populate /etc/mail/access
 with at least 127.0.0.1 RELAY and try again?
 /Morgan

Yeah, I am aware what dnl does. The reason I commented that stuff
out is because I have no use for any of it - all those files (access,
local-host-names, mailertable, virtusertable, etc) are all empty by
default and I had no reason to add anything to them.  I'll try going
back to the default config and putting the RELAY line in the access
file.

Thanks once again for the help. I really do appreciate the time.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-04 Thread Morgan Wesström
 Yeah, I am aware what dnl does. The reason I commented that stuff
 out is because I have no use for any of it - all those files (access,
 local-host-names, mailertable, virtusertable, etc) are all empty by
 default and I had no reason to add anything to them.  I'll try going
 back to the default config and putting the RELAY line in the access
 file.
 
 Thanks once again for the help. I really do appreciate the time.

Sendmail is not an open relay by default so you need at least one RELAY
entry in /etc/mail/access for it to forward mail externally. I'm still
curious of where it picks up that w...@localhost but chances are it will
disappear as soon as you have a valid access config.
/Morgan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread APseudoUtopia
On Mon, Mar 2, 2009 at 10:14 PM, Glen Barber glen.j.bar...@gmail.com wrote:
 On Sun, Mar 1, 2009 at 2:24 PM, APseudoUtopia apseudouto...@gmail.com wrote:
 [snip]

 #
 # User www's crontab
 # Note, I also tried removing the MAILTO to no avail
 #
 MAILTO=root
 # m     h       dom     mon     dow     cmd
 *       *       *       *       *       echo Hello


 [snip]

 1.)  You are not using the full path to /bin/echo, which is why it is failing.

 2.) This is a poor designed way to test cron's mail output.

 A Better(tm) way would be something like:
 MAILTO=root
 */5 * * * * /bin/ping -c1 localhost /dev/null

 which would mail to root on success or failure.

 Regards,

 --
 Glen Barber


Thanks for the tips. I've put the following line in my normal user
account's crontab (This account does have a shell, it's one I use on a
daily basis):

SHELL=/bin/sh
mailto=my_email_acco...@gmail.com
*   *   *   *   *   /sbin/ping -c4 localhost

I'm getting no emails at all. In /var/log/maillog, I'm getting the
following output:

Mar  3 21:10:00 domain sendmail[86797]: n23LA0td086797: from=www,
size=0, class=0, nrcpts=0,
msgid=200903032110.n23la0td086...@subdomain.domain.tld,
relay=...@localhost
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread Glen Barber
On Tue, Mar 3, 2009 at 4:10 PM, APseudoUtopia apseudouto...@gmail.com wrote:
 Thanks for the tips. I've put the following line in my normal user
 account's crontab (This account does have a shell, it's one I use on a
 daily basis):

 SHELL=/bin/sh
 mailto=my_email_acco...@gmail.com
 *       *       *       *       *       /sbin/ping -c4 localhost

 I'm getting no emails at all. In /var/log/maillog, I'm getting the
 following output:

 Mar  3 21:10:00 domain sendmail[86797]: n23LA0td086797: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903032110.n23la0td086...@subdomain.domain.tld,
 relay=...@localhost


You've replaced a problem with another problem.  Have you tried to
send the mail locally first?

-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread Morgan Wesström

Glen Barber wrote:
 On Tue, Mar 3, 2009 at 4:10 PM, APseudoUtopia apseudouto...@gmail.com wrote:
 Thanks for the tips. I've put the following line in my normal user
 account's crontab (This account does have a shell, it's one I use on a
 daily basis):

 SHELL=/bin/sh
 mailto=my_email_acco...@gmail.com
 *   *   *   *   *   /sbin/ping -c4 localhost

 I'm getting no emails at all. In /var/log/maillog, I'm getting the
 following output:

 Mar  3 21:10:00 domain sendmail[86797]: n23LA0td086797: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903032110.n23la0td086...@subdomain.domain.tld,
 relay=...@localhost

Isn't w...@localhost a very weird hostname for a relay? Can you really
resolve that into an IP address?
/Morgan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread APseudoUtopia
On Tue, Mar 3, 2009 at 4:17 PM, Glen Barber glen.j.bar...@gmail.com wrote:
 On Tue, Mar 3, 2009 at 4:10 PM, APseudoUtopia apseudouto...@gmail.com wrote:
 Thanks for the tips. I've put the following line in my normal user
 account's crontab (This account does have a shell, it's one I use on a
 daily basis):

 SHELL=/bin/sh
 mailto=my_email_acco...@gmail.com
 *       *       *       *       *       /sbin/ping -c4 localhost

 I'm getting no emails at all. In /var/log/maillog, I'm getting the
 following output:

 Mar  3 21:10:00 domain sendmail[86797]: n23LA0td086797: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903032110.n23la0td086...@subdomain.domain.tld,
 relay=...@localhost


 You've replaced a problem with another problem.  Have you tried to
 send the mail locally first?

 --
 Glen Barber


I have tested it - and sending mail manually from command line to the
gmail account works fine without any problems.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread APseudoUtopia
On Tue, Mar 3, 2009 at 4:52 PM, Morgan Wesström
freebsd-questi...@pp.dyndns.biz wrote:

 Glen Barber wrote:
 On Tue, Mar 3, 2009 at 4:10 PM, APseudoUtopia apseudouto...@gmail.com 
 wrote:
 Thanks for the tips. I've put the following line in my normal user
 account's crontab (This account does have a shell, it's one I use on a
 daily basis):

 SHELL=/bin/sh
 mailto=my_email_acco...@gmail.com
 *       *       *       *       *       /sbin/ping -c4 localhost

 I'm getting no emails at all. In /var/log/maillog, I'm getting the
 following output:

 Mar  3 21:10:00 domain sendmail[86797]: n23LA0td086797: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903032110.n23la0td086...@subdomain.domain.tld,
 relay=...@localhost

 Isn't w...@localhost a very weird hostname for a relay? Can you really
 resolve that into an IP address?
 /Morgan

Hm, I'm not sure where it's getting that from. The MAILTO variable is
set in the crontab, so it shouldn't be going to or relaying through
localhost at all, right? It should go directly to gmail's servers?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread Glen Barber
On Tue, Mar 3, 2009 at 5:29 PM, APseudoUtopia apseudouto...@gmail.com wrote:

 I have tested it - and sending mail manually from command line to the
 gmail account works fine without any problems.


What I'm saying is that you changed two of the variables without
actually verifying one or the other work first.  Change the MAILTO
back to root and retest.


-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread APseudoUtopia
On Tue, Mar 3, 2009 at 5:44 PM, Glen Barber glen.j.bar...@gmail.com wrote:
 On Tue, Mar 3, 2009 at 5:29 PM, APseudoUtopia apseudouto...@gmail.com wrote:

 I have tested it - and sending mail manually from command line to the
 gmail account works fine without any problems.


 What I'm saying is that you changed two of the variables without
 actually verifying one or the other work first.  Change the MAILTO
 back to root and retest.


 --
 Glen Barber


SHELL=/bin/sh
#mailto=st...@tastetherainbow.ws
MAILTO=root
*   *   *   *   *   /sbin/ping -c4 localhost

Still no email. Same message in the maillog:

Mar  3 22:48:00 youcant sendmail[92113]: n23Mm0vP092113: from=www,
size=0, class=0, nrcpts=0,
msgid=200903032248.n23mm0vp092...@youcant.tastetherainbow.ws,
relay=...@localhost

This is driving me crazy :-\
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread Mel
On Tuesday 03 March 2009 13:44:34 APseudoUtopia wrote:
 On Tue, Mar 3, 2009 at 4:52 PM, Morgan Wesström

 freebsd-questi...@pp.dyndns.biz wrote:
  Glen Barber wrote:
  On Tue, Mar 3, 2009 at 4:10 PM, APseudoUtopia apseudouto...@gmail.com 
wrote:
  Thanks for the tips. I've put the following line in my normal user
  account's crontab (This account does have a shell, it's one I use on a
  daily basis):
 
  SHELL=/bin/sh
  mailto=my_email_acco...@gmail.com
  *       *       *       *       *       /sbin/ping -c4 localhost
 
  I'm getting no emails at all. In /var/log/maillog, I'm getting the
  following output:
 
  Mar  3 21:10:00 domain sendmail[86797]: n23LA0td086797: from=www,
  size=0, class=0, nrcpts=0,
  msgid=200903032110.n23la0td086...@subdomain.domain.tld,
  relay=...@localhost
 
  Isn't w...@localhost a very weird hostname for a relay? Can you really
  resolve that into an IP address?
  /Morgan

 Hm, I'm not sure where it's getting that from. The MAILTO variable is
 set in the crontab, so it shouldn't be going to or relaying through
 localhost at all, right? It should go directly to gmail's servers?

If grep 'n23LA0td086797' /var/log/maillog only yields one entry, then 
something is wrong with your email setup. There should at least be one more 
entry from the spooler to pickup final destination. And yes, the 
relay 'w...@localhost' seems odd, but since I gave up sendmail for postfix 
years ago, I'm not current with how it spits things into syslog.

-- 
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread Morgan Wesström
 relay=...@localhost
 Isn't w...@localhost a very weird hostname for a relay? Can you really
 resolve that into an IP address?
 /Morgan
 Hm, I'm not sure where it's getting that from. The MAILTO variable is
 set in the crontab, so it shouldn't be going to or relaying through
 localhost at all, right? It should go directly to gmail's servers?
 
 If grep 'n23LA0td086797' /var/log/maillog only yields one entry, then 
 something is wrong with your email setup. There should at least be one more 
 entry from the spooler to pickup final destination. And yes, the 
 relay 'w...@localhost' seems odd, but since I gave up sendmail for postfix 
 years ago, I'm not current with how it spits things into syslog.
 

In my case I only see either local there or my smart host as defined
in /var/mail/{hostname}.mc
Can you provide a diff -u between /etc/mail/freebsd.mc and
/etc/mail/{hostname}.mc ?

/Morgan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-03 Thread APseudoUtopia
On Tue, Mar 3, 2009 at 6:48 PM, Morgan Wesström
freebsd-questi...@pp.dyndns.biz wrote:
 relay=...@localhost
 Isn't w...@localhost a very weird hostname for a relay? Can you really
 resolve that into an IP address?
 /Morgan
 Hm, I'm not sure where it's getting that from. The MAILTO variable is
 set in the crontab, so it shouldn't be going to or relaying through
 localhost at all, right? It should go directly to gmail's servers?

 If grep 'n23LA0td086797' /var/log/maillog only yields one entry, then
 something is wrong with your email setup. There should at least be one more
 entry from the spooler to pickup final destination. And yes, the
 relay 'w...@localhost' seems odd, but since I gave up sendmail for postfix
 years ago, I'm not current with how it spits things into syslog.


 In my case I only see either local there or my smart host as defined
 in /var/mail/{hostname}.mc
 Can you provide a diff -u between /etc/mail/freebsd.mc and
 /etc/mail/{hostname}.mc ?

 /Morgan

I'd switch over to postfix, but I'm only using this to send output
from cron and the daily security run scripts. I don't receive any mail
over the network, so I think it'd be pointless to go through the
effort of switching and configuring another MTA.

Here's the diff. I figured it was too long to include in the email
(word wrap will make it hard to read :-P)
http://pastebin.ca/1352338

Here's the full contents of /etc/mail/{hostname}.mc
http://pastebin.ca/1352340

Thanks for the help.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-02 Thread APseudoUtopia
On Sun, Mar 1, 2009 at 9:03 PM, Frank Shute fr...@shute.org.uk wrote:
 On Sun, Mar 01, 2009 at 02:24:47PM -0500, APseudoUtopia wrote:

 Cron is not sending output as emails. I noticed this when I stopped
 seeing the output of a backup script in my daily email. I thought
 there was a problem with the backup script - but no, it's cron not
 sending the emails.

 I had this problem before on 6.1, which I never found a solution to. I
 gave up on it, and eventually I upgraded to 7.1. After the upgrade,
 cron worked perfectly. However, I just noticed that it stopped working
 again. I have no idea what changed (It's a production server, I
 haven't been playing with config files).

 User www's mail is redirected to root, which is redirected to a @gmail
 account via /etc/aliases.
 This is on 7.1-RELEASE-p3 running a custom kernel.

 Any solution to this problem would be fantastic. I use the emails from
 cron on a daily basis, and it really messes me up to have it not
 working.

 #
 # User www's crontab
 # Note, I also tried removing the MAILTO to no avail
 #
 MAILTO=root
 # m     h       dom     mon     dow     cmd
 *       *       *       *       *       echo Hello


 
 # /var/log/cron
 
 Mar  1 19:22:00 youcant /usr/sbin/cron[22627]: (operator) CMD
 (/usr/libexec/save-entropy)
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 Mar  1 19:22:00 youcant /usr/sbin/cron[22628]: (www) CMD (echo Hello)
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found



 
 # /var/log/maillog
 
 Mar  1 19:22:00 youcant sendmail[22630]: n21JM0Gl022630: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903011922.n21jm0gl022...@youcant.tastetherainbow.ws,
 relay=...@localhost

 It looks like you're using user: www for your crontab.

 Unfortunately, from /etc/passwd:

 www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin

 i.e user www can't do much without a shell.

 Create a crontab as a user with a shell, MAILTO to your gmail account.

 The user may want to be a member of a group with privileges. Or use
 sudo.

 Don't forget to add him to /var/cron/allow as per manpage for
 crontab(1).

 You could set SHELL in your crontab for www (might work) but I'd use a
 different user who's a member of group operator maybe.

 Hope that helps.

 Regards,

 --

  Frank


  Contact info: http://www.shute.org.uk/misc/contact.html



Thanks for the suggestions. The backup script I have in the crontab
still runs perfectly fine - there's just no output. So cron itself is
working, just not any email output. I'll try playing around with the
MAILTO and the SHELL and such to try and get it working.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-02 Thread Frank Shute
On Sun, Mar 01, 2009 at 02:24:47PM -0500, APseudoUtopia wrote:

 Cron is not sending output as emails. I noticed this when I stopped
 seeing the output of a backup script in my daily email. I thought
 there was a problem with the backup script - but no, it's cron not
 sending the emails.
 
 I had this problem before on 6.1, which I never found a solution to. I
 gave up on it, and eventually I upgraded to 7.1. After the upgrade,
 cron worked perfectly. However, I just noticed that it stopped working
 again. I have no idea what changed (It's a production server, I
 haven't been playing with config files).
 
 User www's mail is redirected to root, which is redirected to a @gmail
 account via /etc/aliases.
 This is on 7.1-RELEASE-p3 running a custom kernel.
 
 Any solution to this problem would be fantastic. I use the emails from
 cron on a daily basis, and it really messes me up to have it not
 working.
 
 #
 # User www's crontab
 # Note, I also tried removing the MAILTO to no avail
 #
 MAILTO=root
 # m h   dom mon dow cmd
 *   *   *   *   *   echo Hello

PATH is not set or binary not called with it's path.

 
 
 
 # /var/log/cron
 
 Mar  1 19:22:00 youcant /usr/sbin/cron[22627]: (operator) CMD
 (/usr/libexec/save-entropy)
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 Mar  1 19:22:00 youcant /usr/sbin/cron[22628]: (www) CMD (echo Hello)
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 
 
Heh! I misread your original post. I didn't  realise that youcant
was your hostname. It confused me ;)

A few ideas: Make MAILTO in cron point to your gmail account. If not
you'll need an alias for www in aliases(5) to point to that gmail
account and you have to remember to rebuild it with newaliases(1)
after you've edited it.

 
 
 # /var/log/maillog
 
 Mar  1 19:22:00 youcant sendmail[22630]: n21JM0Gl022630: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903011922.n21jm0gl022...@youcant.tastetherainbow.ws,
 relay=...@localhost

This has got a few problems. It's saying the size of the message is 0
(probably because you've not set your PATH)  the number of recipients
is 0 and it seems to be relaying it to w...@localhost rather than
delivering it to your gmail account (newaliases not run).

Regards,

-- 

 Frank 


 Contact info: http://www.shute.org.uk/misc/contact.html 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-02 Thread Glen Barber
On Sun, Mar 1, 2009 at 2:24 PM, APseudoUtopia apseudouto...@gmail.com wrote:
[snip]

 #
 # User www's crontab
 # Note, I also tried removing the MAILTO to no avail
 #
 MAILTO=root
 # m     h       dom     mon     dow     cmd
 *       *       *       *       *       echo Hello


[snip]

1.)  You are not using the full path to /bin/echo, which is why it is failing.

2.) This is a poor designed way to test cron's mail output.

A Better(tm) way would be something like:
MAILTO=root
*/5 * * * * /bin/ping -c1 localhost /dev/null

which would mail to root on success or failure.

Regards,

-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Cron Not Sending Mail

2009-03-01 Thread APseudoUtopia
Cron is not sending output as emails. I noticed this when I stopped
seeing the output of a backup script in my daily email. I thought
there was a problem with the backup script - but no, it's cron not
sending the emails.

I had this problem before on 6.1, which I never found a solution to. I
gave up on it, and eventually I upgraded to 7.1. After the upgrade,
cron worked perfectly. However, I just noticed that it stopped working
again. I have no idea what changed (It's a production server, I
haven't been playing with config files).

User www's mail is redirected to root, which is redirected to a @gmail
account via /etc/aliases.
This is on 7.1-RELEASE-p3 running a custom kernel.

Any solution to this problem would be fantastic. I use the emails from
cron on a daily basis, and it really messes me up to have it not
working.

#
# User www's crontab
# Note, I also tried removing the MAILTO to no avail
#
MAILTO=root
# m h   dom mon dow cmd
*   *   *   *   *   echo Hello



# /var/log/cron

Mar  1 19:22:00 youcant /usr/sbin/cron[22627]: (operator) CMD
(/usr/libexec/save-entropy)
Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
group_compat, setgrent, not found
Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
group_compat, endgrent, not found
Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
passwd_compat, endpwent, not found
Mar  1 19:22:00 youcant /usr/sbin/cron[22628]: (www) CMD (echo Hello)
Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
group_compat, setgrent, not found
Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
group_compat, endgrent, not found
Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
passwd_compat, endpwent, not found
Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
group_compat, setgrent, not found
Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
group_compat, endgrent, not found
Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
passwd_compat, endpwent, not found




# /var/log/maillog

Mar  1 19:22:00 youcant sendmail[22630]: n21JM0Gl022630: from=www,
size=0, class=0, nrcpts=0,
msgid=200903011922.n21jm0gl022...@youcant.tastetherainbow.ws,
relay=...@localhost
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Cron Not Sending Mail

2009-03-01 Thread Frank Shute
On Sun, Mar 01, 2009 at 02:24:47PM -0500, APseudoUtopia wrote:

 Cron is not sending output as emails. I noticed this when I stopped
 seeing the output of a backup script in my daily email. I thought
 there was a problem with the backup script - but no, it's cron not
 sending the emails.
 
 I had this problem before on 6.1, which I never found a solution to. I
 gave up on it, and eventually I upgraded to 7.1. After the upgrade,
 cron worked perfectly. However, I just noticed that it stopped working
 again. I have no idea what changed (It's a production server, I
 haven't been playing with config files).
 
 User www's mail is redirected to root, which is redirected to a @gmail
 account via /etc/aliases.
 This is on 7.1-RELEASE-p3 running a custom kernel.
 
 Any solution to this problem would be fantastic. I use the emails from
 cron on a daily basis, and it really messes me up to have it not
 working.
 
 #
 # User www's crontab
 # Note, I also tried removing the MAILTO to no avail
 #
 MAILTO=root
 # m h   dom mon dow cmd
 *   *   *   *   *   echo Hello
 
 
 
 # /var/log/cron
 
 Mar  1 19:22:00 youcant /usr/sbin/cron[22627]: (operator) CMD
 (/usr/libexec/save-entropy)
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22627]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 Mar  1 19:22:00 youcant /usr/sbin/cron[22628]: (www) CMD (echo Hello)
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22628]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 group_compat, setgrent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 group_compat, endgrent, not found
 Mar  1 19:22:00 youcant cron[22630]: NSSWITCH(nss_method_lookup): nis,
 passwd_compat, endpwent, not found
 
 
 
 
 # /var/log/maillog
 
 Mar  1 19:22:00 youcant sendmail[22630]: n21JM0Gl022630: from=www,
 size=0, class=0, nrcpts=0,
 msgid=200903011922.n21jm0gl022...@youcant.tastetherainbow.ws,
 relay=...@localhost

It looks like you're using user: www for your crontab.

Unfortunately, from /etc/passwd:

www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin

i.e user www can't do much without a shell.

Create a crontab as a user with a shell, MAILTO to your gmail account.

The user may want to be a member of a group with privileges. Or use
sudo.

Don't forget to add him to /var/cron/allow as per manpage for
crontab(1).

You could set SHELL in your crontab for www (might work) but I'd use a
different user who's a member of group operator maybe.

Hope that helps.

Regards,

-- 

 Frank 


 Contact info: http://www.shute.org.uk/misc/contact.html 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org