Gnus development mailing list
 help / color / mirror / Atom feed
* Re: problems with splitting and imap
       [not found] ` <871vobjn07.fsf@lifelogs.com>
@ 2009-07-20 18:59   ` Ted Zlatanov
       [not found]     ` <h42q22$ded$1@rileyrgdev.eternal-september.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Ted Zlatanov @ 2009-07-20 18:59 UTC (permalink / raw)
  Cc: bbdb-info, Ding Mailing List

The following message is a courtesy copy of an article
that has been posted to gnu.emacs.gnus as well.

On Mon, 20 Jul 2009 12:13:44 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> On Sun, 19 Jul 2009 15:31:09 +0200 Richard Riley <rileyrgdev@gmail.com> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problems with splitting and imap
       [not found]     ` <h42q22$ded$1@rileyrgdev.eternal-september.org>
@ 2009-07-21 16:00       ` Ted Zlatanov
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Zlatanov @ 2009-07-21 16:00 UTC (permalink / raw)
  Cc: Ding Mailing List, bbdb-info

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 <rileyrgdev@gmail.com> wrote: 

RR> Ted Zlatanov <tzz@lifelogs.com> writes:
>> On Mon, 20 Jul 2009 12:13:44 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote: 
>> 
TZ> On Sun, 19 Jul 2009 15:31:09 +0200 Richard Riley <rileyrgdev@gmail.com> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-21 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <h3v7is$if4$1@rileyrgdev.eternal-september.org>
     [not found] ` <871vobjn07.fsf@lifelogs.com>
2009-07-20 18:59   ` problems with splitting and imap Ted Zlatanov
     [not found]     ` <h42q22$ded$1@rileyrgdev.eternal-september.org>
2009-07-21 16:00       ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).