Default variable details
Some of debops.nullmailer default variables have more extensive
configuration than simple strings or lists, here you can find documentation and
examples for them.
nullmailer__remotes
This list, as well as nullmailer__default_remotes, is used to configure
where nullmailer should forward all mail messages. Each element of a list
can be either a string that defines the exact line in the
/etc/nullmailer/remotes configuration file, or a YAML dictionary with
following parameters:
hostRequired. DNS hostname of the SMTP server to which all messages will be forwarded.
protocolOptional. Specify the daemon from
/usr/lib/nullmailer/which should be used to send the mail messages. Eithersmtp(default) orqmtp.portOptional. Specify the port to connect. If not specified,
25will be used as default.starttlsOptional, boolean. If not specified and
nullmailer__starttlsis enabled, each configured SMTP server will be asked to provide encrypted connection usingSTARTTLScommand. Ifitem.ssloritem.optionsparameters are specified, theSTARTTLSsupport is not enabled by default.sslOptional, boolean. If enabled, new connections to this SMTP server will automatically be encrypted using SSL. This usually requires a different port for communication, typically
465.insecureOptional, boolean. By default when encrypted connections are used,
nullmailerchecks the validity of the X.509 certificate provided by the server. If this parameter is enabled, the validity checks won't be performed.x509cafileOptional. Specify absolute path to the X.509 Certificate Authority certificate which should be used to validate the certificate of a given SMTP server. If not specified, the system-wide CA database will be used.
x509certfileOptional. Specify absolute path to the X.509 certificate which should be presented to the remote SMTP server for authentication.
x509crlfileOptional. Specify absolute path to the CRL file which should be used to validate the certificate provided by the remote SMTP server.
x509fmtderOptional, boolean. If enabled, indicates that the specified certificates are in DER format (PEM otherwise).
authorauth_loginOptional, boolean. If enabled, indicates that the specified sever requires user authentication before accepting forwarded mail messages.
userOptional. Specify the username which should be used to login to the remote SMTP server.
passorpasswordOptional. Specify the password which should be used to login to the remote SMTP server.
optionsOptional. Custom list of options recognized by the
nullmailerprotocol modules. Check the usage information in the/usr/lib/nullmailer/*commands to see possible options, and examples below to see how they can be used.
Examples
Configure a remote SMTP server without TLS encryption:
nullmailer__remotes:
- host: 'mx.example.org'
starttls: False
Configure a remote SMTP server with mail messages delivered via submission
protocol:
nullmailer__remotes:
- host: 'mail.example.org'
port: '587'
auth: True
user: 'username'
pass: 'password'
Configure GMail as remote SMTP server with options specified manually:
nullmailer__remotes:
- host: 'smtp.gmail.com'
options: [ '--starttls', '--port=587', '--auth-login',
'--user=username', '--pass=password' ]
nullmailer__configuration_files
This list, as well as nullmailer__private_configuration_files,
manages configuration files used by the nullmailer service. Each entry in
the list is a YAML dictionary with parameters:
destRequired. Absolute path to the configuration file.
contentFile contents which should be placed in the configuration file. If it results in an empty string, file will be empty. Not needed if
item.srcis specified.srcAbsolute path to the source file located on the Ansible Controller. Not needed if
item.contentis specified.stateOptional. If not specified or
present, the configuration file will be created. Ifabsent, the configuration file will be removed.ownerOptional. Specify an user account which should be the owner of the configuration file. The user account must already exist.
groupOptional. Specify what group the configuration file belongs to. The group must already exist.
modeOptional. Specify the file attributes which should be set for the configuration file.
You can find the usage examples of these lists in the role
defaults/main.yml file.