From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65826 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Avoid calling idna-to-ascii on ASCII domain names (was: Gnus generates an invalid To header) Date: Sat, 01 Dec 2007 12:56:59 +0100 Message-ID: References: <87tznbkgqs.fsf@member.fsf.org> <873autb65l.fsf@member.fsf.org> <87prxxw534.fsf@denkblock.local> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196510300 28881 80.91.229.12 (1 Dec 2007 11:58:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2007 11:58:20 +0000 (UTC) To: Original-X-From: ding-owner+M14321@lists.math.uh.edu Sat Dec 01 12:58:29 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IyQzN-0000sj-5B for ding-account@gmane.org; Sat, 01 Dec 2007 12:58:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IyQyX-0002WS-O2; Sat, 01 Dec 2007 05:57:37 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IyQyW-0002WE-Gi for ding@lists.math.uh.edu; Sat, 01 Dec 2007 05:57:36 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IyQyQ-0003pz-A1 for ding@lists.math.uh.edu; Sat, 01 Dec 2007 05:57:36 -0600 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IyQyN-00016M-00 for ; Sat, 01 Dec 2007 12:57:27 +0100 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by mail.uni-ulm.de (8.14.1/8.14.1) with ESMTP id lB1BvSSH014121 for ; Sat, 1 Dec 2007 12:57:28 +0100 (MET) Original-Received: from localhost (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 5B00B1C4A4 for ; Sat, 1 Dec 2007 12:57:28 +0100 (CET) X-Face: #vK]N[`vqjuod*|)'[iD7/"3AB-ApT%fmN"LWAg@oS7OesGv~)n[OBTLM#I="J'Y^-7I I/ps7o_'IK@#-Rs{::DZ@O8yS|fexe,XslY[:dNWOb~>?mC-&i_c)say:"\IpA.5U.b]'NY;Pks{lb h.+#6%DpZuaK3dcHB`Av3zc:r!C%~s0&m,tWj]&},qg.+0ww2gK%f!:GK|wMl.I!(voY*1"^li8"~B BNG)9LvPi?^DMR-GVDnZqhu*3Hi,+g=wFhI)BL6&u{EOVEHjVEVq~d?_}lMntWAc3(6?kftjc>_f>! g0wM(qPM$d5]^TT_Qyi&L?LGVG)SHN;Gk/,pkY9,~ Mail-Copies-To: nobody User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) X-DCC--Metrics: poseidon 1113; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: by amavisd-new X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65826 Archived-At: [ Resending. The first message didn't reach the list, AFAICS. In the meantime, I have installed the latter patch. ] On Mon, Nov 26 2007, Elias Oltmanns wrote: > Tassilo Horn wrote: >> Reiner Steib writes: >>> By edebugging `message-idna-to-ascii-rhs-1', I found that it calls >>> (idna-to-ascii rhs) with `rhs' = "" because the right hand side of >>> "tierklinikkaiserbergduisburg" is the empty string. Maybe message >>> should just return the same header instead if calling `idna-to-ascii' >>> if `rhs' is empty? [...] > What Reiner suggests is fixing a bug on Gnus' part and a priori the > right thing to do. This patch avoids calling `idna-to-ascii' if the domain part is empty: --8<---------------cut here---------------start------------->8--- --- message.el 06 Nov 2007 00:13:10 +0100 7.228 +++ message.el 28 Nov 2007 22:15:16 +0100 @@ -5547,7 +5547,9 @@ (mapcar 'downcase (mapcar 'car (mail-header-parse-addresses field)))))) - (setq ace (downcase (idna-to-ascii rhs))) + (setq ace (if (equal rhs "") + "" + (downcase (idna-to-ascii rhs)))) (when (and (not (equal rhs ace)) (or (not (eq message-use-idna 'ask)) (y-or-n-p (format "Replace %s with %s in %s:? " --8<---------------cut here---------------end--------------->8--- This one avoids calling `idna-to-ascii' if the domain part contains only ASCII characters. I think we should apply it. Does anyone see a problem with it? --8<---------------cut here---------------start------------->8--- --- message.el 06 Nov 2007 00:13:10 +0100 7.228 +++ message.el 28 Nov 2007 22:21:47 +0100 @@ -5547,7 +5547,9 @@ (mapcar 'downcase (mapcar 'car (mail-header-parse-addresses field)))))) - (setq ace (downcase (idna-to-ascii rhs))) + (setq ace (if (string-match "\\`[[:ascii:]]+\\'" rhs) + rhs + (downcase (idna-to-ascii rhs)))) (when (and (not (equal rhs ace)) (or (not (eq message-use-idna 'ask)) (y-or-n-p (format "Replace %s with %s in %s:? " --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/