Multiple Fetchmail

Longman clug at gasops.co.uk
Tue Oct 21 11:02:12 CEST 2008


* Paul M wrote:
> Longman wrote:
>> If I want to have fetchmail running in daemon mode for multiple users
>> but don't want those users to have shell access to the box what options
> 
> I too found that fetchmail in daemon mode did odd things from time to
> time, so, instead....
> 
> I have one .fetchmailrc in the home directory for user mail, and then
> have a cronjob for that user; I redirect output to
> /var/log/mail/fetchmail.out so I can see if it's failing.
> 
> 
> I think I had to fix up some directory permissions but it's been happy
> for a long time.
> 
> 

I have a fetchmail script like this:

if [ -f /tmp/.xyzfetchmail.lock ] ; then
  echo 'Script is still running'
else
    echo 1 > /tmp/.zyzfetchmail.lock
    fetchmail -s --sslproto ssl123
    rm -f /tmp/.xyz.fetchmail.lock
fi

Then execute it from cron. There is an appropriate .fetchmailrc file.
This is done for each user (using different lock files).  This gives
'fetchmail -d' behaviour.




More information about the CLUG mailing list