- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with postfix_gmail
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
The configures postfix to use Gmail as a relay. Based on initial work by Christopher Miersma, this version allows for the configuration of gmail relays with additional options, such as network selection, SSL key selection, and interfaces. It also allows for a manual hostname to be specifed in the class.
This module ensures that postfix is installed and running. It also adds cyrus sasl packages to handle encryption to Google. The config file sets up the authentication and rate limiting. In addition, mailutils are also installed (mailx) to facilitate testing of the mail system itself. This module has been tested on Ubuntu 20.04 LTS.
- postfix and related packages.
- /etc/postfix/main.cf
Nothing special.
- Make sure postfix actually is your MTA of choice.
- Have a Gmail account for sending your server mail. Enable the less secure option.
You can call the main class with username and password as below:
class { 'postfix_gmail':
username => "[email protected]",
password => "XXXXXXXXXXXXXX",
myhostname => "puppet.server.com",
sslcert => "/etc/ssl/certs/ssl-cert-snakeoil.pem",
sslkey => "/etc/ssl/certs/ssl-cert-snakeoil.key",
cacert => "/etc/ssl/certs/ca-certificates.crt",
interfaces => "local",
destinations => ['puppet.server.com', 'puppet', 'puppetreply', 'localhost.localdomain', 'localhost','relaystuff.mail.com'],
networks => ['127.0.0.0/8','[::ffff:127.0.0.0]/104','[::1]/128'],
}
There are two internal classes. One for installing the packages and another for managing the config.
This has only been tested on Ubuntu 20.04LTS but was originally tested with CentOS. It probably works anywhere with postfix in /etc/postfix.
Contributing: contact me and don't break the basic functionality.
v0.2.0 - Anna Hegedus