Hello Emacsers!
## UPDATE (SOLVED)
For those who might face the same problem.
I managed to solve it, in fact it was the Emacs `smtpmail` library (maybe in combination with a recent change on the server side).
I added the SMTP server I'm using to the variable `smtpmail-servers-requiring-authorization`, which is documented as follows:
> "Regexp matching servers that require authorization. **Normally smtpmail will try first to send emails via SMTP without user/password credentials**, and then retry using credentials if the server says that it requires it. If the server name matches this regexp, smtpmail will send over the credentials on the first attempt."
Recently, we received a phishing mail in a work mailing list, the mail was sent from what it seems to be a valid address in the university's domain name. I guess the sysadmin disabled sending mails without credentials after that.
## Original question
I'm facing a strange problem with mu4e, I had a pretty stable multi-context setup (using the `mu4e` module of Doom Emacs).
My complete mu4e configuration can be found [in my dotfiles repo](https://github.com/abougouffa/dotfiles/blob/main/dot_doom.d/config.org#email-mu4e).
For the problematic account, it has config similar to this one:
```lisp
(set-email-account! "My Account"
'((mu4e-sent-folder . "/dir/Sent")
(mu4e-drafts-folder . "/dir/Drafts")
(mu4e-trash-folder . "/dir/Trash")
(mu4e-refile-folder . "/dir/Archive")
(smtpmail-smtp-user . "mail@address.com")
(user-mail-address . "mail@address.com")
(smtpmail-stream-type . ssl)
(smtpmail-smtp-server . "smtp.address.com")
(smtpmail-smtp-service . 465))
t)
```
Suddenly, I cannot send email with one of my accounts, I get this error each time I try to send an email:
```
smtpmail-send-it: Sending failed: 554 5.7.1 <my_email_address@server.com>: Sender address rejected: Access denied
```
I don't think it is a server side problem because I can send emails from my phone with the exact same server and protocol settings.
I tried to change settings to use **starttls** instead.
```lisp
(set-email-account! "My Account"
'((mu4e-sent-folder . "/dir/Sent")
(mu4e-drafts-folder . "/dir/Drafts")
(mu4e-trash-folder . "/dir/Trash")
(mu4e-refile-folder . "/dir/Archive")
(smtpmail-smtp-user . "mail@address.com")
(user-mail-address . "mail@address.com")
(smtpmail-stream-type . starttls)
(smtpmail-smtp-server . "smtp.address.com")
(smtpmail-smtp-service . 587))
t)
```
With these settings, I get this error:
```
smtpmail-send-it: Sending failed: 454 4.7.1 <destination@address.com>: Relay access denied
```
I wiped my `~/.authinfo.gpg`, I always get the same errors. *mu4e* doesn't ask me about the password anymore, while for the other accounts, when I send a mail for the first time, it asks me about the password and adds it to `~/.authinfo.gpg`.
Does anyone have an idea? By the way, I'm using Emacs 28.1 (nativecomp).