You are not logged in.

#1 2012-04-14 20:12:25

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

rss2email with procmail question [SOLVED]

Hey,

I'm using rss2email (rss2email-xdg-git) and I'm trying to mail the results to my local user on the server and have it get marked as read and put into the News directory in my mailbox.  rss2email works perfectly and because I have postfix configured to deliver mail locally, I set my TO address as firecat53@localhost, which also works perfectly. The only issue is trying to get procmail to mark the mails as read after they get moved to the News/ folder. I've tried several variations (one included below) found online, but none seem to work so far. Any ideas?

PATH=/bin:/usr/bin:/usr/local/bin
SHELL=/bin/sh
MAILDIR=$HOME/mail/firecat4153/
DEFAULT=$HOME/mail/firecat4153/INBOX/
LOGFILE=$HOME/.procmaillog
VERBOSE=on

:0
* ^User-Agent: rss2email
{
    foldername=News
    # First deliver to maildir so LASTFOLDER gets set
    :0c
    .$foldername/

    # Mark as read
    :0
    * LASTFOLDER ?? /\/[^/]+$
    { tail=$MATCH }
    
    TRAP="mv $LASTFOLDER .$foldername/cur/$tail:2,S"

    HOST
}

:0:
${DEFAULT}

Anyone have this working? Or a different way to accomplish the same thing?

Thanks,
Scott

Last edited by firecat53 (2012-04-15 17:42:22)

Offline

#2 2012-04-15 17:42:02

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: rss2email with procmail question [SOLVED]

Well, I finally found the recipe that worked...these procmail regexes are rather mind-bending.

Scott

PATH=/bin:/usr/bin:/usr/local/bin
SHELL=/bin/sh
MAILDIR=$HOME/mail/firecat4153/
DEFAULT=$HOME/mail/firecat4153/INBOX/
LOGFILE=$HOME/.procmaillog
VERBOSE=off

:0
* ^User-Agent: rss2email
{
    foldername=News
    # Save news items to the News/ folder
    :0c
    $foldername/

    # Mark as read (note the ':' separator in the sed command...easier to read in this case than using '\/')
    :0 ai
    * LASTFOLDER ?? ()\/[^/]+^^
    | mv `echo $LASTFOLDER | sed -e 's:/tmp/:/new/:g'` "$foldername/cur/$MATCH:2,S"
}

:0:
${DEFAULT}

Last edited by firecat53 (2012-04-16 16:40:23)

Offline

Board footer

Powered by FluxBB