aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/mail.pp8
-rw-r--r--manifests/vserver.pp24
2 files changed, 31 insertions, 1 deletions
diff --git a/manifests/mail.pp b/manifests/mail.pp
new file mode 100644
index 0000000..2f4b0ed
--- /dev/null
+++ b/manifests/mail.pp
@@ -0,0 +1,8 @@
+class nodo::mail inherits nodo::vserver {
+ # Class for mail nodes
+ $postfix_relayhost = "$domain"
+ $postfix_smtp_listen = "$ip"
+ $postfix_mydestination = "\$myorigin"
+
+ include postfix::mta
+}
diff --git a/manifests/vserver.pp b/manifests/vserver.pp
index 72406ca..b8ae60e 100644
--- a/manifests/vserver.pp
+++ b/manifests/vserver.pp
@@ -31,7 +31,7 @@ class nodo::vserver inherits nodo {
# Define a vserver instance
define instance($context, $ensure = 'running', $proxy = false,
- $puppetmaster = false, $gitd = false,
+ $puppetmaster = false, $gitd = false, $mail = false,
$icecast = false, $sound = false, $ticket = false,
$memory_limit = false) {
@@ -308,6 +308,28 @@ class nodo::vserver inherits nodo {
order => '901',
}
}
+ if $mail {
+ shorewall::rule { 'mail-1':
+ action => 'DNAT',
+ source => 'net',
+ destination => "fw:192.168.0.$context:25",
+ proto => 'tcp',
+ destinationport => '25',
+ ratelimit => '-',
+ order => '1000',
+ }
+
+ shorewall::rule { 'mail-2':
+ action => 'DNAT',
+ source => '$FW',
+ destination => "fw:192.168.0.$context:25",
+ proto => 'tcp',
+ destinationport => '25',
+ originaldest => "$ipaddress",
+ ratelimit => '-',
+ order => '1001',
+ }
+ }
}
}
}