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

Re: How the average guy gets mail...



Hi Cameron,

I second everything said so far on this thread, however, on a multi-user
system I would implement fetchmail-on-dialup in a slightly different
way.

Create an /etc/fetchmail-users file with all the users that want to run
fetchmail

---8< snip >8---
# users that get mail by fetchmail
user_foo
user_bar
---8< snip >8---

Then create a ip-up script:

#!/bin/bash

if [ -f /etc/fetchmail-users ]; then
	for user in `grep -v '^#' /etc/fetchmail-users`; do 
		if [ -f ~$user/.fetchmailrc ];  then
			su -c "fetchmail -d 900" $user
		fi
	done
fi


And as ip-down:

#!/bin/bash

if [ -f /etc/fetchmail-users ]; then
	for user in `grep -v '^#' /etch/fetchmail-users`; do
		su -c "fetchmail --quit" $user
	done
fi


Of course this is complete overkill with a single user setup and in
fact, there is a German proverb which I find quite appropriate: "Mit
Kanonen auf Spatzen schießen".  Meaning: "To shoot with cannons onto
sparrows."

Anyway, you better check the code before running it, as it is off the
top of my head and I'm in a condition right now, where I wouldn't want
to drive a car, for example.

Cheers,
Vikto^
-- 
Viktor Rosenfeld
WWW: http://www.informatik.hu-berlin.de/~rosenfel/



Reply to: