Guest SDMF Posted March 10, 2003 Report Share Posted March 10, 2003 I'm trying to set up fetchmail to automatically pull my e-mail into my local mailbox. To do this, it must be running in daemon mode. Since I have never manually configured any daemons, where should I put the command that would need to be called to start it in daemon mode every time I log in to linux? Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 10, 2003 Report Share Posted March 10, 2003 You run it via xinetd I will look at my setup at work tommorow, it's been ages since i did it Quote Link to comment Share on other sites More sharing options...
Guest BooYah Posted March 10, 2003 Report Share Posted March 10, 2003 I set it in my /home/booyah/.fetchmailrc set daemon 600 600 is 600 seconds. I have it set up so sylpheed uses fetchmail to pull my mail from my POP, then sylpheed snags it from /var/mail/ hope this helps Quote Link to comment Share on other sites More sharing options...
aru Posted March 10, 2003 Report Share Posted March 10, 2003 I have a different approach, I run it through cron as I'm only certain hours of the day online: #Recogida automática de correo cada 10 minutos */10 0-8,18-23 * * mon-fri /usr/bin/fetchmail &> /dev/null */10 * * * sat,sun /usr/bin/fetchmail &> /dev/null fetches the mail from dozens of accounts every ten minutes only when I want HTH Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 10, 2003 Report Share Posted March 10, 2003 actually looking at my setup i have it as a normal service in etc/rc.d/init.d/ with etc/fetchmailrc contains the polling options and account to user info that way it is seen as a service in mcc which can be toggled to start at boot Quote Link to comment Share on other sites More sharing options...
Guest SDMF Posted March 10, 2003 Report Share Posted March 10, 2003 OK. Basically, I just want to use fetchmail to pull the mail down to my user account, so that I can read it with something like Pine, that can be used within a terminal session. This way I can look at my POP3 mail from other locations, if I were to SSH into my user account. I'm going to look at fetchmailrc, so I can see what the format is. Quote Link to comment Share on other sites More sharing options...
Guest SDMF Posted March 10, 2003 Report Share Posted March 10, 2003 OK, fetchmail only seems to work when I run it from the command line. I created a script in /etc/rc.d/init.d/ called fetchmail, here are the contents of that script: # Launch fetchmail /usr/local/bin/fetchmail -f /etc/fetchmailrc This is my /etc/fetchmailrc set postmaster "sdmf" set bouncemail set no spambounce set properties "" set daemon 600 poll mail.comcast.net with proto POP3 user 'ej2980' there is 'sdmf' here pass 'hidden' fetchall I looked in /var/spool/mail/, and there is nothing with my username in it. I rebooted after adding the script to launch fetchmail. It's not showing as a running process when I run ps -e | grep fetchmail. The permissions on the script are 0744. Also, johnnyv, there was no entry for it in the MCC after I rebooted it, which may have something to do with the fact that it is not running on boot. Quote Link to comment Share on other sites More sharing options...
Guest SDMF Posted March 11, 2003 Report Share Posted March 11, 2003 I just ran fetchmail --check, and it said that there were 2 messages waiting. But when I run fetchmail in daemon mode, it doesn't fetch anything. Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 11, 2003 Report Share Posted March 11, 2003 here is the contents of /etc/rc.d/init.d/fetchmail #!/bin/sh # # chkconfig: 345 91 35 # description: Starts and stops the fetchmail daemon used to retrive mail # via various protocols (such as POP3 and IMAP4). # # config: /etc/fetchmailrc # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # Check that fetchmailrc exists. [ -s /etc/fetchmailrc ] || exit 0 RETVAL=0 # See how we were called. case "$1" in start) if [ ! -f /var/lock/subsys/fetchmail ]; then echo -n "Starting Fetchmail services: " daemon fetchmail -k -U -d 1200 -f /etc/fetchmailrc RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fetchmail else RETVAL=1 fi ;; stop) if [ -f /var/lock/subsys/fetchmail ]; then # killproc fetchmail action "Shutting Fetchmail services: " /usr/bin/fetchmail --quit rm -f /var/lock/subsys/fetchmail >/dev/null 2>&1 RETVAL=$? else RETVAL=1 fi ;; restart) $0 stop $0 start RETVAL=$? ;; reload) if [ -f /var/lock/subsys/fetchmail ]; then echo -n "Reloading fetchmailrc file: " killproc fetchmail -HUP RETVAL=$? echo else RETVAL=1 fi ;; status) status fetchmail RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1 esac exit $RETVAL This is a mandrake script it was in mandrake 8.1 don't remember how i got it sorry here is my /etc/fetchmailrc set daemon 1200 poll pop.ihug.co.nz proto pop3 user "uroxsys5" pass "**********" is "john" here user "uroxsys" pass "***********" is "shared" here etc.... Quote Link to comment Share on other sites More sharing options...
Guest SDMF Posted March 11, 2003 Report Share Posted March 11, 2003 OK thanks. Where does it deliver mail to, though? Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 11, 2003 Report Share Posted March 11, 2003 have you created a mail file for your user /var/spool/mail/yourusername if not create it! see this howto http://www.mandrakeuser.org/docs/connect/cmail3.html Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 11, 2003 Report Share Posted March 11, 2003 ahhhhh you need to install the fetchmail-daemon rpm which puts the fetchmail script in the /etc/rc.d/init.d and make it availiable as a service edit: damn posting this stuff has pushed me into an "old timer" , seems abit of a let down after awesome :( Quote Link to comment Share on other sites More sharing options...
Guest SDMF Posted March 11, 2003 Report Share Posted March 11, 2003 ok, I just went to that site and created the mail file, and then tried to run the script that you posted. Here is the output: [root@hangar18 etc]# /etc/rc.d/init.d/fetchmail start Starting Fetchmail Services: execvp: No such file or directory [FAILED] Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 11, 2003 Report Share Posted March 11, 2003 did you install the fetchmail-daemon package? Quote Link to comment Share on other sites More sharing options...
Guest SDMF Posted March 11, 2003 Report Share Posted March 11, 2003 no. I'll have to get a newer version, though, than is included on the mandrake CD, since I compiled and installed version 6.2.1 of fetchmail from source. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.