procmail
[Top] [All Lists]

Re: Sorting with Plus Addressing

1998-05-18 02:55:49
|Sat 98-05-16 "M.A. Powe" <looie(_at_)teleport(_dot_)com> list.procmail
| I can't seem to get this to work.
| 
| I can send myself a test mail to looie+list(_at_)teleport(_dot_)com & it comes
| through fine.
| 
| Then I put this in .procmailrc:  this is from Jari's pm-tips & also is
| shown in one of the filtering faqs:
| 
| ARG = $1
| :0:
| * ARG ?? list
| test/.
| 
| But it doesn't get sorted.  It just goes into the inbox.  The plus
| address still shows in the To: line.

I leave the sendmail stuff to David and phil :-)

I handle the plus addresses like this in my .procmailrc.  I don't care
how do I get the plus information: a) RFC comment trick b) sendmail plus 
c) procmail command -a on shell prompt while I test scripts.

Eh, if this all above looks complicated; Never mind. Use the plus as 
you want :-)

jari


Explanation:

o   Define subroutines
o   Define login address match TOME
o   See if $1 is available (procmail option -a  -m)
o   If no ARG and message is addressed TOME, then see if RFC comment
    plus address is present

        To: jari(_dot_)aalto(_at_)poboxes(_dot_)com (Jari Aalto+list.procmail)
                                               ^^^^^^^^^^^^^ 
    Variable PLUS will contain "list.procmail" (Returned value
    from rc_addr subroutine)

o   If we got PLUS, one way or another, then send message to
    biff log and check what to do with the plus information

    The filnal test check that there really is spool file. If there is
    not, then the PLUS address wasn't right. I only want to deliver to 
    spool flies that already exist. So the echo commands inkform me

        1. PLUS tag found from message
        2. PLUS spool file existed and message was delivered 
           according to PLUS

    I store the plus addresses files to Emacs Ding Spool directory,
    which is a nnml backend that understands procmail delivered files.
    
        Whatever PLUS I receive:

        list.*  hierarchy is for mailing lists
        mail.*  hierarchy is for personal mail

        ~/Mail/spool/[PLUS].spool --> ~/Mail/spool/list.procmail.spool
        ~/Mail/spool/[PLUS].spool --> ~/Mail/spool/mail.emacs.spool
        ...


    RC_ADDR = $PMSRC/pm-jaaddr.rc   # Explode address components
    RC_FROM = $PMSRC/pm-jafrom.rc   # Get 'From' without shell calls.

    TOME    = "(ssjaaa|jaalto|jari)"

    ...
    ...    

    ARG     = $1

    :0
    *  ARG      ?? ^^^^
    *  TOME     ?? (.)
    *$ ^TO()\/.*$TOME.*
    {
        INPUT       = $MATCH
        INCLUDERC   = $RC_ADDR              # explode address
        PLUS        = $COMMENT_PLUS         # Read PLUS address
    }

    :0
    *   PLUS ?? [a-z]
    * ? echo "    PLUS $PLUS" >> $HIN
    {
        #   do something with plus

        file = "$SPOOL/$PLUS.spool"

        :0 :
        * ? test -e $file
        * ? echo "    PLUS $file" >> $HIN
        $file

    }

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