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

[mu4e] multiple account setup doesn't work as documented #4670

Closed
andreas-h opened this issue Jan 18, 2016 · 6 comments
Closed

[mu4e] multiple account setup doesn't work as documented #4670

andreas-h opened this issue Jan 18, 2016 · 6 comments

Comments

@andreas-h
Copy link
Contributor

@TheBB @darkfeline @nwolfe

For me, the multiple account setup doesn't work as advertised. In my init.el, I have the following:

(setq mu4e-account-alist
  '(("UniHB"
     (user-mail-address "me@uni-bremen.de")
     (smtpmail-default-smtp-server "smtp.uni-bremen.de")
     (smtpmail-local-domain "uni-bremen.de")
     (smtpmail-smtp-server "smtp.uni-bremen.de")
     (smtpmail-stream-type 'ssl)
     (smtpmail-smtp-service 465))

    ("Private"
     (user-mail-address "me@posteo.de")
     (smtpmail-default-smtp-server "posteo.de")
     (smtpmail-local-domain "posteo.de")
     (smtpmail-smtp-server "posteo.de")
     (smtpmail-stream-type "ssl")
     (smtpmail-smtp-service 465))))
(mu4e/mail-account-reset)

Apparently, mu4e-account-alist is not defined yet at the end of the mu4e layer's package.el. At least, when I modify the last lines of package.el to read

(message "WILL NOW SET HOOK")
(when mu4e-account-alist
  (message "YEAY SETTING HOOK")
  (add-hook 'mu4e-compose-pre-hook 'mu4e/set-account)
  (add-hook 'message-sent-hook 'mu4e/mail-account-reset)))))

I only get the first message in my *messages* buffer, and not the second one. However, when I eval those lines in the *scratch* buffer afterwards, I get both messages.

Any help in resolving this is greatly appreciated =)

@darkfeline
Copy link
Contributor

I ran into this "bug" recently too.

The mu4e layer expects mu4e-account-alist to be defined before the layer is loaded. I believe this gives you a few options (someone correct this as needed):

  1. Set mu4e-account-alist in dotspacemacs/layers: (mu4e :variables mu4e-account-alist t) (Note I used a dummy setting here and actually set mu4e-account-alist in dotspacemacs/user-config).
  2. Set mu4e-account-alist in dotspacemacs/user-init (again, you can use a dummy setting to t or actually set it here, your choice).
  3. Set mu4e-account-alist in <my-layer>/pre-init-mu4e (<my-layer> being your personal configuration layer).

andreas-h added a commit to andreas-h/spacemacs that referenced this issue Jan 19, 2016
Clarify usage for multiple accounts, as discussed by @darkfeline in syl20bnr#4670
@andreas-h
Copy link
Contributor Author

thanks, that fixed it =)

@nwolfe
Copy link
Contributor

nwolfe commented Jan 19, 2016

@andreas-h @darkfeline FYI I tweaked this behavior in the past here: ea9ce5e

I only used a single email account, and I didn't want to be bothered to define this special mu4e-account-alist when my existing config worked fine, so I made that change above to not enforce this variable definition.

Seems like there's still some room for improvement here where we wouldn't have to pre-define this value in the layer declaration, but this is a step in the right direction.

TheBB pushed a commit that referenced this issue Jan 21, 2016
Clarify usage for multiple accounts, as discussed by @darkfeline in #4670
@kostajh
Copy link
Contributor

kostajh commented Jan 25, 2016

Not sure if ya'll want a new issue created, but the docs should be updated in any case to use the new Contexts feature in the latest stable mu4e release.

@darkfeline
Copy link
Contributor

I think we can rip out the multiple account support entirely with the new mu4e-contexts feature. I'll create a PR for it.

Here: #4836

d1egoaz pushed a commit to d1egoaz/spacemacs that referenced this issue Feb 6, 2016
Clarify usage for multiple accounts, as discussed by @darkfeline in syl20bnr#4670
@d12frosted
Copy link
Contributor

Fixed with released of Spacemacs v0.200. Let us know if you still have any problems with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants