Is there anyway to suppress cron emails on successful running of a program. I'm using cron to check my email via fetchmail, and it emails me every 5 minutes. I want fetchmail to check, even when I'm not logged in, so I'm using cron. -- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
Jim,
Why are you using cron?? Just start fetchmail in daemon mode and it will
do what you want:
[root@Nemesis david]# fetchmail -f /etc/fetchmailrc
[root@Nemesis david]# cat /etc/fetchmailrc
set daemon 600
set postmaster david
set logfile /var/log/fetchmail.log
poll pop.cox-internet.com proto pop3 user me.cox-internet.com pass
thepassword is david here
--
David C. Rankin, J.D., P.E.
RANKIN * BERTIN, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
(936) 715-9333
(936) 715-9339 fax
www.rankin-bertin.com
--
----- Original Message -----
From: "Jim Sabatke"
Is there anyway to suppress cron emails on successful running of a program. I'm using cron to check my email via fetchmail, and it emails me every 5 minutes. I want fetchmail to check, even when I'm not logged in, so I'm using cron.
-- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke
Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
David Rankin wrote:
Jim,
Why are you using cron?? Just start fetchmail in daemon mode and it will do what you want:
[root@Nemesis david]# fetchmail -f /etc/fetchmailrc [root@Nemesis david]# cat /etc/fetchmailrc set daemon 600 set postmaster david set logfile /var/log/fetchmail.log poll pop.cox-internet.com proto pop3 user me.cox-internet.com pass thepassword is david here
Why am (was) I using it? Probably because I just spent a week getting fetchmail/postfix/cyrus/mysql to work and I'm brain dead! :) Thanks for the kick in the pants to bring me back to reality. -- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
On 10 May, David Rankin wrote:
Jim,
Why are you using cron?? Just start fetchmail in daemon mode and it will do what you want:
[root@Nemesis david]# fetchmail -f /etc/fetchmailrc [root@Nemesis david]# cat /etc/fetchmailrc set daemon 600 set postmaster david set logfile /var/log/fetchmail.log poll pop.cox-internet.com proto pop3 user me.cox-internet.com pass thepassword is david here
-- David C. Rankin, J.D., P.E. RANKIN * BERTIN, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 (936) 715-9333 (936) 715-9339 fax www.rankin-bertin.com -- ----- Original Message ----- From: "Jim Sabatke"
To: Sent: Monday, May 10, 2004 4:25 PM Subject: [SLE] cron email Is there anyway to suppress cron emails on successful running of a program. I'm using cron to check my email via fetchmail, and it emails me every 5 minutes. I want fetchmail to check, even when I'm not logged in, so I'm using cron.
-- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke
Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Running fetchmail in daemon mode is all well and good, but if one is running multiple accounts, each wanting their own mail checked whether logged in or not, cron is the way to go to my mind. As follows (assuming you're polling a POP account): ~/.crontab -- */5 * * * * /usr/bin/fetchmail -s -f /home/joeblow/.fetchmailrc ~/.fetchmailrc -- poll <your isp> with proto POP3 user 'joeblow' there with pass 'whatever' is 'joeblow' here mda "/usr/bin/procmail -d %s' ~/.procmailrc of each users choice (I have ~/.proc.. calling four additional scripts for mail handling as well). To my mind, the beauty of *nix, single apps that do one thing well - in conjuction with others, of course. Just my two cents. -- John Lalla Santa Barbara, CA .~. _ /v\ -o) no gates... /( )\ /\\ running GNU/Linux no windows! ^^^^^ _\_v free at last! "Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . "
* John Lalla
Running fetchmail in daemon mode is all well and good, but if one is running multiple accounts, each wanting their own mail checked whether logged in or not, cron is the way to go to my mind.
Why don't you just run one instance of fetchmail and include the multiple accounts in your fetchmailrc. Seems like there would be considerable less system overhead and complexity. You *do* realize that this is plausible? -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711
On 10 May, Patrick Shanahan wrote:
* John Lalla
[05-10-04 21:17]: Running fetchmail in daemon mode is all well and good, but if one is running multiple accounts, each wanting their own mail checked whether logged in or not, cron is the way to go to my mind.
Why don't you just run one instance of fetchmail and include the multiple accounts in your fetchmailrc. Seems like there would be considerable less system overhead and complexity. You *do* realize that this is plausible?
Unfortunately, all household members use the same pop server. I tried such a setup and it wouldn't work. Hence, cron, fetchmail and procmail all drawing on individual rc files. If you know of a better way, please tell. Although, my present setup seems to be working with no hitches. Regards, -- John Lalla Santa Barbara, CA .~. _ /v\ -o) no gates... /( )\ /\\ running GNU/Linux no windows! ^^^^^ _\_v free at last! "Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . "
On Tuesday 11 May 2004 12:37 am, John Lalla wrote:
On 10 May, Patrick Shanahan wrote:
* John Lalla
[05-10-04 21:17]: Running fetchmail in daemon mode is all well and good, but if one is running multiple accounts, each wanting their own mail checked whether logged in or not, cron is the way to go to my mind.
Why don't you just run one instance of fetchmail and include the multiple accounts in your fetchmailrc. Seems like there would be considerable less system overhead and complexity. You *do* realize that this is plausible?
Unfortunately, all household members use the same pop server. I tried such a setup and it wouldn't work. Hence, cron, fetchmail and procmail all drawing on individual rc files.
If you know of a better way, please tell. Although, my present setup seems to be working with no hitches.
Regards,
Why would the fact that they all use the same pop server matter?? They each
have their own userid I assume?
Here's just part of my /etc/fetchmailrc:
set daemon 300
set logfile /var/log/fetchmail
defaults
proto pop3
mda "/usr/bin/procmail -f %F -d %T "
#
# user1@
* John Lalla
On 10 May, Patrick Shanahan wrote:
Why don't you just run one instance of fetchmail and include the multiple accounts in your fetchmailrc. Seems like there would be considerable less system overhead and complexity. You *do* realize that this is plausible?
Unfortunately, all household members use the same pop server. I tried such a setup and it wouldn't work. Hence, cron, fetchmail and procmail all drawing on individual rc files.
If you know of a better way, please tell. Although, my present setup seems to be working with no hitches.
example .fetchmailrc: (this works, I use something similar set logfile "~/.procmail/fetchmail.log" set postmaster "your_mail" set bouncemail set spambounce set properties "v" set daemon 150 poll pop.centralr.cox.net with proto POP3 timeout 60 user 'user1' there with password 'passwd1' is '1user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user2' there with password 'passwd2' is '2user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user3' there with password 'passwd3' is '3user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user4' there with password 'passwd4' is '4user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user5' there with password 'passwd5' is '5user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 poll imap.myrealbox.com with proto IMAP timeout 45 user 'user6' there with password 'passwd6' is '6user' here options fetchall stripcr ssl mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user7' there with password 'passwd7' is '7user' here options fetchall stripcr ssl mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 poll mail.messagingengine.com with proto IMAP timeout 45 user 'user8@fastmail.fm' there with password 'passwd8' is '8user' here options fetchall stripcr ssl mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711
On 11 May, Patrick Shanahan wrote:
* John Lalla
[05-10-04 23:41]: On 10 May, Patrick Shanahan wrote:
Why don't you just run one instance of fetchmail and include the multiple accounts in your fetchmailrc. Seems like there would be considerable less system overhead and complexity. You *do* realize that this is plausible?
Unfortunately, all household members use the same pop server. I tried such a setup and it wouldn't work. Hence, cron, fetchmail and procmail all drawing on individual rc files.
If you know of a better way, please tell. Although, my present setup seems to be working with no hitches.
example .fetchmailrc: (this works, I use something similar
set logfile "~/.procmail/fetchmail.log" set postmaster "your_mail" set bouncemail set spambounce set properties "v" set daemon 150
poll pop.centralr.cox.net with proto POP3 timeout 60 user 'user1' there with password 'passwd1' is '1user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user2' there with password 'passwd2' is '2user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user3' there with password 'passwd3' is '3user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user4' there with password 'passwd4' is '4user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user5' there with password 'passwd5' is '5user' here options fetchall stripcr mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554
poll imap.myrealbox.com with proto IMAP timeout 45 user 'user6' there with password 'passwd6' is '6user' here options fetchall stripcr ssl mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554 user 'user7' there with password 'passwd7' is '7user' here options fetchall stripcr ssl mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554
poll mail.messagingengine.com with proto IMAP timeout 45 user 'user8@fastmail.fm' there with password 'passwd8' is '8user' here options fetchall stripcr ssl mda '/usr/lib/sendmail -i -oem -f %F %T' antispam 571 550 501 554
Patrick, Many thanks for the recipe. I see your point in its simplicity. My teenage daughter isn't happy sharing her password with me, so I guess I won't tell her I have full access to her directory ;). My eleven year old son, however, thinks it's really funny - although he also understand the logic. He's been running GNU/Linux most of his life, while she has little interest - save chatting with her friends. The only glitch I've noticed is that my mail filtering setup no longer distinguishes between myself as user and as root. I have root's mail forwarded to me as a user, of course, and filtering is set to recognize email (To|From) root and deposit it in a selected mbox. While this continues to work, any mail I send myself is now deposited in root's mbox as well. I assume this is due to my alias. :0 * ^(From|To).*root livingston Oh well, this slight inconvenience aside, running fetchmail in daemon mode does seem practical. Thanks again for the suggestion. Regards, -- John Lalla Santa Barbara, CA .~. _ /v\ -o) no gates... /( )\ /\\ running GNU/Linux no windows! ^^^^^ _\_v free at last! "Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . "
On Monday 10 May 2004 10:17 pm, John Lalla wrote:
On 10 May, David Rankin wrote:
Jim,
Why are you using cron?? Just start fetchmail in daemon mode and it will do what you want:
[root@Nemesis david]# fetchmail -f /etc/fetchmailrc [root@Nemesis david]# cat /etc/fetchmailrc set daemon 600 set postmaster david set logfile /var/log/fetchmail.log poll pop.cox-internet.com proto pop3 user me.cox-internet.com pass thepassword is david here
-- David C. Rankin, J.D., P.E. RANKIN * BERTIN, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 (936) 715-9333 (936) 715-9339 fax www.rankin-bertin.com -- ----- Original Message ----- From: "Jim Sabatke"
To: Sent: Monday, May 10, 2004 4:25 PM Subject: [SLE] cron email Is there anyway to suppress cron emails on successful running of a program. I'm using cron to check my email via fetchmail, and it emails me every 5 minutes. I want fetchmail to check, even when I'm not logged in, so I'm using cron.
-- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke
Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Running fetchmail in daemon mode is all well and good, but if one is running multiple accounts, each wanting their own mail checked whether logged in or not, cron is the way to go to my mind.
Not unless you *really* *really* have to allow each user to have their own .fetchmailrc. You can do it all in one /etc/.fetchmailrc with a lot less hassel. (running 6 accts here on a home LAN)
As follows (assuming you're polling a POP account):
~/.crontab --
*/5 * * * * /usr/bin/fetchmail -s -f /home/joeblow/.fetchmailrc
~/.fetchmailrc --
poll <your isp> with proto POP3 user 'joeblow' there with pass 'whatever' is 'joeblow' here mda "/usr/bin/procmail -d %s'
~/.procmailrc of each users choice (I have ~/.proc.. calling four additional scripts for mail handling as well).
To my mind, the beauty of *nix, single apps that do one thing well - in conjuction with others, of course.
Just my two cents.
-- +----------------------------------------------------------------------------+ + Bruce S. Marshall bmarsh@bmarsh.com Bellaire, MI 05/11/04 06:46 + +----------------------------------------------------------------------------+ "Eloquence: Saying the proper thing and stopping." --Stanley Link
The Tuesday 2004-05-11 at 06:49 -0400, Bruce Marshall wrote:
Running fetchmail in daemon mode is all well and good, but if one is running multiple accounts, each wanting their own mail checked whether logged in or not, cron is the way to go to my mind.
Not unless you *really* *really* have to allow each user to have their own .fetchmailrc. You can do it all in one /etc/.fetchmailrc with a lot less hassel.
(running 6 accts here on a home LAN)
The only reason to run separate fetchmail processes would be to keep passwords private for each person - but as the root can read them all, it doesn't matter. -- Cheers, Carlos Robinson
On Mon, May 10, 2004 at 02:25:41PM -0700, Jim Sabatke wrote:
Is there anyway to suppress cron emails on successful running of a program.
From manpage of crontab(5):
If MAILTO is defined but empty (MAILTO=""), no mail will be sent. Otherwise mail is sent to the owner of the crontab. Regards, -Kastus
On Mon, 2004-05-10 at 17:25, Jim Sabatke wrote:
Is there anyway to suppress cron emails on successful running of a program. I'm using cron to check my email via fetchmail, and it emails me every 5 minutes. I want fetchmail to check, even when I'm not logged in, so I'm using cron.
-- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke
Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
Add "2>&1 > /dev/null" to the end of your command to re-direct output to the bit bucket (without the quotes). -- Ken Schneider unix user since 1989 linux user since 1994 SuSE user since 1998 (5.2)
Jim,
you don't need to run fetchmail via cron. You can run fetchmail in
daemon mode.
You should have a script to run fetchmail in /etc/init.d - mine includes the
following line for starting the service:
startproc $FETCHMAIL_BIN -d 600 -a -f /etc/fetchmailrc -L /var/log/fetchmail
2>&1
The -d 600 option makes it run in daemon mode, checking mail every 600
seconds -
10 minutes.
Quoting Jim Sabatke
Is there anyway to suppress cron emails on successful running of a program. I'm using cron to check my email via fetchmail, and it emails me every 5 minutes. I want fetchmail to check, even when I'm not logged in, so I'm using cron.
-- Jim Sabatke Hire Me!! - See my resume at http://my.execpc.com/~jsabatke
Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup.
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
------------------------------------------ Jorge Manuel B. S. Vicetto Network Manager and Systems Administrator Angra do Heroísmo Nursing School (ESEnfAH) ------------------------------------------ ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
participants (9)
-
Bruce Marshall
-
Carlos E. R.
-
David Rankin
-
Jim Sabatke
-
John Lalla
-
Jorge Manuel B. S. Vicetto
-
Kastus
-
Kenneth Schneider
-
Patrick Shanahan