RE: [SLE] Running Fetchmail as a deamon
As you already know, Fetchmail takes the information from the .fetchmailrc file from your home directory. So if you log on as User1 only /home/User1/.fetchmailrc file is used. Now, thinking about it, this makes sense as you can have a number of users log into your Linux box and they can have different email addresses and/or accounts. So, if User1 dials up, he/she doesn't get email for User2. Therefore putting Fetchmail in your /etc/ppp/ip-up script works well. BUT - there is always a but.... Here's my question..... If User1 logs in... and dials the internet, then /etc/ppp/ip-ip is called, starting fetchmail. If User2 logs in - is fetchmail accessing User2/.fetchmailrc to retrieve email for User2 email account? Example: The Linux machine has 1 shared modem to access the internet User1 has an email account: junkmail@email.net He logs into Linux, the modem dials out, ip-up is called and fetchmail is started using User1/.fetchmailrc User2 has an email account: iloveemail@another.isp.com She logs into Linux. She can't dial out - because the modem is being used by User1. But, fetchmail has already been started as a daemon. Is User2's .fetchmailrc file downloading email from iloveemail@another.isp.com (eventhough she never executed the ip-up script? Geesh - I go about things very long winded, don't I? Kev
-----Original Message----- From: Togan Muftuoglu [mailto:toganm@turk.net] Sent: 28 April 2000 11:28 To: suse-linux-e@suse.com Subject: Re: [SLE] Running Fetchmail as a deamon
dids wrote:
does wvdial call ip_up
Yes wdial calls the ip up
Koos Pol wrote
Fetchmail is a user process. It will places itself in the background by default. If you have a permanent network connection you can run it from the commandline with nohup. If you have non-permanent network connection, you can run it automatically from ip-up or manually from the commandline.
Currently I do it manually as fetchmail -d 300
After checking the ip-up script there is a line regarding fetchmail which is commented
#/usr/bin/fetchmail -a -v >> /var/log/fetchmail 2>&1 &
so if I comment out it and put the options -d 300 am I correct to understand it will work as a daemon ? but how does this script will know fetchmail config file it should read and check the appropriate accounts. or is there a way to centarilize the fecthmail config file also
Thanks -- Togan Muftuoglu toganm@turk.net
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
User2 has an email account: iloveemail@another.isp.com She logs into Linux. She can't dial out - because the modem is being used by User1. But, fetchmail has already been started as a daemon. Is User2's .fetchmailrc file downloading email from iloveemail@another.isp.com (eventhough she never executed the ip-up script?
We would need to see the script that called fetchmail as a daemon. You are talking about the .fetchmailrc file in the user's directory which does nothing to start the daemon but is only a Resource Configuration file (hence the "rc" in .fetchmailrc). I have my users set up to start the daemon when they log in by having a "getmail" script in each users ~/bin directory and I place the getmail command in each users .bashrc file. To stop the daemon when they log out, I put "fetchmail -q" in their .bash_logout file to automatically stop the daemon when they log out. Running fetchmail as a daemon when the system is not conected to the internet merely generates error messages and you can specify in the .fetchmailrc file a log file to place the error messages in. If fetchmail is unable to connect to the mail server, it just places an error message in the log file you specify, but tries to poll the server continuously at the interval you specify. Mark -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Kevin Jackson wrote:
As you already know, Fetchmail takes the information from the .fetchmailrc file from your home directory. So if you log on as User1 only /home/User1/.fetchmailrc file is used.
Now, thinking about it, this makes sense as you can have a number of users log into your Linux box and they can have different email addresses and/or accounts. So, if User1 dials up, he/she doesn't get email for User2.
Therefore putting Fetchmail in your /etc/ppp/ip-up script works well.
BUT - there is always a but.... Here's my question.....
If User1 logs in... and dials the internet, then /etc/ppp/ip-ip is called, starting fetchmail. If User2 logs in - is fetchmail accessing User2/.fetchmailrc to retrieve email for User2 email account?
Example: The Linux machine has 1 shared modem to access the internet
User1 has an email account: junkmail@email.net He logs into Linux, the modem dials out, ip-up is called and fetchmail is started using User1/.fetchmailrc
User2 has an email account: iloveemail@another.isp.com She logs into Linux. She can't dial out - because the modem is being used by User1. But, fetchmail has already been started as a daemon. Is User2's .fetchmailrc file downloading email from iloveemail@another.isp.com (eventhough she never executed the ip-up script?
Geesh - I go about things very long winded, don't I?
All that is possible. As usual everything dependes. As there are so many configurations as there are people... I use dial on demand with ISDN. I fetch my different accounts with fetchmail. If you start fetchmail from ip-up, it's run as root. All rights. ;-) fetchmail supports an *alternetivly* (in my case system wide) config file: fetchmail -f /etc/fetchmailrc (rights: 600, root.root). Every time ip-up runs, my mail is fetched. The contence looks like (from mind, see the examples in man fetchmail or man fetchmailrc, buried deep in there) poll pop.foo.bar protocol POP3 no dns username foo password bar to brauki here followed by further line for further user/accounts. To make sure to get mail after all, I use a cron script checking the last time a connection was made. If it's more than a certain time, I do a "ping.foo.bar -c1" to create a connection and with that exchange mail. The disadvantage is that you need (once) all passwords for all accounts (if there are other users), but in that case fetchmail itself would be a questionable option... If you try this, don't forget to uncomment the sendmail -q statement as well to be able to post to the internet... Juergen
Kev
-- =========================================== __ _ Juergen Braukmann juergen.braukmann@gmx.de| -o)/ / (_)__ __ ____ __ Tel: 0201-743648 dk4jb@db0qs.#nrw.deu.eu | /\\ /__/ / _ \/ // /\ \/ / ===========================================_\_v __/_/_//_/\_,_/ /_/\_\ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
On Fri, 28 Apr 2000, Kevin Jackson wrote: kj> As you already know, Fetchmail takes the information from the .fetchmailrc kj> file from your home directory. kj> So if you log on as User1 only /home/User1/.fetchmailrc file is used. kj> kj> Now, thinking about it, this makes sense as you can have a number of users kj> log into your Linux box and they can have different email addresses and/or kj> accounts. So, if User1 dials up, he/she doesn't get email for User2. kj> kj> Therefore putting Fetchmail in your /etc/ppp/ip-up script works well. kj> kj> BUT - there is always a but.... Here's my question..... kj> kj> If User1 logs in... and dials the internet, then /etc/ppp/ip-ip is called, kj> starting fetchmail. kj> If User2 logs in - is fetchmail accessing User2/.fetchmailrc to retrieve kj> email for User2 email account? kj> a seperate fetchmail process will be started for each user, it may be advantages to create a mail user (or simply use root) if not already present, add the necessary lines to its .fetchmailrc file for all users mail boxes and add a line like the following to the /etc/crontab file or to the users crontab file. (all on one line) 0-59/5 * * * * mail test "`ps acx | grep pppd`" != "" && /usr/bin/fetchmail -d 300 | `--- remove if using users crontab if it finds that pppd daemon is running, it will launch fetchmail which will begin checking for messages. A seperate line like the following (all on one line) 0-59/5 * * * * mail test "`ps acx | grep pppd`" = "" && /usr/bin/fetchmail -q which will check to see if pppd is down and kill fetchmail thus preventing problems. Or instead of greping ps, you cna check for which ever file pppd or wvdial or whatever leaves to indeicate that it's running, which will be faster, but I can't remember what it is so I showed the above. The benefit of the above is that no matter which user starts pppd, fetchmail will grab everyones email and place it in the appropriate users mailbox if you have fetchmail configured correctly to do that. kj> Example: kj> The Linux machine has 1 shared modem to access the internet kj> kj> User1 has an email account: junkmail@email.net kj> He logs into Linux, the modem dials out, ip-up is called and fetchmail is kj> started using User1/.fetchmailrc kj> kj> User2 has an email account: iloveemail@another.isp.com kj> She logs into Linux. kj> She can't dial out - because the modem is being used by User1. kj> But, fetchmail has already been started as a daemon. Is User2's kj> .fetchmailrc file downloading email from iloveemail@another.isp.com kj> (eventhough she never executed the ip-up script? kj> Fetchmail won't start for the second user with the above example being used thru ip-up, which is why I opt for the above description I show. kj> Geesh - I go about things very long winded, don't I? kj> kj> Kev kj> kj> > -----Original Message----- kj> > From: Togan Muftuoglu [mailto:toganm@turk.net] kj> > Sent: 28 April 2000 11:28 kj> > To: suse-linux-e@suse.com kj> > Subject: Re: [SLE] Running Fetchmail as a deamon kj> > kj> > kj> > dids wrote: kj> > > kj> > > does wvdial call ip_up kj> > Yes wdial calls the ip up kj> > kj> > kj> > Koos Pol wrote kj> > > > Fetchmail is a user process. It will places itself in the kj> > background by kj> > > > default. If you have a permanent network connection you can run kj> > > > it from the kj> > > > commandline with nohup. kj> > > > If you have non-permanent network connection, you can run kj> > it automatically kj> > > > from ip-up or manually from the commandline. kj> > kj> > Currently I do it manually as fetchmail -d 300 kj> > kj> > kj> > After checking the ip-up script there is a line regarding fetchmail kj> > which is commented kj> > kj> > #/usr/bin/fetchmail -a -v >> /var/log/fetchmail 2>&1 & kj> > kj> > so if I comment out it and put the options -d 300 am I correct to kj> > understand it will work as a daemon ? but how does this kj> > script will know kj> > fetchmail config file it should read and check the kj> > appropriate accounts. kj> > or is there a way to centarilize the fecthmail config file also kj> > kj> > Thanks kj> > -- kj> > Togan Muftuoglu kj> > toganm@turk.net kj> > kj> > -- kj> > To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com kj> > For additional commands send e-mail to kj> > suse-linux-e-help@suse.com kj> > Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/ kj> > kj> kj> -- S.Toms - tomas@primenet.com - www.primenet.com/~tomas SuSE Linux v6.3+ - Kernel 2.2.14 -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (4)
-
Anonymous User
-
juergen.braukmann@ruhr-west.de
-
kevin.jackson@jhallpr.demon.co.uk
-
tomas@primenet.com