procmail
[Top] [All Lists]

complex auto-reply question

1999-09-04 16:09:05
(Or: how I spent my Labor Day Weekend.  :-)

Hi, folks,

I've recently expanded on my already-elaborate auto-reply mechanism as
follows.

Had it set up for two or three years now so that it replies to a given
address not more than once a week.  (Much thanks to David Tamkin and a
couple of others for inestimable help with that.)  There's also been a
no-acks option for those for whom even an at-most weekly tickle is too
much. 

Now I've automated control of acknowledgments with the recipient.  She
or he gets the commands in the ack telling her or him how to turn them
off permanently; turn them back on; or set them to verbose, i.e., acks
to every message instead of weekly.  That part is running fine.

Some people write me at an old address, and I want to advise them that
they should update their address lists.  Instead of duplicating a good
deal of the entire recipe "engine," I managed to incorporate that part
into the general ack.  If they write to that address, they get another
message instead of the default one, reminding them of the new address.
If they had previously requested no acks or weekly acks but they write
me at the old address, they still get an extra, instant reply over the
address issue.  That took me all day to program, but now is done.  :-)

As if the interface between auto-replies, recipient control, and extra
notification for a different address weren't enough, now a colleague's
gone on leave and asked me to handle her mail.  Okay, I prepended into
my .procmailrc a section for her.  Then I enabled a .forward file that
copies her mail to me and leaves the original in her spool (for her to
find on her return in three weeks).  I have a message that goes out to
people who write her telling them that she's on leave and that I'm the
person they can ask questions of while she's gone.  I even ponied up a
recipe for her for laggards who mail *her* to the old domain.  All her
recipes are also seemingly working as desired.

But there is one tiny problem.

If someone writes to both her and me, they receive two acknowledgments
from her and none from me.  If I tell "her" recipe not to invoke if I,
too, am on the To: line, then they get two from me, and none from her.

The schema (pseudo-code) for my .procmailrc is:

        (1)     "Her" section

                (a)     Slide the message into $ORGMAIL and
                        thus bypass my own acks

                (b)     Auto-Ack
                        (i)   Old address?  Send Notice "X"
                        (ii)  New address?  Send Notice "Y"

        (2)     Ack-Control section
                This goes before my own auto-ack by design
                
                (a)     Let folks stop all acks
                (b)     Let them restart the weekly acks
                (c)     Let them set verbose (chronic) acks

                (d)     Confirm success of (a), (b), or (c)

        (3)     Ack Section
                (a)     Look for 'em in the 7-day cache
                        (i)   Not there?  Go to (b)
                        (ii)  There?  Exit

                (b)     Look for special cases
                        (i)   Are they in a no-acks folder?
                              If so, exit
                        (ii)  Are they in a verbose folder?
                              If so, go to (c)

                (c)     If here, we're gonna ack 'em
                        (i)   Was email sent to old domain?
                              If so, set Notice to "L"
                              If not, set Notice to "M"

                        (ii)  If they're not in the verbose
                              dir, add them to today's date
                              in the 7-day cache

                        (iii) Send Notice "L" or "M"

All sections take appropriate prophylactic action with use of X-Loops,
avoiding daemons, lists, etc.

Later I will post the recipes, as I'd like commentary about optimizing
them, too.

Thanks for the help.

-- 
    \     .-.     .-.     .-.     .-.     .-.     .-.     .-.     /
     \-d-/-m-\-a-/-n-\-(_at_)-/-n-\-e-/-t-\-c-/-o-\-m-/-.-\-c-/-o-\-m-/
      '-'     '-'     '-'     '-'     '-'     '-'     '-'     '-'

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