From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.help Subject: Re: How do I check if the format of an email address is valid? Date: Fri, 31 Mar 2006 01:30:02 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: References: <442BD086.9090805@student.lu.se> <87mzf762xq.fsf@thalassa.informatimago.com> <442C5AD3.3090004@student.lu.se> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143765058 21757 80.91.229.2 (31 Mar 2006 00:30:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Mar 2006 00:30:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 31 02:30:47 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FP7X9-00075i-Sx for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Mar 2006 02:30:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FP7X9-0001x7-Da for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Mar 2006 19:30:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FP7X0-0001wx-KM for help-gnu-emacs@gnu.org; Thu, 30 Mar 2006 19:30:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FP7Wy-0001vO-US for help-gnu-emacs@gnu.org; Thu, 30 Mar 2006 19:30:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FP7Wy-0001vE-KQ for help-gnu-emacs@gnu.org; Thu, 30 Mar 2006 19:30:24 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FP7ZF-0004Xk-RL for help-gnu-emacs@gnu.org; Thu, 30 Mar 2006 19:32:46 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FP7Wp-0006xH-Fm for help-gnu-emacs@gnu.org; Fri, 31 Mar 2006 02:30:15 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 Mar 2006 02:30:15 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 Mar 2006 02:30:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-To: help-gnu-emacs@gnu.org Original-Lines: 106 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: :6KQZ[nyoS_edmB.%gw-=)BYth^|2+Y+^cu%I$FSx!&>-'om>3H7A|M&n(V7fIo3P.; yo.b yq4$p; ZaBtkv)\}biaiBQe"mD}iib1AA@99-fZ7i*bLhNRVC&0Wkxg9)SH?oWc@{ Mail-Copies-To: nobody User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:fOgQKIRQuCe7apWxL1ViYSF3aKw= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34089 Archived-At: On Fri, Mar 31 2006, Lennart Borgman wrote: > Pascal Bourguignon wrote: >> Lennart Borgman writes: >>> - `message-valid-fqdn-regexp' (which is copied to >>> gnus-button-valid-local-part-regexp') You meant `gnus-button-valid-fqdn-regexp' here. >>> has a list of TLD:s. Is this really wise? Consider the purpose of these variables in Gnus: `message-valid-fqdn-regexp' is used to exclude obvious bogus system names from being used as the domain part in a Message-ID. `gnus-button-valid-fqdn-regexp' is used when creating buttons (clickable links) when a mail address or a Message-ID appears in the body of mail/usenet articles: Say null123@marauder.physik.uni-ulm.de or reiner.steib@gmx.de etc. The regexp should catch virtually all valid addresses without generating too many false positives, e.g. TeX code \def\foo@randomstuff.bar{} or similar. If we miss some new TLD, it's not critical and the user can easily add it or upgrade Gnus. >>> I guess there will be new TLD:s. (In fact there may already be >>> some that are not in this list.) Is anyone aware of any missing TLDs? (defcustom message-valid-fqdn-regexp (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain. ;; valid TLDs: "\\([a-z][a-z]" ;; two letter country TDLs "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org" "\\|aero\\|coop\\|info\\|name\\|museum" "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style? "\\)") "Regular expression that matches a valid FQDN." ;; see also: gnus-button-valid-fqdn-regexp :version "22.1" :group 'message-headers :type 'regexp) >> You can customize the variable! BTW, the tin newsreader even hard-codes a matrix of (in)valid two letter country domains. The user/admin has to recompile to add new domains. IIRC it's used when checking for a valid FQDN. > This argument can be used in the reverse direction too. Do most > users really gain something from the list of known TLD:s in the > regexp? For the purpose in Gnus: Yes, IMHO. What would you suggest to use instead? >>> - It is maybe a pitty that you have to load those big modules (message >>> and gnus) just to get the patterns. >> You only need to (require 'message) to get message-valid-fqdn-regexp. [...] >> And you only need to (require 'gnus-art) to get the other variables. Well, `gnus-art.el' will in turn load "half of the moon": ;-) ,----[ emacs -Q -f ielm ] | ELISP> (length features) | 76 | ELISP> (require 'gnus-art) | gnus-art | ELISP> (length features) | 130 `---- ,----[ emacs -Q -f ielm ] | ELISP> (length features) | 76 | ELISP> (require 'message) | message | ELISP> (length features) | 107 `---- > I just want to check the format of email addresses entered on a html page. And you'll post-process it using Emacs? >>> And then I can not stop myself from wondering if there really are any >>> format of email addresses that asures that conforming addresses are >>> actually existing email adresses ;-) >> Of course not. > And I will probably never learn the fine art of joking in email messages ;-) I wasn't joking. :-) Of course not from the format, but... Basically you need to do something like "host -t mx" (using `dig.el'?), connect to the smtp port, send "RCPT TO:" and parse the output ("user unknown"?). But I'm not sure if this still works nowadays. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/