diff --git a/README.md b/README.md index bd9f947..31500f9 100644 --- a/README.md +++ b/README.md @@ -324,6 +324,18 @@ Integer. Port on `relayhost` emails should be sent to Default: 25 +##### `mail_encryption` + +String. Encryption to be used. + +Default: not defined (backup currently defaults to `:starttls`. + +##### `mail_domain` + +String. Your host name for the HELO command. + +Default: none. + ##### `enable_hc` Boolean. Whether backup job noticies should be sent to HipChat diff --git a/manifests/job.pp b/manifests/job.pp index 949ede3..cc90fc5 100644 --- a/manifests/job.pp +++ b/manifests/job.pp @@ -68,6 +68,8 @@ $email_to = undef, $relay_host = 'localhost', $relay_port = '25', + $mail_domain = undef, + $mail_encryption = undef, # Hipchat $enable_hc = false, $hc_success = false, @@ -228,8 +230,6 @@ if !$email_to { fail("[Backup::Job::${name}]: A destination email address is required for email notifications") - } else { - validate_re($email_to, '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$', "[Backup::Job::${name}]: ${email_to} is not a valid email address") } if $relay_port and !is_integer($relay_port) { @@ -415,6 +415,8 @@ # - $email_to # - $relay_host # - $relay_port + # - $mail_domain + # - $mail_encryption concat::fragment { "${_name}_email": target => "/etc/backup/models/${_name}.rb", content => template('backup/job/email.erb'), diff --git a/manifests/params.pp b/manifests/params.pp index 14d2ac6..41d2f22 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,7 +18,7 @@ } } 'Debian': { - $package_dependencies = ['ruby-dev', 'libxslt1-dev', 'libxml2-dev', 'g++', 'patch'] + $package_dependencies = ['ruby-dev', 'libxslt1-dev', 'libxml2-dev', 'g++', 'patch', 'zlib1g-dev'] if $::lsbmajordistrelease { $releaseversion = $::lsbmajordistrelease } diff --git a/templates/job/email.erb b/templates/job/email.erb index c002335..6a185ca 100644 --- a/templates/job/email.erb +++ b/templates/job/email.erb @@ -12,5 +12,11 @@ <% end -%> <% if @relay_host -%> mail.port = <%= @relay_port %> +<% end -%> +<% if @mail_domain -%> + mail.domain = "<%= @mail_domain %>" +<% end -%> +<% if @mail_encryption -%> + mail.encryption = <%= @mail_encryption %> <% end -%> end