* mail-source.el (mail-source-touch-pop): New function.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 28 Aug 2002 11:24:32 +0000 (11:24 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 28 Aug 2002 11:24:32 +0000 (11:24 +0000)
* message.el (message-smtpmail-send-it): New function.
(message-send-mail-function): Add it for a candidate.

lisp/ChangeLog
lisp/mail-source.el
lisp/message.el

index fff12cf..0ac078a 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-28  Katsumi Yamaoka <yamaoka@jpl.org>
+
+       * mail-source.el (mail-source-touch-pop): New function.
+
+       * message.el (message-smtpmail-send-it): New function.
+       (message-send-mail-function): Add it for a candidate.
+
 2002-08-27  Simon Josefsson  <jas@extundo.com>
 
        * gnus-msg.el (posting-charset-alist): Use
index 24a1981..0bab31f 100644 (file)
@@ -772,6 +772,24 @@ If ARGS, PROMPT is used as an argument to `format'."
                    mail-source-password-cache)))
       result)))
 
+(defun mail-source-touch-pop ()
+  "Open and close a POP connection shortly.
+POP server should be defined in `mail-source-primary-source' (which is
+preferred) or `mail-sources'.  You may use it for the POP-before-SMTP
+authentication.  To do that, you need to set the option
+`message-send-mail-function' to `message-smtpmail-send-it' and put the
+following line in .gnus file:
+
+\(add-hook 'message-send-mail-hook 'mail-source-touch-pop)
+"
+  (let ((sources (if mail-source-primary-source
+                    (list mail-source-primary-source)
+                  mail-sources)))
+    (while sources
+      (if (eq 'pop (car (car sources)))
+         (mail-source-check-pop (car sources)))
+      (setq sources (cdr sources)))))
+
 (defun mail-source-new-mail-p ()
   "Handler for `display-time' to indicate when new mail is available."
   ;; Flash (ie. ring the visible bell) if mail is available.
index 6e9f71e..69a4ade 100644 (file)
@@ -393,12 +393,13 @@ variable `mail-header-separator'.
 
 Valid values include `message-send-mail-with-sendmail' (the default),
 `message-send-mail-with-mh', `message-send-mail-with-qmail',
-`smtpmail-send-it' and `feedmail-send-it'.
+`message-smtpmail-send-it', `smtpmail-send-it' and `feedmail-send-it'.
 
 See also `send-mail-function'."
   :type '(radio (function-item message-send-mail-with-sendmail)
                (function-item message-send-mail-with-mh)
                (function-item message-send-mail-with-qmail)
+               (function-item message-smtpmail-send-it)
                (function-item smtpmail-send-it)
                (function-item feedmail-send-it)
                (function :tag "Other"))
@@ -3126,6 +3127,15 @@ to find out how to use this."
     ;; Pass it on to mh.
     (mh-send-letter)))
 
+(defun message-smtpmail-send-it ()
+  "Send the prepared message buffer with `smtpmail-send-it'.
+This only differs from `smtpmail-send-it' that this command evaluates
+`message-send-mail-hook' just before sending a message.  It is useful
+if your ISP requires the POP-before-SMTP authentication.  See the
+documentation for the function `mail-source-touch-pop'."
+  (run-hooks 'message-send-mail-hook)
+  (smtpmail-send-it))
+
 (defun message-canlock-generate ()
   "Return a string that is non-trival to guess.
 Do not use this for anything important, it is cryptographically weak."