vegetaaaaaaa, (edited )
@vegetaaaaaaa@lemmy.world avatar

You can definitely replace senders with correct mail addresses for relaying through SMTP servers that expect them (this is what I do):


<span style="font-style:italic;color:#969896;"># /etc/msmtprc
</span><span style="color:#323232;">account default
</span><span style="color:#323232;">...
</span><span style="color:#323232;">host smtp.gmail.com
</span><span style="color:#323232;">auto_from on
</span><span style="color:#323232;">auth on
</span><span style="color:#323232;">user myaddress
</span><span style="color:#323232;">password hunter2
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;"># Replace local recipients with addresses in the aliases file
</span><span style="color:#323232;">aliases /etc/aliases
</span>

<span style="font-style:italic;color:#969896;"># /etc/aliases
</span><span style="color:#323232;">mailer-daemon: postmaster
</span><span style="color:#323232;">postmaster: root
</span><span style="color:#323232;">nobody: root
</span><span style="color:#323232;">hostmaster: root
</span><span style="color:#323232;">usenet: root
</span><span style="color:#323232;">news: root
</span><span style="color:#323232;">webmaster: root
</span><span style="color:#323232;">www: root
</span><span style="color:#323232;">ftp: root
</span><span style="color:#323232;">abuse: root
</span><span style="color:#323232;">noc: root
</span><span style="color:#323232;">security: root
</span><span style="color:#323232;">root: default
</span><span style="color:#323232;">www-data: root
</span><span style="color:#323232;">default: myaddress@gmail.com
</span>

(the only thing I changed from the defaults in the aliases file is adding the last line)

This makes it so all/most system accounts susceptible to send mail are aliased to root, and root in turn is aliased to my email address (which is the one configured in host/user/password in msmtprc)

Edit: I think it’s actually the auto_from option which interests you. Check the msmtp manpage

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhosted@lemmy.world
  • ngwrru68w68
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • kavyap
  • cubers
  • megavids
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines