Skip to content

Latest commit

 

History

History
1109 lines (620 loc) · 21.4 KB

REFERENCE.md

File metadata and controls

1109 lines (620 loc) · 21.4 KB

Reference

Table of Contents

Classes

Defined types

Functions

Classes

postfixadmin

Postfixadmin main class

Parameters

The following parameters are available in the postfixadmin class:

ensure_database

Data type: Boolean

if true a database is created Defaults to false

Default value: false

ensure_vhost

Data type: Boolean

if true a virtualhost is created Defaults to false

Default value: false

ensure_postfix_queries

Data type: Boolean

if true the maps querying the database for postfix are created Defaults to false

Default value: false

ensure_dovecot_queries

Data type: Boolean

if true the maps querying the database for dovecot are created Defaults to false

Default value: false

admins

Data type: Hash

Hash of hashes to create postfixadmin::cli::create_admin Defaults to {}

Default value: {}

domains

Data type: Hash

Hash of hases to create postfixadmin::cli::create_domain Defaults to {}

Default value: {}

aliasdomains

Data type: Hash

Hash of hases to create postfixadmin::cli::create_aliasdomain Defaults to {}

Default value: {}

dovecot_classes

Data type: Array

Array of classnames that are required for devecot query installation (defaults to ['dovecot'])

Default value: ['dovecot']

postfix_classes

Data type: Array

Array of classnames that are required for postfix query installation (defaults to ['postfix'])

Default value: ['postfix']

postfixadmin::cli::params

Class to set the postfixadmin client program to use

Parameters:

Parameters

The following parameters are available in the postfixadmin::cli::params class:

path

Data type: Any

Default value: ['/bin','/usr/bin']

cmd

Data type: Any

the postfixadmin-cli program defaults to: 'bash /usr/share/postfixadmin/scripts/postfixadmin-cli'

Default value: 'bash /usr/share/postfixadmin/scripts/postfixadmin-cli'

postfixadmin::config

class for postfixadmin configuration

Parameters

The following parameters are available in the postfixadmin::config class:

config_file

Data type: String

configuration file to use

Default value: '/etc/postfixadmin/config.local.php'

configs

Data type: Hash

Hash of configuration variables to set. Defaults to {}

Default value: {}

owner

Data type: String

configfile owner

Default value: 'root'

group

Data type: String

configfile group

Default value: 'www-data'

mode

Data type: String

configfile mode

Default value: '0640'

postfixadmin::db

install database

Parameters

The following parameters are available in the postfixadmin::db class:

dbpass

Data type: String

password to connect to the database.

Default value: 'CHANGEME'

dbtype

Data type: String

database type to use currently mysql or mysqli is supported.

Default value: 'mysql'

dbname

Data type: String

name of the database defaults to: 'postfixadmin'

Default value: 'postfixadmin'

dbuser

Data type: String

username to connect to the database. defaults to: 'postfixadmin'

Default value: 'postfixadmin'

basepath

Data type: String

basepath for database, defaults to ''

Default value: ''

dbport

Data type: String

port to connect to db defaults to '3306' (mysql)

Default value: '3306'

host

Data type: String

host that is allowed to connect for database creation defaults to 'localhost'

Default value: 'localhost'

host_config

Data type: Optional[String]

host that is used to connect to database defaults to same as host.

Default value: undef

dbconfig_inc

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'

postfixadmin::db::mysql

privat class to manage mysql db use postfixadmin::db instead

Parameters

The following parameters are available in the postfixadmin::db::mysql class:

dbname

Data type: Any

Default value: $postfixadmin::db::dbname

dbuser

Data type: Any

Default value: $postfixadmin::db::dbuser

dbpass

Data type: Any

Default value: $postfixadmin::db::dbpass

host

Data type: Any

Default value: $postfixadmin::db::host

postfixadmin::fix_debian_bug

This fixes debian bug #856338

see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856338

Parameters

The following parameters are available in the postfixadmin::fix_debian_bug class:

docroot

Data type: String

the document root

Default value: '/usr/share/postfixadmin'

postfixadmin::install

install packages

Parameters

The following parameters are available in the postfixadmin::install class:

package_name

Data type: String

name of the package to install

Default value: 'postfixadmin'

packages

Data type: Array

additional packages to install

Default value: []

package_ensure

Data type: String

what to ensure for packages

Default value: 'installed'

postfixadmin::queries::dovecot

class to create mysql maps for postfix

Parameters:

Parameters

The following parameters are available in the postfixadmin::queries::dovecot class:

dbpass

Data type: String

password to connect to the database.

Default value: 'CHANGEME'

dbuser

Data type: String

username to connect to the database. defaults to: 'postfixadmin'

Default value: 'postfixadmin'

dbname

Data type: String

name of the database defaults to: 'postfixadmin'

Default value: 'postfixadmin'

host

Data type: String

host to connect to. defaults to localhost

Default value: 'localhost'

mysql_flags

Data type: Array

Array of additional flags for connecting to mysql eg. ssl settings. defaults to []

Default value: []

dir

Data type: String

directory to place the map

Default value: '/etc/dovecot/postfixadmin'

owner

Data type: String

owner of the map files

Default value: 'root'

group

Data type: String

group of the map files

Default value: 'root'

mode

Data type: String

mode of the map files

Default value: '0640'

default_password_scheme

Data type: String

change to match your Postfixadmin setting. depends on your $CONF['encrypt'] setting defaults to 'MD5-CRYPT'

Default value: 'MD5-CRYPT'

mboxpath

Data type: String

path to the mbailboxes

Default value: ''

uid

Data type: String

uid to use for mailboxes must matche dovecot.conf AND Postfix virtual_uid_maps parameter defaults to '' (not included in query)

Default value: ''

gid

Data type: String

gid to use for mailboxes must matche dovecot.conf AND Postfix virtual_gid_maps parameter defaults to '' (not included in query)

Default value: ''

quota

Data type: Boolean

if true quota is included in the query defaults to true

Default value: true

postfixadmin::queries::postfix

class to create mysql maps for postfix

Parameters

The following parameters are available in the postfixadmin::queries::postfix class:

dbpass

Data type: String

password to connect to the database.

Default value: 'CHANGEME'

dbuser

Data type: String

username to connect to the database. defaults to: 'postfixadmin'

Default value: 'postfixadmin'

dbname

Data type: String

name of the database defaults to: 'postfixadmin'

Default value: 'postfixadmin'

hosts

Data type: Array

Array of hosts to connect to. defaults to ['localhost']

Default value: [ 'localhost' ]

dir

Data type: String

directory to place the map

Default value: '/etc/postfix/postfixadmin'

owner

Data type: String

owner of the map files

Default value: 'root'

group

Data type: String

group of the map files

Default value: 'postfix'

mode

Data type: String

mode of the map files

Default value: '0640'

allow_account_as_sender

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

postfixadmin::vhost

This class chooses the type of vhost to run webserver

Parameters

The following parameters are available in the postfixadmin::vhost class:

vhosttype

Data type: String

type of vhost to run. currently only apache supported (default)

Default value: 'apache'

servername

Data type: String

Servername (defaults to $::fqdn)

Default value: $::fqdn

serveraliases

Data type: Array

Array of Serveraliasess to listen to (default [])

Default value: []

docroot

Data type: String

Document root

Default value: '/usr/share/postfixadmin'

ssl

Data type: Boolean

If true, use ssl (defaults to false) If true, you also need to set cert, key and chain.

Default value: false

ssl_cert

Data type: String

ssl cert to use

Default value: unset

ssl_key

Data type: String

ssl key to use

Default value: unset

ssl_chain

Data type: String

ssl chain to use

Default value: unset

port

Data type: String

port to use (default 443)

Default value: '443'

redirect_to_ssl

Data type: Boolean

if true, redirects all non https requests to https defaults to true.

Default value: true

create_resources

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: {}

postfixadmin::vhost::apache

internal class that installs an apache vhost Parameters are inherited from postfixadmin::vhost

Parameters

The following parameters are available in the postfixadmin::vhost::apache class:

servername

Data type: String

Default value: $postfixadmin::vhost::servername

serveraliases

Data type: Array

Default value: $postfixadmin::vhost::serveraliases

docroot

Data type: String

Default value: $postfixadmin::vhost::docroot

apache_vhost

Data type: Hash

Default value: {}

ssl

Data type: Boolean

Default value: $postfixadmin::vhost::ssl

ssl_cert

Data type: String

Default value: $postfixadmin::vhost::ssl_cert

ssl_key

Data type: String

Default value: $postfixadmin::vhost::ssl_key

ssl_chain

Data type: String

Default value: $postfixadmin::vhost::ssl_chain

port

Data type: String

Default value: $postfixadmin::vhost::port

redirect_to_ssl

Data type: Boolean

Default value: $postfixadmin::vhost::redirect_to_ssl

Defined types

postfixadmin::cli::create_admin

This define just ensures that a an admin account exists.

Parameters

The following parameters are available in the postfixadmin::cli::create_admin defined type:

admin

Data type: String

the name of the admin account (needs to be an Email) Defaults to $title

Default value: $title

password

Data type: String

The passord to initialy set. If set to '' (the default) an random password is generated

Default value: ''

superadmin

Data type: Boolean

if set to true the admin is a superadmin with access to all domains Default to false

Default value: false

send_mail

Data type: Boolean

if true, a mail to $admin is sent with password and url

Default value: false

postfixadmin::cli::create_aliasdomain

define to ensure an aliasdomain exists

Parameters

The following parameters are available in the postfixadmin::cli::create_aliasdomain defined type:

target_domain

Data type: String

the domain it points to

domain

Data type: String

the domain to ensure (defaults to $title)

Default value: $title

create_domain

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

postfixadmin::cli::create_domain

Ensures, that a domain exists But does not modify any domains

Parameters

The following parameters are available in the postfixadmin::cli::create_domain defined type:

domain

Data type: String

The domain defaults to $title

Default value: $title

description

Data type: String

a description defaults to $title

Default value: $title

aliases

Data type: Integer

amount of Aliases (-1=disable, 0=unlimited) defaults to false (do not use option)

Default value: -

mailboxes

Data type: Integer

amount of mailboxes (-1=disable, 0=unlimited) defaults to false (do not use option)

Default value: -

quota

Data type: Integer

domain quota (MB | -1 = disable | 0 = unlimited) defaults to false (do not use option)

Default value: -

maxquota

Data type: Integer

Mailbox Quota (MB) (MB | -1 = disable | 0 = unlimited) defaults to false (do not use option)

Default value: -

default_aliases

Data type: Boolean

If true (default) set the default aliases

Default value: true

postfixadmin::domain

helper define to create domains

Parameters

The following parameters are available in the postfixadmin::domain defined type:

domain

Data type: String

The domain name defaults to $title

Default value: $title

target_domain

Data type: String

if set, an alias domain is created, defaults to ''

Default value: ''

cli_parameters

Data type: Hash

additional parameters for postfixadmin::cli::create_domain or postfixadmin::cli::create_aliasdomain

Default value: {}

Functions

postfixadmin_generate_pw

Type: Ruby 3.x API

computes a random password string

postfixadmin_generate_pw()

computes a random password string

Returns: String a random password st