postfix uses hostname instead of myhostname

Solution 1:

mydomain = example.com
myorigin = $mydomain

By default, the option append_at_myorigin is set to yes, which means that any and all outgoing mail that has no domain component will get the value of myorigin appended.

In your case, that is the domain name, and not the hostname.

Always send mail using fully-qualified addresses, i.e. containing both a localpart and a valid, existing domain/hostname part.

If for some reason you cannot, use one of the methods described in the Address Rewriting Readme