If you would like to configure postfix to use Sendgrid as the mail relay, you can do so by editing the postfix main configuration file.
vi /etc/postfix/main.cf
And then paste the content below at the end of the file :
smtp_sasl_auth_enable = yes smtp_sasl_password_maps = static:username:password smtp_sasl_security_options = noanonymous smtp_tls_security_level = encrypt header_size_limit = 4096000 relayhost = [smtp.sendgrid.net]:587