class mail::virtual( $database_user = lookup('mail::virtual::database_user', undef, undef, $mail::virtual::params::database_user), $database_host = lookup('mail::virtual::database_host', undef, undef, $mail::virtual::params::database_host), $database_name = lookup('mail::virtual::database_name', undef, undef, $mail::virtual::params::database_name), $database_password = lookup('mail::virtual::database_password', undef, undef, ''), ) { # Check parameters case $database_password { '': { fail("You need to define mail::virtual::database_password config") } } # Virtual subsystems include mail::virtual::packages include mail::sasl include mail::dovecot class { [ 'mail::virtual::database', 'mail::virtual::web' ]: } # Virtual mailboxes file { '/var/mail/virtual': ensure => directory, owner => vmail, group => vmail, mode => '0750', require => User['vmail'], } group { "vmail": ensure => present, gid => 5000, } user { "vmail": ensure => present, uid => 5000, gid => "vmail", password => "*", home => '/var/mail/virtual', require => Group['vmail'], } }