procmail
[Top] [All Lists]

Help with automatic replay and forward message to majordomo with new body.

1999-06-01 01:46:20
Dear Procmail Mailing List Listees,

A couple of months ago I heard of procmail for the first time and have
since spent several tens of hours studying up on it.  I think it is
terrific.  Thank you.

I am stuck with a mysterious problem.

What I want to do is, receive a message from people with say "add me"in
the SUJECT.  With this,
1) I wish to automatically reply back to the person automatically to say
I have received the request and that it will be automatically processed
2) Send a message on to majordomo requesting that that person be added
to the mailing list - with "subscribe maillist-ml SENDER" in the BODY of
the mail.

I tried this concoction:

----------

SENDER=`formail -rtzx To:`
SUBMATCH="add me"

:0c:
* !^Sender:.*majordomo*|^Subject:.*Re*
* $ ^Subject:.*$SUBMATCH*
| (formail -r -A"Precedence: junk" \
   -A"X-Loop: hughes(_at_)sanguine(_dot_)net" ; \
   echo "" ; \
   echo "(This is an automatically generated message.)" ; \
   echo "" ; \
   echo "Thank you for requesting subscription to my mailing list." ; \
   echo "" ; \
   echo "") | $SENDMAIL -t

:0fhw:
* !^Sender:.*majordomo*|^Subject:.*Re*
* $ ^Subject:.*$SUBMATCH*
| (formail -r -A"Precedence: junk" \
   -rtI"From: $SENDER" \
   -A"X-Loop: hughes(_at_)sanguine(_dot_)net" ; \
   echo "subscribe tc-ml $SENDER") | $SENDMAIL -oi 
majordomo(_at_)adomain(_dot_)com

----------

(This may look clumsy - suggestions welcome!)  but it works.  Or so it
seemed.

It does work when I send a message from within a my telnet shell with
"add me".  The PROBLEM occurs when I send a request from a standard mail
client (outside shell, via some software or web page).

The problem is that when I go to read my mail,
a)  Only the last message is in my mailbox
b) I get the following message from my email client:
"   The mail server responded:
Unable to process From lines (enveloped), change recognition mode."
If I persist with trying to get email like this the whole systems
crashed (Win 95, Communicator 4.6)

I fix the problem by going in and disabling procmail and deleting the
mail once, then it is okay...

When I look at the procmail.log, the following entry appears, although I
don't know if it is directly related to the problem.

"procmail: Couldn't determine implicit lockfile from " (formail -r
-A"Precedence: junk" \"

I will be very grateful if someone can help me out here.  I have already
spent many many hours trying to figure it out and send you this email as
my last resort... (If your suggestion(s) include throwing my original
recipe out and  writing something better for my purposes (please give me
some hints) then I will me most supportive of that too idea).

Thanking you in advance.

Scott Hughes.

--

<Prev in Thread] Current Thread [Next in Thread>
  • Help with automatic replay and forward message to majordomo with new body., Scott Hughes <=