From cc6c41729846c703820ef4b3f01a59809d9f487b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 22 Dec 2014 18:35:35 +0530 Subject: [PATCH 1/2] Dovecot setup --- ee/cli/plugins/stack.py | 15 +++++++++++++-- ee/core/variables.py | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 135e62e0..c2f86606 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -101,6 +101,18 @@ class EEStackController(CementBaseController): else: EERepo.add(ppa=EEVariables.ee_php_repo) + if set(EEVariables.ee_dovecot).issubset(set(apt_packages)): + if EEVariables.ee_platform_codename == 'squeeze': + print("Adding repository for dovecot ... ") + EERepo.add(repo_url=EEVariables.ee_dovecot_repo) + + EEShellExec.cmd_exec("echo \"dovecot-core dovecot-core/" + "create-ssl-cert boolean yes\" " + "| debconf-set-selections") + EEShellExec.cmd_exec("echo \"dovecot-core dovecot-core/ssl-cert-" + "name string $(hostname -f)\"" + " | debconf-set-selections") + @expose(hide=True) def post_pref(self, apt_packages, packages): if len(apt_packages): @@ -243,8 +255,7 @@ class EEStackController(CementBaseController): pass # apt_packages = apt_packages + EEVariables.ee_nginx if self.app.pargs.mail: - pass - # apt_packages = apt_packages + EEVariables.ee_nginx + apt_packages = apt_packages + EEVariables.ee_dovecot if self.app.pargs.nginx: apt_packages = apt_packages + EEVariables.ee_nginx if self.app.pargs.php: diff --git a/ee/core/variables.py b/ee/core/variables.py index efb9a6f0..3618388d 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -39,6 +39,14 @@ class EEVariables(): ee_postfix_repo = "" ee_postfix = ["postfix"] + # Dovecot repo and packages + ee_dovecot_repo = ("deb http://http.debian.net/debian-backports {codename}" + "-backports main".format(codename=ee_platform_codename)) + + ee_dovecot = ["dovecot-core", "dovecot-imapd", "dovecot-pop3d", + "dovecot-lmtpd", "dovecot-mysql", "dovecot-sieve", + "dovecot-managesieved"] + # Repo ee_repo_file = "ee-repo.list" ee_repo_file_path = ("/etc/apt/sources.list.d/" + ee_repo_file) From 75a2faa35f3c3eb493517b51ea64de10204c20ef Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 22 Dec 2014 19:46:43 +0530 Subject: [PATCH 2/2] Addded Dovecot template --- ee/cli/templates/dovecot.mustache | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 ee/cli/templates/dovecot.mustache diff --git a/ee/cli/templates/dovecot.mustache b/ee/cli/templates/dovecot.mustache new file mode 100644 index 00000000..c4062322 --- /dev/null +++ b/ee/cli/templates/dovecot.mustache @@ -0,0 +1,48 @@ +protocols = imap pop3 lmtp sieve + +mail_location = maildir:/var/vmail/%d/%n + +disable_plaintext_auth = no +auth_mechanisms = plain login +#!include auth-system.conf.ext +!include auth-sql.conf.ext + +ssl_protocols = !SSLv2 !SSLv3 + +service lmtp { + unix_listener /var/spool/postfix/private/dovecot-lmtp { + mode = 0600 + user = postfix + group = postfix + } +} +service auth { + unix_listener /var/spool/postfix/private/auth { + mode = 0666 + user = postfix + group = postfix + } + unix_listener auth-userdb { + mode = 0600 + user = vmail + } + user = dovecot +} +service auth-worker { + user = vmail +} + +log_path = /var/log/dovecot.log + +mail_plugins = $mail_plugins autocreate + +plugin { + autocreate = Trash + autocreate2 = Junk + autocreate3 = Drafts + autocreate4 = Sent + autosubscribe = Trash + autosubscribe2 = Junk + autosubscribe3 = Drafts + autosubscribe4 = Sent +}