Complete.Org: Mailing Lists: Archives: discussion: December 1999:
[aclug-L] Re: procmail question
Home

[aclug-L] Re: procmail question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: [aclug-L] Re: procmail question
From: Jeff <schaller@xxxxxxxxxxxxx>
Date: Thu, 16 Dec 1999 08:18:35 -0600 (CST)
Reply-to: aclug-L@xxxxxxxxxxxx

On Wed, 15 Dec 1999 glandix@xxxxxxxxxxxxxx wrote:

> On 15 Dec, Jeff wrote:
> > :0c:
> > * ^From:.* your parent's address
> > copy-folder
> 
> ok, kewl!  this is exactly what i wanted!! 
> 
> question, tho'...  what's the format all about?  i mean will this:
> 
> :0c:
> * ^From:mom&dad@xxxxxxxx
> 
> do the same thing, assuming that is their e-mail, or do i have to have
> .* before their address...

As Carl said, the .* catches cruft that might show up before the
actual address.


> p.s. sorry, i'm VERY new to procmail, and trying to figure all this
> out....

No problem! It was a very reasonable question :)


> is the ^Sender: field different than the from field?  

Yes. :)

> does Sender contain only the e-mail address?

Probably, but don't count on it.  The Sender field indicates that the
email itself came from a different source than the person who hit
'send' (like a mailing list).  For your parents, use the From: field.
See RFC 822 for more (than enough) info ... ie:
http://www.freesoft.org/CIE/RFC/Orig/rfc822.txt


> i don't quite understand the "." tho'...  i understand the "*" because
> of ls *blah*.txt things i do, but i don't quite get the dot...  i'm
> used to something like 'ls .*blah' showing up files like .1blah,
> .sdfblah, etc...

You're thinking of "globs" versus "regular expressions".  Globs use
* [] and ?.  It's what shells like bash use, so you can do
ls .*blah to list files that start with a period, have some junk, then
blah at the end.  To do that with a regular expression (_won't work in
the shell_), it'd be like "\..*blah" .  Because periods are special in
regular expressions, you have to escape it.
SO a quick overview:
GLOBS:
*       - match any amount of junk
?       - match one of any junk (one character)
[]      - match a "class" of stuff [abc] would be one of a, b, or c

REGEX:
*       - match any amount of what came before the *
.       - match any one character
?       - match zero or one of what came before the ?
[]      - match a class of stuff [abc] would be one of a, b, or c

As you can see, there is some overlap, but don't confuse the two.
Regexes are very powerful because you can combine them --
[+-]?[0-9]+\.[0-9]* would be one way to match a floating-point number:
it says to match possibly a + or - at the beginning (not required),
then one or more digits, then a period, then maybe some digits
afterwards.

> been thru the examples in /usr/doc/procmail, but haven't browsed any of
> the man pages except 'man procmail'...

man procmailex is good.

-jeff
-- 
The new Reagan biography, Dutch: A Memoir Of Ronald Reagan, is drawing fire.
What do you think? "The Reagan bio may be partly fictional, but I don't mind.
That means it should correspond pretty closely with my memories of his
administration." Iris Roberts, Botanist.
http://www.theonion.com/onion3537/wdyt_3537.html


[Prev in Thread] Current Thread [Next in Thread]