From ca4dfa5e5a83fe7243affbf7e34a1435cbc5b00a Mon Sep 17 00:00:00 2001 From: Matt Price Date: Thu, 12 Jan 2017 20:07:55 -0500 Subject: [PATCH 4/4] org-mime: improve handling of cc & bcc headers --- contrib/lisp/org-mime.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el index 2ced42ec8..465fb3416 100644 --- a/contrib/lisp/org-mime.el +++ b/contrib/lisp/org-mime.el @@ -257,6 +257,10 @@ otherwise export the entire body." (to (funcall mp "MAIL_TO")) (cc (funcall mp "MAIL_CC")) (bcc (funcall mp "MAIL_BCC")) + (other-headers (cond ((and cc bcc) `((cc . ,cc) (bcc . ,bcc))) + (cc `((cc . ,cc))) + (bcc `((bcc . ,bcc))) + (t nil))) (body (buffer-substring (save-excursion (goto-char (point-min)) (forward-line 1) @@ -265,8 +269,7 @@ otherwise export the entire body." (forward-char)) (point)) (point-max)))) - (org-mime-compose body (or fmt 'org) file to subject - `((cc . ,cc) (bcc . ,bcc)))))) + (org-mime-compose body (or fmt 'org) file to subject other-headers)))) (defun org-mime-send-buffer (&optional fmt) (run-hooks 'org-mime-send-buffer-hook) -- 2.11.0