help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bad times with authinfo, smtpmail, mu4e, davmail and mails providers


From: Snail Lazy
Subject: Re: bad times with authinfo, smtpmail, mu4e, davmail and mails providers
Date: Tue, 20 Jul 2021 15:11:38 +0200
User-agent: mu4e 1.4.2; emacs 27.1

Philip Kaludercic <philipk@posteo.net> writes:

> Lazy Snail <lazysnail2077@gmail.com> writes:
>
>> If smtpmail.el and authinfo fails to let us get it this way, what do you
>> recommend as smtp server ? postfix ?
>
> I use msmtp, because it requires no server but acts like sendmail making
> it easy to use + it has a easy configuration file.
>
> https://marlam.de/msmtp/

Thanks for the suggestion. I wrote a configuration for msmtp and it
helped me to debug our issues and to wrote tests, ultimately we stuck
with smtpmail, so the answer to my question is, yes, smtpmail and
authinfo can handle specifics domains, just use the mail adress as
username and ensure that the variable smtpmail-smtp-user is also set to
the mail address. I think you must specify 127.0.0.1 instead of
localhost in authinfo for davmail thought, that was one of our pitfall.

A test for offlineimap,

#+begin_src emacs-lisp :tangle ~/mail.test.el :eval no
(require 'ert)
(require 'smtpmail)
(require 'mu4e)
(mu4e~start)

(ert-deftest mail-test-offlineimap ()
    "offlineimap should exit normally"
  (should (eq
           (call-process-shell-command
            "offlineimap")
           0)))
#+end_src

and then a test for each of the accounts

#+begin_src emacs-lisp :tangle ~/mail.test.el :eval no
(ert-deftest mail-test-account-2 ()
    "Testing sending mails with account 2"
  ;; msmtp should return 0
  ;; (should (eq
  ;;           (call-process-shell-command
  ;;            "echo \"hello there \" \\
  ;; | msmtp -a lazysnail2077 lazysnail2077@gmail.com")
  ;;           0))
  ;; should not produce an error
  (should
   (save-window-excursion
    (mu4e-context-switch 'force "lazysnail2077")
    (mu4e-compose-new)
    (insert "lazysnail2077@gmail.com")
    (next-line)
    (insert "mail-test-account-2")
    (message-send-and-exit))))
#+end_src

The tests helped us to reduce the suspects in the stack. At the end, the
‘modern password’ authentification stuck us despite having already
defined ‘app passwords’ (multiple times) and enabled ‘less secure apps’.
Defining new ‘app passwords’ a last time seemed to unlock the situation.

To conclude, we better choosed a good mail provider rather than gmail,
who not only rob your mails but also your time ;)
-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]