Changing the subject

"@lbutlr" <[email protected]> Sun, 4 Oct 2015 20:45:23 -0600
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
I have some meals that are sent to a custom email address. I have no control over how the emails are formed (they are from a remote device) but the part of the email that is important is in the body, so I tried this to put the information in the more accessible subject:

VERBOSE=ON
:0
* ARG ?? ^^alert^^
{
    TRAP='mv "$LASTFOLDER" "${LASTFOLDER}:2,S"'
    SUBJECT=`formail -I ""`

    :fwh
    | formail -I"Subject: $SUBJECT”

    # Send an SMS alert
    INCLUDERC=$HOME/.sms_procmail
   
    :0
    .alerts/
}
VERBOSE=OFF

ARG = alert TO = [email protected] FROM = [email protected]
procmail: [35385] Sun Oct  4 20:35:40 2015
procmail: Match on "^^alert^^"
procmail: Assigning "TRAP=mv "$LASTFOLDER" "${LASTFOLDER}:2,S""
procmail: Executing "formail,-I,"
procmail: Assigning "SUBJECT=
Alert Text is here, and yes a blank line is part of the alert text"
procmail: Match on "| formail -I"Subject: $SUBJECT""
procmail: Extraneous filter-flag ignored

So, I am doing something wrong in the :fw, I guess. I did look up how to do this, not trusting my memory, but that matches what I found


procmail: Assigning "LASTFOLDER=INCLUDERC=/home/kreme/.sms_procmail"
procmail: Opening "INCLUDERC=/home/kreme/.sms_procmail"
procmail: Error while writing to "INCLUDERC=/home/kreme/.sms_procmail”

That seems odd.

procmail: Assigning "LASTFOLDER=.alerts/new/1444012540.35385_1.mail.covisp.net"
procmail: Notified comsat: "kreme@0:/home/kreme/Maildir//.alerts/new/1444012540.35385_1.mail.covisp.net"
procmail: Assigning "EXITCODE=0"
procmail: Executing "mv,.alerts/new/1444012540.35385_1.mail.covisp.net,.alerts/new/1444012540.35385_1.mail.covisp.net:2,S"


I have other recipes that call the sms_procmail file and send messages properly.

What did I miss?


-- 
"Making music should not be left to the professionals." -  Michelle
Shocked


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail