Server IP : 85.214.239.14 / Your IP : 18.222.118.236 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/3/root/proc/self/root/usr/share/doc/fetchmail/contrib/ |
Upload File : |
#!/bin/sh # # maildaemon, fetchmail driver intended to be invoked hourly by cron. # # Script by Larry Fahnoe <fahnoe@kegworks.mn.org>, who writes: # # This is intended to support a standalone system (NeXTSTEP in this case) # which makes manual, on-demand PPP connections to the outside world. The # script is run as the target user from cron on an hourly basis. If it # finds a PPP link is up (it sees routes on a PPP interface), fetchmail is # invoked. If the link is not up, and the hour is in the list of hours that # connections should be made, the link is brought up and fetchmail is # invoked. The program or script used to bring up the link should return an # exit status which reflects whether the link actually came up. # # I wrote this because I wanted to be able to have control over the amount # of time spent connected to an ISP and yet still be able to poll for mail # at intervals that made sense to me. One limitation of this script is that # it does not take into account that an existing PPP link might be going to # a different ISP or network. # # You'll have to configure these USER=fahnoe # your name HOME=/Users/fahnoe # home directory (for the logfile) FORCEHOURS="05 09 13 17" # when to bring the link up if it's not already SERVER=mailserver.isp.com # mailserver host name # Link initialization and wrapup scripts (you may have to configure these) PPPUP="/usr/local/bin/pppup $SERVER" PPPDOWN=/usr/local/bin/pppdown PATH=/usr/local/bin:/bin:/usr/ucb:/usr/bin:/usr/etc export PATH USER HOME LOG=$HOME/log/maildaemon.log # get the mail, depends on $HOME/.fetchmailrc and $USER FETCHMAIL( ) { ( echo "`date` $SERVER" fetchmail $SERVER if [ $? -gt 1 ] then echo "`date` $SERVER (evil things happened in fetchmail)" fi ) >> $LOG 2>&1 } # if the link is already up, check for mail. # if the hour is in FORCEHOURS, force the link up and check for mail. (netstat -rn | awk '{ print $6 }' | grep ppp[0-9] > /dev/null) if [ $? -eq 0 ] then FETCHMAIL else hour=`date | sed -e 's/:/ /g' | awk '{ print $4 }'` for x in $FORCEHOURS do if [ $hour = $x ] then $PPPUP if [ $? -eq 0 ] then FETCHMAIL $PPPDOWN else echo "`date` $SERVER (link establishment failure)" >> $LOG exit 1 fi fi done fi exit