From 1e088983f6a80b6fd47543d0b4989e9ddb3234d5 Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Fri, 4 Oct 2024 21:59:59 -0400 Subject: add imap stuff --- files/etc/cron.d/acme.common | 2 + files/etc/pf.conf.freebsd | 6 +- .../etc/dovecot/conf.d/10-auth.conf.imap_server | 7 + .../etc/dovecot/conf.d/10-mail.conf.imap_server | 23 ++ .../etc/dovecot/conf.d/10-master.conf.imap_server | 32 +++ .../etc/dovecot/conf.d/10-ssl.conf.imap_server | 8 + .../etc/dovecot/conf.d/15-lda.conf.imap_server | 8 + .../dovecot/conf.d/15-mailboxes.conf.imap_server | 31 +++ .../etc/dovecot/conf.d/20-imap.conf.imap_server | 3 + .../etc/dovecot/conf.d/20-lmtp.conf.imap_server | 3 + .../dovecot/conf.d/20-managesieve.conf.imap_server | 11 + .../etc/dovecot/conf.d/90-fts.conf.imap_server | 6 + .../etc/dovecot/conf.d/90-quota.conf.imap_server | 32 +++ .../conf.d/90-sieve-extprograms.conf.imap_server | 3 + .../etc/dovecot/conf.d/90-sieve.conf.imap_server | 28 +++ .../dovecot/conf.d/auth-ldap.conf.ext.imap_server | 8 + .../dovecot-ldap-passdb.conf.ext.imap_server | 11 + .../dovecot-ldap-userdb.conf.ext.imap_server | 17 ++ .../usr/local/etc/dovecot/dovecot.conf.imap_server | 5 + .../local/etc/dovecot/report-ham.sieve.imap_server | 15 ++ .../etc/dovecot/report-spam.sieve.imap_server | 7 + .../sieve-before.d/10-rspamd.sieve.imap_server | 5 + files/usr/local/etc/nginx/nginx.conf.common | 2 +- .../local/etc/poudriere.d/make.conf.pkg_repository | 1 - .../local/etc/poudriere.d/pkglist.pkg_repository | 4 +- files/usr/local/etc/rc.d/solr.imap_server | 76 ++++++ files/usr/local/etc/rc.d/tika.imap_server | 55 ++++ files/usr/local/etc/solr/log4j2.xml.imap_server | 17 ++ .../usr/local/etc/solr/solrconfig.xml.imap_server | 280 +++++++++++++++++++++ files/usr/local/etc/sudoers.d/acme.smtp_server | 1 + files/usr/local/etc/tika/config.xml.imap_server | 21 ++ files/usr/local/etc/tika/log4j2.xml.imap_server | 17 ++ .../libexec/dovecot/quota-warning.sh.imap_server | 20 ++ .../dovecot/sieve-pipe/report-ham.sh.imap_server | 7 + .../dovecot/sieve-pipe/report-spam.sh.imap_server | 7 + .../db/solr/dovecot/conf/schema.xml.imap_server | 48 ++++ .../solr/dovecot/conf/solrconfig.xml.imap_server | 91 +++++++ files/var/db/solr/solr.xml.imap_server | 76 ++++++ 38 files changed, 988 insertions(+), 6 deletions(-) create mode 100644 files/etc/cron.d/acme.common create mode 100644 files/usr/local/etc/dovecot/conf.d/10-auth.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/10-mail.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/10-master.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/10-ssl.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/15-lda.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/15-mailboxes.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/20-imap.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/20-lmtp.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/20-managesieve.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/90-fts.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/90-quota.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/90-sieve-extprograms.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/90-sieve.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/conf.d/auth-ldap.conf.ext.imap_server create mode 100644 files/usr/local/etc/dovecot/dovecot-ldap-passdb.conf.ext.imap_server create mode 100644 files/usr/local/etc/dovecot/dovecot-ldap-userdb.conf.ext.imap_server create mode 100644 files/usr/local/etc/dovecot/dovecot.conf.imap_server create mode 100644 files/usr/local/etc/dovecot/report-ham.sieve.imap_server create mode 100644 files/usr/local/etc/dovecot/report-spam.sieve.imap_server create mode 100644 files/usr/local/etc/dovecot/sieve-before.d/10-rspamd.sieve.imap_server create mode 100644 files/usr/local/etc/rc.d/solr.imap_server create mode 100644 files/usr/local/etc/rc.d/tika.imap_server create mode 100644 files/usr/local/etc/solr/log4j2.xml.imap_server create mode 100644 files/usr/local/etc/solr/solrconfig.xml.imap_server create mode 100644 files/usr/local/etc/sudoers.d/acme.smtp_server create mode 100644 files/usr/local/etc/tika/config.xml.imap_server create mode 100644 files/usr/local/etc/tika/log4j2.xml.imap_server create mode 100644 files/usr/local/libexec/dovecot/quota-warning.sh.imap_server create mode 100644 files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server create mode 100644 files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server create mode 100644 files/var/db/solr/dovecot/conf/schema.xml.imap_server create mode 100644 files/var/db/solr/dovecot/conf/solrconfig.xml.imap_server create mode 100644 files/var/db/solr/solr.xml.imap_server (limited to 'files') diff --git a/files/etc/cron.d/acme.common b/files/etc/cron.d/acme.common new file mode 100644 index 0000000..05bf064 --- /dev/null +++ b/files/etc/cron.d/acme.common @@ -0,0 +1,2 @@ +MAILTO=root +00 15 * * * ${acme_user} lockf -t 0 /tmp/acme-cron.lock acme.sh --cron --home ${acme_home} --syslog 6 > /dev/null diff --git a/files/etc/pf.conf.freebsd b/files/etc/pf.conf.freebsd index e01f49d..881fcea 100644 --- a/files/etc/pf.conf.freebsd +++ b/files/etc/pf.conf.freebsd @@ -5,8 +5,12 @@ $(if [ -n "${pf_egress_interfaces:-}" ]; then fi) allowed_tcp_ports = "{ $(join ', ' ${allowed_tcp_ports:-}) }" allowed_udp_ports = "{ $(join ', ' ${allowed_udp_ports:-}) }" + +$([ "${acme_standalone:-}" = true ] && cat < + + + + + + %maxLen{%-5p %c %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + + + diff --git a/files/usr/local/etc/solr/solrconfig.xml.imap_server b/files/usr/local/etc/solr/solrconfig.xml.imap_server new file mode 100644 index 0000000..f7a9d7b --- /dev/null +++ b/files/usr/local/etc/solr/solrconfig.xml.imap_server @@ -0,0 +1,280 @@ + + + 9.3.0 + + ${solr.data.dir:} + + + + ${solr.lock.type:native} + + + + + ${solr.ulog.dir:} + ${solr.ulog.numVersionBuckets:65536} + + + ${solr.autoCommit.maxTime:15000} + false + + + ${solr.autoSoftCommit.maxTime:-1} + + + + + ${solr.max.booleanClauses:1024} + + + + + + + + true + + 20 + + 200 + + + + + + + + + + + false + + + + + + + + + + + + + explicit + 10 + hdr + + + + + + explicit + json + true + + + + + + _text_ + + + + + + text_general + + + default + _text_ + solr.DirectSolrSpellChecker + internal + 0.5 + 2 + 1 + 5 + 4 + 0.01 + + + + + + default + on + true + 10 + 5 + 5 + true + true + 10 + 5 + + + spellcheck + + + + + + + + true + false + + + terms + + + + + + + + 100 + + + + + + 70 + 0.5 + [-\w ,/\n\"']{20,200} + + + + + + ]]> + ]]> + + + + + + + + + + + + + + + + + ,, + ,, + ,, + ,, + ,]]> + ]]> + + + + + + 10 + .,!? + + + + + + WORD + en + US + + + + + + + + + [^\w-\.] + _ + + + + + + + yyyy-MM-dd['T'[HH:mm[:ss[.SSS]][z + yyyy-MM-dd['T'[HH:mm[:ss[,SSS]][z + yyyy-MM-dd HH:mm[:ss[.SSS]][z + yyyy-MM-dd HH:mm[:ss[,SSS]][z + [EEE, ]dd MMM yyyy HH:mm[:ss] z + EEEE, dd-MMM-yy HH:mm:ss z + EEE MMM ppd HH:mm:ss [z ]yyyy + + + + + java.lang.String + text_general + + *_str + 256 + + true + + + java.lang.Boolean + booleans + + + java.util.Date + pdates + + + java.lang.Long + java.lang.Integer + plongs + + + java.lang.Number + pdoubles + + + + + + + + + + + text/plain; charset=UTF-8 + + diff --git a/files/usr/local/etc/sudoers.d/acme.smtp_server b/files/usr/local/etc/sudoers.d/acme.smtp_server new file mode 100644 index 0000000..5180fdc --- /dev/null +++ b/files/usr/local/etc/sudoers.d/acme.smtp_server @@ -0,0 +1 @@ +acme ALL=(root) NOPASSWD: /usr/sbin/service postfix reload diff --git a/files/usr/local/etc/tika/config.xml.imap_server b/files/usr/local/etc/tika/config.xml.imap_server new file mode 100644 index 0000000..22fe638 --- /dev/null +++ b/files/usr/local/etc/tika/config.xml.imap_server @@ -0,0 +1,21 @@ + + + + /usr/local/bin/java + false + + -Xmx${tika_heap_size} + -XX:+UseG1GC + -XX:+PerfDisableSharedMem + -XX:+ParallelRefProcEnabled + -XX:MaxGCPauseMillis=250 + -XX:+AlwaysPreTouch + -Dlog4j.configurationFile=${tika_conf_dir}/log4j2.xml + + + tika + status + + + + diff --git a/files/usr/local/etc/tika/log4j2.xml.imap_server b/files/usr/local/etc/tika/log4j2.xml.imap_server new file mode 100644 index 0000000..cabde07 --- /dev/null +++ b/files/usr/local/etc/tika/log4j2.xml.imap_server @@ -0,0 +1,17 @@ + + + + + + + %maxLen{%-5p %c %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + + + diff --git a/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server b/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server new file mode 100644 index 0000000..96419f5 --- /dev/null +++ b/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server @@ -0,0 +1,20 @@ +#!/bin/sh + +set -eu -o pipefail + +PERCENT=$1 +USER=$2 +FROM=$3 + +cat << EOF | /usr/libexec/dovecot/dovecot-lda -d "$USER" -o "plugin/quota=count:User quota:noenforcing" +From: ${FROM} +Subject: Mailbox quota warning + +This is an automatically generated message. + +Your mailbox is now ${PERCENT}% full. + +When your mailbox exceeds its quota, you will no longer receive new mail. + +Please delete some messages to free up space. +EOF diff --git a/files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server b/files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server new file mode 100644 index 0000000..e09674a --- /dev/null +++ b/files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server @@ -0,0 +1,7 @@ +#!/bin/sh + +exec /usr/local/bin/rspamc \\ + --connect="${rspamd_host}.${domain}" \\ + --password="${rspamd_rw_password}" \\ + --key="${rspamd_pubkey}" \\ + learn_ham diff --git a/files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server b/files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server new file mode 100644 index 0000000..825113f --- /dev/null +++ b/files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server @@ -0,0 +1,7 @@ +#!/bin/sh + +exec /usr/local/bin/rspamc \\ + --connect="${rspamd_host}.${domain}" \\ + --password="${rspamd_rw_password}" \\ + --key="${rspamd_pubkey}" \\ + learn_spam diff --git a/files/var/db/solr/dovecot/conf/schema.xml.imap_server b/files/var/db/solr/dovecot/conf/schema.xml.imap_server new file mode 100644 index 0000000..601a290 --- /dev/null +++ b/files/var/db/solr/dovecot/conf/schema.xml.imap_server @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + diff --git a/files/var/db/solr/dovecot/conf/solrconfig.xml.imap_server b/files/var/db/solr/dovecot/conf/solrconfig.xml.imap_server new file mode 100644 index 0000000..918a755 --- /dev/null +++ b/files/var/db/solr/dovecot/conf/solrconfig.xml.imap_server @@ -0,0 +1,91 @@ + + + + 9.3.0 + + + + + + + + + + + + + + ${solr.data.dir:} + + + + + ${solr.ulog.dir:} + ${solr.ulog.numVersionBuckets:65536} + + + + ${solr.autoCommit.maxTime:15000} + false + + + + ${solr.autoSoftCommit.maxTime:-1} + + + + + + + + + + + + + + true + + 20 + + 200 + + false + + + + + + + + + + explicit + 10 + + + + + + _text_ + + + + + diff --git a/files/var/db/solr/solr.xml.imap_server b/files/var/db/solr/solr.xml.imap_server new file mode 100644 index 0000000..1778390 --- /dev/null +++ b/files/var/db/solr/solr.xml.imap_server @@ -0,0 +1,76 @@ + + + + + + + + ${solr.max.booleanClauses:1024} + ${solr.sharedLib:} + ${solr.modules:} + ${solr.allowPaths:} + ${solr.allowUrls:} + + + + ${host:} + ${solr.port.advertise:0} + ${hostContext:solr} + + ${genericCoreNodeNames:true} + + ${zkClientTimeout:30000} + ${distribUpdateSoTimeout:600000} + ${distribUpdateConnTimeout:60000} + ${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider} + ${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider} + ${zkCredentialsInjector:org.apache.solr.common.cloud.DefaultZkCredentialsInjector} + ${distributedClusterStateUpdates:false} + ${distributedCollectionConfigSetExecution:false} + ${minStateByteLenForCompression:-1} + ${stateCompressor:org.apache.solr.common.util.ZLibCompressor} + + + + + ${socketTimeout:600000} + ${connTimeout:60000} + + + + + + + + + -- cgit v1.2.3