unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* smtpmail.el and 1msg
@ 2004-03-04 21:29 jglauner
  2004-03-08 16:51 ` Simon Josefsson
  0 siblings, 1 reply; 14+ messages in thread
From: jglauner @ 2004-03-04 21:29 UTC (permalink / raw)


I'd like to propose a patch (and I'm not sure I'm in the right place)
for smtpmail.el.  

The problem I experienced was that smtpmail would spin, waiting for
response from the "QUIT" command.  It would appear that my ISP changed
its mail software and now has configured an option called 1msg which
closes the connection when the end of "DATA" has been reached.  The
smtpmail package was still trying to read from the process, even
though the process had closed.  So I created a binding for a variable
called smtpmail-1msg, parsing the greeting string, looking for the
1msg token to set and later use when deciding whether or not to bother
sending "QUIT".

Here's my diff:


diff -c /usr/share/emacs/21.2/lisp/mail/smtpmail.el /home/jglauner/emacs/smtpmail.el
*** /usr/share/emacs/21.2/lisp/mail/smtpmail.el	Fri Mar 22 11:02:55 2002
--- /home/jglauner/emacs/smtpmail.el	Fri Feb 20 09:35:48 2004
***************
*** 349,355 ****
  	response-code
  	greeting
  	process-buffer
! 	(supported-extensions '()))
      (unwind-protect
  	(catch 'done
  	  ;; get or create the trace buffer
--- 349,356 ----
  	response-code
  	greeting
  	process-buffer
! 	(supported-extensions '())
! 	(smtpmail-1msg nil))
      (unwind-protect
  	(catch 'done
  	  ;; get or create the trace buffer
***************
*** 374,386 ****
  	    (make-local-variable 'smtpmail-read-point)
  	    (setq smtpmail-read-point (point-min))
  
- 	    
  	    (if (or (null (car (setq greeting (smtpmail-read-response process))))
  		    (not (integerp (car greeting)))
  		    (>= (car greeting) 400))
  		(throw 'done nil)
  	      )
  
  	    ;; EHLO
  	    (smtpmail-send-command process (format "EHLO %s" (smtpmail-fqdn)))
  
--- 375,388 ----
  	    (make-local-variable 'smtpmail-read-point)
  	    (setq smtpmail-read-point (point-min))
  
  	    (if (or (null (car (setq greeting (smtpmail-read-response process))))
  		    (not (integerp (car greeting)))
  		    (>= (car greeting) 400))
  		(throw 'done nil)
  	      )
  
+ 	    (setq smtpmail-1msg (string-match "1msg/" (cadr greeting)))
+ 
  	    ;; EHLO
  	    (smtpmail-send-command process (format "EHLO %s" (smtpmail-fqdn)))
  
***************
*** 521,527 ****
  ;	    (and (null (car (smtpmail-read-response process)))
  ;		 (throw 'done nil))
  	    t ))
!       (if process
  	  (save-excursion
  	    (set-buffer (process-buffer process))
  	    (smtpmail-send-command process "QUIT")
--- 523,529 ----
  ;	    (and (null (car (smtpmail-read-response process)))
  ;		 (throw 'done nil))
  	    t ))
!       (if (and process (not smtpmail-1msg))
  	  (save-excursion
  	    (set-buffer (process-buffer process))
  	    (smtpmail-send-command process "QUIT")

Diff finished at Fri Feb 20 09:36:00


Cheers!

--Jonathan

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

end of thread, other threads:[~2004-03-12 13:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-04 21:29 smtpmail.el and 1msg jglauner
2004-03-08 16:51 ` Simon Josefsson
2004-03-09 22:36   ` Simon Josefsson
2004-03-10 18:15     ` jglauner
2004-03-10 22:51       ` Simon Josefsson
2004-03-10 23:05         ` Jonathan Glauner
2004-03-10 23:11           ` Simon Josefsson
2004-03-10 23:24             ` Jonathan Glauner
2004-03-10 23:38             ` Jonathan Glauner
2004-03-11 10:54               ` Simon Josefsson
2004-03-12 13:42           ` Stefan Monnier
2004-03-11 14:37   ` Stefan Monnier
2004-03-11 18:52     ` Simon Josefsson
2004-03-11 19:11       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).