From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: How do I check if the format of an email address is valid? Date: Fri, 31 Mar 2006 13:26:11 +0200 Message-ID: <442D11D3.4050301@student.lu.se> References: <442BD086.9090805@student.lu.se> <87mzf762xq.fsf@thalassa.informatimago.com> <442C5AD3.3090004@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1143804394 9825 80.91.229.2 (31 Mar 2006 11:26:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Mar 2006 11:26:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 31 13:26:33 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 1FPHlq-0006Kg-Km for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Mar 2006 13:26:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FPHlp-0004WS-Vv for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Mar 2006 06:26:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FPHlf-0004WD-EH for help-gnu-emacs@gnu.org; Fri, 31 Mar 2006 06:26:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FPHle-0004Vx-RZ for help-gnu-emacs@gnu.org; Fri, 31 Mar 2006 06:26:15 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FPHle-0004Vt-L7 for help-gnu-emacs@gnu.org; Fri, 31 Mar 2006 06:26:14 -0500 Original-Received: from [81.228.11.159] (helo=pne-smtpout2-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FPHo2-0003sG-83 for help-gnu-emacs@gnu.org; Fri, 31 Mar 2006 06:28:42 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout2-sn1.fre.skanova.net (7.2.070) id 43F9B8E90098B706 for help-gnu-emacs@gnu.org; Fri, 31 Mar 2006 13:26:13 +0200 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: help-gnu-emacs@gnu.org In-Reply-To: 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:34098 Archived-At: Reiner Steib wrote: > 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? > Why not just [a-z]{2, 6} >> I just want to check the format of email addresses entered on a html page. >> > > And you'll post-process it using Emacs? > Just what the user entered (in completion in nxhtml-mode). > 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. > Thanks, I did not know. But that seems out of the scope for me right now. (And it is a bit complicated to find the tools on w32 - but they seem to be in BIND.)