procmail
[Top] [All Lists]

Re: newbie questions about a very simle mailing list.

2004-01-16 12:46:21
At 01:38 2004-01-16 -0600, Bo Peng wrote:
Basically, every email that send to me with subject that
contains [SOMETHING] will be forwarded to a bunch of people. I am very
new to procmail and it took me a long while to figure out the following.

It's been discussed on this very list in the past - have you tried searching the archives?

:0hw: ${HOME}/.proc.lock1
* Subject:.*\[SOMETHING\]
{
  :0fhw: ${HOME}/.proc.lock2
  |  ${FORMAIL} -I "To: I(_at_)some(_dot_)place" -I "Reply-To: 
I(_at_)some(_dot_)place"\
  -I "Return-Path: I(_at_)some(_dot_)place"

  :0c: ${HOME}/.proc.lock3
  ! email1,email2,email3
}

This kind of works but I have the following questions:
1. I get warnings such as
  procmail: Extraneous filter-flag ignored
  procmail: Extraneous locallockfile ignored
  procmail: Extraneous deliver-head flag ignored
  What did I do wrong? As a matter of fact, I do not know when do I need
  to specify a lock file so I used three. :-(

Set VERBOSE=ON, and examine the logfile - you'll get a very good idea where the warnings are happening.

Lose "hw:" (and the explicit lockfile name) from the outer recipe, and ":" from both of the inner reciped - a filter doesn't need a lockfile (it isn't writing to a file), and a forward copy (to addresses) doesn't need a lockfile either.

As per the manpage, you specify a lockfile flag when you're DELIVERING TO A FILE. Under certain other conditions (say, when delivering to a script which you know writes to a file which itself doesn't lock), you might specify an explicit lockfile - that's not called for here though.

2. I would like to use
  ${FORMAIL} -I "To: My Name <I(_at_)some(_dot_)place>" ...
  but formail fails. How can I use <> in the To string?

Shell escapes?  \<  \>

3. Do I need to specify both "Reply-To:" and "Return-Path:"? It seems
   that some email clients use Relply-To:, some use Return-Path, some
   ignore them all and use To:

Return-Path is used for delivery of DSNs (bounces, as in "returned" mail). Reply-To: should properly override the _From:_ of a message. If you have some mail client that _replies_ (vs. _reply_all_) to the To: field, you have a seriously broken mail client.

4. I tried to follow some online examples .... but

  |  (${FORMAIL} -I "To: I(_at_)some(_dot_)place" -I "Reply-To: 
I(_at_)some(_dot_)place"\
  -I "Return-Path: I(_at_)some(_dot_)place") | sendmail -oi email1,email2,email3

  does not work for me.

"does not work" isn't adequate. That's not a really good example in any case - one should avoid invoking "sendmail", but instead use ${SENDMAIL} -- for several reasons - one is that sendmail may not be in your path, another is that the MTA local invocation _might_ not actually be named sendmail (though most of the alternate MTAs use a shell to translate from common sendmail invocations), and lastly, when you need to debug, it's handy if you can redefine SENDMAIL at the top of your .rc and instantly disable actual sending of your mail.

You should take a look at my sandbox comments (see my .sig). They'll be rather helpful when debugging your script, AND it keeps you from hammering your friends with a bunch of junk while you sort things out.


Some observations:

Something I note is that you're not setting an X-Loop header, nor are you checking for one (no surprise since you're not setting one), which would add a level of protection against looped mails.

Instead of relying upon the subject, why don't you see if you have PLUSSED addressing (I've sent a BCC of this message to a plussed address, so if you receive TWO copies, your mail config supports plussing - review the headers to see the differences in the messages). It's a lot easier for someone to address a specific address, but a bit more involved to remember to send a message to a specific address AND put something in the subject - and every time they forget to, the message will be deposited into your regular mail.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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