LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 04-21-2007, 02:58 PM   #1
mazzo
Member
 
Registered: Jun 2003
Location: Thames Valley, UK
Distribution: RedHat from 5 -9, Fedora, Ubuntu, Centos 3 - 7, Puppy Linux
Posts: 136

Rep: Reputation: 15
fetchmail - why does CentOS 5 not like my old cron job?


I have (eventually) got round to upgrading my RH7.1 server. Now I'm using CentOS 5 - which is great and so far everything is doing what it should.

I run a fetchmail cron with multidrop. Before on my RH7.1 I simply had the .fetchmailrc in /root and then had the following lines in my crontab (root's crontab I should add)

0,5,10,15,20,25,30,35,40,45,50,55 7-23 * * 0-6 /usr/bin/fetchmail -E X-Envelope-To -s
0 0-6 * * 0-6 /usr/bin/fetchmail -E X-Envelope-To -s

I've done the same again (ie .fetchmailrc in /root and the same crontab entries), however I am getting mail to root everytime it runs saying:

Subject: Cron <root@catulus> /usr/bin/fetchmail -E X-Envelope-To -s
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

fetchmail: WARNING: Running as root is discouraged.

Why? I never got messages before with an identical script.

If it shouldn't running as root, how should I run it?
Do user's cron jobs only run when they are logged in?

Thanks
 
Old 04-21-2007, 04:12 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,164

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
RH 7.1 is ancient and was probably running an equally ancient version of fetchmail. The don't run as root warning was probably added in a later version of fetchmail. It's good advice, too, if you run fetchmail as root and there is a security flaw in it or you have it con figured badly, then a malicious server or mail message could be used to gain complete control of your system for an attacker.

The solution is to run fetchmail as a nonprivileged user. A user's cron jobs run whenever they are scheduled -- not jsut when the user is logged in.
 
Old 04-23-2007, 04:02 PM   #3
mazzo
Member
 
Registered: Jun 2003
Location: Thames Valley, UK
Distribution: RedHat from 5 -9, Fedora, Ubuntu, Centos 3 - 7, Puppy Linux
Posts: 136

Original Poster
Rep: Reputation: 15
Thanks for that. Will run it as a user instead!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos, Fetchmail, Postfix, Open Exchange = Weird Mail behaviour bugg_tb Linux - Server 1 02-13-2007 03:00 AM
Full-time job updating CentOS uselpa Red Hat 1 10-28-2005 04:31 PM
Cron Job petenyce Linux - Newbie 5 10-11-2005 05:03 PM
fetchmail/cron hang problem Peff Linux - Software 0 07-13-2005 12:09 AM
cron job? dr_zayus69 Linux - Newbie 14 12-01-2004 07:16 PM


All times are GMT -5. The time now is 11:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration