Compare commits
9 Commits
45a90a300d
...
e94b6c6f7e
Author | SHA1 | Date |
---|---|---|
Tube | e94b6c6f7e | |
Tube | 177710b390 | |
Tube | 1185caea79 | |
Tube | 75e2dbec0d | |
Tube | e8ec083022 | |
Tube | fcfe374832 | |
Tube | 215c81f3ee | |
Tube | 577366e195 | |
Tube | 0328d4c55a |
|
@ -71,7 +71,10 @@ vars:
|
||||||
{m: "log_config",f:"mod_log_config"},
|
{m: "log_config",f:"mod_log_config"},
|
||||||
{m: "version",f:"mod_version"},
|
{m: "version",f:"mod_version"},
|
||||||
{m: "unixd",f:"mod_unixd"},
|
{m: "unixd",f:"mod_unixd"},
|
||||||
{m: "ssl",f:"mod_ssl"}
|
{m: "ssl",f:"mod_ssl"},
|
||||||
|
{m:"proxy",f:"mod_proxy"},
|
||||||
|
{m:"proxy_http",f:"mod_proxy_http"},
|
||||||
|
{m:"proxy_http2",f:"mod_proxy_http2"},
|
||||||
]';
|
]';
|
||||||
|
|
||||||
|
|
||||||
|
|
19
dovecot.cf
19
dovecot.cf
|
@ -7,7 +7,7 @@ bundle agent dovecot(cfg)
|
||||||
classes:
|
classes:
|
||||||
"use_ssl" expression => strcmp("$(cfg[ssl])","true");
|
"use_ssl" expression => strcmp("$(cfg[ssl])","true");
|
||||||
"rspamd_scripts" expression => strcmp("$(cfg[rspamd_scripts])","true");
|
"rspamd_scripts" expression => strcmp("$(cfg[rspamd_scripts])","true");
|
||||||
|
"global_sieve_after" expression => strcmp("$(cfg[global_sieve_after])","true");
|
||||||
vars:
|
vars:
|
||||||
"imap_key" string => "$(cfg_dir)/private/imap.key";
|
"imap_key" string => "$(cfg_dir)/private/imap.key";
|
||||||
"imap_cert" string => "$(cfg_dir)/private/imap.crt";
|
"imap_cert" string => "$(cfg_dir)/private/imap.crt";
|
||||||
|
@ -87,10 +87,10 @@ methods:
|
||||||
"any" usebundle => wmde_install_packages(@(pkgs),"dovecot");
|
"any" usebundle => wmde_install_packages(@(pkgs),"dovecot");
|
||||||
"any" usebundle => wmde_service("$(service_name)","dovecot_kept","dovecot_repaired"),
|
"any" usebundle => wmde_service("$(service_name)","dovecot_kept","dovecot_repaired"),
|
||||||
depends_on => @(service_deps);
|
depends_on => @(service_deps);
|
||||||
rspamd_scripts::
|
|
||||||
"any" usebundle => dovecot_install_rspamd_sieve_scripts("$(dovecot.cfg_dir)/rspamd"),
|
"any" usebundle => dovecot_install_rspamd_sieve_scripts("$(dovecot.cfg_dir)/rspamd"),
|
||||||
depends_on => {"dovecot_pkgs_installed"};
|
depends_on => {"dovecot_pkgs_installed"};
|
||||||
|
|
||||||
|
|
||||||
files:
|
files:
|
||||||
"$(cfg_dir)/."
|
"$(cfg_dir)/."
|
||||||
create => "true",
|
create => "true",
|
||||||
|
@ -264,6 +264,21 @@ methods:
|
||||||
|
|
||||||
) ,depends_on => {"dovecot_install_rspamd_sieve_scripts_dir_created"};
|
) ,depends_on => {"dovecot_install_rspamd_sieve_scripts_dir_created"};
|
||||||
|
|
||||||
|
|
||||||
|
"any" usebundle => dovecot_install_sieve_script("$(target_dir)/global_sieve_after.sieve",
|
||||||
|
'
|
||||||
|
require ["fileinto"];
|
||||||
|
if allof (header :contains "X-Spam" "Yes")
|
||||||
|
{
|
||||||
|
fileinto "Junk";
|
||||||
|
}
|
||||||
|
|
||||||
|
',"dovecot_global_sieve_after"),depends_on => {
|
||||||
|
"dovecot_install_rspamd_sieve_scripts_dir_created",
|
||||||
|
"dovecot_pkgs_installed"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
files:
|
files:
|
||||||
|
|
||||||
"$(target_dir)/rspamd-learn-ham.sh"
|
"$(target_dir)/rspamd-learn-ham.sh"
|
||||||
|
|
514
mailserver.cf
514
mailserver.cf
|
@ -6,9 +6,15 @@
|
||||||
bundle agent install_mailserver(param_cfg)
|
bundle agent install_mailserver(param_cfg)
|
||||||
{
|
{
|
||||||
vars:
|
vars:
|
||||||
|
|
||||||
|
"default_alias_maps" string => "hash:/etc/aliases";
|
||||||
|
freebsd::
|
||||||
|
"default_alias_maps" string => "hash:/etc/mail/aliases";
|
||||||
|
|
||||||
|
any::
|
||||||
"default_cfg" data => '{
|
"default_cfg" data => '{
|
||||||
"pam_auth":true,
|
"pam_auth":true,
|
||||||
"vimb_auth":false,
|
"vimb_auth":true,
|
||||||
"imap":true,
|
"imap":true,
|
||||||
"submission":true,
|
"submission":true,
|
||||||
"smtp":true,
|
"smtp":true,
|
||||||
|
@ -21,7 +27,7 @@ vars:
|
||||||
"mydestination":"$myhostname, localhost",
|
"mydestination":"$myhostname, localhost",
|
||||||
"mail_location" : "maildir:~/Maildir:LAYOUT=maildir++:INBOX=~/Maildir/.INBOX:CONTROL=~/Mail/control:INDEX=~/Mail/index",
|
"mail_location" : "maildir:~/Maildir:LAYOUT=maildir++:INBOX=~/Maildir/.INBOX:CONTROL=~/Mail/control:INDEX=~/Mail/index",
|
||||||
"vmail_location" : "maildir:~/Maildir:LAYOUT=maildir++:INBOX=~/Maildir/.INBOX:CONTROL=~/Mail/control:INDEX=~/Mail/index",
|
"vmail_location" : "maildir:~/Maildir:LAYOUT=maildir++:INBOX=~/Maildir/.INBOX:CONTROL=~/Mail/control:INDEX=~/Mail/index",
|
||||||
|
"alias_maps":"$(default_alias_maps)"
|
||||||
|
|
||||||
}';
|
}';
|
||||||
|
|
||||||
|
@ -155,19 +161,24 @@ vars:
|
||||||
"maxproc":"-",
|
"maxproc":"-",
|
||||||
"command":"smtpd",
|
"command":"smtpd",
|
||||||
"args":[
|
"args":[
|
||||||
|
"{ -o smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination }",
|
||||||
"{ -o smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination }"
|
"{ -o smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination }"
|
||||||
"{ -o smtpd_client_restrictions = permit_mynetworks reject }",
|
"#{ -o smtpd_client_restrictions = permit_mynetworks }",
|
||||||
"{ -o smtpd_relay_restrictions = permit_mynetworks reject }",
|
"#{ -o smtpd_sender_restrictions = }"
|
||||||
"{ -o smtpd_sender_restrictions = permit_mynetworks }"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
,
|
,
|
||||||
"main_raw":"
|
"main_raw":"
|
||||||
|
#debug_peer_level=4
|
||||||
|
#debug_peer_list= 5.9.7.163
|
||||||
|
|
||||||
myhostname=$(cfg[myhostname])
|
myhostname=$(cfg[myhostname])
|
||||||
mydestination=$(cfg[mydestination])
|
mydestination=$(cfg[mydestination])
|
||||||
|
alias_maps=$(cfg[alias_maps])
|
||||||
myorigin=$(cfg[myorigin])
|
myorigin=$(cfg[myorigin])
|
||||||
|
local_recipient_maps = unix:passwd.byname $alias_maps
|
||||||
"
|
"
|
||||||
,
|
,
|
||||||
"master_raw":""
|
"master_raw":""
|
||||||
|
@ -180,7 +191,7 @@ myorigin=$(cfg[myorigin])
|
||||||
|
|
||||||
methods:
|
methods:
|
||||||
"any" usebundle => install_postfix_pkgs;
|
"any" usebundle => install_postfix_pkgs;
|
||||||
"any" usebundle => install_dovecot_pkgs;
|
# "any" usebundle => install_dovecot_pkgs;
|
||||||
|
|
||||||
"any" usebundle => dovecot(@(dovecot_cfg));
|
"any" usebundle => dovecot(@(dovecot_cfg));
|
||||||
"any" usebundle => postfix(@(postfix_cfg));
|
"any" usebundle => postfix(@(postfix_cfg));
|
||||||
|
@ -188,3 +199,494 @@ reports:
|
||||||
# "DCP: $(dovecot_protos)";
|
# "DCP: $(dovecot_protos)";
|
||||||
# "DBS: $(dbs)";
|
# "DBS: $(dbs)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bundle agent aia_install_dbs
|
||||||
|
{
|
||||||
|
methods:
|
||||||
|
"any" usebundle => install_mysql_server(@(aia_mailserver.mysql_cfg)),
|
||||||
|
handle => "aia_mysql_installed";
|
||||||
|
|
||||||
|
"any" usebundle => create_mysql_db(@(aia_mailserver.vimb_db)),
|
||||||
|
depends_on => {"aia_mysql_installed"};
|
||||||
|
|
||||||
|
"any" usebundle => create_mysql_db(@(aia_mailserver.roundcube_cfg)),
|
||||||
|
depends_on => {"aia_mysql_installed"};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bundle agent aia_install_apache
|
||||||
|
{
|
||||||
|
|
||||||
|
methods:
|
||||||
|
"any" usebundle => apache;
|
||||||
|
"any" usebundle => install_apache,
|
||||||
|
depends_on => {"aia_php_installed"};
|
||||||
|
|
||||||
|
"any" usebundle => install_php_fpm,handle=>"aia_php_installed";
|
||||||
|
}
|
||||||
|
|
||||||
|
bundle agent aia_install_sites
|
||||||
|
{
|
||||||
|
vars:
|
||||||
|
"mail_site" data => '{
|
||||||
|
"domain":"$(aia_mailserver.cfg[imap_domain])",
|
||||||
|
"aliases":[
|
||||||
|
"$(aia_mailserver.cfg[smtp_domain])"
|
||||||
|
],
|
||||||
|
"email":"7u83@mail.ru",
|
||||||
|
"disable":false,
|
||||||
|
}';
|
||||||
|
|
||||||
|
|
||||||
|
methods:
|
||||||
|
"any" usebundle => apache_vhost(@(aia_mailserver.vimb_site));
|
||||||
|
"any" usebundle => apache_vhost(@(aia_mailserver.roundcube_site));
|
||||||
|
"any" usebundle => apache_vhost(@(aia_mailserver.rspamd_site));
|
||||||
|
|
||||||
|
"any" usebundle => certbot_cert(@(mail_site),"$(apache.web_root)");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bundle agent aia_mailserver(param_cfg)
|
||||||
|
{
|
||||||
|
vars:
|
||||||
|
any::
|
||||||
|
"default_cfg" data => '{
|
||||||
|
"pam_auth":true,
|
||||||
|
"vimb_auth":true,
|
||||||
|
"imap":true,
|
||||||
|
"submission":true,
|
||||||
|
"smtp":true,
|
||||||
|
"pop3":false,
|
||||||
|
"sieve":false,
|
||||||
|
"ssl":false,
|
||||||
|
"opendkim":false,
|
||||||
|
"myhostname":"$(sys.host)",
|
||||||
|
"myorigin":"$myhostname",
|
||||||
|
"mydestination":"$myhostname, localhost",
|
||||||
|
"mail_location" : "mbox:~/mail:LAYOUT=maildir++:INBOX=/var/mail/%u:INDEX=~/mail/index:CONTROL=~/mail/control"
|
||||||
|
"vmail_location" : "maildir:~/Maildir:LAYOUT=maildir++:INBOX=~/Maildir/.INBOX:CONTROL=~/Mail/control:INDEX=~/Mail/index",
|
||||||
|
"alias_maps":"$(postfix.default_alias_maps)",
|
||||||
|
|
||||||
|
"db_host":"127.0.0.1",
|
||||||
|
"vimb_db_pass":"vimbdb-secret",
|
||||||
|
"vimb_server_email_name":"Vimbadmin $(param_cfg[vimb_domain])",
|
||||||
|
|
||||||
|
"roundcube_db_pass":"roundcube-secret",
|
||||||
|
"roundcube_version":"1.6.4",
|
||||||
|
|
||||||
|
"vimb_rememberme_salt":"Xa])o3GwVe-$8>-vz}y<uR/@Nr*tMwA!^O,D~Npj/JBq8:kM=mLLF(UlFhPntV.(",
|
||||||
|
"vimb_password_salt":"1M;C&Mn{4}){:f=VH*99S%dp)lnKdaQ8#;g>~+&D\C!2Ni+_AeocxD^ZhGQz-H/8",
|
||||||
|
|
||||||
|
"rspamd_bind_socket":"127.0.0.1:11332",
|
||||||
|
|
||||||
|
"vmail_user":"vmail",
|
||||||
|
"vmail_uid":"5000",
|
||||||
|
"vmail_gid":"5000",
|
||||||
|
"vmail_dir":"/var/vmail",
|
||||||
|
}';
|
||||||
|
|
||||||
|
"cfg" data => mergedata(@(default_cfg),@(param_cfg));
|
||||||
|
|
||||||
|
"mysql_cfg" data => '{
|
||||||
|
"settings":{
|
||||||
|
"mysqld":{
|
||||||
|
"bind-address":"$(cfg[db_host])",
|
||||||
|
"lower_case_table_names":"1",
|
||||||
|
"default-authentication-plugin":"mysql_native_password"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"bind_address":"$(cfg[db_host])",
|
||||||
|
"backup_dir":"/tank/backups/mysql_backups"
|
||||||
|
}';
|
||||||
|
|
||||||
|
"vimb_db" data => '{
|
||||||
|
"db_name":"vimbadmin",
|
||||||
|
"db_user":"vimbadmin",
|
||||||
|
"db_host":"$(cfg[db_host])",
|
||||||
|
"db_pass":"$(cfg[vimb_db_pass])",
|
||||||
|
"db_user_host":"%"
|
||||||
|
}';
|
||||||
|
|
||||||
|
"vimb_site" data => '{
|
||||||
|
"domain":"$(cfg[vimb_domain])",
|
||||||
|
"aliases":[ ],
|
||||||
|
"email":"7u83@mail.ru",
|
||||||
|
"disable":false,
|
||||||
|
"doc_root":"$(apache.www_dir)/$(cfg[vimb_domain])/public",
|
||||||
|
"ssl":true,
|
||||||
|
"raw":"
|
||||||
|
Alias /vimbadmin $(apache.www_dir)/$(cfg[vimb_domain])/public
|
||||||
|
"
|
||||||
|
}';
|
||||||
|
|
||||||
|
"vimb_cfg" data => '{
|
||||||
|
"src_tgz":"$(sys.workdir)/data/public/vimbadmin-3.4.1.tar.gz",
|
||||||
|
"install_dir":"$(apache.www_dir)/$(cfg[vimb_domain])",
|
||||||
|
|
||||||
|
"restore_db_file":"$(cfg[backup_dir])/vimbdb.sql",
|
||||||
|
|
||||||
|
"db_driver":"pdo_mysql",
|
||||||
|
"db_user":"$(vimb_db[db_user])",
|
||||||
|
"db_pass":"$(vimb_db[db_pass])",
|
||||||
|
"db_host":"$(vimb_db[db_host])",
|
||||||
|
"db_name":"$(vimb_db[db_name])",
|
||||||
|
"server_email_name":"$(cfg[vimb_server_email_name])",
|
||||||
|
"server_email_address":"$(cfg[vimb_server_email_address])",
|
||||||
|
|
||||||
|
|
||||||
|
"security_salt":"$(cfg[vimb_security_salt])",
|
||||||
|
"rememberme_salt":"$(cfg[vimb_rememberme_salt])",
|
||||||
|
"password_salt":"$(cfg[vimb_password_salt])",
|
||||||
|
}';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"roundcube_site" data => '{
|
||||||
|
"domain":"$(cfg[webmail_domain])",
|
||||||
|
"aliases":[ ],
|
||||||
|
"email":"7u83@mail.ru",
|
||||||
|
"disable":false,
|
||||||
|
"doc_root":"$(apache.www_dir)/$(cfg[webmail_domain])/public",
|
||||||
|
"ssl":true,
|
||||||
|
"raw":"
|
||||||
|
"
|
||||||
|
}';
|
||||||
|
|
||||||
|
"roundcube_cfg" data =>'{
|
||||||
|
"db_host":"$(cfg[db_host])",
|
||||||
|
"db_user":"roundcube",
|
||||||
|
"db_pass":"$(cfg[roundcube_db_pass])",
|
||||||
|
"db_user_host":"%",
|
||||||
|
"db_name":"roundcube",
|
||||||
|
"www_user":"$(apache.www_user)",
|
||||||
|
"www_group":"$(apache.www_group)",
|
||||||
|
|
||||||
|
"install_dir":"$(apache.www_dir)/$(cfg[webmail_domain])",
|
||||||
|
"version":"$(cfg[roundcube_version])",
|
||||||
|
"backup_dir":"$(cfg[backup_dir])/roundcube",
|
||||||
|
"settings":{
|
||||||
|
"imap_host":"\'tls://$(cfg[imap_domain]):143\'",
|
||||||
|
"smtp_host":"\'tls://$(cfg[smtp_domain]):587\'"
|
||||||
|
}
|
||||||
|
|
||||||
|
}';
|
||||||
|
|
||||||
|
|
||||||
|
"rspamd_site" data => '{
|
||||||
|
"domain" : "$(cfg[rspamd_domain])",
|
||||||
|
"aliases" : [ ],
|
||||||
|
"email": "7u83@mail.ru",
|
||||||
|
"disable": false,
|
||||||
|
"ssl": true,
|
||||||
|
"doc_root":"$(apache.www_dir)/$(cfg[rspamd_domain])",
|
||||||
|
"php_handler":"proxy:unix:$(php.fpm_socket)|fcgi://localhost/",
|
||||||
|
"raw": "
|
||||||
|
<Location / >
|
||||||
|
ProxyPass http://localhost:11334/
|
||||||
|
ProxyPassReverse http://localhost:11334/
|
||||||
|
</Location>
|
||||||
|
|
||||||
|
"
|
||||||
|
}';
|
||||||
|
|
||||||
|
"rspamd_cfg" data => '{
|
||||||
|
"worker_normal":"
|
||||||
|
#bind_socket = \\"localhost:12222\\"
|
||||||
|
"
|
||||||
|
,
|
||||||
|
"worker_proxy":"
|
||||||
|
upstream \\"local\\" {
|
||||||
|
self_scan = yes
|
||||||
|
}
|
||||||
|
bind_socket = \\"$(cfg[rspamd_bind_socket])\\"
|
||||||
|
",
|
||||||
|
"password":"hallorspamd",
|
||||||
|
"enable-password":"hallorspamd-enable"
|
||||||
|
}';
|
||||||
|
|
||||||
|
"opendkim_cfg" data => '{
|
||||||
|
"mynetworks":[
|
||||||
|
"127.0.0.1",
|
||||||
|
],
|
||||||
|
"keyfile":"$(cfg[dkim_private_key_file])",
|
||||||
|
"selector":"$(cfg[dkim_selector])",
|
||||||
|
"uid":"$(postfix.user)",
|
||||||
|
"gid":"$(postfix.group)",
|
||||||
|
"milter_sock":"$(postfix.queue_dir)/private/opendkim"
|
||||||
|
}';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"dbs" string => string_mustache('
|
||||||
|
"userdbs":[
|
||||||
|
{{#cfg.vimb_auth}}
|
||||||
|
{
|
||||||
|
"driver":"sql",
|
||||||
|
"args":"$(dovecot_vimbadmin_sql.cfg_file)"
|
||||||
|
},
|
||||||
|
{{/cfg.vimb_auth}}
|
||||||
|
{{#cfg.pam_auth}}
|
||||||
|
{
|
||||||
|
"driver":"passwd",
|
||||||
|
"args":""
|
||||||
|
},
|
||||||
|
{{/cfg.pam_auth}}
|
||||||
|
],
|
||||||
|
"passdbs":[
|
||||||
|
{{#cfg.vimb_auth}}
|
||||||
|
{
|
||||||
|
"driver":"sql",
|
||||||
|
"args":"$(dovecot_vimbadmin_sql.cfg_file)"
|
||||||
|
} ,
|
||||||
|
{{/cfg.vimb_auth}}
|
||||||
|
{{#cfg.pam_auth}}
|
||||||
|
{
|
||||||
|
"driver":"pam",
|
||||||
|
"args":"dovecot"
|
||||||
|
},
|
||||||
|
{{/cfg.pam_auth}}
|
||||||
|
],',
|
||||||
|
bundlestate("$(this.bundle)"));
|
||||||
|
|
||||||
|
|
||||||
|
"dovecot_cfg" data => '{
|
||||||
|
"protocols":["imap","sieve","lmtp"],
|
||||||
|
"ssl":true,
|
||||||
|
"imap_cert":"$(certbot.certbot_dir)/live/$(cfg[imap_domain])/fullchain.pem",
|
||||||
|
"imap_key":"$(certbot.certbot_dir)/live/$(cfg[imap_domain])/privkey.pem",
|
||||||
|
"submission_cert":"$(certbot.certbot_dir)/live/$(cfg[imap_domain])/fullchain.pem",
|
||||||
|
"submission_key":"$(certbot.certbot_dir)/live/$(cfg[imap_domain])/privkey.pem",
|
||||||
|
"rspamd_scripts":true,
|
||||||
|
"global_sieve_after":true,
|
||||||
|
"default_imap_folders":true,
|
||||||
|
"vmail_dir":"$(cfg[vmail_dir])",
|
||||||
|
"vmail_uid":"$(cfg[vmail_uid])",
|
||||||
|
"vmail_gid":"$(cfg[vmail_gid])",
|
||||||
|
|
||||||
|
"raw":"
|
||||||
|
mail_location = $(cfg[mail_location])
|
||||||
|
mail_privileged_group=mail
|
||||||
|
log_path = /var/log/dovecot.log
|
||||||
|
mail_debug=yes
|
||||||
|
auth_debug=yes
|
||||||
|
|
||||||
|
|
||||||
|
protocol sieve {
|
||||||
|
managesieve_max_line_length = 65536
|
||||||
|
}
|
||||||
|
",
|
||||||
|
$(dbs)
|
||||||
|
"services":{
|
||||||
|
"imap-login":{
|
||||||
|
"raw":"
|
||||||
|
inet_listener imap {
|
||||||
|
port = 143
|
||||||
|
}
|
||||||
|
inet_listener imaps {
|
||||||
|
port = 993
|
||||||
|
ssl = yes
|
||||||
|
}
|
||||||
|
"
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"pop3-login":{
|
||||||
|
"raw":"
|
||||||
|
inet_listener pop3 {
|
||||||
|
port = 110
|
||||||
|
}
|
||||||
|
inet_listener pop3s {
|
||||||
|
port = 995
|
||||||
|
ssl = yes
|
||||||
|
}
|
||||||
|
"
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"auth":{
|
||||||
|
"raw":"
|
||||||
|
unix_listener $(postfix.queue_dir)/private/auth {
|
||||||
|
user = postfix
|
||||||
|
group = postfix
|
||||||
|
mode = 0666
|
||||||
|
}
|
||||||
|
"
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"lmtp":{
|
||||||
|
"raw":"
|
||||||
|
unix_listener $(postfix.queue_dir)/private/dovecot-lmtp {
|
||||||
|
group = postfix
|
||||||
|
mode = 0600
|
||||||
|
user = postfix
|
||||||
|
}
|
||||||
|
"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}';
|
||||||
|
|
||||||
|
|
||||||
|
"postfix_cfg" data => '{
|
||||||
|
"non_smtpd_milters":[
|
||||||
|
"unix:$ (postfix.queue_dir)/private/opendkim"
|
||||||
|
]
|
||||||
|
,
|
||||||
|
"services" : [
|
||||||
|
{
|
||||||
|
"name":"submission"
|
||||||
|
"comment": "Submission service"
|
||||||
|
"enable":$(cfg[submission]),
|
||||||
|
"type":"inet",
|
||||||
|
"private":"n",
|
||||||
|
"unpriv":"-",
|
||||||
|
"chroot":"n",
|
||||||
|
"wakeup":"-",
|
||||||
|
"maxproc":"-",
|
||||||
|
"command":"smtpd",
|
||||||
|
"args":[
|
||||||
|
"{ -o smtpd_sender_restrictions = permit_sasl_authenticated reject }",
|
||||||
|
"{ -o smtpd_recipient_restrictions = reject_unknown_recipient_domain permit_sasl_authenticated reject }",
|
||||||
|
"{ -o smtpd_client_restrictions = permit_sasl_authenticated reject }",
|
||||||
|
"{ -o smtpd_helo_restrictions = permit_sasl_authenticated reject }",
|
||||||
|
"{ -o smtpd_relay_restrictions = permit_sasl_authenticated reject }",
|
||||||
|
"{ -o smtpd_sasl_auth_enable = yes }",
|
||||||
|
"{ -o smtpd_sasl_type = dovecot }",
|
||||||
|
"{ -o smtpd_sasl_path = $(postfix.queue_dir)/private/auth }",
|
||||||
|
"{ -o smtpd_tls_security_level = encrypt }",
|
||||||
|
"{ -o smtpd_tls_key_file = $(certbot.certbot_dir)/live/$(cfg[imap_domain])/privkey.pem }",
|
||||||
|
"{ -o smtpd_tls_cert_file = $(certbot.certbot_dir)/live/$(cfg[imap_domain])/fullchain.pem }",
|
||||||
|
"{ -o smtpd_tls_loglevel = 1 }",
|
||||||
|
"{ -o smtpd_tls_received_header = yes }",
|
||||||
|
"{ -o smtpd_tls_session_cache_timeout = 3600s }",
|
||||||
|
"{ -o smtpd_tls_mandatory_ciphers = high}",
|
||||||
|
"{ -o tls_ssl_options = 0x40000000}",
|
||||||
|
"{ -o tls_preempt_cipherlist = yes}",
|
||||||
|
"{ -o smtpd_tls_eecdh_grade = ultra}",
|
||||||
|
"{ -o smtpd_tls_auth_only = yes }",
|
||||||
|
"{ -o smtp_tls_note_starttls_offer = yes }",
|
||||||
|
"{ -o smtpd_milters = unix:/var/spool/postfix/private/opendkim }",
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
],
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
"name":"smtp",
|
||||||
|
"comment": "SMTP service",
|
||||||
|
"enable":$(cfg[smtp]),
|
||||||
|
"type":"inet",
|
||||||
|
"private":"n",
|
||||||
|
"unpriv":"-",
|
||||||
|
"chroot":"n",
|
||||||
|
"wakeup":"-",
|
||||||
|
"maxproc":"-",
|
||||||
|
"command":"smtpd",
|
||||||
|
"args":[
|
||||||
|
"{ -o smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination }",
|
||||||
|
"{ -o smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination }"
|
||||||
|
"{ -o smtpd_recipient_restrictions = permit_mynetworks reject_unlisted_recipient reject_unauth_destination reject_unknown_recipient_domain reject_rbl_client ix.dnsbl.manitu.net reject_rbl_client zen.spamhaus.org }",
|
||||||
|
"{ -o smtpd_client_restrictions = permit_mynetworks reject_unknown_reverse_client_hostname reject_unauth_pipelining }",
|
||||||
|
"{ -o smtpd_helo_restrictions = permit_mynetworks reject_invalid_hostname reject_unknown_hostname reject_non_fqdn_hostname }",
|
||||||
|
"{ -o smtpd_relay_restrictions = permit_mynetworks defer_unauth_destination }",
|
||||||
|
"{ -o smtpd_milters = inet:$(cfg[rspamd_bind_socket]) }",
|
||||||
|
"{ -o smtpd_use_tls = yes }",
|
||||||
|
"{ -o smtpd_tls_mandatory_ciphers = high }",
|
||||||
|
"{ -o tls_preempt_cipherlist = yes }",
|
||||||
|
"{ -o smtpd_tls_eecdh_grade = ultra }",
|
||||||
|
"{ -o smtpd_tls_security_level = may }",
|
||||||
|
"{ -o smtp_tls_note_starttls_offer = yes }",
|
||||||
|
"{ -o smtpd_sasl_auth_enable = no }",
|
||||||
|
"{ -o smtpd_tls_loglevel = 1 }",
|
||||||
|
"{ -o smtpd_tls_received_header = yes }",
|
||||||
|
"{ -o smtpd_tls_session_cache_timeout = 3600s }",
|
||||||
|
"{ -o smtpd_tls_key_file = $(certbot.certbot_dir)/live/$(cfg[imap_domain])/privkey.pem }",
|
||||||
|
"{ -o smtpd_tls_cert_file = $(certbot.certbot_dir)/live/$(cfg[imap_domain])/fullchain.pem }",
|
||||||
|
],
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
,
|
||||||
|
"main_raw":"
|
||||||
|
#debug_peer_level=4
|
||||||
|
#debug_peer_list= 5.9.7.163
|
||||||
|
#compatibility_level = 3.8
|
||||||
|
myhostname=$(cfg[myhostname])
|
||||||
|
mydestination=$(cfg[mydestination])
|
||||||
|
alias_maps=$(cfg[alias_maps])
|
||||||
|
myorigin=$(cfg[myorigin])
|
||||||
|
local_recipient_maps = unix:passwd.byname $alias_maps
|
||||||
|
|
||||||
|
virtual_transport = lmtp:unix:private/dovecot-lmtp
|
||||||
|
virtual_alias_maps = mysql:$(postfix_vimbadmin_sql.virtual_alias_maps)
|
||||||
|
virtual_mailbox_domains = mysql:$(postfix_vimbadmin_sql.virtual_domains_maps)
|
||||||
|
virtual_mailbox_maps = mysql:$(postfix_vimbadmin_sql.virtual_mailbox_maps)
|
||||||
|
|
||||||
|
"
|
||||||
|
,
|
||||||
|
"master_raw":""
|
||||||
|
|
||||||
|
}
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
reports:
|
||||||
|
|
||||||
|
users:
|
||||||
|
"$(cfg[vmail_user])"
|
||||||
|
policy => "present",
|
||||||
|
description => "Vmail user",
|
||||||
|
uid => "$(cfg[vmail_uid])";
|
||||||
|
|
||||||
|
|
||||||
|
methods:
|
||||||
|
"any" usebundle => aia_install_dbs,
|
||||||
|
handle => "aia_dbs_installed";
|
||||||
|
|
||||||
|
"any" usebundle => aia_install_apache,
|
||||||
|
handle=> "aia_apache_installed";
|
||||||
|
|
||||||
|
"any" usebundle => aia_install_sites,
|
||||||
|
handle => "aia_sites_installed",
|
||||||
|
depends_on => {"aia_apache_installed"};
|
||||||
|
|
||||||
|
"any" usebundle => vimbadmin(@(vimb_cfg)),
|
||||||
|
depends_on => {"aia_sites_installed"};
|
||||||
|
|
||||||
|
|
||||||
|
"any" usebundle => roundcube(@(roundcube_cfg)),
|
||||||
|
handle => "aia_roundcube_installed",
|
||||||
|
depends_on => {
|
||||||
|
"aia_sites_installed",
|
||||||
|
"aia_roundcube_backup_dir_created"
|
||||||
|
};
|
||||||
|
|
||||||
|
"any" usebundle => configure_roundcube(@(roundcube_cfg)),
|
||||||
|
depends_on => {"aia_roundcube_installed"};
|
||||||
|
|
||||||
|
"any" usebundle => install_postfix_pkgs;
|
||||||
|
"any" usebundle => install_dovecot_pkgs;
|
||||||
|
"any" usebundle => install_redis;
|
||||||
|
"any" usebundle => install_rspamd_pkgs;
|
||||||
|
|
||||||
|
|
||||||
|
"any" usebundle => dovecot(@(dovecot_cfg));
|
||||||
|
"any" usebundle => postfix(@(postfix_cfg));
|
||||||
|
"any" usebundle => rspamd(@(rspamd_cfg));
|
||||||
|
|
||||||
|
"any" usebundle => dovecot_vimbadmin_sql(@(vimb_cfg),@(dovecot_cfg));
|
||||||
|
"any" usebundle => postfix_vimbadmin_sql(@(vimb_db));
|
||||||
|
|
||||||
|
"any" usebundle => opendkim(@(opendkim_cfg));
|
||||||
|
|
||||||
|
files:
|
||||||
|
"$(roundcube_cfg[backup_dir])/."
|
||||||
|
create=>"true",
|
||||||
|
handle => "aia_roundcube_backup_dir_created";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
opendkim.cf
11
opendkim.cf
|
@ -12,7 +12,6 @@ vars:
|
||||||
"uid" string => "opendkim";
|
"uid" string => "opendkim";
|
||||||
"gid" string => "opendkim";
|
"gid" string => "opendkim";
|
||||||
"cfg_file" string => "/etc/opendkim.conf";
|
"cfg_file" string => "/etc/opendkim.conf";
|
||||||
#"pid_file" string => "/var/run/opendkim.pid";
|
|
||||||
"pid_file" string => "/run/opendkim/opendkim.pid";
|
"pid_file" string => "/run/opendkim/opendkim.pid";
|
||||||
|
|
||||||
centos::
|
centos::
|
||||||
|
@ -20,7 +19,6 @@ vars:
|
||||||
"uid" string => "opendkim";
|
"uid" string => "opendkim";
|
||||||
"gid" string => "opendkim";
|
"gid" string => "opendkim";
|
||||||
"cfg_file" string => "/etc/opendkim.conf";
|
"cfg_file" string => "/etc/opendkim.conf";
|
||||||
#"pid_file" string => "/var/run/opendkim.pid";
|
|
||||||
"pid_file" string => "/run/opendkim/opendkim.pid";
|
"pid_file" string => "/run/opendkim/opendkim.pid";
|
||||||
|
|
||||||
freebsd::
|
freebsd::
|
||||||
|
@ -29,6 +27,7 @@ vars:
|
||||||
"gid" string => "mailnull";
|
"gid" string => "mailnull";
|
||||||
"cfg_file" string => "/usr/local/etc/mail/opendkim.conf";
|
"cfg_file" string => "/usr/local/etc/mail/opendkim.conf";
|
||||||
"pid_file" string => "/var/run/opendkim.pid";
|
"pid_file" string => "/var/run/opendkim.pid";
|
||||||
|
"service_name" string => "milter-opendkim";
|
||||||
|
|
||||||
any::
|
any::
|
||||||
|
|
||||||
|
@ -79,6 +78,14 @@ reports:
|
||||||
bundle agent opendkim_systemd_overrides
|
bundle agent opendkim_systemd_overrides
|
||||||
{
|
{
|
||||||
files:
|
files:
|
||||||
|
freebsd::
|
||||||
|
"/etc/rc.conf.d/milteropendkim"
|
||||||
|
create=>"true",
|
||||||
|
content=>'
|
||||||
|
milteropendkim_uid="$(opendkim.cfg[uid])"
|
||||||
|
milteropendkim_gid="$(opendkim.cfg[gid])"
|
||||||
|
';
|
||||||
|
|
||||||
centos::
|
centos::
|
||||||
|
|
||||||
"/etc/systemd/system/opendkim.service.d/override.conf"
|
"/etc/systemd/system/opendkim.service.d/override.conf"
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
bundle agent postfix(cfg)
|
bundle agent postfix(cfg)
|
||||||
{
|
{
|
||||||
vars:
|
vars:
|
||||||
|
"default_alias_maps" string => "hash:/etc/aliases";
|
||||||
|
freebsd::
|
||||||
|
"default_alias_maps" string => "hash:/etc/mail/aliases";
|
||||||
|
|
||||||
freebsd::
|
freebsd::
|
||||||
"pkgs" slist => {
|
"pkgs" slist => {
|
||||||
|
|
|
@ -35,6 +35,7 @@ vars:
|
||||||
"root_user" string => "root";
|
"root_user" string => "root";
|
||||||
"root_group" string => "wheel";
|
"root_group" string => "wheel";
|
||||||
"rspamadm" string => "/usr/local/bin/rspamadm";
|
"rspamadm" string => "/usr/local/bin/rspamadm";
|
||||||
|
"rspamc" string => "/usr/local/bin/rspamc";
|
||||||
|
|
||||||
debian::
|
debian::
|
||||||
"pkgs" slist => {"rspamd"};
|
"pkgs" slist => {"rspamd"};
|
||||||
|
@ -43,6 +44,7 @@ vars:
|
||||||
"root_user" string => "root";
|
"root_user" string => "root";
|
||||||
"root_group" string => "root";
|
"root_group" string => "root";
|
||||||
"rspamadm" string => "/usr//bin/rspamadm";
|
"rspamadm" string => "/usr//bin/rspamadm";
|
||||||
|
"rspamc" string => "/usr/bin/rspamc";
|
||||||
|
|
||||||
centos::
|
centos::
|
||||||
"pkgs" slist => {"rspamd"};
|
"pkgs" slist => {"rspamd"};
|
||||||
|
@ -51,6 +53,7 @@ vars:
|
||||||
"root_user" string => "root";
|
"root_user" string => "root";
|
||||||
"root_group" string => "root";
|
"root_group" string => "root";
|
||||||
"rspamadm" string => "/usr//bin/rspamadm";
|
"rspamadm" string => "/usr//bin/rspamadm";
|
||||||
|
"rspamc" string => "/usr/bin/rspamc";
|
||||||
|
|
||||||
runpw::
|
runpw::
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec /usr/bin/rspamc -h localhost:11334 learn_ham
|
exec {{vars.rspamd.rspamc}} -h localhost:11334 learn_ham
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec /usr/bin/rspamc -h localhost:11334 learn_spam
|
exec {{vars.rspamd.rspamc}} -h localhost:11334 learn_spam
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,6 @@ namespace inbox {
|
||||||
auto = subscribe
|
auto = subscribe
|
||||||
special_use = \Trash
|
special_use = \Trash
|
||||||
}
|
}
|
||||||
|
|
||||||
mailbox Sent {
|
mailbox Sent {
|
||||||
auto = subscribe
|
auto = subscribe
|
||||||
special_use = \Sent
|
special_use = \Sent
|
||||||
|
@ -120,31 +119,37 @@ namespace inbox {
|
||||||
}
|
}
|
||||||
{{/vars.dovecot.cfg.default_imap_folders}}
|
{{/vars.dovecot.cfg.default_imap_folders}}
|
||||||
|
|
||||||
{{#vars.dovecot.cfg.rspamd_scripts}}
|
|
||||||
protocol imap {
|
protocol imap {
|
||||||
mail_plugins = $mail_plugins imap_sieve
|
mail_plugins = $mail_plugins imap_sieve
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{#vars.dovecot.cfg.rspamd_scripts}}
|
||||||
plugin {
|
plugin {
|
||||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||||
|
|
||||||
# From elsewhere to Spam folder
|
# From elsewhere to Spam folder
|
||||||
imapsieve_mailbox1_name = Junk
|
imapsieve_mailbox1_name = Junk
|
||||||
imapsieve_mailbox1_causes = COPY
|
imapsieve_mailbox1_causes = COPY
|
||||||
imapsieve_mailbox1_before = file:/etc/dovecot/rspamd/rspamd-learn-spam.sieve
|
imapsieve_mailbox1_before = file:{{vars.dovecot.cfg_dir}}/rspamd/rspamd-learn-spam.sieve
|
||||||
|
|
||||||
# From Spam folder to elsewhere
|
# From Spam folder to elsewhere
|
||||||
imapsieve_mailbox2_name = *
|
imapsieve_mailbox2_name = *
|
||||||
imapsieve_mailbox2_from = Junk
|
imapsieve_mailbox2_from = Junk
|
||||||
imapsieve_mailbox2_causes = COPY
|
imapsieve_mailbox2_causes = COPY
|
||||||
imapsieve_mailbox2_before = file:/etc/dovecot/rspamd/rspamd-learn-ham.sieve
|
imapsieve_mailbox2_before = file:{{vars.dovecot.cfg_dir}}/rspamd/rspamd-learn-ham.sieve
|
||||||
|
|
||||||
sieve_pipe_bin_dir = /etc/dovecot/rspamd
|
sieve_pipe_bin_dir = {{vars.dovecot.cfg_dir}}/rspamd
|
||||||
|
|
||||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
||||||
}
|
}
|
||||||
{{/vars.dovecot.cfg.rspamd_scripts}}
|
{{/vars.dovecot.cfg.rspamd_scripts}}
|
||||||
|
|
||||||
|
{{#vars.dovecot.cfg.global_sieve_after}}
|
||||||
|
plugin {
|
||||||
|
sieve_after = {{vars.dovecot.cfg_dir}}/rspamd/global_sieve_after.sieve
|
||||||
|
}
|
||||||
|
{{/vars.dovecot.cfg.global_sieve_after}}
|
||||||
|
|
||||||
|
|
||||||
{{vars.dovecot.cfg.raw}}
|
{{vars.dovecot.cfg.raw}}
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/* Local configuration for Roundcube Webmail */
|
||||||
|
|
||||||
|
// ----------------------------------
|
||||||
|
// SQL DATABASE
|
||||||
|
// ----------------------------------
|
||||||
|
// Database connection string (DSN) for read+write operations
|
||||||
|
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
|
||||||
|
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
|
||||||
|
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
|
||||||
|
// Note: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
|
||||||
|
// or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
|
||||||
|
// Note: Various drivers support various additional arguments for connection,
|
||||||
|
// for Mysql: key, cipher, cert, capath, ca, verify_server_cert,
|
||||||
|
// for Postgres: application_name, sslmode, sslcert, sslkey, sslrootcert, sslcrl, sslcompression, service.
|
||||||
|
// e.g. 'mysql://roundcube:@localhost/roundcubemail?verify_server_cert=false'
|
||||||
|
$config['db_dsnw'] = 'mysql://roundcube:roundcube-secret@127.0.0.1/roundcube';
|
||||||
|
|
||||||
|
// ----------------------------------
|
||||||
|
// IMAP
|
||||||
|
// ----------------------------------
|
||||||
|
// The IMAP host (and optionally port number) chosen to perform the log-in.
|
||||||
|
// Leave blank to show a textbox at login, give a list of hosts
|
||||||
|
// to display a pulldown menu or set one host as string.
|
||||||
|
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
|
||||||
|
// prefix tls:// to use STARTTLS.
|
||||||
|
// If port number is omitted it will be set to 993 (for ssl://) or 143 otherwise.
|
||||||
|
// Supported replacement variables:
|
||||||
|
// %n - hostname ($_SERVER['SERVER_NAME'])
|
||||||
|
// %t - hostname without the first part
|
||||||
|
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
|
||||||
|
// %s - domain name after the '@' from e-mail address provided at login screen
|
||||||
|
// For example %n = mail.domain.tld, %t = domain.tld
|
||||||
|
// WARNING: After hostname change update of mail_host column in users table is
|
||||||
|
// required to match old user data records with the new host.
|
||||||
|
$config['imap_host'] = 'tls://imap.dewp.org:143';
|
||||||
|
|
||||||
|
// ----------------------------------
|
||||||
|
// SMTP
|
||||||
|
// ----------------------------------
|
||||||
|
// SMTP server host (and optional port number) for sending mails.
|
||||||
|
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
|
||||||
|
// prefix tls:// to use STARTTLS.
|
||||||
|
// If port number is omitted it will be set to 465 (for ssl://) or 587 otherwise.
|
||||||
|
// Supported replacement variables:
|
||||||
|
// %h - user's IMAP hostname
|
||||||
|
// %n - hostname ($_SERVER['SERVER_NAME'])
|
||||||
|
// %t - hostname without the first part
|
||||||
|
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
|
||||||
|
// %z - IMAP domain (IMAP hostname without the first part)
|
||||||
|
// For example %n = mail.domain.tld, %t = domain.tld
|
||||||
|
// To specify different SMTP servers for different IMAP hosts provide an array
|
||||||
|
// of IMAP host (no prefix or port) and SMTP server e.g. ['imap.example.com' => 'smtp.example.net']
|
||||||
|
$config['smtp_host'] = 'tls://smtp.dewp.org:587';
|
||||||
|
|
||||||
|
// provide an URL where a user can get support for this Roundcube installation
|
||||||
|
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
|
||||||
|
$config['support_url'] = '';
|
||||||
|
|
||||||
|
// This key is used for encrypting purposes, like storing of imap password
|
||||||
|
// in the session. For historical reasons it's called DES_key, but it's used
|
||||||
|
// with any configured cipher_method (see below).
|
||||||
|
// For the default cipher_method a required key length is 24 characters.
|
||||||
|
$config['des_key']='7yIlnRw2oqQAeYVtzZnv169d';
|
||||||
|
|
||||||
|
// ----------------------------------
|
||||||
|
// PLUGINS
|
||||||
|
// ----------------------------------
|
||||||
|
// List of active plugins (in plugins/ directory)
|
||||||
|
$config['plugins'] = ['acl', 'archive', 'attachment_reminder', 'emoticons', 'enigma', 'hide_blockquote', 'identicon', 'jqueryui', 'managesieve', 'markasjunk', 'newmail_notifier', 'password', 'vcard_attachments', 'zipdownload'];
|
||||||
|
|
||||||
|
// the default locale setting (leave empty for auto-detection)
|
||||||
|
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
|
||||||
|
$config['language']='us_EN';
|
||||||
|
|
||||||
|
$config['mail_domain'] = 'ms.plamix.org';
|
||||||
|
|
Loading…
Reference in New Issue