You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jacob Coby <jc...@listingbook.com> on 2002/09/07 00:05:51 UTC

[users@httpd] Procmail and Postfix (OT)

I'm trying to setup a procmail script to auto respond to anything sent to a
particular account with a "this account is for messaging from us to you
only; nobody checks this account.  please send another email to whoever you
thought you were sending one to".

Using `procmail ./.procmailrc < ./test-mail.txt` where test-mail.txt is a
testing email works fine.  However, when I send a message to
test_email_reply, I get nothing back, and it's delivered successfully.

This is the script I have so far:

-- .procmailrc start --
SUBJECT=`formail -xSubject:`
SENDER=`formail -xFrom:`
RECIPIENT=`formail -xTo:`
:0 cb
| formail -r -k -b -I"To:$RECIPIENT" \
  -I"From: $SENDER" \
  -I"Subject: $SUBJECT"  > mail.body$LOCKEXT
:0 c
#* !^FROM_DAEMON
* !^X-Loop: test_email_reply@mydomain.com
| (formail -r  \
  -A"X-Loop: test_email_reply@mydomain.com" \
  -I"Subject: MESSAGE UNDELIVERABLE: $SUBJECT" ; \
  cat response ; \
  echo "-- original message --" ; \
  cat "mail.body$LOCKEXT"  \
  ) | $SENDMAIL -t | rm -f mail.body$LOCKEXT
-- end --

And a log snippet of a delivered message:

-- begin --
Sep  6 17:54:35 thecomputer postfix/local[23913]: 84337502A7:
to=<te...@mydomain.com>, relay=local, delay=0, status=sent
("|/usr/bin/procmail")
-- end --

Permissions for the /home/test_email_reply dir is 755, and all files in
/home/test_email_replay are 644.  Using another user's account, I can get
the message manually sent, without the response body.

Yes, this is way OT, and I should probably subscribe to two more mailing
lists, but I get way too much email as it is. :)

Please respond off list.

yes, I know this is probably not the best procmail script you've ever seen
being my first experience with it.

-Jacob
http://www.listingbook.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org