I have the following setup:- * isync / mbsync to sync with Gmail's IMAP * notmuch to index/tag/search * notmuch emacs as the interface to notmuch * msmtp / msmtpq to SMTP User-Agent: Notmuch/0.23.5 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-unknown-linux-gnu) notmuch database path is '~/.mail', with '~/.mail/gmail/' being the directory for maildir folders for the gmail account. i.e. ~/.mail/gmail/Inbox, ~/.mail/gmail/Sent, ~/.mail/gmail/Drafts Now while I can read, tag, and send mail from notmuch emacs, I can't get notmuch to insert the sent messages into the local maildir 'Sent' folder. Syncing with Gmail's IMAP, the local maildir reflects the messages I have sent after the next sync with the IMAP server after updating the 'Sent Mail' folder on Gmail's IMAP. I'd rather have notmuch to insert the sent message into the local maildir 'Sent' directory when the message is successfully sent/queued through msmtp / msmtpq. Another thing I cannot get to work is killing the message buffer on successfully sending a message. I get this message when doing 'C-c C-c' in a Notmuch Message buffer: "Sending via mail... message-send-mail-with-sendmail: Sending...failed to mail for [ -oi -t ] : send was successful; " I have tried reading notmuch-mua.el, notmuch-maildir-fcc.el, notmuch-message.el, but I cannot figure out what I am missing. The relevant section of my init file is below. ------- (require 'notmuch) ;;(autoload 'notmuch "notmuch" "notmuch mail" t) ;;(setq mm-sign-option 'guided) ;;(setq mm-encrypt-option 'guided) (setq mm-text-html-renderer 'shr) (setq shr-color-visible-luminance-min 70) (setq notmuch-search-oldest-first nil notmuch-show-all-multipart/alternative-parts nil notmuch-always-prompt-for-sender t notmuch-fcc-dirs "gmail/Sent/ +sent -new" notmuch-show-indent-messages-width 4 notmuch-crypto-process-mime t notmuch-maildir-use-notmuch-insert t notmuch-mua-compose-in 'new-frame notmuch-mua-user-agent-function 'notmuch-mua-user-agent-full mml-default-encrypt-method 'pgpmime mml-default-sign-method 'pgpmime mml-secure-openpgp-encrypt-to-self t ;;mail-user-agent 'message-user-agent mail-specify-envelope-from 'header mail-envelope-from 'header mail-interactive t sendmail-program "/usr/local/bin/msmtpq" message-send-mail-function 'message-send-mail-with-sendmail message-sendmail-f-is-evil t message-sendmail-envelope-from 'header message-kill-buffer-on-exit t ;;message-directory "gmail" ; stores postponed messages to the specified directory message-default-mail-headers "Cc: \nBcc: \n" message-fcc-handler-function 'message-do-fcc message-fill-column 72 user-full-name "Vishal Belsare" user-mail-address "myname@gmail.com" ) ------- Keen to know what I am doing wrong and how to fix. Thanks. -- Vishal Belsare GPG Fingerprint: 9ACC F873 D04E CF71 11DD 4598 28FD 5DF6 BCC8 CB43