1

I'm having trouble setting up mu4e. My configuration in config.el:

(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it
   starttls-use-gnutls t
   smtpmail-stream-type 'starttls
   smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
   smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg")
   smtpmail-smtp-user "[email protected]"
   smtpmail-default-smtp-server "smtp.gmail.com"
   smtpmail-smtp-server "smtp.gmail.com"
   smtpmail-smtp-service 587)

My problem is that smtpmail-smtp-service defaults 25 after Doom Emacs initialization and I can´t figure out where this is being set.

I added the following line after the above code and restarted doom emacs:

(add-variable-watcher 'smtpmail-smtp-service (lambda (s n o w) (debug)))

and this is what I get:

Debugger entered: nil
  load-with-code-conversion("/home/pablo/.doom.d/config.el" "/home/pablo/.doom.d/config.el" nil t)
  load("~/.doom.d/config" nil nomessage)
  (condition-case e (load path noerror 'nomessage) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (setq path (locate-file path load-path (get-load-suffixes))) (signal (cond ((not (and path (featurep ...))) 'error) ((file-in-directory-p path (expand-file-name "cli" doom-core-dir)) 'doom-cli-error) ((file-in-directory-p path doom-core-dir) 'doom-core-error) ((file-in-directory-p path doom-user-dir) 'doom-user-error) ((file-in-directory-p path doom-profile-dir) 'doom-profile-error) ((file-in-directory-p path doom-modules-dir) 'doom-module-error) ('doom-error)) (list path e))))
  doom-load("~/.doom.d/config")
  byte-code("\305\306!\204\f\0\305\307!\203\351\1\10\30\310\311!\211\203\"\0\211@\312\1!\210\1A\266\202\202\21\0\210\313\21\314\22\315\316\317\"\210\315\320\321\"\210\315..." [doom-context doom-modules doom-disabled-packages custom-file doom-module-context doom-context-p init reload ensure-list modules doom-context-push #<hash-table equal 38/65 0x158a7ac628f3> nil setplist :core (nil [0 -110 -110 :core nil nil nil]) :user (nil [1 105 -105 :user nil nil nil]) :completion (company [3 0 0 :completion company nil nil] ivy [4 0 0 :completion ivy nil nil]) :ui (doom [5 0 0 :ui doom nil nil] doom-dashboard [6 0 0 :ui doom-dashboard nil nil] doom-quit [7 0 0 :ui doom-quit nil nil] hl-todo [8 0 0 :ui hl-todo nil nil] modeline [9 0 0 :ui modeline nil nil] ophints [10 0 0 :ui ophints nil nil] popup [11 0 0 :ui popup (+defaults) nil] treemacs [12 0 0 :ui treemacs nil nil] vc-gutter [13 0 0 :ui vc-gutter nil nil] vi-tilde-fringe [14 0 0 :ui vi-tilde-fringe nil nil] workspaces [15 0 0 :ui workspaces nil nil]) :editor (file-templates [16 0 0 :editor file-templates nil nil] fold [17 0 0 :editor fold nil nil] snippets [18 0 0 :editor snippets nil nil]) :emacs (dired [19 0 0 :emacs dired nil nil] electric [20 0 0 :emacs electric nil nil] undo [21 0 0 :emacs undo nil nil] vc [22 0 0 :emacs vc nil nil]) :checkers (syntax [23 0 0 :checkers syntax nil nil]) :tools (ein [24 0 0 :tools ein nil nil] eval [25 0 0 :tools eval (+overlay) nil] lookup [26 0 0 :tools lookup nil nil] lsp [27 0 0 :tools lsp (+eglot) nil] magit [28 0 0 :tools magit nil nil] pdf [29 0 0 :tools pdf nil nil]) :lang (emacs-lisp [30 0 0 :lang emacs-lisp nil nil] latex [31 0 0 :lang latex (+pdflatex) nil] markdown [32 0 0 :lang markdown nil nil] org [33 0 0 :lang org (+pretty +pandoc +present) nil] python [34 0 0 :lang python (+eglot) nil] sh [35 0 0 :lang sh nil nil]) :email (mu4e [36 0 0 :email mu4e (+gmail) nil]) :config (use-package [2 -111 -111 :config use-package nil nil] default [37 0 0 :config default (+bindings +smartparens) nil]) [2 -111 -111 :config use-package nil nil] doom-load "~/.emacs.d/modules/config/use-package/init" [0 -110 -110 :core nil nil nil] "~/.emacs.d/lisp/init" doom-run-hooks doom-before-modules-init-hook doom-after-modules-init-hook doom-before-modules-config-hook [3 0 0 :completion company nil nil] "~/.emacs.d/modules/completion/company/config" [4 0 0 :completion ivy nil nil] "~/.emacs.d/modules/completion/ivy/config" [5 0 0 :ui doom nil nil] ...] 4)
  load("/home/pablo/.emacs.d/.local/etc/@/init.29.elc" noerror nomessage nosuffix)
  (progn (load init-file-name 'noerror 'nomessage 'nosuffix))
  (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix)))
  (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el")))
  (progn (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el"))))
  (if init-file-user (progn (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el")))))
  (condition-case error (if init-file-user (progn (let ((init-file-name (file-name-concat doom-profile-dir (format "init.%d.elc" emacs-major-version)))) (setq user-init-file t) (if init-file-name (progn (load init-file-name 'noerror 'nomessage 'nosuffix))) (if (eq user-init-file t) (progn (signal 'doom-nosync-error (list init-file-name)))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el"))))) ((debug error) (display-warning 'initialization (format-message "An error occurred while loading `%s':\n\n%s%s%s\n\nTo ..." user-init-file (get (car error) 'error-message) (if (cdr error) ": " "") (mapconcat #'(lambda (s) (prin1-to-string s t)) (cdr error) ", ")) :warning) (setq init-file-had-error t)))
  (let ((debug-on-error debug-on-error-initial)) (condition-case error (if init-file-user (progn (let ((init-file-name (file-name-concat doom-profile-dir ...))) (setq user-init-file t) (if init-file-name (progn (load init-file-name ... ... ...))) (if (eq user-init-file t) (progn (signal ... ...))) (setq user-init-file (concat (string-remove-suffix ".elc" user-init-file) ".el"))))) ((debug error) (display-warning 'initialization (format-message "An error occurred while loading `%s':\n\n%s%s%s\n\nTo ..." user-init-file (get (car error) 'error-message) (if (cdr error) ": " "") (mapconcat #'(lambda ... ...) (cdr error) ", ")) :warning) (setq init-file-had-error t))) (or (eq debug-on-error debug-on-error-initial) (progn (setq debug-on-error-should-be-set t) (setq debug-on-error-from-init-file debug-on-error))))
  (let ((debug-on-error-from-init-file nil) (debug-on-error-should-be-set nil) (debug-on-error-initial (if (eq init-file-debug t) 'startup init-file-debug)) (inhibit-null-byte-detection t)) (let ((debug-on-error debug-on-error-initial)) (condition-case error (if init-file-user (progn (let ((init-file-name ...)) (setq user-init-file t) (if init-file-name (progn ...)) (if (eq user-init-file t) (progn ...)) (setq user-init-file (concat ... ".el"))))) ((debug error) (display-warning 'initialization (format-message "An error occurred while loading `%s':\n\n%s%s%s\n\nTo ..." user-init-file (get (car error) 'error-message) (if (cdr error) ": " "") (mapconcat #'... (cdr error) ", ")) :warning) (setq init-file-had-error t))) (or (eq debug-on-error debug-on-error-initial) (progn (setq debug-on-error-should-be-set t) (setq debug-on-error-from-init-file debug-on-error)))) (if debug-on-error-should-be-set (progn (setq debug-on-error debug-on-error-from-init-file))))
  startup--load-user-init-file@init-doom(#f(compiled-function () #<bytecode -0x16e6aa77779e5cd7>) #f(compiled-function () #<bytecode -0x1f3c61addc0b8a75>) t)
  apply(startup--load-user-init-file@init-doom (#f(compiled-function () #<bytecode -0x16e6aa77779e5cd7>) #f(compiled-function () #<bytecode -0x1f3c61addc0b8a75>) t))
  startup--load-user-init-file(#f(compiled-function () #<bytecode -0x16e6aa77779e5cd7>) #f(compiled-function () #<bytecode -0x1f3c61addc0b8a75>) t)
  command-line()
  normal-top-level()

EDIT I found out that smtpmail-smtp-serviceis being set to 25 in custom.el:

 '(smtpmail-smtp-server "smtp.gmail.com")
 '(smtpmail-smtp-service 25)

I guess those lines are being included by the line that enables the mu4e module in init.el:

       :email
       (mu4e +gmail)

How can I set the value of smtpmail-smtp-service without changing that in custom.el?

2
  • 1
    Which custom.el? If the value 25 is being set via customize, then change it via customize, not setq.
    – rpluim
    Commented Mar 6 at 12:57
  • That did the trick! Thank you. I used the Emacs Customize Interface to set smtpmail-smtp-service to 587.
    – pcremades
    Commented Mar 7 at 20:04

1 Answer 1

0

I solved the problem using Emacs Easy Customization Interface to set variable smtpmail-smtp-service to 587.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.