Browse files

Add smtp cookbook using Exim4

  • Loading branch information...
1 parent 2320952 commit 5a307812b95c060f23788d59649cb8299d015256 @rosenfeld committed May 6, 2011
View
1 smtp/files/default/exim4.conf.localmacros
@@ -0,0 +1 @@
+AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = 1
View
34 smtp/recipes/default.rb
@@ -0,0 +1,34 @@
+package 'exim4'
+
+template "/etc/exim4/update-exim4.conf.conf" do
+ source 'update-exim4.conf.conf.erb'
+ notifies :run, "execute[update-exim4.conf]"
+end
+
+cookbook_file "/etc/exim4/conf.d/auth/01_exim4-allow-notls-passwords" do
+ source 'exim4.conf.localmacros'
+ notifies :run, "execute[update-exim4.conf]"
+end
+
+template "/etc/exim4/passwd.client" do
+ group 'Debian-exim'
+ mode '0640'
+ source 'passwd.client.erb'
+ notifies :run, "execute[update-exim4.conf]"
+end
+
+template("/etc/email-addresses") do
+ mode '0644'
+ source 'email-addresses.erb'
+end
+
+service "exim4" do
+ action [ :enable, :start ]
+ supports :restart => true, :reload => true, :status => true
+end
+
+execute "update-exim4.conf" do
+ command "/usr/sbin/update-exim4.conf"
+ action :nothing
+ notifies :reload, "service[exim4]"
+end
View
12 smtp/templates/default/email-addresses.erb
@@ -0,0 +1,12 @@
+# This is /etc/smtp-addresses. It is part of the exim package
+#
+# This file contains smtp addresses to use for outgoing mail. Any local
+# part not in here will be qualified by the system domain as normal.
+#
+# It should contain lines of the form:
+#
+#user: someone@isp.com
+#otheruser: someoneelse@anotherisp.com
+git: <%= node[:smtp][:default_sender] %>
+www-data: <%= node[:smtp][:default_sender] %>
+root: <%= node[:smtp][:default_sender] %>
View
8 smtp/templates/default/passwd.client.erb
@@ -0,0 +1,8 @@
+# password file used when the local exim is authenticating to a remote
+# host as a client.
+#
+# see exim4_passwd_client(5) for more documentation
+#
+# Example:
+### target.mail.server.example:login:password
+<%= node[:smtp][:address] %>:<%= node[:smtp][:username] %>:<%= node[:smtp][:password] %>
View
13 smtp/templates/default/update-exim4.conf.conf.erb
@@ -0,0 +1,13 @@
+dc_eximconfig_configtype='smarthost'
+dc_other_hostnames='<%= node[:fqdn] %>'
+dc_local_interfaces='127.0.0.1 ; ::1'
+dc_readhost='<%= node[:fqdn] %>'
+dc_relay_domains=''
+dc_minimaldns='false'
+dc_relay_nets=''
+dc_smarthost='<%= node[:smtp][:address] %>::<%= node[:smtp][:port] || '25' %>'
+CFILEMODE='644'
+dc_use_split_config='true'
+dc_hide_mailname='true'
+dc_mailname_in_oh='true'
+dc_localdelivery='mail_spool'

0 comments on commit 5a30781

Please sign in to comment.