Re: filtering Cron fetchmail reports

2010-05-09 Thread Michael Tatge
* On Sat, May 08, 2010 05:24PM -0400 Haines Brown KB1GRM ET1 
(bro...@historicalmaterialism.info) muttered:
> I run fetchmail with cron, and as a result, each time it runs there's
> a mail message from cron in mutt reporting what fetchmail did. It is a 
> nuisance to have to delete all these messages, and so I'd like to 
> avoid them.

See MAILTO

HTH,

Michael
-- 
Problem solving under Linux has never been the circus that it is under
AIX.
-- Pete Ehlke in comp.unix.aix

PGP-Key-ID: 0xDC1A44DD
Jabber: init...@amessage.de


Re: filtering Cron fetchmail reports

2010-05-09 Thread Nathan Stratton Treadway
On Sun, May 09, 2010 at 10:20:55 -0400, Haines Brown KB1GRM ET1 wrote:
> But I do have a question. I started fetchmail daemon:
> 
>   $ fetchmail
>   fetchmail: background fetchmail at 19841 awakened.
> 
> but see that I already have /etc/default/fetchmail (I'm running 
> debian), which means fetchmail will start automatically on boot. 
>
> However, won't fetchmail then be run by root and not see the 
> "set daemon 900" statement in ~/.fetchmailrc? So will fetchmail 
> fail to start in daemon mode for user?

In Debian, the /etc/init.d/fetchmail script will only start a
system-wide fetchmail daemon if both the proper setting is set within
/etc/default/fetchmail (e.g. START_DAEMON=yes) and the /etc/fetchmailrc
file exists.  

So unless you (or someone) specifically enabled it, the system-wide
daemon wouldn't be running.  Also, if those lines you cut-and-pasted
show that you can awaken the background process by running "fetchmail"
as yourself, that would be an indication that that background process is
also running as yourself.

 
> If so, I wonder if I can also list fetchmail in ~/.fluxbox/init? 

Personally, I start the daemon manually, but I think it should be fine
to have the window mananger start it up automatically.

Nathan


Re: filtering Cron fetchmail reports

2010-05-09 Thread Jamie Griffin
> but see that I already have /etc/default/fetchmail (I'm running 
> debian), which means fetchmail will start automatically on boot. 
> However, won't fetchmail then be run by root and not see the 
> "set daemon 900" statement in ~/.fetchmailrc? So will fetchmail 
> fail to start in daemon mode for user?

If I remember correctly (been ages since I used Linux) /etc/default/fetchmail 
is a start-up script for fetchmail. You could then put your configuration stuff 
in /etc/fetchmailrc. It might also be a good idea to check if Debian package 
runs the daemon as fetchmail user, which is what I used to do when I used it, 
to avoid running it as root. 

Jamie



Re: filtering Cron fetchmail reports

2010-05-09 Thread Haines Brown KB1GRM ET1
> Running featchmail as a daemon works well for me.  I have the account
> info recorded in my .fetchmailrc file, and then when I first boot my
> machine I just run "fetchmail -d300" and enter the password for my email
> account before I start up Mutt.

Nathan, this seems to be the best solution for me. I'm running 
fetchmail as daemon now, and so far it seems to work. I'm getting new 
messages in mutt, but not any fetchmail reports.

But I do have a question. I started fetchmail daemon:

  $ fetchmail
  fetchmail: background fetchmail at 19841 awakened.

but see that I already have /etc/default/fetchmail (I'm running 
debian), which means fetchmail will start automatically on boot. 
However, won't fetchmail then be run by root and not see the 
"set daemon 900" statement in ~/.fetchmailrc? So will fetchmail 
fail to start in daemon mode for user?

If so, I wonder if I can also list fetchmail in ~/.fluxbox/init? 
 
Haines



Re: filtering Cron fetchmail reports

2010-05-09 Thread Derek Martin
On Sun, May 09, 2010 at 07:29:46AM -0400, Haines Brown KB1GRM ET1 wrote:
> > 
> > 
> > p...@rick
> 
> Thanks, Patrick, but the reason for my writing is that this approach 
> (using the command "fetchmail > /dev/null 2>&1" did not work. 

Cron will only generate e-mail if the program has output, which the
above command guarantees won't happen.  One can only conclude that if
you're still getting e-mail, you somehow did it wrong.  I can only
think of two possibilities: either you have a typo in your crontab, or
you updated your crontab improperly (perhaps by editing the file in
the spool directory directly?).  Well, I suppose it's possible that
there's a bug in your version of cron also... but that seems extremely
unlikely.

I assume you are running it in cron via your own (i.e. not root) user?
If so, then running "crontab -l" will print out what your crontab
looks like.  You might post the output of that to the list, so we can
have a look.

Running as a daemon will certainly prevent the mail, and filtering
with procmail will just as easily make sure you don't see it.  I will
mention that I formerly ran fetchmail as a daemon, and then ran into
some problem (the details of which I've forgotten, it was quite a
while ago) which prompted me to switch to running it from cron.  I
invoke it as above, and as expected I don't get any e-mail.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpXomlPS55Zr.pgp
Description: PGP signature


Re: filtering Cron fetchmail reports

2010-05-09 Thread Haines Brown KB1GRM ET1
> 
> 
> p...@rick

Thanks, Patrick, but the reason for my writing is that this approach 
(using the command "fetchmail > /dev/null 2>&1" did not work. 

It seems that if I run the command from a command prompt, it works: 
the fetchmail error or report is sent to the bit bucket. But if I run 
fetchmail with cron, the errors and reports end up being sent to mutt. 
It seems that cron is treating error messages and reports from 
fetchmail as ordinary messages rather than as errors. I suppose the 
answer might be to run fetchmail as daemon. I'll try that next.

Haines  


Re: filtering Cron fetchmail reports

2010-05-08 Thread Jostein Berntsen
On 08.05.10,17:24, Haines Brown KB1GRM ET1 wrote:
> I'm sure there's a simple answer to this, but I've not found it. I run 
> fetchmail with cron, and as a result, each time it runs there's a mail 
> message from cron in mutt reporting what fetchmail did. It is a 
> nuisance to have to delete all these messages, and so I'd like to 
> avoid them.
> 
> Would running fetchmail as daemon have any effect?
> 
> Haines Brown
> 

You can also filter these messages with Procmail, using something like 
this in the rc file:

:0
* ^Subject: Cron.*fetchmail
/dev/null

 
Jostein



Re: filtering Cron fetchmail reports

2010-05-08 Thread Nathan Stratton Treadway
On Sat, May 08, 2010 at 17:24:34 -0400, Haines Brown KB1GRM ET1 wrote:
> Would running fetchmail as daemon have any effect?

Running featchmail as a daemon works well for me.  I have the account
info recorded in my .fetchmailrc file, and then when I first boot my
machine I just run "fetchmail -d300" and enter the password for my email
account before I start up Mutt.

The daemon will send me a warning email if something goes wrong later
(e.g. it's unable to log in because the the password on the server has
changed), but otherwise it doesn't generate any "extra" emails.

(However, normal activity/progress messages do show up in my
/var/log/syslog, so if I ever have a need, I can go back and see how
many messages it downloaded during a particular run, etc.)


Nathan


Re: filtering Cron fetchmail reports

2010-05-08 Thread Patrick Ben Koetter
* Haines Brown KB1GRM ET1 :
> I'm sure there's a simple answer to this, but I've not found it. I run 
> fetchmail with cron, and as a result, each time it runs there's a mail 
> message from cron in mutt reporting what fetchmail did. It is a 
> nuisance to have to delete all these messages, and so I'd like to 
> avoid them.
> 
> Would running fetchmail as daemon have any effect?



p...@rick

-- 
Postfix - Einrichtung, Betrieb und Wartung

saslfinger (debugging SMTP AUTH):



filtering Cron fetchmail reports

2010-05-08 Thread Haines Brown KB1GRM ET1
I'm sure there's a simple answer to this, but I've not found it. I run 
fetchmail with cron, and as a result, each time it runs there's a mail 
message from cron in mutt reporting what fetchmail did. It is a 
nuisance to have to delete all these messages, and so I'd like to 
avoid them.

Would running fetchmail as daemon have any effect?

Haines Brown