procmail
[Top] [All Lists]

RE: Inclusive recipe

2007-10-24 15:23:01
Rem P Roberti wrote Thursday, October 25, 2007 12:02 AM:


On 2007.10.24 23:36:38 +0000, Dallman Ross wrote:

Rem P Roberti wrote Wednesday, October 24, 2007 7:58 PM:
I'm sorry, I should have been more clear on this.  I'm the only
user on the system, and the addresses are all for folks that
belong to a single organization.  I want all of this email to
go to the one proprietary mailbox.

   SPACE = ' '
   TAB = '  '
   WS = $SPACE$TAB
   ADDRESS = (foo|bar|baz)

   :0:
   * $ ^To:.*(.*\<)?$ADDRESS(_at_)example[(_dot_)]com\>
   mailbox

could work.  Note that there are corner-cases that could be
problematic, which is why I asked all those questions.
The main rule is that procmail is an MDA, not an MTA.
It can't distinguish undisclosed addresses that were on
the Envelope-To when the message was Bcc'd and contains
multiple recipients, for example.


-- 
dman

(Please don't quote back my .sig to me and the list.)


Once again, my lack of explanation is probably making things
difficult.  I receive and email.  The "From:" header tells me
who the email is from.  I want a number of different senders,
with different "From:" addresses to go into the same mailbox.
It has been suggested that the form of the recipe should be
something like this:

:0
* ^From: (address |\
     address |\
     address |\
     address)
theonemailbox

You didn't say "From" before.  You said "the addresses are for folks" --
which means "to."  Frankly, I was wondering how you could be the only
user yet have a bunch of alias addresses coming in, yet not be willing
to set up an alias table and deliver the stuff that way.  But okay,
"From."

Your presentation of what was suggested is not very different from
what I suggested, if you'll notice.  Change "To:" to "From:".

Some of the same caveats apply.  People can disguise their sending
addresses.  Procmail might not be able to tell, as it's only the
delivery agent, not that transfer agent.  Are these people
straightforwardly
sending you mail without any hiding behind envelope-from addresses that
don't match up, etc., etc.?

Your example won't work because of the spaces after the word "address"
and because you are unlikely to see a From: line that just says
"From: address.*" with only one space after the header fieldname and
no brackets or anything else intervening.  Moreover, you might have
false matches if, say, one From-address is "dman(_at_)nomotek(_dot_)com" and
another one is "feldman(_at_)nomotek(_dot_)com".  Or what if dman isn't
in your collection but he writes you, while felddman is in your 
collection?  Your recipe would (barring the problem mentioned as
to syntax) match falsely on dman.

    SPACE = ' '
    TAB = '     '  # a real tab char!
    WS = $SPACE$TAB
    ADDRESS = (foo|bar|baz)
 
    :0:
    * $ ^From:.*(.*\<)?$ADDRESS(_at_)example[(_dot_)]com\>
    mailbox

Basically, it's the same thing I wrote above that you've
quoted back, with "To:" changed to "From:".  I suggest
you try it.  Oh, you didn't answer as to whether the
senders all are coming from the same domain.  If not,
well, tweak accordingly.

Also, you can alternatively set ADDRESS with the whitespace like so:

   ADDRESS = '(foo|\
               bar|\
               baz)'
or

   ADDRESS = '(\
               foo|\
               bar|\
               baz|\
               )'

Not that this is similar to your "suggested" solution, but the
whitespace has been carefully applied so as not to follow the
relevant line's string but only come before.  Whitespace after
a continuation slash, on the next line before any new text,
will be ignored.  Other whitespace will not be ignored but will
be considered literally.  I believe this is stated in the man
pages somewhere.

-- 
dman
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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