emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

smtpmail.el and 1msg


From: jglauner
Subject: smtpmail.el and 1msg
Date: Thu, 4 Mar 2004 15:29:10 -0600

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 via email to

[Prev in Thread] Current Thread [Next in Thread]