postfixadmin
: Postfixadmin main classpostfixadmin::cli::params
: Class to set the postfixadmin client program to use Parameters:postfixadmin::config
: class for postfixadmin configurationpostfixadmin::db
: install databasepostfixadmin::db::mysql
: privat class to manage mysql db use postfixadmin::db insteadpostfixadmin::fix_debian_bug
: This fixes debian bug #856338 see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856338postfixadmin::install
: install packagespostfixadmin::queries::dovecot
: class to create mysql maps for postfix Parameters:postfixadmin::queries::postfix
: class to create mysql maps for postfixpostfixadmin::vhost
: This class chooses the type of vhost to run webserverpostfixadmin::vhost::apache
: internal class that installs an apache vhost Parameters are inherited from postfixadmin::vhost
postfixadmin::cli::create_admin
: This define just ensures that a an admin account exists.postfixadmin::cli::create_aliasdomain
: define to ensure an aliasdomain existspostfixadmin::cli::create_domain
: Ensures, that a domain exists But does not modify any domainspostfixadmin::domain
: helper define to create domains
postfixadmin_generate_pw
: computes a random password string
Postfixadmin main class
The following parameters are available in the postfixadmin
class:
ensure_database
ensure_vhost
ensure_postfix_queries
ensure_dovecot_queries
admins
domains
aliasdomains
dovecot_classes
postfix_classes
Data type: Boolean
if true a database is created Defaults to false
Default value: false
Data type: Boolean
if true a virtualhost is created Defaults to false
Default value: false
Data type: Boolean
if true the maps querying the database for postfix are created Defaults to false
Default value: false
Data type: Boolean
if true the maps querying the database for dovecot are created Defaults to false
Default value: false
Data type: Hash
Hash of hashes to create postfixadmin::cli::create_admin Defaults to {}
Default value: {}
Data type: Hash
Hash of hases to create postfixadmin::cli::create_domain Defaults to {}
Default value: {}
Data type: Hash
Hash of hases to create postfixadmin::cli::create_aliasdomain Defaults to {}
Default value: {}
Data type: Array
Array of classnames that are required for devecot query installation (defaults to ['dovecot'])
Default value: ['dovecot']
Data type: Array
Array of classnames that are required for postfix query installation (defaults to ['postfix'])
Default value: ['postfix']
Class to set the postfixadmin client program to use
Parameters:
The following parameters are available in the postfixadmin::cli::params
class:
Data type: Array
Default value: ['/bin','/usr/bin']
Data type: String
the postfixadmin-cli program defaults to: 'bash /usr/share/postfixadmin/scripts/postfixadmin-cli'
Default value: 'bash /usr/share/postfixadmin/scripts/postfixadmin-cli'
class for postfixadmin configuration
The following parameters are available in the postfixadmin::config
class:
Data type: String
configuration file to use
Default value: '/etc/postfixadmin/config.local.php'
Data type: Hash
Hash of configuration variables to set. Defaults to {}
Default value: {}
Data type: String
configfile owner
Default value: 'root'
Data type: String
configfile group
Default value: 'www-data'
Data type: String
configfile mode
Default value: '0640'
install database
The following parameters are available in the postfixadmin::db
class:
Data type: String
password to connect to the database.
Default value: 'CHANGEME'
Data type: String
database type to use currently mysql or mysqli is supported.
Default value: 'mysql'
Data type: String
name of the database defaults to: 'postfixadmin'
Default value: 'postfixadmin'
Data type: String
username to connect to the database. defaults to: 'postfixadmin'
Default value: 'postfixadmin'
Data type: Optional[String[1]]
basepath for database, defaults to undef
Default value: undef
Data type: String
port to connect to db defaults to '3306' (mysql)
Default value: '3306'
Data type: String
host that is allowed to connect for database creation defaults to 'localhost'
Default value: 'localhost'
Data type: Optional[String]
host that is used to connect to database defaults to same as host.
Default value: undef
Data type: String
where to write the db config. defaults to '/etc/postfixadmin/dbconfig.inc.php' if you do not want to write, set it to ''
Default value: '/etc/postfixadmin/dbconfig.inc.php'
privat class to manage mysql db use postfixadmin::db instead
The following parameters are available in the postfixadmin::db::mysql
class:
Data type: String
name of the database
Default value: $postfixadmin::db::dbname
Data type: String
username to access the database
Default value: $postfixadmin::db::dbuser
Data type: String
password for the database
Default value: $postfixadmin::db::dbpass
Data type: String
hostname
Default value: $postfixadmin::db::host
Data type: Optional[String[1]]
collate for the database
Default value: undef
Data type: Optional[String[1]]
charset for the database
Default value: undef
This fixes debian bug #856338
see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856338
The following parameters are available in the postfixadmin::fix_debian_bug
class:
Data type: String
the document root
Default value: '/usr/share/postfixadmin'
install packages
The following parameters are available in the postfixadmin::install
class:
Data type: String
name of the package to install
Default value: 'postfixadmin'
Data type: Array
additional packages to install
Default value: []
Data type: String
what to ensure for packages
Default value: 'installed'
class to create mysql maps for postfix
Parameters:
The following parameters are available in the postfixadmin::queries::dovecot
class:
dbpass
dbuser
dbname
host
mysql_flags
dir
owner
group
mode
default_password_scheme
mboxpath
uid
gid
quota
Data type: String
password to connect to the database.
Default value: 'CHANGEME'
Data type: String
username to connect to the database. defaults to: 'postfixadmin'
Default value: 'postfixadmin'
Data type: String
name of the database defaults to: 'postfixadmin'
Default value: 'postfixadmin'
Data type: String
host to connect to. defaults to localhost
Default value: 'localhost'
Data type: Array
Array of additional flags for connecting to mysql eg. ssl settings. defaults to []
Default value: []
Data type: String
directory to place the map
Default value: '/etc/dovecot/postfixadmin'
Data type: String
owner of the map files
Default value: 'root'
Data type: String
group of the map files
Default value: 'root'
Data type: String
mode of the map files
Default value: '0640'
Data type: String
change to match your Postfixadmin setting. depends on your $CONF['encrypt'] setting defaults to 'MD5-CRYPT'
Default value: 'MD5-CRYPT'
Data type: Optional[String[1]]
path to the mbailboxes defaults to undef
Default value: undef
Data type: Optional[String[1]]
uid to use for mailboxes must matche dovecot.conf AND Postfix virtual_uid_maps parameter defaults to undef (not included in query)
Default value: undef
Data type: Optional[String[1]]
gid to use for mailboxes must matche dovecot.conf AND Postfix virtual_gid_maps parameter defaults to undef (not included in query)
Default value: undef
Data type: Boolean
if true quota is included in the query defaults to true
Default value: true
class to create mysql maps for postfix
The following parameters are available in the postfixadmin::queries::postfix
class:
Data type: String
password to connect to the database.
Default value: 'CHANGEME'
Data type: String
username to connect to the database. defaults to: 'postfixadmin'
Default value: 'postfixadmin'
Data type: String
name of the database defaults to: 'postfixadmin'
Default value: 'postfixadmin'
Data type: Array
Array of hosts to connect to. defaults to ['localhost']
Default value: ['localhost']
Data type: String
directory to place the map
Default value: '/etc/postfix/postfixadmin'
Data type: String
owner of the map files
Default value: 'root'
Data type: String
group of the map files
Default value: 'postfix'
Data type: String
mode of the map files
Default value: '0640'
Data type: Boolean
used for mysql_sender_access if set to true add the account as a permitted sender address. this allows to create send only accounts which do not receive any mails (eg. sender address is aliased to another mailbox). Accounts needs to be formated as email adresses for this to work !
Default value: false
This class chooses the type of vhost to run webserver
The following parameters are available in the postfixadmin::vhost
class:
vhosttype
servername
serveraliases
docroot
ssl
ssl_cert
ssl_key
ssl_chain
port
redirect_to_ssl
create_resources
Data type: String
type of vhost to run. currently only apache supported (default)
Default value: 'apache'
Data type: String
Servername (defaults to $::fqdn)
Default value: $facts['networking']['fqdn']
Data type: Array
Array of Serveraliasess to listen to (default [])
Default value: []
Data type: String
Document root
Default value: '/usr/share/postfixadmin'
Data type: Boolean
If true, use ssl (defaults to false) If true, you also need to set cert, key and chain.
Default value: false
Data type: Optional[Stdlib::Absolutepath]
ssl cert to use
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
ssl key to use
Default value: undef
Data type: Optional[Stdlib::Absolutepath]
ssl chain to use
Default value: undef
Data type: Integer
port to use (default 443)
Default value: 443
Data type: Boolean
if true, redirects all non https requests to https defaults to true.
Default value: true
Data type: Hash
a Hash of Hashes to create additional resources eg. to retrieve a certificate. Defaults to {} (do not create any additional resources) Example (hiera):
postfixadmin::vhost::create_resources: sslcert::get_cert: get_my_postfix_cert: private_key_path: '/etc/postfixadmin/ssl/key.pem' cert_path: '/etc/postfixadmin/ssl/cert.pem'
Will result in executing:
sslcert::get_cert{'get_my_postfix_cert': private_key_path => '/etc/postfixadmin/ssl/key.pem' cert_path => '/etc/postfixadmin/ssl/cert.pem' }
Default value: {}
internal class that installs an apache vhost Parameters are inherited from postfixadmin::vhost
The following parameters are available in the postfixadmin::vhost::apache
class:
Data type: String
Default value: $postfixadmin::vhost::servername
Data type: Array
Default value: $postfixadmin::vhost::serveraliases
Data type: String
Default value: $postfixadmin::vhost::docroot
Data type: Hash
Default value: {}
Data type: Boolean
Default value: $postfixadmin::vhost::ssl
Data type: Optional[Stdlib::Absolutepath]
Default value: $postfixadmin::vhost::ssl_cert
Data type: Optional[Stdlib::Absolutepath]
Default value: $postfixadmin::vhost::ssl_key
Data type: Optional[Stdlib::Absolutepath]
Default value: $postfixadmin::vhost::ssl_chain
Data type: Integer
Default value: $postfixadmin::vhost::port
Data type: Boolean
Default value: $postfixadmin::vhost::redirect_to_ssl
This define just ensures that a an admin account exists.
The following parameters are available in the postfixadmin::cli::create_admin
defined type:
Data type: String
the name of the admin account (needs to be an Email) Defaults to $title
Default value: $title
Data type: Optional[String[1]]
The passord to initialy set. If set to undef (the default) an random password is generated
Default value: undef
Data type: Boolean
if set to true the admin is a superadmin with access to all domains Default to false
Default value: false
Data type: Boolean
if true, a mail to $admin is sent with password and url
Default value: false
define to ensure an aliasdomain exists
The following parameters are available in the postfixadmin::cli::create_aliasdomain
defined type:
Data type: String
the domain it points to
Data type: String
the domain to ensure (defaults to $title)
Default value: $title
Data type: Boolean
if true (default) we use postfixadmin::cli::create_domain to create the domain. if you set this to false you need to create the domain before using this define.
Default value: true
Ensures, that a domain exists But does not modify any domains
The following parameters are available in the postfixadmin::cli::create_domain
defined type:
Data type: String
The domain defaults to $title
Default value: $title
Data type: String
a description defaults to $title
Default value: $title
Data type: Integer
amount of Aliases (-1=disable, 0=unlimited) defaults to false (do not use option)
Default value: -1
Data type: Integer
amount of mailboxes (-1=disable, 0=unlimited) defaults to false (do not use option)
Default value: -1
Data type: Integer
domain quota (MB | -1 = disable | 0 = unlimited) defaults to false (do not use option)
Default value: -1
Data type: Integer
Mailbox Quota (MB) (MB | -1 = disable | 0 = unlimited) defaults to false (do not use option)
Default value: -1
Data type: Boolean
If true (default) set the default aliases
Default value: true
helper define to create domains
The following parameters are available in the postfixadmin::domain
defined type:
Data type: String
The domain name defaults to $title
Default value: $title
Data type: Optional[String[1]]
if set, an alias domain is created, defaults to undef
Default value: undef
Data type: Hash
additional parameters for postfixadmin::cli::create_domain or postfixadmin::cli::create_aliasdomain
Default value: {}
Type: Ruby 3.x API
computes a random password string
computes a random password string
Returns: String
a random password st