unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* bad times with authinfo, smtpmail, mu4e, davmail and mails providers
@ 2021-07-15 19:00 Lazy Snail
  2021-07-15 20:03 ` Philip Kaludercic
  0 siblings, 1 reply; 3+ messages in thread
From: Lazy Snail @ 2021-07-15 19:00 UTC (permalink / raw)
  To: help-gnu-emacs


Hi,

I try to help somebody to setup its mails accounts with smtpmail.el,
mu4e, offlineimap, davmail, for gmail and outlook accounts, since
... nearly two months and countless readings over the internet...

For now with some up and down we were able to receive mails from all
accounts, but to send them throught only one account that is the most
simpler conf ;

I suspect that part of the problem is, let's say the we have the two
following mails address :

lisper@specific.do
lisper@domain.sp

1. they uses smtp.gmail.com as smtpmail-server, regardless of what say
their domain name.
2. they have the same username.

Does smtpmail.el and authinfo able to handle such situations ? If so,
how specify it to them ?

About davmail, in our setup the gateway is localhost. However I think I
have the same issue to specify it correctly in authinfo: how to specify
that localhost is only a gateway and that we want to authentificate with
eg, lisper@outlook.com ?

If smtpmail.el and authinfo fails to let us get it this way, what do you
recommend as smtp server ? postfix ?

plz help
-- 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bad times with authinfo, smtpmail, mu4e, davmail and mails providers
  2021-07-15 19:00 bad times with authinfo, smtpmail, mu4e, davmail and mails providers Lazy Snail
@ 2021-07-15 20:03 ` Philip Kaludercic
  2021-07-20 13:11   ` Snail Lazy
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Kaludercic @ 2021-07-15 20:03 UTC (permalink / raw)
  To: Lazy Snail; +Cc: help-gnu-emacs

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/

-- 
	Philip Kaludercic



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bad times with authinfo, smtpmail, mu4e, davmail and mails providers
  2021-07-15 20:03 ` Philip Kaludercic
@ 2021-07-20 13:11   ` Snail Lazy
  0 siblings, 0 replies; 3+ messages in thread
From: Snail Lazy @ 2021-07-20 13:11 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: help-gnu-emacs


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 ;)
-- 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-20 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-15 19:00 bad times with authinfo, smtpmail, mu4e, davmail and mails providers Lazy Snail
2021-07-15 20:03 ` Philip Kaludercic
2021-07-20 13:11   ` Snail Lazy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).