Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <simon@josefsson.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: ding@gnus.org
Subject: Re: Sieve gets in infinite loop
Date: Fri, 08 Jan 2010 16:56:18 +0100	[thread overview]
Message-ID: <874omwegkd.fsf@mocca.josefsson.org> (raw)
In-Reply-To: <4B4753BB.1020401@gnu.org> (Jason Rumney's message of "Fri, 08 Jan 2010 23:48:11 +0800")

Jason Rumney <jasonr@gnu.org> writes:

> Reiner Steib wrote:
>> On Thu, Nov 19 2009, Jason Rumney wrote:
>>
>>   
>>> My server sends the following non-matching line:
>>>
>>>    OK "Dovecot ready."
>>>     
>>
>> I know next to nothing about sieve, but AFAICS, you (and your server)
>> are right.  Feel free to adjust sieve-manage-parse-capability-1 as
>> needed.
>>   
>
> The following simple patch works for me, but I don't understand why
> the eol needed to be on the regexp in the first place, so I may be
> missing something.
>
> === modified file 'lisp/gnus/sieve-manage.el'
> --- lisp/gnus/sieve-manage.el    2009-01-09 03:01:50 +0000
> +++ lisp/gnus/sieve-manage.el    2010-01-08 14:53:46 +0000
> @@ -636,7 +636,7 @@
>           sieve-manage-capability))
>     (push (list str) sieve-manage-capability))
>       (forward-line)))
> -  (when (re-search-forward (concat "^OK" sieve-manage-server-eol) nil t)
> +  (when (re-search-forward "^OK" nil t)
>     (setq sieve-manage-state 'nonauth)))
>
> (defalias 'sieve-manage-parse-greeting-1 'sieve-manage-parse-capability-1)

According to http://tools.ietf.org/html/draft-ietf-sieve-managesieve-09
the response line can contain an optional string:

    response-nobye        = ("NO" / "BYE") [SP "(" resp-code ")"]
                            [SP string] CRLF
                            ;; The string contains human readable text
                            ;; encoded as UTF-8.

So how about

-  (when (re-search-forward (concat "^OK" sieve-manage-server-eol) nil t)
+  (when (re-search-forward (concat "^OK.*" sieve-manage-server-eol) nil t)

instead?  Not perfect, but hopefully would solve your problem and still
match EOL stuff.

/Simon



  reply	other threads:[~2010-01-08 15:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87ws1msdgx.fsf@wanchan.jasonrumney.net>
2009-11-21 19:31 ` Reiner Steib
2010-01-08 15:48   ` Jason Rumney
2010-01-08 15:56     ` Simon Josefsson [this message]
2010-01-08 16:39       ` Jason Rumney
2010-01-08 18:56         ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874omwegkd.fsf@mocca.josefsson.org \
    --to=simon@josefsson.org \
    --cc=ding@gnus.org \
    --cc=jasonr@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).