A docker image that uses postfix as a relay through gmail. Useful to link to other images.
NOTE: works with domains hosted by Google, also. ie, Google for Work.
SYSTEM_TIMEZONE = UTC or America/New_York MYNETWORKS = "10.0.0.0/8 192.168.0.0/16 126.96.36.199/8" EMAIL = gmail or google domain EMAILPASS = password (is turned into a hash and this env variable is removed at boot)
docker run -i -t --rm \ --name gmailrelay \ -p 9025:25 \ -e SYSTEM_TIMEZONE="America/New_York" \ -e MYNETWORKS="10.0.0.0/8 192.168.0.0/16 188.8.131.52/8" \ -e EMAIL="YOUR_EMAIL@gmail.com" \ -e EMAILPASS="your_password" \ postfix-gmail-relay
You should take care with username and password. Even if you unset the variable, you can still see them in plain text running docker inspect.
E.g. docker inspect gmailrelay