View previous topic :: View next topic |
Author |
Message |
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Tue Jun 01, 2004 9:33 pm Post subject: Fetchmail daemon, without using cron |
|
|
I have an email server. I use hotwayed and use fetchmail to download all the emails to my server. I also have few other emails thats also gets downloaded using fetchmail.
Usually i'm the only person on my server who uses the email.
now my users are growing in numbers. I need a better way of starting fetchmail for each users without having to run cron for each user.
I know there's a daemon for fetchmail, but whenever i try and run it complains about there not being /etc/fetchmailrc, but all my configuration is done individually and would like to avoid having to put everything inside one file.
I want the users to be able to edit the own files themselves. Anyway, i just need a daemon like function that uses each useres .fetchmailrc and does exactly the same thing as a cron would do.
Does this exist?
Does the fetchmail daemon do this already? _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
jwj Apprentice
Joined: 07 May 2004 Posts: 240
|
Posted: Wed Jun 02, 2004 12:18 am Post subject: Re: Fetchmail daemon, without using cron |
|
|
MooktaKiNG wrote: | I know there's a daemon for fetchmail, but whenever i try and run it complains about there not being /etc/fetchmailrc, but all my configuration is done individually and would like to avoid having to put everything inside one file.
|
-f <pathname> | --fetchmailrc <pathname>
Specify a non-default name for the ~/.fetchmailrc run control
file. |
|
Back to top |
|
|
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Wed Jun 02, 2004 10:31 am Post subject: Re: Fetchmail daemon, without using cron |
|
|
jwj wrote: | MooktaKiNG wrote: | I know there's a daemon for fetchmail, but whenever i try and run it complains about there not being /etc/fetchmailrc, but all my configuration is done individually and would like to avoid having to put everything inside one file.
|
-f <pathname> | --fetchmailrc <pathname>
Specify a non-default name for the ~/.fetchmailrc run control
file. |
I don't understand what you are saying. _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
jwj Apprentice
Joined: 07 May 2004 Posts: 240
|
Posted: Wed Jun 02, 2004 7:11 pm Post subject: |
|
|
Your user can start fetchmail with the -f option and point it to the users fetchmailrc.
E.g.
Code: | fetchmail -d 500 -f ~/.myfetchmailrc |
Cheers,
Jan |
|
Back to top |
|
|
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Wed Jun 02, 2004 7:22 pm Post subject: |
|
|
jwj wrote: | Your user can start fetchmail with the -f option and point it to the users fetchmailrc.
E.g.
Code: | fetchmail -d 500 -f ~/.myfetchmailrc |
Cheers,
Jan |
Isn't that the same as cron? This is polling.
Each user has a seperate process of fetchmail.
There must be an easier way to do this. _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
jwj Apprentice
Joined: 07 May 2004 Posts: 240
|
Posted: Thu Jun 03, 2004 8:12 am Post subject: |
|
|
If you only want to have 1 fetchmail running you could use your cron-solution and use your users configfile.
Something like
Code: |
#Pseudo sh Code
for myusers in $(ls -1 /home/); do
if test -f /home/$myusers/.fetchmailrc
then
fetchmail -f /home/$myusers/.fetchmailrc
fi
done
|
The cron job has to be run as somebody who has read access to the users .fetchmailrc. |
|
Back to top |
|
|
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Thu Jun 03, 2004 6:09 pm Post subject: |
|
|
jwj wrote: | If you only want to have 1 fetchmail running you could use your cron-solution and use your users configfile.
Something like
Code: |
#Pseudo sh Code
for myusers in $(ls -1 /home/); do
if test -f /home/$myusers/.fetchmailrc
then
fetchmail -f /home/$myusers/.fetchmailrc
fi
done
|
The cron job has to be run as somebody who has read access to the users .fetchmailrc. |
I thought about a solution like this, but i was waiting to see what other had to say
Only thing is if you .fetchmailrc is like this:
Quote: |
poll pop.my.com
proto pop3
user "username@my.com"
pass "password"
fetchall
|
and still use the script above, will it work?
Will it download the email and save it to the correct local user? _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
jwj Apprentice
Joined: 07 May 2004 Posts: 240
|
Posted: Thu Jun 03, 2004 7:35 pm Post subject: |
|
|
Should work, you can use the "is" keyword in the config
Code: |
user mailname@domain is localusername
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|