Emacs Message: save sent mails
How do you make Emacs Message (
C-x m) conserve outward bound mails?
Exists a typical means to do this?
C-x C-s yet this mishandles and also very easy to neglect, besides, you can not be 100% it is the mail in fact sent out: you could have done some eleventh hour adjustments that you later on forgot.
Could this (
save-buffer) be conjured up from a "send message" hook and also be automated? (Like
text-mode-hook.) If so, what hook? (How do you get the hooks of a setting?)
BCC to on your own: not really classy?
FCC: appears to be ideal remedy, still, have to be automated, both conjuration and also an excellent documents name created.
I make use of extra make complex remedy:
(defconst my-safe-filename-char-regex "[[:alnum:][email protected]]" "Safe file names.") (defun my-clean-filename (filename) (mapconcat (lambda (ch) (or (when (string-match my-safe-filename-char-regex (char-to-string ch)) (char-to-string ch)) "-")) filename "") ) (defun my-message-save () "Store message in `gnus-article-save-directory' after successful sending. It is possible that mail rejected and I lost it completely, this func save it for me." (unless (eq major-mode 'message-mode) (error "Attempt to call my-message-save in non message-mode buffer")) (make-directory gnus-article-save-directory t) (let ( (buf (current-buffer)) (field-to (my-clean-filename (or (message-fetch-field "Newsgroups") (message-fetch-field "To")))) (field-subject (my-clean-filename (message-fetch-field "Subject"))) file ) (setq file (concat gnus-article-save-directory "/" (format-time-string "%F_%T") "_" field-to "_" field-subject)) (with-temp-file file (insert-buffer buf) )) ) (add-hook 'message-sent-hook 'my-message-save)
Also keep in mind that I make use of message - sent out - hook as opposed to message - send - hook .
You can set the variable
T for any kind of teams you intend to archive.
See its documents here. (or
(gnus) Group Parameters)
gcc-self isn't a" timeless" variable, you've to set it via
(setq gnus-parameters '((".*" (gcc-self . t))))