From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/41707 Path: main.gmane.org!not-for-mail From: Bjørn Mork Newsgroups: gmane.emacs.gnus.general Subject: Quoting RFC2047-encoded words Date: Mon, 07 Jan 2002 00:14:52 +0100 Organization: DoD Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035177063 7600 80.91.224.250 (21 Oct 2002 05:11:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:11:03 +0000 (UTC) Return-Path: Original-Received: (qmail 18954 invoked from network); 6 Jan 2002 23:15:27 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 6 Jan 2002 23:15:27 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16NMVX-00036v-00; Sun, 06 Jan 2002 17:15:15 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 06 Jan 2002 17:15:07 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id RAA01874 for ; Sun, 6 Jan 2002 17:14:55 -0600 (CST) Original-Received: (qmail 18944 invoked by alias); 6 Jan 2002 23:14:58 -0000 Original-Received: (qmail 18939 invoked from network); 6 Jan 2002 23:14:58 -0000 Original-Received: from quimby.gnus.org (HELO quimby2.netfonds.no) (195.204.10.66) by gnus.org with SMTP; 6 Jan 2002 23:14:58 -0000 Original-Received: from news by quimby2.netfonds.no with local (Exim 3.12 #1 (Debian)) id 16NMVP-0005hM-00 for ; Mon, 07 Jan 2002 00:15:07 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 78 Original-NNTP-Posting-Host: c4s142h4.upc.chello.no Original-X-Trace: quimby2.netfonds.no 1010358907 21907 62.179.170.4 (6 Jan 2002 23:15:07 GMT) Original-X-Complaints-To: usenet@quimby2.netfonds.no Original-NNTP-Posting-Date: 6 Jan 2002 23:15:07 GMT User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.1 (i386-debian-linux-gnu) Cancel-Lock: sha1:8LCiY1RtYPTcbngTPtG8+YV8AaM= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:41707 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:41707 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit This is a typical Gnus generated From field, based on address and name from the user- variables and from posting styles: From: "=?iso-8859-1?q?Bj=F8rn?= Mork" But RFC2047 says "An 'encoded-word' MUST NOT appear within a 'quoted-string'.", so Gnus is violating RFC2047. The problem seems to be this part of code in message-make-from: ;; Look for a character that cannot appear unquoted ;; according to RFC 822. (when (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]" nil 1) ;; Quote fullname, escaping specials. (goto-char (point-min)) (insert "\"") (while (re-search-forward "[\"\\]" nil 1) (replace-match "\\\\\\&" t)) As it states, this is (or was) necessary to avoid violating RFC822. The problem is that the header may or may not be encoded at a later stage, making it conform to RFC822 without the quotes. I wonder if the proper way to fix it is just to remove the above code from message-make-from, leaving the possible violation up to the user through gnus-group-posting-charset-alist and user-full-name. AFAIK, the current defaults will not violate RFC2822 I just cannot see an easy way for Gnus to automatically decide whether the quotes should be added or not. It is not possible to do it at the time the header is generated, and later modifications should really be up to the user IMHO. So how about just removing that offending part of message-make-from? Simple patch attached. (another problem is that if the user provides a quoted-string as part of a From or To header field, then Gnus should properly RFC2047 encode it. Which I believe means that the quoted-string must be treated as an atom by the encoder. I'm too lisp-illiterate to fix this I'm afraid) Bjørn -- Your ten-incher is great, right? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=message.patch Index: lisp/message.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v retrieving revision 6.185 diff -u -r6.185 message.el --- lisp/message.el 2002/01/06 19:09:00 6.185 +++ lisp/message.el 2002/01/06 23:11:18 @@ -3732,16 +3732,6 @@ (aset tmp (1- (match-end 0)) ?-)) (string-match "[\\()]" tmp))))) (insert fullname) - (goto-char (point-min)) - ;; Look for a character that cannot appear unquoted - ;; according to RFC 822. - (when (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]" nil 1) - ;; Quote fullname, escaping specials. - (goto-char (point-min)) - (insert "\"") - (while (re-search-forward "[\"\\]" nil 1) - (replace-match "\\\\\\&" t)) - (insert "\"")) (insert " <" login ">")) (t ; 'parens or default (insert login " (") --=-=-=--