Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fetchmail daemon, without using cron
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
MooktaKiNG
Guru
Guru


Joined: 11 Nov 2002
Posts: 326
Location: London, UK

PostPosted: Tue Jun 01, 2004 9:33 pm    Post subject: Fetchmail daemon, without using cron Reply with quote

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
View user's profile Send private message
jwj
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 240

PostPosted: Wed Jun 02, 2004 12:18 am    Post subject: Re: Fetchmail daemon, without using cron Reply with quote

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
View user's profile Send private message
MooktaKiNG
Guru
Guru


Joined: 11 Nov 2002
Posts: 326
Location: London, UK

PostPosted: Wed Jun 02, 2004 10:31 am    Post subject: Re: Fetchmail daemon, without using cron Reply with quote

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
View user's profile Send private message
jwj
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 240

PostPosted: Wed Jun 02, 2004 7:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
MooktaKiNG
Guru
Guru


Joined: 11 Nov 2002
Posts: 326
Location: London, UK

PostPosted: Wed Jun 02, 2004 7:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
jwj
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 240

PostPosted: Thu Jun 03, 2004 8:12 am    Post subject: Reply with quote

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
View user's profile Send private message
MooktaKiNG
Guru
Guru


Joined: 11 Nov 2002
Posts: 326
Location: London, UK

PostPosted: Thu Jun 03, 2004 6:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
jwj
Apprentice
Apprentice


Joined: 07 May 2004
Posts: 240

PostPosted: Thu Jun 03, 2004 7:35 pm    Post subject: Reply with quote

Should work, you can use the "is" keyword in the config

Code:

user mailname@domain is localusername
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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