From 5102e44e313eb88d7a16f14dd5c8d12ceb411e1d Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Wed, 28 Aug 2002 11:24:32 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 7 +++++++ lisp/mail-source.el | 18 ++++++++++++++++++ lisp/message.el | 12 +++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fff12cfb7..0ac078ab9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2002-08-28 Katsumi Yamaoka + + * 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 * gnus-msg.el (posting-charset-alist): Use diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 24a19813f..0bab31f7d 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -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. diff --git a/lisp/message.el b/lisp/message.el index 6e9f71ea5..69a4ade34 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -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." -- 2.34.1