From 058dbb366b96cae1f8fb0def65f73a698f1c375d Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Jul 2014 10:09:41 +0200 Subject: make our autoconfig setup public --- files/conf.d/mozilla_autoconfig.conf | 6 +++ manifests/mozilla_autoconfig.pp | 37 ++++++++++++++++ templates/webfiles/autoconfig/config.shtml.erb | 58 ++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 files/conf.d/mozilla_autoconfig.conf create mode 100644 manifests/mozilla_autoconfig.pp create mode 100644 templates/webfiles/autoconfig/config.shtml.erb diff --git a/files/conf.d/mozilla_autoconfig.conf b/files/conf.d/mozilla_autoconfig.conf new file mode 100644 index 0000000..6e4f7db --- /dev/null +++ b/files/conf.d/mozilla_autoconfig.conf @@ -0,0 +1,6 @@ +Alias /.well-known/autoconfig/mail/config-v1.1.xml /var/www/autoconfig/config.shtml + + Options +Includes + AddType application/xml .shtml + AddOutputFilter INCLUDES .shtml + diff --git a/manifests/mozilla_autoconfig.pp b/manifests/mozilla_autoconfig.pp new file mode 100644 index 0000000..f16e5ec --- /dev/null +++ b/manifests/mozilla_autoconfig.pp @@ -0,0 +1,37 @@ +# setup autoconfig infos +# +# this will create a global autoconfig file, that maps +# any of your hosted domains on this host to a certain +# provider configuration. Which means, that you get a zero +# setup autoconfig for any domain that you host the website +# and the emails for. +# By default you only need to define the provider, which +# is usually your main domain. Everything else should be +# derived from that. +# You can however still fine tune things from it. +class apache::mozilla_autoconfig( + $provider, + $display_name = undef, + $shortname = undef, + $imap_server = undef, + $pop_server = undef, + $smtp_server = undef, + $documentation_url = undef, +) { + apache::config::global { 'mozilla_autoconfig.conf': } + + file{ + '/var/www/autoconfig': + ensure => directory, + require => Package['apache'], + owner => root, + group => apache, + mode => '0640'; + '/var/www/autoconfig/config.shtml': + content => template('apache/webfiles/autoconfig/config.shtml.erb'), + owner => root, + group => apache, + mode => '0640', + before => Service['apache'], + } +} diff --git a/templates/webfiles/autoconfig/config.shtml.erb b/templates/webfiles/autoconfig/config.shtml.erb new file mode 100644 index 0000000..3a3d6bb --- /dev/null +++ b/templates/webfiles/autoconfig/config.shtml.erb @@ -0,0 +1,58 @@ + + + + + + + + + <%= @display_name || @provider %> Mail () + <%= @shortname || @provider.split('.').first %> + + <%= @imap_server || "imap.#{@provider}" %> + 143 + STARTTLS + password-cleartext + %EMAILADDRESS% + + + <%= @imap_server || "imap.#{@provider}" %> + 993 + SSL + password-cleartext + %EMAILADDRESS% + + + <%= @pop_server || "pop.#{@provider}" %> + 110 + STARTTLS + password-cleartext + %EMAILADDRESS% + + + <%= @pop_server || "pop.#{@provider}" %> + 995 + SSL + password-cleartext + %EMAILADDRESS% + + + <%= @smtp_server || "smtp.#{@provider}" %> + 587 + STARTTLS + password-cleartext + %EMAILADDRESS% + + + <%= @smtp_server || "smtp.#{@provider}"%> + 465 + SSL + password-cleartext + %EMAILADDRESS% + + "> + Allgemeine Beschreibung der Einstellungen + Generic settings page + + + -- cgit v1.2.3