Timothy J Luoma wrote:
[snip]
Strangely enough, that does not seem to be working for me:
* ^Subject:[ ]send-ascii *\/[^ ].*
* !^Subject:[ ]send-ascii .*[/.]\.
(there's a space and a tab in the first set of [ ])
am I doing something wrong?
You need a "*" after the [ ] set:
* ^Subject:[ ]*send-ascii *\/[^ ].*
* !^Subject:[ ]*send-ascii .*[/.]\.
Remember, "[ab]*" matches any number of a or b characters;
without the * it matches exactly one only. Since the RFC's
allow zero to any amount of whitespace after the ":" in a
headerfield, it makes sense to match that.
I had a "*" there in the earlier example I posted (and to which
you earlier responded, but I was busy watching the Patriots
roll over the Steelers), but maybe that was the problem there
for you as well.
* ^Subject: stuff
only matches when there's exactly one space after the ":".
But what about:
Subject:stuff
Subject: stuff
etc.? (All legal!)
Now, let's look at your two conditions assuming you get past
the [ ]* issue: first:
* ^Subject:[ ]send-ascii *\/[^ ].*
This matches, I think, "send-ascii" followed by zero or more
spaces, followed by a non-space, followed by zero or more
"any character"s. Why do you want to do that?
The procmailex example that David quoted should lead you to:
* ^Subject:[ ]*send-ascii [0-9a-z]
Note it has a *later* test, inside {}, after the "illegal"
names have been skipped, for what will map to:
* ^Subject:[ ]*send-ascii \/[^ ].*
and *that* is used to set $MATCH. If you want to allow
uppercase filenames as well, try:
* ^Subject:[ ]*send-ascii [0-9a-zA-Z]
(I'm not sure whether procmail's case-insensitive matches
carry over into [] sets.)
Second:
* !^Subject:[ ]send-ascii .*[/.]\.
This excludes "send-ascii " followed by anything followed by
either "/." or "..", which is how it keeps access within
the current directory. (It loses the capability of sending
names like "foo..bar" but that's probably no great loss.)
Hope that helps. I don't have a lot of time to play with this
today, so I disclaim responsibility for any errors in the above :-)
Cheers,
Stan.
ps - when you say "doesn't seem to be working for me" it
would help if you'd give examples. I can't even decide if
you think it passes things that should fail, or fails things
it should pass.