LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware and fetchmail (https://www.linuxquestions.org/questions/slackware-14/slackware-and-fetchmail-297169/)

mikz 03-03-2005 09:51 AM

Slackware and fetchmail
 
Does anybody know of a "rc.fetchmail" for Slackware which I can use to start fetchmail with at boottime.?

I've tried the 'fetchmail -d 60', but it complains of "no mailservers have been specified".

dennisk 03-03-2005 01:54 PM

Slackware uses getmail not fetchmail by default. Why? You can read that here .

I believe fetchmail is available in the extras or pasture directories if you insist.

Dennisk

oxleyk 04-12-2005 09:26 AM

I've read the programmer's crowing about why getmail is better than fetchmail and it seems to be mostly a rather snide attempt at salesmanship. Andrew Carnegie ruined a competing steel manufacturer by simply stating that the competitor's rails lacked "homogeneity". No one knew what that meant but the railroad companies didn't want to use those rails, or question Carnegie's judgement.

When I can find a solution, that works, to stop the strict deprecation warnings I get with getmail, I might use it.

Can anyone else answer the original question? I get this error also.

Kent

haze 04-12-2005 09:41 AM

I found this on the net, and it works like a dream.

rc.fetchmail stop
rc.fetchmail start

the '-d 60'' checks every minute.

Code:

#! /bin/sh
# Copyright (c) 1996 SuSE GmbH Nuernberg, Germany.  All rights reserved.
#
# Author: Klaus Franken
#
# /sbin/init.d/fetchmail
#
# please edit /root/.fetchmailrc
return=$rc_done

case "$1" in
    start)
        echo -n "Starting fetchmail-daemon"
        /usr/bin/fetchmail -d 60 -a -f /root/.fetchmailrc -L /var/log/fetchmail 2>&1 || return=$rc_failed
        echo -e "$return"
        ;;
    stop)
        echo -n "Shutting down fetchmail-daemon"
        /usr/bin/fetchmail -quit || return=$rc_failed
        echo -e "$return"
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac

exit 0


oxleyk 04-12-2005 09:52 AM

Thanks! Does anything need to be changed for Slackware? Does the "rc.fetchmail start" go in rc.local?

Kent

haze 04-12-2005 12:49 PM

Fits into Slackware like a glove.

1. chmod 755 /etc/rc.d/rc.fetchmail
2. place in /etc/rc.d/rc.local
3. Reboot

oxleyk 04-12-2005 01:03 PM

Then do I have to move my .fetchmailrc file to /root/ or can I change the path in the script? Currently I'm only checking one mail account (mine) for one user (me) so the rc file is in my home directory, but with a multi-user system I suppose it should be in /root.

I discovered that the error message comes from fetchmail not knowing where to find the .fetchmailrc file. I haven't tried it but I'm guessing that an alternative to the above-mentioned script would be to put a line in rc.local something like this: fetchmail -f /path/to/.fetchmailrc

Thanks again.

Kent

Franklin 04-12-2005 08:28 PM

I don't know if this is at all useful to you, but I use fetchmail in conjunction with gkrellm to check my pop3 acount and provide email notification. I opt to leave the mail on the server and retrieve it using kmail or evolution, but I could just as easily download it to /var/mail/steve. I used Fetchmailconf to set up fetchmail, which is also provided with slackware.

Sorry if I'm pointing out the obvious - wouldn't be the first time.

haze 04-16-2005 05:00 AM

Yes, move the .fetchmailrc file to /root/ .


All times are GMT -5. The time now is 02:50 PM.