regexp matching question

Ian Zimmerman itz-4SqnbbNSRR0 at public.gmane.org
Fri Oct 7 00:35:00 UTC 2005


Behdad> I'm not sure what you exactly mean, but AFAIK, a new message is
Behdad> started when the regexp "^From:" matches, and the header ends
Behdad> when two consecutive new lines (Dos or Unix conventions) match.
Behdad> What's wrong with that?

It's "^From " , without the colon.  These lines are, at least technically
speaking, _not_ part of the header; they are added during delivery,
reflecting the "envelope" return address (ie. the <MAIL FROM:> information
from SMTP protocol), which can be entirely different from the contents
of the From: header.

This mechanism makes it necessary to escape occurences of this pattern
within the message body; the usual convention is to change a leading "From "
into ">From ".  My guess is it's this escaping (and reverting it for
final human consumption) that can be hard to get right in code and a
source of possible subtle bugs, though in my experience formail is solid
as a rock.

The format certainly does leave a bad case of kludge aftertaste; I agree
that Maildirs are much cleaner.  But you need a filesystem that can handle
the gobs of files in a single directory for Maildirs.

-- 
"It's not true or not."  A reality show producer (real quote)
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list