LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Multiple instances of Fetchmail on RHEL (https://www.linuxquestions.org/questions/linux-enterprise-47/multiple-instances-of-fetchmail-on-rhel-739334/)

Kumud Kumar Singh 07-11-2009 02:33 AM

Multiple instances of Fetchmail on RHEL
 
Hi,
My fetchmail.rc file is configured to download mails for more than 100 users. my fetchmail runs at every 5 minutes and download the mails. Now the problem is it takes around 15 minutes to 20 minutes to complete the one cycle of fetchmail file for downloading all mails for every users.

My question is can i run multiple instances of fetchmail at a time, say 3 instances of fetchmail file containing 30 uses each in one file, so that it downloads mails for all users at a time.

Thanks
Kumud

unSpawn 07-12-2009 06:44 AM

Quote:

Originally Posted by Kumud Kumar Singh (Post 3604044)
can i run multiple instances of fetchmail at a time

Yes you can!

Kumud Kumar Singh 07-13-2009 12:26 AM

Thanks,

Can u pls guide me how to do that.
I am stuck pls. help me

kumud

unSpawn 07-13-2009 06:59 AM

What have you tried? What point are you stuck at?

Kumud Kumar Singh 07-13-2009 12:10 PM

i have around 112 users.
what i have done is, i have created 3 .fetchmailrc file named .fetchmailrc1, .fetchmairc2 and 3, distributing 35 users in each file.
now the problem is fetchmail program runs only .fetchmailrc file.
i have tried running fetchmail for remaining files, but it doesn't fetch mails for the users which are in files .fetchmailrc2 and 3.

Thanks

unSpawn 07-13-2009 12:35 PM

'man fetchmail', "Miscellaneous Options": "-f <pathname> | --fetchmailrc <pathname>: Specify a non-default name for the ~/.fetchmailrc run control file"?

Kumud Kumar Singh 07-14-2009 12:54 AM

I didn't get You.
Can u be more specific ?

Kumud

unSpawn 07-14-2009 05:02 AM

If you issue 'man fetchmail', then in that manual page go to the chapter "Miscellaneous Options". There you will find a switch called "--fetchmailrc". This switch allows you to specify another path/name instead of "~/.fetchmailrc".

Kumud Kumar Singh 07-14-2009 11:28 PM

Thanks
but it doesn't help

Winmax 08-16-2013 02:58 AM

even this is pretty old i will trow my solution in here becouse i dont think this is solved:

Code:

cat /etc/init.d/_fetchmailStart
#!/bin/sh

d_start() {

        echo "start user1 hotmail - POP3"
        export FETCHMAILHOME=/home/user1/.fetchmail/Hotmail
        fetchmail -L /var/log/fetchmailUser1Hotmail.log -f ${FETCHMAILHOME}/fetchmailrc --pidfile ${FETCHMAILHOME}/fetchmail.pid -d 800

        echo "start user1 gmx - IMAP IDLE"
        export FETCHMAILHOME=/home/user1/.fetchmail/GMX
        fetchmail -L /var/log/fetchmailuser1Gmx.log -f ${FETCHMAILHOME}/fetchmailrc --pidfile ${FETCHMAILHOME}/fetchmail.pid -d 60

        echo "start user2 gmx - IMAP IDLE"
        export FETCHMAILHOME=/home/user2/.fetchmail/GMX
        fetchmail -L /var/log/fetchmailuser2Gmx.log -f ${FETCHMAILHOME}/fetchmailrc --pidfile ${FETCHMAILHOME}/fetchmail.pid -d 60

        echo  "started"

}

d_stop() {
        pkill -f "fetchmail.pid"
        echo "killed"
}

case "$1" in
'start')
        d_start
        ;;
'stop')
        d_stop
        ;;
'restart')
        d_stop
        sleep 5
        d_start
        ;;
*)
        echo "Usage: $0 { start | stop | restart}"
        ;;
esac
exit 0

and for GMX IMAP IDLE:

Code:

cat /home/user1/.fetchmail/GMX/fetchmailrc
set postmaster root
set bouncemail

poll imap.gmx.net protocol IMAP user "myUserName@gmx.de" there with password "myPassword" is user1 here keep ssl idle

and hotmail POP:

Code:

cat /home/user2/.fetchmail/Hotmail/fetchmailrc
set postmaster root
set bouncemail

poll pop3.live.com protocol POP3 user "myUserName@hotmail.de" there with pass "myPassword" is user1 here ssl

maybe someone will find this and be happy :)


All times are GMT -5. The time now is 06:23 PM.