Post APs0hLtuSpL1lAZMwq by mjh@social.linux.pizza
 (DIR) More posts by mjh@social.linux.pizza
 (DIR) Post #APIwlvjnZjhloNirs8 by jselea@blogs.linux.pizza
       2022-09-10T18:41:49Z
       
       1 likes, 1 repeats
       
       This short writeup will guide you on how to do it on Debian-based and Fedora systems.We begin with installing posfix and the required packages for authentication.First – doublecheck that your machine has a Fully Qualified Domain Name set in the hostfile, this will remove alot of headaches from you in the future.My machine is named “T15.domain.tld” – so emails will be arriving from “user@T15.domain.tld”.Debian:apt-get install postfix mailutils libsasl2-2Fedora:dnf install postfix mailx mailx cyrus-sasl cyrus-sasl-plainNext, we will create the sasl-password file and hash it:echo "[relay.domain.tld]:587 username:password" > /etc/postfix/saslpostmap /etc/postfix/saslGreat, now we have to tell postfix that all emails sent via it should be relayed throu the smtp-relay:relayhost = [relay.domain.tld]:587smtp_use_tls = yessmtp_sasl_auth_enable = yessmtp_sasl_security_options =smtp_sasl_password_maps = hash:/etc/postfix/saslsmtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crtRestart postfix and check the log, so everything looks good.Test your setup:echo "This is a test" | mail -s "Just a test" destination_email@domain.tldYou can check the status of the mailqueue with the command mailq.And that's about it!
       
 (DIR) Post #APs0hLtuSpL1lAZMwq by mjh@social.linux.pizza
       2022-11-05T21:20:00Z
       
       0 likes, 0 repeats
       
       @jselea holy shit. This is now so simple, I remember struggle with SendMail
       
 (DIR) Post #APs0hMPSZWZjL1KZ7o by selea@social.linux.pizza
       2022-11-22T18:27:16Z
       
       0 likes, 0 repeats
       
       @mjh Well in some cases you have to create some generic maps in order to have the delivered :)@jselea