Msmtp not sending email through

I am trying to configure emacs to send emails but I consistently get the error

Sending failed: 554 5.0.0 Error: no such user in response to .

I can send an email via the terminal using the command

echo "To: [address] \n Subject: Test Email7" | msmtp --debug --from=[address] -t

This configuration is via doom emacs, here is my config.el

(setq smtpmail-smtp-server "127.0.0.1")
(setq smtpmail-smtp-service 1025)
(setq user-full-name "[name]")
(setq mail-user-agent 'message-user-agent)
(setq user-mail-address "[address]")
(setq sendmail-program "/home/[user]/.nix-profile/bin/msmtp"
      send-mail-function 'message-send-mail-with-sendmail)
(setq smtpmail-smtp-user "[address]")

I am using protonmail bridge to handle the protocol hence the local address

Any help is appreciated :slight_smile:

I made a wiki page on Msmtp, is there something in it which could help? Msmtp - NixOS Wiki

Unfortunately my issue was only with the emacs integration, however I did find a solution for those who arrive here

(use-package mu4e
  :defer 20 ; Wait until 20 seconds after startup
  :config

  (setq mu4e-change-filenames-when-moving t ; avoid sync conflicts
      mu4e-update-interval (* 10 60) ; check mail 10 minutes
      mu4e-compose-format-flowed t ; re-flow mail so it's not hard wrapped
      mu4e-get-mail-command "mbsync -a"
      mu4e-maildir "~/mail/ProtonMail")

  (setq message-send-mail-function 'smtpmail-send-it
      auth-sources '("~/.authinfo") ;need to use gpg version but only local smtp stored for now
      smtpmail-smtp-server "[server]"
      smtpmail-smtp-service [port]
      smtpmail-stream-type  'plain))

Putting this in my config.el seemed to do the trick! I think it was mostly the lack of .authinfo in the inital config