On Wed, 14 Jun 2000, you wrote:

> 
> I have mine set up as a cron job. Create a .fetchmailrc in your normal user's
> home directory that will fetch mail from all your accounts, then set up a cron
> job to run as that user at a specifed interval. I get lots of mail so my
> interval is 4 minutes. Works great...
> 

I use this script that runs as root, to grab all users mail

    *** start ***
#!/bin/bash
run=0
 
# echo Starting mail download for all users
 
for i in `cat /etc/passwd |
          awk -F : '{ print $1 " " $6}'`; do
    if [ $run -eq 0 ]
    then
      name=$i
      run=1
    else
      home=$i
      run=0
      if [ -r $home/.fetchmailrc ]
      then
         echo getting mail for $name
         su -l -c "/usr/bin/fetchmail -s -t 500" $name
      fi
   fi
done 

 **** end ****

-- 
Alex
(Go easy on me, I'm a COBOL programmer in real life)

Reply via email to