aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/mail.pp1
-rw-r--r--manifests/subsystems/tunnel.pp45
2 files changed, 46 insertions, 0 deletions
diff --git a/manifests/mail.pp b/manifests/mail.pp
index 1771f57..bcc386e 100644
--- a/manifests/mail.pp
+++ b/manifests/mail.pp
@@ -37,6 +37,7 @@ class nodo::mail {
"myhostname": value => "$fqdn";
"mydestination": value => $postfix_mydestination;
"mynetworks": value => "127.0.0.0/8";
+ "relay_domains": value => "$domain";
"virtual_alias_maps": value => "hash:/etc/postfix/virtual";
"transport_maps": value => "hash:/etc/postfix/transport";
"mailbox_command": value => '/usr/bin/maildrop -d ${USER}';
diff --git a/manifests/subsystems/tunnel.pp b/manifests/subsystems/tunnel.pp
index 7bca56f..b396c6e 100644
--- a/manifests/subsystems/tunnel.pp
+++ b/manifests/subsystems/tunnel.pp
@@ -3,6 +3,7 @@ class tunnel {
User <<| tag == "autossh-$fqdn" |>>
File <<| tag == "autossh-$fqdn" |>>
+ # TODO: user setup should be put somewhere
define setup($ensure = present, $user = $hostname, $host, $localport, $hostport, $sshport = '22', $keytype = 'dsa') {
$dir = "/var/backups/remote/$user.$domain"
$tag = "autossh-$host"
@@ -68,6 +69,50 @@ class tunnel {
}
define mail ($sshport = '22') {
+ package { "nullmailer":
+ ensure => installed,
+ }
+
+ service { "nullmailer":
+ ensure => 'running',
+ require => Package['nullmailer'],
+ }
+
+ file { "/etc/mailname":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => "$fqdn\n",
+ notify => Service["nullmailer"],
+ }
+
+ file { "/etc/nullmailer":
+ ensure => directory,
+ owner => root,
+ group => root,
+ mode => 0755,
+ }
+
+ file { "/etc/nullmailer/remotes":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => "localhost smtp --port=2525\n",
+ notify => Service["nullmailer"],
+ require => File["/etc/nullmailer"],
+ }
+
+ file { "/etc/nullmailer/adminaddr":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => "$root_mail_recipient\n",
+ require => File["/etc/nullmailer"],
+ }
+
tunnel::setup { "smtp":
host => "$name.$domain",
sshport => "$sshport",