From: dmaus Date: Sun, 10 Jul 2011 06:42:40 +0000 (+0000) Subject: Added support for sending mail with sendmail package X-Git-Tag: merged-trunk-to-elmo-imap4-compliance-3^2~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=47bd1029e3c8284011c4e6dedd5eb844862270cc;p=elisp%2Fwanderlust.git Added support for sending mail with sendmail package * wl-draft.el (wl-draft-send-mail-with-sendmail): New function. Send mail with sendmail package. * wl-vars.el (wl-draft-send-mail-function): Add function to list of prepared send mail functions. Wrapper function for sendmail-send-it was provided by Michael Lex. --- diff --git a/NEWS b/NEWS index c28552b..9b83aa9 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,10 @@ + Wanderlust NEWS -- User-visible changes in Wanderlust. * Changes in 2.16.0 from 2.14.x +** Added support for sending mail with sendmail package + ** Prevent accidental loss of messages when renaming IMAP folder ** Put spam mark on the message registered as spam. diff --git a/wl/ChangeLog b/wl/ChangeLog index 9cb66e4..e3c7930 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,10 @@ +2011-07-10 David Maus + + * wl-draft.el (wl-draft-send-mail-with-sendmail): New + function. Send mail with sendmail package. + * wl-vars.el (wl-draft-send-mail-function): Add function to list + of prepared send mail functions. + 2011-06-03 Erik Hetzner * wl-vars.el (wl-summary-line-format): Document missing control diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 9e966d7..b05eac1 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1126,6 +1126,22 @@ non-nil." (signal (car error) (cdr error)))))) (wl-draft-send-mail-with-smtp)) +(defun wl-draft-send-mail-with-sendmail () + "Send the prepared message buffer with `sendmail-send-it'. +The function `sendmail-send-it' uses the external program +`sendmail-program'." + (let ((id (std11-field-body "message-id")) + (to (std11-field-body "to"))) + (run-hooks 'wl-mail-send-pre-hook) + (require 'sendmail) + (condition-case err + (sendmail-send-it) + (error + (wl-draft-write-sendlog 'failed 'sendmail nil (list to) id) + (signal (car err) (cdr err)))) + (wl-draft-set-sent-message 'mail 'sent) + (wl-draft-write-sendlog 'ok 'sendmail nil (list to) id))) + (defun wl-draft-insert-required-fields (&optional force-msgid) "Insert Message-ID, Date, and From field. If FORCE-MSGID, insert message-id regardless of `wl-insert-message-id'." diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 568be98..170d744 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -898,8 +898,10 @@ reasons of system internal to accord facilities for the Emacs variants.") (defcustom wl-draft-send-mail-function 'wl-draft-send-mail-with-smtp "A function to send mail. Prepared candidates are 'wl-draft-send-mail-with-smtp, -'wl-draft-send-mail-with-qmail and 'wl-draft-send-mail-with-pop-before-smtp." +'wl-draft-send-mail-with-sendmail, 'wl-draft-send-mail-with-qmail +and 'wl-draft-send-mail-with-pop-before-smtp." :type '(radio (function-item wl-draft-send-mail-with-smtp) + (function-item wl-draft-send-mail-with-sendmail) (function-item wl-draft-send-mail-with-qmail) (function-item wl-draft-send-mail-with-pop-before-smtp) (function :tag "Other"))