procmail
[Top] [All Lists]

Re: Sendmail reading from address

1997-09-12 16:24:33
Aaron Dougherty asked,

| Howdy, right now I am using the following recipe to process mail requests
| for an FAQ
| 
| :0h
| * ^TOfaq
| | (formail -rA"X-Loop: swsim(_at_)swsim(_dot_)com" ; \
|    cat $HOME/www/faq.html; \
|    echo ""; \
|    cat $HOME/.signature \
| ) | sendmail -oi -t
| 
| The problem with this, is that the -t tag reads To, Cc, Bcc, etc, for the
| recipient of the auto responce. I would like to bounce messages to faq,
| but if I do that, I end up getting the mail instead the the appropriate
| recipient. Any suggestions?

That's not a problem, because formail -r will not generate any Cc: or Bcc:
headers unless you tell formail to add them.  The only line where sendmail -t
will look for recipients will be the To: line.

Three suggestions, though: first, as Ed Sabol said, you'll probably want to
use procmail's preset variable $SENDMAIL rather than the basename "sendmail";
second, you should check to make sure your X-Loop header is not present.
You're adding it to the outgoing response, which is half the job, but adding
it does no good unless you check for it on incoming mail, because its purpose
is to make sure that your autoresponder doesn't answer itself.

Third, add an extra blank line at the foot of $HOME/www/faq.html; then you
can read the two files with one cat command and not have to break them apart
to echo a blank line in between.

  :0h
  * ^TOfaq
  * !^X-Loop: swsim(_at_)swsim\(_dot_)com
  | (formail -rA"X-Loop: swsim(_at_)swsim(_dot_)com" ; \
     cat $HOME/www/faq.html $HOME/.signature) | $SENDMAIL -oi -t

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