all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jglauner@sbum.org
Subject: smtpmail.el and 1msg
Date: Thu, 4 Mar 2004 15:29:10 -0600	[thread overview]
Message-ID: <16455.40870.198614.821339@freezer.sbum.org> (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

             reply	other threads:[~2004-03-04 21:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-04 21:29 jglauner [this message]
2004-03-08 16:51 ` smtpmail.el and 1msg 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

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=16455.40870.198614.821339@freezer.sbum.org \
    --to=jglauner@sbum.org \
    --cc=jglauner+emacsdevel@sbum.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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.