added EMailUserDestDomain to config
diff --git a/manifests/client.pp b/manifests/client.pp index 7c68064..205b88f 100644 --- a/manifests/client.pp +++ b/manifests/client.pp
@@ -279,6 +279,7 @@ $email_notify_min_days = false, $email_from_user_name = '', $email_admin_user_name = '', + $mail_destination_domain = '', $email_notify_old_backup_days = false, $hosts_file_dhcp = 0, $hosts_file_more_users = '',
diff --git a/manifests/server.pp b/manifests/server.pp index e073591..3542769 100644 --- a/manifests/server.pp +++ b/manifests/server.pp
@@ -168,6 +168,9 @@ # [*email_admin_user_name*] # Destination address to an administrative user who will receive a nightly email with warnings and errors. # +# [*email_destination_domain*] +# Destination domain name for email sent to users. +# # [*email_notify_old_backup_days*] # How old the most recent backup has to be before notifying user. When there have been no backups in this # number of days the user is sent an email. @@ -241,6 +244,7 @@ $email_notify_min_days = 2.5, $email_from_user_name = 'backuppc', $email_admin_user_name = 'backuppc', + $email_destination_domain = '', $email_notify_old_backup_days = 7, $email_headers = { 'MIME-Version' => 1.0, 'Content-Type' => 'text/plain; charset="iso-8859-1"', }, @@ -321,7 +325,7 @@ validate_re("${email_notify_old_backup_days}", '^[1-9]([0-9]*)?$', 'Blackout_good_cnt parameter should be a number') - + validate_re("${cgi_date_format_mmdd}", '^[012]$', 'Cgi_date_format_mmdd parameter should be 0-2')
diff --git a/templates/config.pl.erb b/templates/config.pl.erb index 8b7c892..eb48251 100644 --- a/templates/config.pl.erb +++ b/templates/config.pl.erb
@@ -201,7 +201,7 @@ $Conf{EMailNotifyMinDays} = <%= @email_notify_min_days %>; $Conf{EMailFromUserName} = '<%= @email_from_user_name %>'; $Conf{EMailAdminUserName} = '<%= @email_admin_user_name %>'; -$Conf{EMailUserDestDomain} = ''; +$Conf{EMailUserDestDomain} = '<%= @email_destination_domain %>'; $Conf{EMailNoBackupEverSubj} = undef; $Conf{EMailNoBackupEverMesg} = undef; $Conf{EMailNotifyOldBackupDays} = <%= @email_notify_old_backup_days %>;
diff --git a/templates/host.pl.erb b/templates/host.pl.erb index 23769bd..618090d 100644 --- a/templates/host.pl.erb +++ b/templates/host.pl.erb
@@ -184,6 +184,9 @@ <% if !@email_admin_user_name.empty? -%> $Conf{EMailAdminUserName} = '<%= @email_admin_user_name %>'; <% end -%> +<% if !@email_destination_domain.empty? -%> +$Conf{EMailUserDestDomain} = '<%= @email_destination_domain %>'; +<% end -%> <% if @email_notify_old_backup_days -%> $Conf{EMailNotifyOldBackupDays} = <%= @email_notify_old_backup_days %>; <% end -%>
diff --git a/tests/init.pp b/tests/init.pp index b412a79..bb4aef2 100644 --- a/tests/init.pp +++ b/tests/init.pp
@@ -38,6 +38,7 @@ email_notify_min_days => 1.5, email_from_user_name => 'bpcreport', email_admin_user_name => 'backuppc-alt', + email_destination_domain => '@example.com' email_notify_old_backup_days => 7, apache_allow_from => '127.0.0.1', }