I have no idea who’s sending to whom or where this error is coming from. You’re going to need to be more explicit about what you’re trying to do and what is happening (i.e. where mail is coming from and where it is going), and you must include the relevant maillog entries. The client does not have enough information to troubleshoot problems, usually.
2B50B61BCF: to=<root@localhost>, relay=smtp.sendgrid.net[54.228.39.88]:587, delay=0.77, delays=0.09/0.02/0.54/0.12, dsn=5.0.0, status=bounced (host smtp.sendgrid.net[54.228.39.88] said: 550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements (in reply to end of DATA command))
smtp.sendgrid.net[54.228.39.88] said: 550 The from
address does not match a verified Sender Identity.
mail is being sent from dashboard Webmin/servers/read user mail
I am sending an email to yahoo from my virtual sever info@mydomain.com using SendGrid as SMTP server since I’m on a virtual domain that does not match the mail server
An account on Sendgrid will have to be created for each virtual server that you host on Virtualmin. Sendgrid will expect the individual who is the owner of the domain to agree to their terms and conditions before they activate the service for the virtual server / domain, so your idea to use Sendgrid to send out mail would work only if you are the owner of all the domains that you host on your server. If you are hosting domains for others / your clients, then the idea won’t work.
Even if you carry out the tedious job of actually creating an account on Sendgrid for each virtual server / domain that you host on Virtualmin, you will fall foul of the law by agreeing on behalf of another to their t&c - identity theft.
That’s a different question, but you shouldn’t worry about that. Just give your server a reasonable hostname and let Postfix use it for all outgoing mail. But, that won’t make sendgrid accept your mail. You have to authenticate to sendgrid, no matter what. (And, I think sendgrid wants to know what domains they’ll be sending mail on behalf of when authenticated with your API key.)
Transport maps can be used to choose different relays for each virtual host. But, if you want all of them to go through sendgrid that’s the opposite of what you want.
Of course, I’m assuming all users are semi-trusted. I wouldn’t want to share a mail key with someone who might send spam, as that’ll get all hosts banned from sendgrid.
It does require SPF and DKIM to be setup correctly for every domain, though. Sendgrid provides the information for doing that on their website when you setup to send for a given domain.
If I add the Cname records from SendGrid it works, however, I don’t want to add sendgrid relay server at the root since I have to manually add each account in sendgrid to send mail,