First and foremost to correctly set up a mail server so any and all mail you send doesn't get bounced you will need access to your resource records of your domain which are held at whatever DNS provider you have choosen, mine is Google
I will go over the resource records which is all you should need minus my dkim record which I will not be showing.
First is the actual DNS record.
Second is my CAA record that shows who holds my dns certificate so people can not spoof the DNS certificate.
Third is my MX record which tells everyone what mail server I use for my domain. You can have multiple of these with preference based on the integer before the address.
Fourth is my SPF record which tells all who look up my domain what ip addresses are authorized to send mail for my domain.pretty sure you can have multiple ip addresses or possibly even multiple SPF records.
Fifth is my DMARC record which tells mail exchanges what to do with mail not coming from IP addresses in the SPF record, or mail servers not in the MX records. You could possibly get away with creating this and just saying anything goes instead of reject, but still this is the right way.
Sixth would be my DKIM record which is a rsa key that is used to authenticate all mail coming from my domain, and is particularly a pain to get right.
Having done all of that you can then modify the origin configuration and all exchanges will accept your mail with bells and whistles on, as you will pass all three checks like so if you click original message in gmail.
Here is postfix's not so basic, basic configuration
Here is the documentation from opendkim, otherwise known as domainkeys identified mail, for your dkim server you probably will want eventually.
And here are some links about MX SPF and DMARC records, otherwise known as mail exchanger, sender policy framework, and
domain-based message authentication reporting and conformance respectively.
This is all required if you want your emails to be official and accepted by all, and is also good practice to help cut down on the spam/phish/malware in the world.
Also I may have not shown my dkim because it contains a key and is public record just not comfortable with that, but it is also a resource record held at your dns provider like the others that I showed.