[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Howto?]invoking fetchmail upon ppp connection...



When I dial up and connect to my isp I would like my linux box to
get my e-mail using fetchmail in a way similar to how exim flushes it
queue upon ppp connection.  Exim manages this feat because run-parts
runs a script telling it to do so in /etc/ppp/ip-up.d/exim. I think
I should write a similar script for fetchmail and place it in /etc/ppp/ip-up.d
So I wrote this script, but it doesn't work.
#!/bin/sh
if [ -x /usr/bin/fetchmail]; then
    /usr/bin/fetchmail --fetchmailrc /home/wcrowshaw/.fetchmailrc
fi

It fails because the .fetchmailrc is not 'owned' by the process that
called fetchmail.  But I'm not sure who really owns this process. Here's
the chain of ownership. Currently,
/etc/ppp/ip-up.d/fetchmail  owned by root
/home/wcrowshaw/.fetchmailrc owned by wcrowshaw
I connect to my isp calling pppd and chat under my user-id, wcrowshaw.
I would like to keep the owner of /home/wcrowshaw/.fetchmail so that I
as the user can still invoke my fetchmail manually.

So what should I do? Rewrite the script? Changes ownership of some file?
Or should I set up fetchmail as a daemon?  What's my next step?  Eventually,
I'm going to try to have cron dial in at specific times and send/fetchmail
my e-mail

--
wcrowshaw


p.s. please cc your responses, for some reason the debian-user-digest is
no longer sent to me, and I haven't subscribe to the list itself yet. 




Reply to: