Re: Changing the subject
[email protected] (Dale R. Worley) Mon, 05 Oct 2015 21:05:27 -0400
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
"@lbutlr" <[email protected]> writes: > On Sun Oct 04 2015 20:45:23 @lbutlr <@lbutlr> said:OK, I fixed various typos and error and have something that is ALMOST working: > > :0 > * ARG ?? ^^alert^^ > { > VERBOSE=ON > # SUBJECT=`formail -zx "Subject:"` > TRAP='mv "$LASTFOLDER" "${LASTFOLDER}:2,S"' > > ;0cfwh > BODYSUB=`formail -I ""` > > :0 hfw > |formail -I"Subject: $BODYSUB" > > :0 > .alerts/ > } > > The trouble now is that BODYSUB begins with a <CR> so the subject shows up as > > Subject: > The body txt is here. I'm not familiar with formail. I assume that this usage of it removes all of the headers, in which case, the remainder would start with an empty line. I assume you mean "BODYSUB begins with a <LF>...". Why not just delete the empty line by using: BODYSUB=`formail -I "" | tail -n +2` Of course, this turns the first line of the body into the subject line. There will also be trouble if the body contains more than one line. It would be easier to help you if you explained exactly the transformation you want to accomplish, and also gave an example. Dale