From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68792 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general,gmane.emacs.bbdb.user Subject: Re: problems with splitting and imap Date: Tue, 21 Jul 2009 11:00:38 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <8763dmgh5l.fsf@lifelogs.com> References: <871vobjn07.fsf@lifelogs.com> <87ocrfi3jn.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1248192126 29831 80.91.229.12 (21 Jul 2009 16:02:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2009 16:02:06 +0000 (UTC) Cc: Ding Mailing List , bbdb-info Original-X-From: ding-owner+M17212@lists.math.uh.edu Tue Jul 21 18:01:58 2009 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 1MTHmt-00012K-H6 for ding-account@gmane.org; Tue, 21 Jul 2009 18:01:55 +0200 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 1MTHmP-0000y9-4e; Tue, 21 Jul 2009 11:01:25 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1MTHmN-0000xr-Fr for ding@lists.math.uh.edu; Tue, 21 Jul 2009 11:01:23 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1MTHmD-0000vm-My for ding@lists.math.uh.edu; Tue, 21 Jul 2009 11:01:23 -0500 Original-Received: from chirelay1o.jumptrading.com ([38.98.147.153] helo=chirelay1.jumptrading.com) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1MTHml-0000bY-00 for ; Tue, 21 Jul 2009 18:01:47 +0200 Original-Received: from chirelay1.jumptrading.com (unknown [127.0.0.1]) by chirelay1.jumptrading.com (Symantec Mail Security) with ESMTP id 6F659320004 for ; Tue, 21 Jul 2009 10:59:16 -0500 (CDT) X-AuditID: 26629395-a8baabb0000078af-0c-4a65e5d4f08e Original-Received: from chiexchange02.w2k.jumptrading.com (unknown [38.98.147.140]) by chirelay1.jumptrading.com (Symantec Mail Security) with ESMTP id 5533D2DC003 for ; Tue, 21 Jul 2009 10:59:16 -0500 (CDT) Original-Received: from internalsmtp.w2k.jumptrading.com (10.2.4.29) by chiexchange02.w2k.jumptrading.com (10.2.4.71) with Microsoft SMTP Server id 8.1.291.1; Tue, 21 Jul 2009 11:00:41 -0500 Original-Received: from tzlatanov-ubuntu-desktop.jumptrading.com ([10.2.21.147]) by internalsmtp.w2k.jumptrading.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 21 Jul 2009 11:00:41 -0500 Original-Newsgroups: gnu.emacs.gnus X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:HQweWjZ0kCZTz7iPzrscGZzwQyc= In-Reply-To: (Richard Riley's message of "Tue, 21 Jul 2009 00:04:43 +0200") Posted-To: gnu.emacs.gnus X-OriginalArrivalTime: 21 Jul 2009 16:00:41.0414 (UTC) FILETIME=[65A4C660:01CA0A1C] X-Brightmail-Tracker: AAAAAA== X-Spam-Score: -1.3 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68792 gmane.emacs.bbdb.user:2270 Archived-At: The following message is a courtesy copy of an article that has been posted to gnu.emacs.gnus as well. On Tue, 21 Jul 2009 00:04:43 +0200 Richard Riley wrote: RR> Ted Zlatanov writes: >> On Mon, 20 Jul 2009 12:13:44 -0500 Ted Zlatanov wrote: >> TZ> On Sun, 19 Jul 2009 15:31:09 +0200 Richard Riley wrote: RR> A couple of days ago I had to remove all my splitting code because of RR> this error: >> RR> ,---- RR> | Debugger entered--Lisp error: (wrong-type-argument listp "(Unparsable address -- Strange character \\> found: \">_^_\")") RR> | bbdb/gnus-split-method() RR> | nnimap-split-to-groups(bbdb/gnus-split-method) RR> | nnimap-split-articles(nil "mymail") RR> | nnimap-request-scan(nil "mymail") RR> | gnus-request-scan(nil (nnimap "mymail" (nnimap-stream ssl) (nnimap-address "imap.richardriley.net") (nnimap-authinfo-file "~/.authinfo") (nnir-search-engine imap))) RR> | gnus-read-active-file-1((nnimap "mymail" (nnimap-stream ssl) (nnimap-address "imap.richardriley.net") (nnimap-authinfo-file "~/.authinfo") (nnir-search-engine imap)) nil) RR> | gnus-read-active-file() RR> | gnus-group-get-new-news(nil) RR> | gnus-1(nil nil nil) RR> | gnus(nil) RR> | call-interactively(gnus nil nil) RR> `---- >> RR> Could someone please suggest how to fix this/locate the offending message? >> RR> I'm talking to a dovecot IMAP server btw. >> TZ> Looks like a bug in bbdb/gnus-split-method. It should return nil if TZ> this error happens (or maybe do something smarter, I don't know the code TZ> too well so I didn't write a patch). The error is coming from TZ> `rfc822-addresses' which is part of Emacs. >> TZ> I am cc-ing the BBDB group for help. >> >> Sorry, the first CC didn't work. Retrying. This may get hairy because >> gnu.emacs.gnus is a newsgroup. I also cc-ed the Ding mailing list for >> Gnus, so replies from BBDB developers make it back to Gnus developers. >> >> Ted RR> Thanks Ted. RR> I have to had to remove all splitting client side for the moment :-( RR> But even a hint as to how to catch the offending mail would be a great RR> help. You can catch the offender by redefining rfc822.el functions. This is rfc822-addresses: (defun rfc822-addresses (header-text) (if (string-match "\\`[ \t]*\\([^][\000-\037 ()<>@,;:\\\".]+\\)[ \t]*\\'" header-text) ;; Make very simple case moderately fast. (list (substring header-text (match-beginning 1) (match-end 1))) (let ((buf (generate-new-buffer " rfc822"))) (unwind-protect (save-excursion (set-buffer buf) (make-local-variable 'case-fold-search) (setq case-fold-search nil) ;For speed(?) (insert header-text) ;; unfold continuation lines (goto-char (point-min)) (while (re-search-forward "\\([^\\]\\(\\\\\\\\\\)*\\)\n[ \t]" nil t) (replace-match "\\1 " t)) (goto-char (point-min)) (let ((list ()) tem ;; This is for rfc822-bad-address. Give it a non-nil ;; initial value to prevent rfc822-bad-address from ;; raising a wrong-type-argument error (rfc822-address-start (point))) (catch 'address ; this is for rfc822-bad-address (rfc822-nuke-whitespace) (while (not (eobp)) (setq rfc822-address-start (point)) (setq tem (cond ((rfc822-looking-at ?\,) nil) ((looking-at "[][\000-\037@;:\\.>)]") (debug "list so far %s, remaining text %s" list (buffer-substring (point) (point-max)) ; *** debug *** (forward-char) (rfc822-bad-address (format "Strange character \\%c found" (preceding-char)))) (t (rfc822-addresses-1 t)))) (cond ((null tem)) ((stringp tem) (setq list (cons tem list))) (t (setq list (nconc (nreverse tem) list))))) (nreverse list)))) (and buf (kill-buffer buf)))))) Note the single debug statement I inserted. Hit `C-x C-e' after the last parenthesis to use this function; copy it into the *scratch* buffer to keep playing with it. You'll see a stack popup buffer now every time the function moves through an address list. Just follow along to find the breaking point (`c' continues, `q' quits). It's the address following the last successful one, in "remaining text." You can get much fancier here (e.g. show the current content) but I want to show you the very basics of debugging. Basically you're seeing this, I think, because there's one of the characters listed above the debug statement (brackets, octal 0-037, @;:\.>, closing parenthesis) where one shouldn't be. The BBDB function it assumes a particular format for the return of `rfc822-addresses' and breaks when that format is not observed if one of the addresses has an invalid character as described above. Ted