On Fri, 22 Nov 2002 16:24:28 +1100, Martin Schwenke said:
my previous fix, since it isn't necessary - if someone can check
what
mail-extract-address-components does on a "Motorola X.400
non-prettified address", then we might be able to chuck most of the
You're going to make Lisp code decide between throwing its hands up
in disgust and collapsing in paroxysms of giggles? ;)
But seriously - the idea of trying to support X.400 addresses (especially
non-prettyfied ones) makes me think about rms's refusal to accept code
that supports non-free software. Sometimes it's time to take a moral
stand and refuse to encourage bad ideas....
(OK, it's been a too-long week already. I'll quit ranting. ;)
(string-match "/[GS]=\\([-a-zA-Z0-9._]+\\)[^!@%]+\\([-a-zA-Z0-9!(a)%._]+\\)
(1) (2) (2)
(1) If we're going to try to support X.400 addresses, is there a reason to
restrict it to some Motorola subset? I'm not *positive*, but I suspect
that extending the string-match from "/[GS]=\\" to "/[A-Z]+=\\" will
catch
all the c= and prmd= and all that stuff too. At least it looks like this
code only deals with the X.400 variants that smash ' ' to '_' - if we had
to deal with quoted whitespace, the code would be a lot worse.
(2) To support more general X.400, we'd have to accept something like
/c=us/prmd=foo_mail/o=bar/ou=baz/cn=joe_random(a)some.x-400.gate - but
that would require having '/' in the regexp as well...
(3) I'm also not sure about the _ here - this looks like it will accept
a _ in a hostname, which is a no-no. Of course, the _ *would* be OK after
a ! or % since it would still be in the rfc822 local-part. I guess it's no
sin accepting a broken hostname, as long as we correctly focus on a purported
address and not a comment field.
And lest I be accused of X.400 bashing, I'll leave you all with this gem
of an address, straight from RFC822, section 3.1.4:
So, for example, the folded body of an address field
":sysmail"@ Some-Group. Some-Org,
Muhammed.(I am the greatest) Ali @(the)Vegas.WBA
is analyzed into the following lexical symbols and types:
:sysmail quoted string
@ special
Some-Group atom
. special
Some-Org atom
, special
Muhammed atom
. special
(I am the greatest) comment
Ali atom
@ atom
(the) comment
Vegas atom
. special
WBA atom
The canonical representations for the data in these addresses
are the following strings:
":sysmail"@Some-Group.Some-Org
and
Muhammed.Ali(a)Vegas.WBA
Yes, it's valid. Gaak. ;)
http://public.yahoo.com/~jfriedl/regex/code.html if you're masochistic. ;)
/Valdis