Gnus development mailing list
 help / color / mirror / Atom feed
* B c with nnimap: extra newlines
@ 1999-12-15 13:42 Janne Rinta-Manty
  2000-01-13 14:13 ` Janne Rinta-Manty
  0 siblings, 1 reply; 4+ messages in thread
From: Janne Rinta-Manty @ 1999-12-15 13:42 UTC (permalink / raw)


I have a problem with nnimap: moving articles (B m) to other nnimap
folders works fine, but copying (B c) doubles every newline in the
article, including headers. (Which of course results in articles that
have only one proper header line.)

I just recently put all my mail folders under nnimap, before that
INBOX was the only nnimap group, other used nnfolder. And
copying/moving was OK.

What could cause this?
(Gnus 5.8.2 / Emacs 20.3)

-- 
Janne Rinta-Mänty



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

* Re: B c with nnimap: extra newlines
  1999-12-15 13:42 B c with nnimap: extra newlines Janne Rinta-Manty
@ 2000-01-13 14:13 ` Janne Rinta-Manty
  2000-01-13 14:39   ` Simon Josefsson
  0 siblings, 1 reply; 4+ messages in thread
From: Janne Rinta-Manty @ 2000-01-13 14:13 UTC (permalink / raw)


Janne Rinta-Manty 1999-12-17T10:10:27Z:
JRM> I have a problem with nnimap: moving articles (B m) to other
JRM> nnimap folders works fine, but copying (B c) doubles every
JRM> newline in the article, including headers.

I seem to have solved the problem now by commenting out the following
lines from nnimap-request-accept-article:

		  ;; turn into rfc822 format (\r\n eol's)
;		  (with-current-buffer (current-buffer)
;		    (goto-char (point-min))
;		    (while (search-forward "\n" nil t)
;		      (replace-match "\r\n")))

Assuming the above code works for everybody else, I wonder what's
wrong with my setup. IMAP server? SSH? Or should imap-client-eol be
used instead of "\r\n" (I have set it to "\n")?

-- 
Janne Rinta-Mänty



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

* Re: B c with nnimap: extra newlines
  2000-01-13 14:13 ` Janne Rinta-Manty
@ 2000-01-13 14:39   ` Simon Josefsson
  2000-01-14 12:05     ` Janne Rinta-Manty
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Josefsson @ 2000-01-13 14:39 UTC (permalink / raw)
  Cc: ding

Janne Rinta-Manty <jrm@iki.fi> writes:

> JRM> I have a problem with nnimap: moving articles (B m) to other
> JRM> nnimap folders works fine, but copying (B c) doubles every
> JRM> newline in the article, including headers.
> 
> I seem to have solved the problem now by commenting out the following
> lines from nnimap-request-accept-article:
> 
> 		  ;; turn into rfc822 format (\r\n eol's)
> ;		  (with-current-buffer (current-buffer)
> ;		    (goto-char (point-min))
> ;		    (while (search-forward "\n" nil t)
> ;		      (replace-match "\r\n")))
> 
> Assuming the above code works for everybody else, I wonder what's
> wrong with my setup. IMAP server? SSH? Or should imap-client-eol be
> used instead of "\r\n" (I have set it to "\n")?

Are you using SSH port-forwarding?  Perhaps it doesn't preserve CRLF?
Was that the reason for changing `imap-client-eol'?

Anyway, I think there was a bug involved when modifying
`imap-client-eol'. Could you please back out your patch and test this
instead?

Index: imap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/imap.el,v
retrieving revision 1.10
diff -w -u -u -w -r1.10 imap.el
--- imap.el	2000/01/04 15:45:06	1.10
+++ imap.el	2000/01/13 14:39:06
@@ -1320,11 +1320,11 @@
 		       (let ((process imap-process)
 			     (stream imap-stream))
 			 (with-current-buffer cmd
-			   (when (eq stream 'kerberos4)
+			   (when (not (equal imap-client-eol "\r\n"))
 			     ;; XXX modifies buffer!
 			     (goto-char (point-min))
 			     (while (search-forward "\r\n" nil t)
-			       (replace-match "\n")))
+			       (replace-match imap-client-eol)))
 			   (and imap-log
 				(with-current-buffer (get-buffer-create
 						      imap-log)



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

* Re: B c with nnimap: extra newlines
  2000-01-13 14:39   ` Simon Josefsson
@ 2000-01-14 12:05     ` Janne Rinta-Manty
  0 siblings, 0 replies; 4+ messages in thread
From: Janne Rinta-Manty @ 2000-01-14 12:05 UTC (permalink / raw)


Simon Josefsson 2000-01-13T16:14:25Z:
SJ> Are you using SSH port-forwarding?  Perhaps it doesn't preserve
SJ> CRLF?  Was that the reason for changing `imap-client-eol'?

No port-forwarding - I added ssh straight into imap streams (mostly by
adapting code from the other streams' functions). The reason for
changing imap-client-eol was that commands sent to the server with
"\r\n" didn't work but "\n" was OK. I suspect there must be something
wrong with my hack then?

(BTW the SSH connection is pre-authenticated.)

(defvar imap-ssh-program "ssh -p %p %s exec /etc/rimapd"
  "Program for SSH connection.
The %s is replaced with server and %p with port.")

(setq imap-streams '(ssh kerberos4 ssl network))

(setq imap-stream-alist
      '((ssh       imap-ssh-p        imap-ssh-open)
	(kerberos4 imap-kerberos4s-p imap-kerberos4-open)
	(ssl       imap-ssl-p        imap-ssl-open)
	(network   imap-network-p    imap-network-open)))

(setq nnimap-stream 'ssh)
(setq nnimap-authenticator 'ssh)

(setq imap-authenticators '(ssh kerberos4 cram-md5 login anonymous))

(setq imap-authenticator-alist
      '((ssh       imap-ssha-p       imap-ssh-auth)
	(kerberos4 imap-kerberos4a-p imap-kerberos4-auth)
	(cram-md5  imap-cram-md5-p   imap-cram-md5-auth)
	(login     imap-login-p      imap-login-auth)
	(anonymous imap-anonymous-p  imap-anonymous-auth)))

(defun imap-ssha-p (buffer)
  t)

(defun imap-ssh-auth (buffer)
  (eq imap-stream 'ssh))

(defconst imap-default-ssh-port 22)

(defun imap-ssh-p (buffer)
  t)

(defun imap-ssh-open (name buffer server port)
  (message "imap: Opening ssh connection to %s..." server)
  (let* ((port (or port imap-default-ssh-port))
	 (coding-system-for-read imap-coding-system-for-read)
	 (coding-system-for-write imap-coding-system-for-write)
	 (process (start-process
		   name buffer shell-file-name shell-command-switch
		   (format-spec
		    imap-ssh-program
		    (format-spec-make ?s server ?p (number-to-string port))))))
    (when process
      (with-current-buffer buffer
	(goto-char (point-min))
	(while (and (memq (process-status process) '(open run))
		    (goto-char (point-max))
		    (forward-line -1)
		    (not (imap-parse-greeting)))
	  (accept-process-output process 1)
	  (sit-for 1))
	(and imap-log
	     (with-current-buffer (get-buffer-create imap-log)
	       (imap-disable-multibyte)
	       (buffer-disable-undo)
	       (goto-char (point-max))
	       (insert-buffer-substring buffer)))
	(erase-buffer))
      (when (memq (process-status process) '(open run))
	process))))

SJ> Anyway, I think there was a bug involved when modifying
SJ> `imap-client-eol'. Could you please back out your patch and test
SJ> this instead?

Ok, tested it, and it made gnus hang (waiting for something from IMAP
server?) when I tried to copy a message. Pressed C-g and tried to quit
the group with Q (q made it hang again), and got this:

Signaling: (error "Internal error, tag 570 status BAD code nil text Argument given to APPEND when none expected")
  signal(error ("Internal error, tag 570 status BAD code nil text Argument given to APPEND when none expected"))
  error("Internal error, tag %s status %s code %s text %s" 570 BAD nil "Argument given to APPEND when none expected")
  imap-parse-response()
  imap-arrival-filter(#<process imap> "570 BAD Argument given to APPEND when none expected\r\n")
  accept-process-output(#<process imap> 1)
  imap-wait-for-tag(573 nil)
  imap-send-command-wait("SELECT \"Mail/fetchmail\"")
  imap-mailbox-select-1("Mail/fetchmail" nil)
  imap-mailbox-select("Mail/fetchmail")
  nnimap-possibly-change-group("Mail/fetchmail" "porsta")
  nnimap-close-group("Mail/fetchmail" "porsta")
  gnus-close-group("nnimap+porsta:Mail/fetchmail")
  gnus-summary-exit-no-update()
* call-interactively(gnus-summary-exit-no-update)

-- 
Janne Rinta-Mänty



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

end of thread, other threads:[~2000-01-14 12:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-15 13:42 B c with nnimap: extra newlines Janne Rinta-Manty
2000-01-13 14:13 ` Janne Rinta-Manty
2000-01-13 14:39   ` Simon Josefsson
2000-01-14 12:05     ` Janne Rinta-Manty

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).