--- /dev/null
+class hgr::postfix {
+
+ package {
+ "exim4":
+ ensure => absent;
+ "postfix":
+ ensure => installed;
+ "sasl2-bin":
+ ensure => installed;
+ "libsasl2-2":
+ ensure => installed;
+ "libsasl2-modules":
+ ensure => installed;
+ "procmail":
+ ensure => installed;
+ }
+
+ file {
+
+ "/etc/postfix/main.cf":
+ ensure => present,
+ content => template("hgr/postfix/main.cf.erb"),
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ notify => Service["postfix"],
+ require => [Package["postfix"],File["/etc/ssl/certs/${::fqdn}.pem"],File["/etc/ssl/private/${::fqdn}.key"],File["/etc/ssl/certs/${::fqdn}-CA.pem"]];
+
+ "/etc/postfix/master.cf":
+ ensure => present,
+ source => "puppet:///modules/hgr/postfix/master.cf",
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ notify => Service["postfix"],
+ require => [Package["postfix","spamassassin"]];
+ # TODO: need to run portmap on this file after updating it / before restarting postfix
+ "/etc/postfix/send_access":
+ ensure => present,
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ notify => Service["postfix"],
+ require => Package["postfix"];
+ "/etc/procmailrc":
+ ensure => present,
+ source => "puppet:///modules/hgr/procmailrc",
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ require => Package["procmail"];
+ }
+
+ service {
+ "postfix":
+ ensure => running,
+ enable => true,
+ require => Package["postfix"];
+ }
+}