summaryrefslogtreecommitdiff
path: root/manifests/implementations/shorewall/virtual/mail.pp
blob: 4eaa07a646a97b0b67e7361b57fa53bc7d3821e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class firewall::implementations::shorewall::virtual::mail($destination) {
  shorewall::rule { 'mail-1':
    action          => 'DNAT',
    source          => 'vm',
    destination     => "fw:$destination:25",
    proto           => 'tcp',
    destinationport => '25',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => '-',
    order           => 1000,
  }

  shorewall::rule { 'mail-2':
    action          => 'DNAT',
    source          => 'net',
    destination     => "vm:$destination:25",
    proto           => 'tcp',
    destinationport => '25',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => '-',
    order           => 1001,
  }

  shorewall::rule { 'mail-3':
    action          => 'DNAT',
    source          => 'vm',
    destination     => "fw:$destination:993",
    proto           => 'tcp',
    destinationport => '993',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
    order           => 1002,
  }

  shorewall::rule { 'mail-4':
    action          => 'DNAT',
    source          => 'net',
    destination     => "vm:$destination:993",
    proto           => 'tcp',
    destinationport => '993',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
    order           => 1003,
  }

  shorewall::rule { 'mail-5':
    action          => 'DNAT',
    source          => 'vm',
    destination     => "fw:$destination:587",
    proto           => 'tcp',
    destinationport => '587',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
    order           => 1004,
  }

  shorewall::rule { 'mail-6':
    action          => 'DNAT',
    source          => 'net',
    destination     => "vm:$destination:587",
    proto           => 'tcp',
    destinationport => '587',
    originaldest    => lookup('firewall::external_ip', undef, undef, $::ipaddress),
    ratelimit       => lookup("firewall::ssl_ratelimit", undef, undef, '-'),
    order           => 1005,
  }
}