I realize that there are too many tutorials on getting your Relaying Postfix SMTP via smtp.gmail.com to work. Most of them are long and complicated, but I found a tutorial from this particular website which provides the shortest, simplest, and the clearest tutorial on how to get it work in less than 5 minutes. I would like to post it here for my future use again, so that I don't need to spend hours finding the right tutorial to get it done :)
If you are having trouble with your FTP login even though you entered the correct username and password, there is a high possibility that this problem was due to SELinux.
I've encountered this problem on my CentOS 6 box and after disabling SELinux, the issue is resolved! To disable SELinux (for CentOS 6):
- Change value
- Reboot your server
Hope it helps! It took me hours to get this solved.