From: morioka Date: Mon, 30 Nov 1998 19:28:03 +0000 (+0000) Subject: (smtpmail-send-it): Add autoload cookie; use `smtpmail-do-bcc' instead X-Git-Tag: flim-1_12-199811302358~3 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e258f90183d99dd9ab90d01ee992132a3fd1b6f;p=elisp%2Fflim.git (smtpmail-send-it): Add autoload cookie; use `smtpmail-do-bcc' instead of `smtp-do-bcc'; modify for interface change of `smtp-via-smtp'. (smtpmail-do-bcc): New function (moved and renamed from `smtp-do-bcc' of smtp.el). --- diff --git a/smtpmail.el b/smtpmail.el index 77a5947..692fd7c 100644 --- a/smtpmail.el +++ b/smtpmail.el @@ -76,6 +76,7 @@ This is relative to `smtpmail-queue-dir'.") ;;; ;;; +;;;###autoload (defun smtpmail-send-it () (require 'mail-utils) (let ((errbuf (if mail-interactive @@ -207,12 +208,13 @@ This is relative to `smtpmail-queue-dir'.") (or resend-to-addresses (smtp-deduce-address-list tembuf (point-min) delimline))) - (smtp-do-bcc delimline) + (smtpmail-do-bcc delimline) ; Send or queue (if (not smtpmail-queue-mail) (if smtpmail-recipient-address-list - (if (not (smtp-via-smtp - smtpmail-recipient-address-list tembuf)) + (if (not (smtp-via-smtp user-mail-address + smtpmail-recipient-address-list + tembuf)) (error "Sending failed; SMTP protocol error")) (error "Sending failed; no recipients")) (let* ((file-data (concat @@ -265,7 +267,8 @@ This is relative to `smtpmail-queue-dir'.") (load file-msg) (setq tembuf (find-file-noselect file-msg)) (if smtpmail-recipient-address-list - (if (not (smtp-via-smtp smtpmail-recipient-address-list tembuf)) + (if (not (smtp-via-smtp user-mail-address + smtpmail-recipient-address-list tembuf)) (error "Sending failed; SMTP protocol error")) (error "Sending failed; no recipients")) (delete-file file-msg) @@ -278,6 +281,25 @@ This is relative to `smtpmail-queue-dir'.") ))) +(defun smtpmail-do-bcc (header-end) + "Delete BCC: and their continuation lines from the header area. +There may be multiple BCC: lines, and each may have arbitrarily +many continuation lines." + (let ((case-fold-search t)) + (save-excursion + (goto-char (point-min)) + ;; iterate over all BCC: lines + (while (re-search-forward "^BCC:" header-end t) + (delete-region (match-beginning 0) (progn (forward-line 1) (point))) + ;; get rid of any continuation lines + (while (and (looking-at "^[ \t].*\n") (< (point) header-end)) + (replace-match "")) + ) + ) ;; save-excursion + ) ;; let + ) + + ;;; (provide 'smtpmail)