procmail
[Top] [All Lists]

Re: fine tuning...

1996-06-23 14:31:09
Mark Jared Nightingale has this recipe:

| :0
| * ^TOresponder(_at_)aecinfo\(_dot_)com
| * !^FROM_DAEMON
| * !^X-Loop: auto(_at_)aecinfo(_dot_)com
|    | (formail -r -A"Precedence: junk" \
|     -I"From: AEC InfoCenter Inc. <comments(_at_)aecinfo(_dot_)com>" \
|     -I"Subject: Auto Information Request" \
|     -A"X-Loop: responder(_at_)aecinfo(_dot_)com" ; \
|     echo "Your request for addition to AEC InfoCenter has been received.  We
| will notify you once your entry is added.") | $SENDMAIL -t

... and these problems:

| 1. I would like to eliminate the "References" line.  Is this being added by
| procmail?  If so, how do I get rid of it?

It is being added by formail -r (formail -rt will add it as well).  As Stan
Ryckman suggested, just add -IReferences: to the options on formail's
command line.

| 2. In the line
|
|         echo "Your request for addition to AEC InfoCenter has been received.
|         We will notify you once your entry is added."
|
|         how can I add hard returns?

The safest way, which I always suggest for procmailrc recipes but never
would do at an interactive shell prompt, is to use multiple echo commands,
one for each line of the text.  That works regardless of the setting of
$SHELL, regardless of whether $SHELL has echo built in, and regardless of
the peculiarities of whatever implementation of echo ends up being called.

Finally, your recipe doesn't use the body of the incoming letter, so there is
no point in making procmail feed it to the pipe.  It will improve efficiency
to use the `h' flag.  So let's solve all three problems:

  :0h
  * ^TOresponder(_at_)aecinfo\(_dot_)com
  * !^FROM_DAEMON
  * !^X-Loop: auto(_at_)aecinfo(_dot_)com
  | (formail -r -A"Precedence: junk" -IReferences: \
      -I"From: AEC InfoCenter Inc. <comments(_at_)aecinfo(_dot_)com>" \
      -I"Subject: Auto Information Request" \
      -A"X-Loop: responder(_at_)aecinfo(_dot_)com" ; \
      echo "Your request for addition to AEC InfoCenter has been received."; \
      echo "We will notify you once your entry is added.") | $SENDMAIL -t

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