as root apt-get install postfix libsasl2 ca-certificate libsasl2-modules
The above lines are telling Postfix that you want to relay mail through gmail on a specific port, telling it to authenticate, and where to find the username and password. The last three lines specify the authentication types supported, where the certificate authority file is and that it should use tls.At this point you can restart Postfix and it should work, however it will complain about not being able to authenticate the certificate. To take care of this issue we’ll use the ca-certificate package we installed and tell it where it can validate the certificate.
This file should have restrictive permissions and then needs to be translated into a .db that Postfix will read.