procmail
[Top] [All Lists]

Re: Adding text to a message body

2002-04-13 10:10:04
I've been working on this, and I still can't get it right.  I
pasted the | formail line directly in, and it adds nothing to the
email, neither in the body or the subject line.

This morning I ran about twenty tests trying different
permutations, and I believe that it is the | formail line that is
failing.  (Yes, I changed the * ^From:.* test to chuck(_at_)well(_dot_)com,
not root(_at_)well(_dot_)com for the test.)  I have tried putting the |
formail line all on one line, with and without the backslash, and
no variation that I have thought of is working.

Any ideas?  Thanks again.

On Wed, 10 Apr 2002, David W. Tamkin wrote:

Chuck asked,

| So I thought I
| would add the URL to the body of the message instead.

Seems to me you ought to put it in both places; in the subject for your
convenience and in the body for her needs.

| How would I do that?
|
| :0fhwc
| * ^From:.*[ <]root(_at_)well\(_dot_)com
| * !^Subject:.*[^     ]*
| | formail -i "Subject: http://www.well.com/user/chuck/calendar/";

You don't want to use `f' and `c' together.  Drop the `c'.  Also, any message
with a Subject: header will fail the second condition, so you might as well
use just

 * !^Subject:

Anyhow, to get the URL into the subject and at the top of the body, modify
the action line of the recipe you already have:

 :0fhw
 * ^From:.*[ <]root(_at_)well\(_dot_)com
 * !^Subject:
 | formail -i "Subject: http://www.well.com/user/chuck/calendar"; ; \
   echo "Calendar update at http://www.well.com/user/chuck/calendar"; ; echo

Filtering the head through formail -i will preserve the blank line at the
neck, so the echoed lines will come after the neck and thus be part of the
body.






_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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