Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with sending mail in mu4e #3663

Closed
jgoerzen opened this issue Aug 1, 2020 · 3 comments
Closed

Issues with sending mail in mu4e #3663

jgoerzen opened this issue Aug 1, 2020 · 3 comments
Labels
is:bug Something isn't working as intended module:email/mu4e Pertains to Doom's :email mu4e module status:resolved Issue was addressed internally

Comments

@jgoerzen
Copy link

jgoerzen commented Aug 1, 2020

What did you expect to happen?

Mail would be sent without an error and a copy stored in Sent, and it should be done in a consistent way regardless of where the point is.

What actually happened?

This may, incidentally, be a problem of documentation; none is provided on how to actually send a message. I am a long-time user of mu4e and migrating to doom. I did not previously use org-mode for composition.

I start a message. I can type it. With my point in the body area, I guess I have to type M-m C-c C-c to send it.

When I do so, I immediately get the message "Already sent message via mail; resend? (y or n)". Even on a brand-new message I just typed. If I hit y, it is sent (once) but is not saved into the Sent folder.

HOWEVER, if my cursor is up in the headers area, all I have to do to send is type C-c C-c. When I do that, I get no "Already sent" message and it is properly copied to my sent mail folder.

I am not using evil mode but otherwise am using the default keybindings with minimal on top.

Additional details:

Here are some excerpts from my config.el:

(setq +mu4e-backend 'offlineimap)
(set-email-account! "personal"
                    '(( user-mail-address      . "jgoerzen@[redacted]"  )
                      ( user-full-name         . "John Goerzen" )
                      ( mail-host-address . "complete.org" )
                      ( send-mail-function . sendmail-send-it )
                      ( mu4e-drafts-folder . "/personal/Drafts")
                      ( mu4e-sent-folder   . "/personal/Sent")
                      ( mu4e-trash-folder  . "/personal/Trash")
                      ( mu4e-refile-folder . "/personal/Archives")
                      ( mail-interactive . nil)
                      ( sendmail-program . "/usr/sbin/sendmail")
                      ( mu4e-view-auto-mark-as-read . t)
                      )
                    t)
(after! mu4e
  (load-file "~/.doom.d/config-mu4e-after.el")
)

And in the config-mu4e-after.el (which I have verified is loading):

  ; Restore some defaults that doom screws with.
  (setq mu4e-maildir "~/Maildir")
  (setq mu4e-use-fancy-chars nil)
(setq mu4e-compose-context-policy 'ask)
  (setq message-send-mail-function 'message-send-mail-with-sendmail)


  (setq mu4e-maildir-shortcuts
        '(  ("/personal/INBOX"   . ?i)
            ("/other/INBOX"     . ?I)
            )
        )


  ; Automatically apply marks when leaving folder.
  (setq mu4e-headers-leave-behavior 'apply)

  ; In mu4e 1.0, started to want to suppress duplicates and include
  ; related from other folders.  Stop that nonsense.
  (setq mu4e-headers-skip-duplicates nil)
  (setq mu4e-headers-include-related nil)

  ;;;;;;; FETCHING
  (setq mu4e-get-mail-command "offlineimap -o")
  (setq mu4e-update-interval 300)

  ;;;;;;;;;;;;;; SENDING
  (setq mu4e-user-mail-address-list '("jgoerzen@[redacted]" "jgoerzen@[redacted2]"))
  (setq message-citation-line-function 'message-insert-formatted-citation-line)

  ; We need to use the From: header of the message for the envelope from
  ; (to get from the correct account context).  [[https://notanumber.io/2016-10-03/better-email-with-mu4e/][Source]]

  (setq message-sendmail-envelope-from 'header)

  ; bbdb-mu4e
  ; From the [[http://www.djcbsoftware.nl/code/mu/mu4e/Maintaining-an-address_002dbook-with-BBDB.html][handbook]]:

  ;; Load BBDB (Method 1)
;; (require 'bbdb-loaddefs)
;; OR (Method 2)
;; (require 'bbdb-loaddefs "/path/to/bbdb/lisp/bbdb-loaddefs.el")
;; OR (Method 3)
(autoload 'bbdb-insinuate-mu4e "bbdb-mu4e")
(bbdb-initialize 'message 'mu4e)
(setq bbdb-mail-user-agent (quote message-user-agent))
(setq mu4e-view-mode-hook (quote (bbdb-mua-auto-update visual-line-mode)))
(setq mu4e-compose-complete-addresses nil)
(setq bbdb-mua-pop-up nil)
(setq bbdb-completion-display-record nil)
; (setq bbdb-mua-pop-up-window-size 5)


Steps to reproduce:

See description above

System information:

emacs   version    26.1
        features   XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2
        build      Sep 22, 2019
        buildopts  (--build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-StqULU/emacs-26.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro)
        windowsys  x
        daemonp    server-running
doom    version    2.0.9
        build      HEAD -> develop, origin/develop, origin/HEAD 16acf1a41 2020-07-31 16:25:45 -0400
        dir        ~/tree/homedirfiles/dot.doom.d/
system  type       gnu/linux
        config     x86_64-pc-linux-gnu
        shell      /bin/bash
        uname      Linux 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64
        path       (~/bin /usr/local/bin /usr/bin /bin /usr/local/games /usr/games /usr/lib/emacs/26.1/x86_64-linux-gnu)
config  envfile    nil
        elc-files  0
        modules    (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) vc-gutter vi-tilde-fringe workspaces :editor file-templates fold snippets :emacs dired electric undo vc :term eshell shell term vterm :checkers syntax spell grammar :tools (eval +overlay) lookup lsp magit make :lang cc data emacs-lisp (haskell +dante) json latex markdown org rust sh :email mu4e :config (default +bindings +smartparens))
        packages   ((mu4e-maildirs-extension))
        unpin      (n/a)
        elpa       (use-package undo-tree spinner org-bullets goto-chg evil diminish bind-key)
@jgoerzen jgoerzen added the is:bug Something isn't working as intended label Aug 1, 2020
@jgoerzen
Copy link
Author

jgoerzen commented Aug 1, 2020

In researching this, I have found multiple additional issues:

  • The shortcut to attach a file is broken (C-c RET f, or M-m C-c RET f).
  • Invoking mml-attach-file inserts the <#part... bit but the file is never attached; that text is simply included literally in the sent email

Further research shows that org-mu4e-compose-org-mode is deprecated by the author. There have been several attempts to do this other ways; for instance this one which was referenced in mu PR 952 although it was stated attachments are still not working right.

At this point, I believe the better user experience would be from removing the :hook (mu4e-compose-mode . org-mu4e-compose-org-mode) from the configuration.

@jgoerzen
Copy link
Author

jgoerzen commented Aug 1, 2020

This is an effective workaround:

(after! mu4e
  (remove-hook 'mu4e-compose-mode-hook 'org-mu4e-compose-org-mode)

)

@hlissner hlissner added the module:email/mu4e Pertains to Doom's :email mu4e module label Aug 1, 2020
@hlissner hlissner added the status:resolved Issue was addressed internally label Aug 1, 2020
@hlissner
Copy link
Member

hlissner commented Aug 1, 2020

As of bfb0410 I've replaced the deprecated org-mu4e with org-msg. This was an overdue change. I haven't used mu4e in some time so I hope this resolves your issue. Let me know if that isn't the case and I'll reopen the issue. Thanks for bringing it to my attention!

ymarco pushed a commit to ymarco/doom-emacs that referenced this issue Aug 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
is:bug Something isn't working as intended module:email/mu4e Pertains to Doom's :email mu4e module status:resolved Issue was addressed internally
Projects
None yet
Development

No branches or pull requests

2 participants