No frikin tables...
Friday 30th 2010f July 2010 01:35:03 PM

Fetchmail For All

After finding that the number of users using my email server was growing i had to find a better way of running fetchmail, a more efficient way.

Usually i would create a cron job for each user this cron would run fetchmail every few minutes.
Being the nature of fetchmail, the daemon only works if you create one config file for everyone, which means adding everyones username and password in one file.
This does not help anyone if they want to edit their own files, becuase this global file is only writable by root.
So cron was the only way to do this.

However, i wrote this script so that i only need one cron, and then i just run this one script when ever i want. Simple.
It also takes the load off the server, since there is only one fetchmail running at any given time.

Set cron up so that it runs this script every 10 minutes:
*/10 * * * * /usr/bin/fetchmailForAll.sh >/dev/null 2>&1

fetchmailForAll.sh View Download