From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [yazicivo@ttnet.net.tr: Locale Dependent Downcasing in smtpmail] Date: Tue, 03 Apr 2007 12:24:52 +0300 Message-ID: References: <87wt0uhee5.fsf@ttnet.net.tr> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1175592317 14723 80.91.229.12 (3 Apr 2007 09:25:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2007 09:25:17 +0000 (UTC) Cc: yazicivo@ttnet.net.tr, emacs-devel@gnu.org To: Kenichi Handa , Simon Josefsson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 03 11:25:07 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HYfGD-0001KQ-7q for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2007 11:25:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYfJK-0007bz-WA for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2007 05:28:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HYfJG-0007bm-Di for emacs-devel@gnu.org; Tue, 03 Apr 2007 05:28:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HYfJE-0007XW-Es for emacs-devel@gnu.org; Tue, 03 Apr 2007 05:28:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYfJE-0007XJ-94 for emacs-devel@gnu.org; Tue, 03 Apr 2007 05:28:12 -0400 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HYfG5-0003zk-HU for emacs-devel@gnu.org; Tue, 03 Apr 2007 05:24:57 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-124-31.inter.net.il [84.229.124.31]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id GKZ66025 (AUTH halo1); Tue, 3 Apr 2007 12:24:49 +0300 (IDT) In-reply-to: (message from Kenichi Handa on Tue, 03 Apr 2007 17:06:07 +0900) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68977 Archived-At: > From: Kenichi Handa > Date: Tue, 03 Apr 2007 17:06:07 +0900 > Cc: rms@gnu.org, emacs-devel@gnu.org > > To avoid such an ad-hoc fix, I must know the purpose of > downcasing here. Do we need just "tr A-Z a-z"? Or, do we > have to downcase also non-ASCII chars? I think the purpose is quite obvious from this fragment: (smtpmail-send-command process (format "EHLO %s" (smtpmail-fqdn))) (if (or (null (car (setq response-code (smtpmail-read-response process)))) (not (integerp (car response-code))) (>= (car response-code) 400)) (progn ;; HELO (smtpmail-send-command process (format "HELO %s" (smtpmail-fqdn))) (if (or (null (car (setq response-code (smtpmail-read-response process)))) (not (integerp (car response-code))) (>= (car response-code) 400)) (throw 'done nil))) (dolist (line (cdr (cdr response-code))) (let ((name (mapcar (lambda (s) (intern (downcase s))) (split-string (substring line 4) "[ ]")))) (and (eq (length name) 1) (setq name (car name))) (and name (cond ((memq (if (consp name) (car name) name) '(verb xvrb 8bitmime onex xone expn size dsn etrn enhancedstatuscodes help xusr auth=login auth starttls)) (setq supported-extensions (cons name supported-extensions))) (smtpmail-warn-about-unknown-extensions (message "Unknown extension %s" name))))))) My interpretation of this is that smtpmail sends EHLO/HELO command to the SMTP server, and then examines the response, which specifies the features supported by the server as a list of strings separated by whitespace. For each such feature, we downcase and intern it, and then check whether the resulting symbol is a member of the list of features known to smtpmail, it adds the feature to the supported-extensions list. Thus, downcasing needs to support only the words in the above list of known extensions (verb, xvrb, 8bitmime, etc.), which are pure-ASCII words. IOW, "tr A-Z a-z" should be enough. Simon, am I right?