Michael Heydekamp <[EMAIL PROTECTED]> wrote on 24.10.04: [...]
> Siehe Anhang dazu im nächsten Posting, das ist das Resultat (quasi > RFC2882 in praxisorientierter Kurzfassung als Arbeitsunterlage). Die > aktuelle Baustellenrotine hänge ich auch mal dran; [...] Siehe Anhang. Michael
Praxisorientierte Regeln fr RFC-konforme Adressen (RFC2822/RFC1034) (Zusammenfassung aus einem Mailthread mit Dirk Nimmich) ================================================== * Leerzeichen (beliebig viele) sind ... - erlaubt in quoted-strings und Kommentaren sowieso - erlaubt vor und nach "@" (weil dot-atom, quoted-string und domain-literal mit Leerzeichen beginnen und enden drfen) - erlaubt vor und nach "<" und ">" (dito) - erlaubt vor und nach Kommentaren (dito) - erlaubt vor und nach " und " von quoted-strings (dito) - *nicht* erlaubt vor und nach "." in atom und dot-atom-text (entgegen RFC822, wo auch das erlaubt ist) Alle Leerzeichen, die sich nicht in quoted-strings oder Kommentaren befinden, drfen/mssen entfernt werden. * Kommentare sind immer als eigene Einheit zu sehen und drfen daher nicht in einer anderen Einheit wie quoted-string, dot-atom o.„. vorkommen (was sie in der Praxis aber leider manchmal trotzdem tun). * Wenn der local-part als quoted-string vorliegt, dann muá der *gesamte* local-part ein quoted-string sein (nicht nur Teile davon). Nur Kommentare k”nnen noch (vor und/oder nach dem quoted-string) zus„tzlich vorkommen. * In Domains kann kein quoted-string vorkommen. Wohl aber domain-literals (die zwar " enthalten k”nnen, was aber nichts mit quoted-strings zu tun hat) und Kommentare. * Domains mssen nicht aus zwei Teilen mit einem Punkt bestehen (weil der in dot-atom-text optional ist). D.h., <[EMAIL PROTECTED]> w„re eine gltige 2822-Adresse. * Jedes "Label" (zwischen "." bzw. Anfang und "." bzw. Ende) eines Domainnamens ... - muá mit einem Buchstaben beginnen (aber in der Praxis werden auch Ziffern verwendet, siehe "1und1.de"!) - muá mit einem Buchstaben oder einer Ziffer enden - darf dazwischen nur Buchstaben, Ziffern und Bindestriche enthalten - darf max. 63 Zeichen lang sein Alles laut RFC1034. RFC2822 l„át deutlich mehr Zeichen zu (siehe "atext")! * Eine Mindestanzahl gr”áer 1 Zeichen ist weder fr den local-part noch fr die Domain vorgeschrieben. Die max. Gesamtl„nge einer Domain betr„gt 255 Zeichen (RFC1034). * Punkte am Ende des local-part und der Domain sind zwar eigentlich nicht erlaubt, sollten aber trotzdem nicht entfernt werden, weil sie in der Praxis vorkommen. Im DNS wird der abschlieáende Punkt fr die Rootdomain verwendet, so daá man zum Beispiel Mail an [EMAIL PROTECTED] schicken kann, w„hrend mit [EMAIL PROTECTED] auch der lokale Rechner "cx" gemeint sein k”nnte. * Dirk Nimmich schreibt: | Wenn man das aufl”st (wiederholbare Teile habe ich nur einmal | wiederholt), kommt etwa das hier heraus: | | < ( ccontent ccontent ) atext.atext ( ccontent ccontent ) @ ( ccontent ccontent ) atext.atext ( ccontent ccontent ) > | < ( ccontent ccontent ) atext.atext ( ccontent ccontent ) @ ( ccontent ccontent ) [ dcontent dcontent ] ( ccontent ccontent ) > | < ( ccontent ccontent ) " qcontent qcontent " ( ccontent ccontent ) @ ( ccontent ccontent ) atext.atext ( ccontent ccontent ) > | < ( ccontent ccontent ) " qcontent qcontent " ( ccontent ccontent ) @ ( ccontent ccontent ) [ dcontent dcontent ] ( ccontent ccontent ) > * Definitionen aus RFC2822: NO-WS-CTL = %d1-8 / ; US-ASCII control characters %d11 / ; that do not include the %d12 / ; carriage return, line feed, %d14-31 / ; and white space characters %d127 ---------------------------------------------------------------------------- text = %d1-9 / ; Characters excluding CR and LF %d11 / %d12 / %d14-127 / obs-text ---------------------------------------------------------------------------- specials = "(" / ")" / ; Special characters used in "<" / ">" / ; other parts of the syntax "[" / "]" / ":" / ";" / "@" / "\" / "," / "." / DQUOTE ---------------------------------------------------------------------------- quoted-pair = ("\" text) / obs-qp ---------------------------------------------------------------------------- FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space obs-FWS ---------------------------------------------------------------------------- ctext = NO-WS-CTL / ; Non white space controls %d33-39 / ; The rest of the US-ASCII %d42-91 / ; characters not including "(", %d93-126 ; ")", or "\" ---------------------------------------------------------------------------- ccontent = ctext / quoted-pair / comment ---------------------------------------------------------------------------- comment = "(" *([FWS] ccontent) [FWS] ")" ---------------------------------------------------------------------------- CFWS = *([FWS] comment) (([FWS] comment) / FWS) ---------------------------------------------------------------------------- addr-spec = local-part "@" domain ---------------------------------------------------------------------------- local-part = dot-atom / quoted-string / obs-local-part ---------------------------------------------------------------------------- domain = dot-atom / domain-literal / obs-domain ---------------------------------------------------------------------------- domain-literal = [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS] ---------------------------------------------------------------------------- dtext = NO-WS-CTL / ; Non white space controls %d33-90 / ; The rest of the US-ASCII %d94-126 ; characters not including "[", ; "]", or "\" ---------------------------------------------------------------------------- dcontent = dtext / quoted-pair ---------------------------------------------------------------------------- atext = ALPHA / DIGIT / ; Any character except controls, "!" / "#" / ; SP, and specials. "$" / "%" / ; Used for atoms "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~" ---------------------------------------------------------------------------- atom = [CFWS] 1*atext [CFWS] ---------------------------------------------------------------------------- dot-atom = [CFWS] dot-atom-text [CFWS] ---------------------------------------------------------------------------- dot-atom-text = 1*atext *("." 1*atext) ---------------------------------------------------------------------------- qtext = NO-WS-CTL / ; Non white space controls %d33 / ; The rest of the US-ASCII %d35-91 / ; characters not including "\" %d93-126 ; or the quote character ---------------------------------------------------------------------------- qcontent = qtext / quoted-pair ---------------------------------------------------------------------------- quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS]
mailstr.pas
Description: Binary data
------------------------------------------------------------------------ FreeXP Entwickler-Mailingliste [EMAIL PROTECTED] http://www.freexp.de/cgi-bin/mailman/listinfo/dev-list