procmail
[Top] [All Lists]

Re: searched, lurked... autoresponse + forward?

1997-06-02 19:28:00
At 09:56 PM 6/2/97 -4000, Todd Andrews wrote:

[snip]
Currently the .forward file has two addresses in it and functions as 
intended, ie. we both get a copy.

Hmm, this will be a problem given that below you want to have the request
message sent to only ONE of these mailboxes.  Perhaps you should do mail
forwarding exclusively from within the procmail script instead?

The site (sig) has a pricing guide which is available on the web, and 
a couple (so far) versions which are proprietary formats (binary) 
which I would like to offer in autoresponse. A recipe  for this is 
welcome, since I have yet to absorb much of the reasoning behind 
recipe code.

Hmm, I had problems with getting some MIME tool working right when using
one provider I had, so I sat down and wrote a simple one that _worked for
me_ (very simple, didn't support all formats, didn't handle
quoted-printable - since the files WERE binary).   Thus I could take the
binaries I wanted to send, and place them in a directory the mailserver
could access and I could update them independantly of the script.  OTOH,
before I did this, I'd had a pre-composed message (essentially a message
I'd saved from my mail client, with the MIME body attached) which I sent
out in reply.  It has been awhile since I was actively using it for
anything, but I just tested it and it seems to still be working (I moved it
to another provider, and have changed a bunch of stuff around it).  It
mimecodes one file, plus outputs a text file for the message body (in my
case, explaining what the heck the attachment is for).

If you want to see the results (with a SMALL, ~3K binary attachment):

To: FileBot(_at_)professional(_dot_)org
Subject:  send NULLSOCK.ZIP


Note that the support stuff for this recipe is ALL OVER THE PLACE in my .rc
files -- I've got a bit in the .procmailrc (to get the filename), and
something else in the recipe handling all the different files I do bot'ing
for.  So asking me for a simple excerpt would prove to be really painful.
If you can wait on it, I can excerpt it sometime next week.  Do so off-list.

Currently, I am attempting to squash bugs in a recipe that will send 
an autoreponse (text) as well as forward me (and only me) a copy of the 
original mail. These I wish for webmaster and postmaster of the 
domain, but the original gets forwarded to both addresses and the 
autoresponse fails. I have heard mention of a logfile which contains 

See above why the original gets forwarded to both addresses.  As for the
autoresponse failure - see below about your .forward file (this would look
to be why procmail isn't working for you), and some suggested tweaks to the
script (none of which should be the reason it isn't currently working for
you).

the secrets of success and failures, but obviously have not enabled 
it as yet since I haven't one...

.procmailrc===================
SHELL=/bin/tcsh

Personal preference, but you just might find it easier to implement some
things if you stick to /bin/sh for your PROCMAIL shell (your telnet/login
would still use whatever shell you prefer, but ProcMail would be using sh).
 I'm not aware of any specific problems with using other shells, but when
dealing with things you don't entirely understand, some times it is best to
stick with the basics.

LOGFILE=/dev/null <--is this the grabage can? Enable how?

enable by doing something like:

LOGFILE=$HOME/Mail/logfile

(or whatever path is appropriate - I like tossing the logfile in with the
mail directory ($MAILDIR), since I periodically move it to another
directory, then archive that off the server, followed by a purge.  The
archive contains ALL of the log activities and mail for any given period.
Personal preference.)

While you're at it, while dealing with debugging, you might want to add:

VERBOSE=on

SENDMAIL=/usr/lib/sendmail

Have you confirmed that sendmail is in fact there?  try using TYPE sendmail
to find in in your path.  Speaking of path, are you setting one at all in
your .procmailrc?  Could prove useful.

:0 h c

this looks ok.

* ^TO_webmaster(_at_)eccl(_dot_)ca
*!^FROM_DAEMON
*!^X-Loop:.*

Change your X-Loop to something more meaningful.  Like to the same as what
you're setting it to down below.  Or are you just looking for ANY message
that has an X-loop in it?

Why not key the autoreply off of some COMMAND in the subject?  Like:
* ^Subject:.*send infofile

(and two recipes - one to look for the command to send the one format, and
the other to handle the second format).

Without it, anyone sending mail to you at your webmaster address will get
your autobot reply - which, for a "generic" contact address such as
webmaster (or postmaster which you separatley refer to), might not be a
GoodThing(tm).

Personal preference: if you're going to autoreply from Webmaster or
Postmaster, send a brief text message indicating "your message has been
recieved.  For self-help information, please send an email to: xxxx with
xxxx as the subject for a help file." as appropriate.  Then on simple
inquiries (namely, those not asking for your binary attachment), people
don't get bonked with the file, yet info on how to get it would still be
available.  If this is for a mailto: link on a webpage, I'd instead just
have a mailto specifically for the file request (as long as you're virtual,
you can have different TO: addresses for the different formats even).

| (formail -r -t -A "Precedence:junk"\

Mind putting a space between Precedence: and junk ?  I don't know that the
way you have it, it'll break anything (certainly not in formail, but the
header as received by the mail client wouldn't be right), but since there's
usually spaces in there...

-I"From: ECCL Webmaster <webmaster(_at_)eccl(_dot_)ca>"\
-I"Subject: Thank you for your mail"\

Again, it shouldn't matter, but I'm one of THOSE people -- put spaces
between the -I (and below, -A) and the string declaration.  Consistency and
all...

Nontechnical: it wouldn't hurt to use a subject line more descriptive of
the fact you're sending them some attached file in response.  You know "The
information file you requested: foobar.zip" or something.

-A"X-Loop: webmaster(_at_)eccl(_dot_)ca";\
cat $HOME/webmaster.txt)|$SENDMAIL -t

#$HOME is where? Virtual root, or public_html?

Should be the root of the user account which procmail is being run for.
From the message below, this appears to probably be '/disk15/usr/eccl/'

 553 /disk15/usr/eccl/.forward: line 1: "|IFS=' '&&exec
/opt/gnu/bin/procmail -f-||exit 75 #eccl... Unbalanced '"' 550
/disk15/usr/eccl/.forward: line 1: "|IFS=' '&&exec /opt/gnu/bin/procmail
-f-||exit 75 #eccl... Address <webmaster(_at_)eccl(_dot_)ca> is unsafe for 
mailing
to programs <-- have I broken an unwritten rule here???

Looks like your .forward file has a typo in it.  Like a missing _trailing_
doublequote.  Ooops.  The last error there seems to be a message from the
mailer saying that because of this typo, it doesn't look like you should be
mailing to this address.  I'd concur with that.

---

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395

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