Rick Knebel wrote:
> Does anyone know if there is a way to run fetchmail as root and use it to
> get different users mail from an ISP?
> I want to start fetchamil as root and have a different line for each user.
Put a ~/.fetchmailrc in each user's home directory that looks like this:
defaults protocol POP3 mda "/usr/bin/procmail -d linux_username" fetchall
nokeep
poll pop.ispname.com username isp_username password isp_password
The above fetchmailrc config will retrieve the user's remote mail and run it
through procmail for local filtering and delivery.
Then in /etc/ppp/ip-up.local (or any script that runs as root when you
connect):
for mailuser in `ls /home`
do
if [ -f /home/$mailuser/.fetchmailrc ]; then
su -l $mailuser -c fetchmail
fi
done
That bit of code checks each home directory for the existence of a
.fetchmailrc and runs fetchmail as that user if the file exists.
Tony
--
Anthony E. Greene <[EMAIL PROTECTED]>
Homepage & PGP Key <http://www.pobox.com/~agreene/>
Linux: The choice of a GNU Generation.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.