procmail
[Top] [All Lists]

formail and multiple tasks

1995-10-07 19:30:39
The subject doesn't say it quite eloquently, but what I'd like to do is 
perform a number of formail type tasks in ONE place in my scripting 
(basically in the first included script, which does a bunch of 
pre-processing, while I have other included scripts which do remote 
commands, files sends, incoming message sorting, vacation, etc).

    Please be gentle - I'm not a UNIX fanatic.  I *am* a programmer
    (which allows me some leniency in handling some of the problems I
    face).

    I'm using procmail for a variety of reasons besides it's basic
    inbox sorting functionality, because my ISP seems to be having more
    and more problems with their FTP service lately.  Additionally,
    some of the commands I use procmail to process are being done
    because my ISP bans use of CRON and AT, yet I want to re-generate
    data files on my shell account (which then provides them from email
    responder and FTP/WWW).


    What I'd like to do is have the following variables set:

    FROM
    TO
    PRECEDENCE (the actual precedence line, if any)
    PLIST and PBULK - LIST and BULK precedence flags
    SUBJECT
    (and a few others)

    Basically then, the remainder of the procmail rules would generally
    make use of these variables in a number of ways (For instance, I
    use procmail to automate data gathering tasks when using a CSLIP
    account - I send commands to myself (the shell account) through
    mail, which are validated by the sender name -- for each such
    function, I don't want to separatley have to "formail" the header).

    I don't want to have to duplicate the parsing efforts throughout
    the script.  It seems so unnatural to do so.

    Am I making sense, or am I out in left field?

    Also, when using variable expansion (variables which themselves
    referred to other variables), I found that there were problems
    going into a second level of expansion.  I am wondering if this
    is something which is my fault (bad code), a UNIX limitation, just
    not possible, or something in procmail.  If it is the latter, was
    it ever resolved or improved upon?  What version?

    (currently using:  v2.92pre9 1993/11/29, which is what my ISP has)

    A couple of additional issues I have, only posted here because I'd
    like to do them in procmail, but I realize they aren't directly
    related.  Pointers would be greatly appreciated:

    I wanted to use 'time' to log the amount of time it takes to
    complete a command (the results of which are send back in a
    Precedence: acknowledgement style message).  Unfortunatley, 'time'
    sends its results out to stderr (diagnostic stream).  How can I get
    processing time to add to my output message?

    I also want to be able to process periodically to create a
    diagnostic message (like an account status -- say disk usage
    (du -a) and mailbox warnings).  Similarily, I'd like to have it
    forward mailboxes when they reach a certain size (or perhaps age),
    to keep my account disk space down to a minimum. It would be neat
    if after a certain command is complete, it could then automatically
    run a prologue type of function (that is, one which isn't just
    another rule, but is specifically rule(s) which are run when normal
    rule processing is complete).  This would allow me to say, have
    some of the commands get processed each time the account receives a
    message (or rather, the NEED to run the command would be
    determined, and if needed, it would be done).

    Thanks for any assist.


-- 
(margin problems, if any, are due to problems in the interface software)

NetCruisers:  ftp://ftp.netcom.com/pub/ps/pse/www/pse_home.html
Home of NCUtil, 3rd-party utility links (including Winsock), and FAQs!

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395
 CompuServe: 72210,521           Internet: PSE(_at_)ix(_dot_)netcom(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>