Gnus development mailing list
 help / color / mirror / Atom feed
* pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems
@ 1999-04-06 18:37 Stainless Steel Rat
  1999-04-06 18:59 ` William M. Perry
  1999-04-06 19:10 ` paul stevenson
  0 siblings, 2 replies; 5+ messages in thread
From: Stainless Steel Rat @ 1999-04-06 18:37 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 587 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here is a patch against pop3 1.3q to bring it to 1.3r.  It should generate
a Content-Length header with the same value as the Lines header Gnus
creates (which is converted to X-Content-Length by Gnus somewhere along the 
line).  This should hopefully prevent unescaped envelopes from being a
problem.

Note: it uses `count-lines-buffer' from simple.el, which might not be part
of FSF Emacs (it is part of XEmacs).  If this is the case, does FSF Emacs
have a more or less equivalently useful function, or am I going to have to
roll my own?


[-- Attachment #2: pop3.el patch: 1.3q to 1.3r --]
[-- Type: application/octet-stream, Size: 1560 bytes --]

*** -	Tue Apr  6 14:29:42 1999
--- pop3.el	Tue Apr  6 14:28:09 1999
***************
*** 4,10 ****
  
  ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
  ;; Keywords: mail, pop3
! ;; Version: 1.3q
  
  ;; This file is part of GNU Emacs.
  
--- 4,10 ----
  
  ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
  ;; Keywords: mail, pop3
! ;; Version: 1.3r
  
  ;; This file is part of GNU Emacs.
  
***************
*** 37,43 ****
  (require 'mail-utils)
  (provide 'pop3)
  
! (defconst pop3-version "1.3q")
  
  (defvar pop3-maildrop (or (user-login-name) (getenv "LOGNAME") (getenv "USER") nil)
    "*POP3 maildrop.")
--- 37,43 ----
  (require 'mail-utils)
  (provide 'pop3)
  
! (defconst pop3-version "1.3r")
  
  (defvar pop3-maildrop (or (user-login-name) (getenv "LOGNAME") (getenv "USER") nil)
    "*POP3 maildrop.")
***************
*** 247,253 ****
  	      (setq From_ (concat (substring From_ 0 (match-beginning 0))
  				  (substring From_ (match-end 0)))))
  	    (goto-char (point-min))
! 	    (insert From_))))))
  
  ;; The Command Set
  
--- 247,261 ----
  	      (setq From_ (concat (substring From_ 0 (match-beginning 0))
  				  (substring From_ (match-end 0)))))
  	    (goto-char (point-min))
! 	    (insert From_)
! 	    (re-search-forward "\n\n")
! 	    (narrow-to-region (point) (point-max))
! 	    (let ((lines (count-lines-buffer (current-buffer))))
! 	      (goto-char (point-min))
! 	      (widen)
! 	      (forward-line -2)
! 	      (insert (format "Content-Length: %s\n" lines)))
! 	    )))))
  
  ;; The Command Set
  

[-- Attachment #3: Type: text/plain, Size: 454 bytes --]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v0.9.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE3ClRYgl+vIlSVSNkRAi8uAKD026LoroiOadOr9c3JZXGMcr+DJwCg1VyM
KU1OttiKVz2DRRN/ARsJBWg=
=bqrW
-----END PGP SIGNATURE-----

-- 
Rat <ratinox@peorth.gweep.net>    \ When not in use, Happy Fun Ball should be
Minion of Nathan - Nathan says Hi! \ returned to its special container and
PGP Key: at a key server near you!  \ kept under refrigeration.

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

* Re: pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems
  1999-04-06 18:37 pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems Stainless Steel Rat
@ 1999-04-06 18:59 ` William M. Perry
  1999-04-06 19:29   ` Stainless Steel Rat
  1999-04-06 19:35   ` Stainless Steel Rat
  1999-04-06 19:10 ` paul stevenson
  1 sibling, 2 replies; 5+ messages in thread
From: William M. Perry @ 1999-04-06 18:59 UTC (permalink / raw)
  Cc: (ding)

Stainless Steel Rat <ratinox@peorth.gweep.net> writes:

> Here is a patch against pop3 1.3q to bring it to 1.3r.  It should
> generate a Content-Length header with the same value as the Lines header
> Gnus creates (which is converted to X-Content-Length by Gnus somewhere
> along the line).  This should hopefully prevent unescaped envelopes from
> being a problem.
> 
> Note: it uses `count-lines-buffer' from simple.el, which might not be
> part of FSF Emacs (it is part of XEmacs).  If this is the case, does FSF
> Emacs have a more or less equivalently useful function, or am I going to
> have to roll my own?

Ummmm... content-length is supposed to be the byte count, is it not?

-Bill P.


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

* Re: pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems
  1999-04-06 18:37 pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems Stainless Steel Rat
  1999-04-06 18:59 ` William M. Perry
@ 1999-04-06 19:10 ` paul stevenson
  1 sibling, 0 replies; 5+ messages in thread
From: paul stevenson @ 1999-04-06 19:10 UTC (permalink / raw)


Stainless Steel Rat <ratinox@peorth.gweep.net> writes:

> Note: it uses `count-lines-buffer' from simple.el, which might not be part
> of FSF Emacs (it is part of XEmacs).  If this is the case, does FSF Emacs
> have a more or less equivalently useful function, or am I going to have to
> roll my own?

FSF emacs doesn't have it.

I tend to use

(count-lines (point-min) (point-max))

in the appropriate buffer. I don't know if there's a nicer way.


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

* Re: pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems
  1999-04-06 18:59 ` William M. Perry
@ 1999-04-06 19:29   ` Stainless Steel Rat
  1999-04-06 19:35   ` Stainless Steel Rat
  1 sibling, 0 replies; 5+ messages in thread
From: Stainless Steel Rat @ 1999-04-06 19:29 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

* wmperry@aventail.com (William M. Perry)  on Tue, 06 Apr 1999
| Ummmm... content-length is supposed to be the byte count, is it not?

Damn... yes, it is.

Anyone using that patch... don't.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v0.9.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE3CmCpgl+vIlSVSNkRAhyVAJ4mNU+TkzZztz//B28qxPcAOzxnJQCgiAbg
goOLhLEp0v0BG0Zq26hNBoA=
=tqWC
-----END PGP SIGNATURE-----

-- 
Rat <ratinox@peorth.gweep.net>    \ Do not taunt Happy Fun Ball.
Minion of Nathan - Nathan says Hi! \ 
PGP Key: at a key server near you!  \ 



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

* Re: pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems
  1999-04-06 18:59 ` William M. Perry
  1999-04-06 19:29   ` Stainless Steel Rat
@ 1999-04-06 19:35   ` Stainless Steel Rat
  1 sibling, 0 replies; 5+ messages in thread
From: Stainless Steel Rat @ 1999-04-06 19:35 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

* wmperry@aventail.com (William M. Perry)  on Tue, 06 Apr 1999
| Ummmm... content-length is supposed to be the byte count, is it not?

Okay, this patch should Do The Right Thing.  I hope.


[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1548 bytes --]

*** -	Tue Apr  6 15:32:18 1999
--- pop3.el	Tue Apr  6 15:31:50 1999
***************
*** 4,10 ****
  
  ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
  ;; Keywords: mail, pop3
! ;; Version: 1.3q
  
  ;; This file is part of GNU Emacs.
  
--- 4,10 ----
  
  ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
  ;; Keywords: mail, pop3
! ;; Version: 1.3r
  
  ;; This file is part of GNU Emacs.
  
***************
*** 37,43 ****
  (require 'mail-utils)
  (provide 'pop3)
  
! (defconst pop3-version "1.3q")
  
  (defvar pop3-maildrop (or (user-login-name) (getenv "LOGNAME") (getenv "USER") nil)
    "*POP3 maildrop.")
--- 37,43 ----
  (require 'mail-utils)
  (provide 'pop3)
  
! (defconst pop3-version "1.3r")
  
  (defvar pop3-maildrop (or (user-login-name) (getenv "LOGNAME") (getenv "USER") nil)
    "*POP3 maildrop.")
***************
*** 247,253 ****
  	      (setq From_ (concat (substring From_ 0 (match-beginning 0))
  				  (substring From_ (match-end 0)))))
  	    (goto-char (point-min))
! 	    (insert From_))))))
  
  ;; The Command Set
  
--- 247,261 ----
  	      (setq From_ (concat (substring From_ 0 (match-beginning 0))
  				  (substring From_ (match-end 0)))))
  	    (goto-char (point-min))
! 	    (insert From_)
! 	    (re-search-forward "\n\n")
! 	    (narrow-to-region (point) (point-max))
! 	    (let ((size (- (point-max) (point-min))))
! 	      (goto-char (point-min))
! 	      (widen)
! 	      (forward-line -2)
! 	      (insert (format "Content-Length: %s\n" size)))
! 	    )))))
  
  ;; The Command Set
  

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]


-- 
Rat <ratinox@peorth.gweep.net>    \ Happy Fun Ball may stick to certain types
Minion of Nathan - Nathan says Hi! \ of skin.
PGP Key: at a key server near you!  \ 

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

end of thread, other threads:[~1999-04-06 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-06 18:37 pop3.el: Content-Length generation (was: bad (i.e. serious) mail problems Stainless Steel Rat
1999-04-06 18:59 ` William M. Perry
1999-04-06 19:29   ` Stainless Steel Rat
1999-04-06 19:35   ` Stainless Steel Rat
1999-04-06 19:10 ` paul stevenson

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