aboutsummaryrefslogtreecommitdiffstats
path: root/trio/html/modules.html
blob: 49885970a17d907b114d2b488648b3b4898beef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
 <title>TRIO</title>
 <link href="trio.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.2.12 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; </center>
<hr><h1>TRIO Modules</h1>Here is a list of all modules:<ul>
<li><a class="el" href="group___printf.html">Formatted Printing Functions.</a>
<li><a class="el" href="group___user_defined.html">User-defined Formatted Printing Functions.</a>
<li><a class="el" href="group___scanf.html">Formatted Scanning Functions.</a>
<li><a class="el" href="group___special_quantities.html">Special Quantifies.</a>
<li><a class="el" href="group___static_strings.html">Static String Functions.</a>
<li><a class="el" href="group___dynamic_strings.html">Dynamic String Functions.</a>
</ul>
<HR>
<center class="copyright">Copyright (C) 2001 Bj&oslash;rn Reese and Daniel Stenberg.</center>
</body>
</html>
ILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # # Please send bug reports, suggestions, and flames to: dmuth@ot.com # # This shell script is used as a "frontend" for running fetchmail. It will # start up fetchmail and save the session to disk, generate statistics # of the e-mail that you downloaded, and tell you how many messages # you have in various folders. A copy of these results are also # e-mailed to you. # # An rc file is also supported. If the file $HOME/.runfetchmailrc # exists, it will be sourced. This way, you can place runfetchmail # into /usr/local/bin, and individual users can have their own settings. # # Pre-requisites: You must have procmail, or at least `mailstat', a # utility that comes with procmail, running on your system. You must # also have `timer', a shell script written by me, if you would like the # total time that the transfer took to be displayed. # # Syntax: runfetchmail [-every] # -every Downloads all messages from the mailserver, regardless of # their size and whether they have been previously downloaded. # # Changes in version 1.1: The argument "-every" is supported. I removed the # $EXIT_CODE variable since I had problems assigning the exit code from # fetchmail to it. # Command line to run fetchmail FETCHMAIL="/usr/local/bin/fetchmail" # Your procmail logfile LOG=$HOME/procmail/log # Do we want to use timer? Set to 0 to disable. TIMER=1 # Our path to sendmail with parameters SENDMAIL="/usr/bin/sendmail -oi -t" # Who am I? SELF="dmuth@ot.com" # The folders that I should check for the number of messages FOLDERS="$MAIL $HOME/mail/lists" # Number of seconds to "sleep" for while procmail finishes up, increase # this if you have a really slow system LATENT=10 # Do we want to use mailstat? Set to 0 to disable MAILSTAT=1 # Do we want to e-mail the output to myself? Set to 0 to disable. # I strongly suggest doing this so that if you lose your connection to # the net part of the way through a download, you can see how much # progess was made E_MAIL=1 ### # End of user defined variables ### # The temp file, and ensure my privacy! TMP=/tmp/fetchmail.sh.$$ # The version of this program VERSION="Runfetchmail 1.1" # Trap errors trap "rm -f $TMP; echo ""Exiting at user request"" ; \ test $TIMER -eq 1 &amp;&amp; timer -stop -id $$ &gt;/dev/null; exit 1" \ 2 3 4 15 # Source the user's rc file if it exists test -e $HOME/.runfetchmailrc &amp;&amp; . $HOME/.runfetchmailrc num_mail() { # This procedure tells me how many messages there are in each folder for D in $* do if test -f $D then echo "There are `frm $D |wc -l` messages in $D" fi done } getmail() { # Fetch the mail! test $TIMER -eq 1 &amp;&amp; timer -start -id $$ -quiet $FETCHMAIL $@ # pause for a short while echo "Now sleeping for $LATENT seconds..." echo -n "Zzz...Zzz...Zzz..." sleep $LATENT echo "wakeup time! &lt;yawn&gt;" } stats() { # Prepare the statistics # Ensure we have a log file test ! -e $LOG &amp;&amp; touch $LOG echo -e "\n\t\t\t $VERSION Statistics" test $MAILSTAT -eq 1 &amp;&amp; mailstat -k &lt;$LOG echo "" num_mail $FOLDERS test $TIMER -eq 1 &amp;&amp; echo -e "\n`timer -stop -id $$ -quiet` have elapsed." } prepmail() { # Let's prepare our e-mail cat &lt;&lt;EOF &gt;$TMP From: $LOGNAME ($VERSION) To: $LOGNAME X-Loop: $SELF Subject: Mail stats from `date "+%D %X"` EOF } ### Main Program # Let's have some initial cleanup rm -f $LOG clear # Create and secure the temporary file test $E_MAIL -eq 1 &amp;&amp; { cat /dev/null &gt;$TMP; chmod 600 $TMP } # Prepare the e-mail before the logs are added to it test $E_MAIL -eq 1 &amp;&amp; prepmail # See if we are downloading every message or not if test "$1" = "-every" then FETCHMAIL="$FETCHMAIL -a -l 0" shift fi # Fetch the mail and have the output written to stdout and (optionally) $TMP test $E_MAIL -eq 1 &amp;&amp; getmail $@ 2&gt;&amp;1 |tee -a $TMP || getmail $@ clear # Do the same thing with the statistics test $E_MAIL -eq 1 &amp;&amp; stats $@ 2&gt;&amp;1 |tee -a $TMP || stats $@ # Now send $TMP to myself and clean up the mess test $E_MAIL -eq 1 &amp;&amp; { cat $TMP |$SENDMAIL; rm -f $TMP } # cleanup the log file for next time rm -f $LOG # The End