diff --git a/Dockerfile.cron b/Dockerfile.cron deleted file mode 100644 index 41c43b1..0000000 --- a/Dockerfile.cron +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:jammy - -RUN apt-get -q update \ - && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ - cron vim ssh rsync \ - letsencrypt \ - python3-certbot-apache \ - python3-certbot-nginx \ - && apt-get clean \ - && for dir in apt dpkg cache log; do \ - if [[ -e /var/lib/apt/lists/${dir} ]]; then \ - rm -rf /var/lib/apt/lists/${dir}; \ - else \ - true ; \ - fi ; \ - done - -COPY /Dockerfile.cron /Dockerfile - -ENTRYPOINT [ "cron", "-f" ] \ No newline at end of file diff --git a/Dockerfile.dns b/Dockerfile.dns new file mode 100644 index 0000000..7737beb --- /dev/null +++ b/Dockerfile.dns @@ -0,0 +1,11 @@ +FROM ubuntu:jammy + +RUN apt-get -q update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + bind9 \ + isc-dhcp-server \ + openssh-server \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} + +ENTRYPOINT [ "/dns.sh" ] \ No newline at end of file diff --git a/Dockerfile.letsencrypt b/Dockerfile.letsencrypt new file mode 100644 index 0000000..2a21e54 --- /dev/null +++ b/Dockerfile.letsencrypt @@ -0,0 +1,15 @@ +FROM ubuntu:jammy + +RUN apt-get -q update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + cron vim ssh rsync \ + letsencrypt \ + python3-certbot-apache \ + python3-certbot-nginx \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} + +COPY /Dockerfile.letsencrypt /Dockerfile.letsencrypt +COPY /letsencrypt.sh /letsencrypt.sh + +ENTRYPOINT [ "/letsencrypt.sh" ] \ No newline at end of file diff --git a/Dockerfile.mail b/Dockerfile.mail new file mode 100644 index 0000000..acb742d --- /dev/null +++ b/Dockerfile.mail @@ -0,0 +1,26 @@ +FROM ubuntu:jammy + +RUN apt-get -q update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + amavisd-new \ + clamav-daemon \ + clamav-freshclam \ + cron \ + dovecot-core \ + dovecot-managesieved \ + dovecot-sieve \ + inotify-tools \ + milter-greylist \ + opendkim \ + openssh-server \ + postfix \ + spamassassin \ + python3 \ + python-is-python3 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} + +COPY /Dockerfile.mail /Dockerfile.mail +COPY /mail.sh /mail.sh + +ENTRYPOINT [ "/mail.sh" ] diff --git a/Dockerfile b/Dockerfile.web similarity index 79% rename from Dockerfile rename to Dockerfile.web index 0448c29..28b029a 100644 --- a/Dockerfile +++ b/Dockerfile.web @@ -14,7 +14,7 @@ RUN apt-get -q update \ RUN a2enmod php8.1 \ && a2enmod rewrite -COPY /Dockerfile /Dockerfile -COPY /ketreweb.sh /ketreweb.sh +COPY /Dockerfile.web /Dockerfile.web +COPY /web.sh /web.sh -ENTRYPOINT [ "/ketreweb.sh" ] +ENTRYPOINT [ "/web.sh" ] diff --git a/config/cron.d/letsencrypt b/config/letsencrypt/etc/cron.d/letsencrypt similarity index 100% rename from config/cron.d/letsencrypt rename to config/letsencrypt/etc/cron.d/letsencrypt diff --git a/config/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/meta.json b/config/letsencrypt/etc/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/meta.json similarity index 100% rename from config/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/meta.json rename to config/letsencrypt/etc/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/meta.json diff --git a/config/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/private_key.json b/config/letsencrypt/etc/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/private_key.json similarity index 100% rename from config/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/private_key.json rename to config/letsencrypt/etc/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/private_key.json diff --git a/config/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/regr.json b/config/letsencrypt/etc/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/regr.json similarity index 100% rename from config/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/regr.json rename to config/letsencrypt/etc/letsencrypt/accounts/acme-staging.api.letsencrypt.org/directory/d519585e86c9d382b1cdee04e5e79080/regr.json diff --git a/config/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/meta.json b/config/letsencrypt/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/meta.json similarity index 100% rename from config/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/meta.json rename to config/letsencrypt/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/meta.json diff --git a/config/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/private_key.json b/config/letsencrypt/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/private_key.json similarity index 100% rename from config/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/private_key.json rename to config/letsencrypt/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/private_key.json diff --git a/config/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/regr.json b/config/letsencrypt/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/regr.json similarity index 100% rename from config/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/regr.json rename to config/letsencrypt/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/25cdd460c4f828fec6b44768359c1e13/regr.json diff --git a/config/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory b/config/letsencrypt/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory similarity index 100% rename from config/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory rename to config/letsencrypt/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory diff --git a/config/letsencrypt/cli.ini b/config/letsencrypt/etc/letsencrypt/cli.ini similarity index 100% rename from config/letsencrypt/cli.ini rename to config/letsencrypt/etc/letsencrypt/cli.ini diff --git a/config/letsencrypt/options-ssl-apache.conf b/config/letsencrypt/etc/letsencrypt/options-ssl-apache.conf similarity index 100% rename from config/letsencrypt/options-ssl-apache.conf rename to config/letsencrypt/etc/letsencrypt/options-ssl-apache.conf diff --git a/config/letsencrypt/options-ssl-nginx.conf b/config/letsencrypt/etc/letsencrypt/options-ssl-nginx.conf similarity index 100% rename from config/letsencrypt/options-ssl-nginx.conf rename to config/letsencrypt/etc/letsencrypt/options-ssl-nginx.conf diff --git a/config/letsencrypt/ssl-dhparams.pem b/config/letsencrypt/etc/letsencrypt/ssl-dhparams.pem similarity index 100% rename from config/letsencrypt/ssl-dhparams.pem rename to config/letsencrypt/etc/letsencrypt/ssl-dhparams.pem diff --git a/config/mail/etc/amavis/README.l10n b/config/mail/etc/amavis/README.l10n new file mode 100644 index 0000000..0b8c1a3 --- /dev/null +++ b/config/mail/etc/amavis/README.l10n @@ -0,0 +1,21 @@ +$Id: README.l10n 742 2005-12-26 17:15:22Z hmh $ + +First of all, read /usr/share/doc/amavisd-new/README.customize.gz + +Amavisd-new is UTF8-aware, and it will do character-set conversion when dealing +with DSN templates. The full unicode codespace is available, if used with the +proper encodings... and you have to use the proper encodings if you don't want +your DSNs to be flagged as more charset-challenged SPAM by other systems. + +ALWAYS respect the charset when adding l10n files. + +Amavisd-new does charset conversion twice: one when reading the text files with +localized templates (to internal perl UTF8), and another when writing the email +notification (from internal perl UTF8 to $hdr_encoding and $bdy_encoding). + +Headers will be RFC2047-encoded if they have any codepoints not allowed by +RFC2822 after the charset conversions. The body text charset encoding is +inserted in the proper MIME header. + +More details are available in /usr/share/doc/amavisd-new/RELEASE_NOTES.gz + diff --git a/config/mail/etc/amavis/conf.d/01-debian b/config/mail/etc/amavis/conf.d/01-debian new file mode 100644 index 0000000..764d8d4 --- /dev/null +++ b/config/mail/etc/amavis/conf.d/01-debian @@ -0,0 +1,47 @@ +use strict; + +# ADMINISTRATORS: +# Debian suggests that any changes you need to do that should never +# be "updated" by the Debian package should be made in another file, +# overriding the settings in this file. +# +# The package will *not* overwrite your settings, but by keeping +# them separate, you will make the task of merging changes on these +# configuration files much simpler... + +# see /usr/share/doc/amavisd-new/examples/amavisd.conf-default for +# a list of all variables with their defaults; +# see /usr/share/doc/amavisd-new/examples/amavisd.conf-sample for +# a traditional-style commented file +# [note: the above files were not converted to Debian settings!] +# +# for more details see documentation in /usr/share/doc/amavisd-new +# and at http://www.ijs.si/software/amavisd/amavisd-new-docs.html + + +# SETTINGS RARELY MODIFIED BY THE LOCAL ADMIN + +$ENV{PATH} = $path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin'; +$file = 'file'; +$gzip = 'gzip'; +$bzip2 = 'bzip2'; +$lzop = 'lzop'; +$rpm2cpio = ['rpm2cpio.pl','rpm2cpio']; +$cabextract = 'cabextract'; +$uncompress = ['uncompress', 'gzip -d', 'zcat']; +#$unfreeze = ['unfreeze', 'freeze -d', 'melt', 'fcat']; #disabled (non-free, no security support) +$unfreeze = undef; +$arc = ['nomarch', 'arc']; +$unarj = ['arj', 'unarj']; +#$unrar = ['rar', 'unrar']; #disabled (non-free, no security support) +$unrar = ['unrar-free']; +$zoo = 'zoo'; +$lha = 'lha'; +$lha = undef; +$pax = 'pax'; +$cpio = 'cpio'; +$ar = 'ar'; +$ripole = 'ripole'; +$dspam = 'dspam'; + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/05-domain_id b/config/mail/etc/amavis/conf.d/05-domain_id new file mode 100644 index 0000000..e1174c0 --- /dev/null +++ b/config/mail/etc/amavis/conf.d/05-domain_id @@ -0,0 +1,19 @@ +use strict; + +# $mydomain is used just for convenience in the config files and it is not +# used internally by amavisd-new except in the default X_HEADER_LINE (which +# Debian overrides by default anyway). + +chomp($mydomain = `head -n 1 /etc/mailname`); + +# amavisd-new needs to know which email domains are to be considered local +# to the administrative domain. Only emails to "local" domains are subject +# to certain functionality, such as the addition of spam tags. +# +# Default local domains to $mydomain and all subdomains. Remember to +# override or redefine this if $mydomain is changed later in the config +# sequence. + +@local_domains_acl = ( ".$mydomain" ); + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/05-node_id b/config/mail/etc/amavis/conf.d/05-node_id new file mode 100644 index 0000000..4d2d37d --- /dev/null +++ b/config/mail/etc/amavis/conf.d/05-node_id @@ -0,0 +1,13 @@ +use strict; + +# $myhostname is used by amavisd-new for node identification, and it is +# important to get it right (e.g. for ESMTP EHLO, loop detection, and so on). + +chomp($myhostname = `hostname --fqdn`); + +# To manually set $myhostname, edit the following line with the correct Fully +# Qualified Domain Name (FQDN) and remove the # at the beginning of the line. +# +#$myhostname = "mail.example.com"; + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/15-av_scanners b/config/mail/etc/amavis/conf.d/15-av_scanners new file mode 100644 index 0000000..1e0b527 --- /dev/null +++ b/config/mail/etc/amavis/conf.d/15-av_scanners @@ -0,0 +1,475 @@ +use strict; + +## +## AV Scanners (Debian version) +## + +@av_scanners = ( + +# ### http://www.clanfield.info/sophie/ (http://www.vanja.com/tools/sophie/) +# ['Sophie', +# \&ask_daemon, ["{}/\n", '/var/run/sophie'], +# qr/(?x)^ 0+ ( : | [\000\r\n]* $)/m, qr/(?x)^ 1 ( : | [\000\r\n]* $)/m, +# qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/m ], + +# ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/ +# ['Sophos SAVI', \&sophos_savi ], + +### http://www.clamav.net/ + ['ClamAV-clamd', + \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"], + qr/\bOK$/m, qr/\bFOUND$/m, + qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ], +# NOTE: run clamd under the same user as amavisd, or run it under its own +# uid such as clamav, add user clamav to the amavis group, and then add +# AllowSupplementaryGroups to clamd.conf; +# NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in +# this entry; when running chrooted one may prefer socket "$MYHOME/clamd". + +# ### http://www.openantivirus.org/ +# ['OpenAntiVirus ScannerDaemon (OAV)', +# \&ask_daemon, ["SCAN {}\n", '127.0.0.1:8127'], +# qr/^OK/m, qr/^FOUND: /m, qr/^FOUND: (.+)/m ], + +# ### http://www.vanja.com/tools/trophie/ +# ['Trophie', +# \&ask_daemon, ["{}/\n", '/var/run/trophie'], +# qr/(?x)^ 0+ ( : | [\000\r\n]* $)/m, qr/(?x)^ 1 ( : | [\000\r\n]* $)/m, +# qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/m ], + +# ### http://www.grisoft.com/ +# ['AVG Anti-Virus', +# \&ask_daemon, ["SCAN {}\n", '127.0.0.1:55555'], +# qr/^200/m, qr/^403/m, qr/^403 .*?: ([^\r\n]+)/m ], + +# ### http://www.f-prot.com/ +# ['F-Prot fpscand', # F-PROT Antivirus for BSD/Linux/Solaris, version 6 +# \&ask_daemon, +# ["SCAN FILE {}/*\n", '127.0.0.1:10200'], +# qr/^(0|8|64) /m, +# qr/^([1235679]|1[01345]) |<[^>:]*(?i)(infected|suspicious|unwanted)/m, +# qr/(?i)<[^>:]*(?:infected|suspicious|unwanted)[^>:]*: ([^>]*)>/m ], + +# ### http://www.f-prot.com/ +# ['F-Prot f-protd', # old version +# \&ask_daemon, +# ["GET {}/*?-dumb%20-archive%20-packed HTTP/1.0\r\n\r\n", +# ['127.0.0.1:10200', '127.0.0.1:10201', '127.0.0.1:10202', +# '127.0.0.1:10203', '127.0.0.1:10204'] ], +# qr/(?i)]*>clean<\/summary>/m, +# qr/(?i)]*>infected<\/summary>/m, +# qr/(?i)(.+)<\/name>/m ], + +# ### http://www.sald.com/, http://www.dials.ru/english/, http://www.drweb.ru/ +# ['DrWebD', \&ask_daemon, # DrWebD 4.31 or later +# [pack('N',1). # DRWEBD_SCAN_CMD +# pack('N',0x00280001). # DONT_CHANGEMAIL, IS_MAIL, RETURN_VIRUSES +# pack('N', # path length +# length("$TEMPBASE/amavis-yyyymmddTHHMMSS-xxxxx/parts/pxxx")). +# '{}/*'. # path +# pack('N',0). # content size +# pack('N',0), +# '/var/drweb/run/drwebd.sock', +# # '/var/amavis/var/run/drwebd.sock', # suitable for chroot +# # '/usr/local/drweb/run/drwebd.sock', # FreeBSD drweb ports default +# # '127.0.0.1:3000', # or over an inet socket +# ], +# qr/\A\x00[\x10\x11][\x00\x10]\x00/sm, # IS_CLEAN,EVAL_KEY; SKIPPED +# qr/\A\x00[\x00\x01][\x00\x10][\x20\x40\x80]/sm,# KNOWN_V,UNKNOWN_V,V._MODIF +# qr/\A.{12}(?:infected with )?([^\x00]+)\x00/sm, +# ], +# # NOTE: If using amavis-milter, change length to: +# # length("$TEMPBASE/amavis-milter-xxxxxxxxxxxxxx/parts/pxxx"). + + ### http://www.kaspersky.com/ (kav4mailservers) + ['KasperskyLab AVP - aveclient', + ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient', + '/opt/kav/5.5/kav4mailservers/bin/aveclient','aveclient'], + '-p /var/run/aveserver -s {}/*', + [0,3,6,8], qr/\b(INFECTED|SUSPICION|SUSPICIOUS)\b/m, + qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.+)/m, + ], + # NOTE: one may prefer [0],[2,3,4,5], depending on how suspicious, + # currupted or protected archives are to be handled + + ### http://www.kaspersky.com/ + ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp'], + '-* -P -B -Y -O- {}', [0,3,6,8], [2,4], # any use for -A -K ? + qr/infected: (.+)/m, + sub {chdir('/opt/AVP') or die "Can't chdir to AVP: $!"}, + sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"}, + ], + + ### The kavdaemon and AVPDaemonClient have been removed from Kasperky + ### products and replaced by aveserver and aveclient + ['KasperskyLab AVPDaemonClient', + [ '/opt/AVP/kavdaemon', 'kavdaemon', + '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient', + '/opt/AVP/AvpTeamDream', 'AvpTeamDream', + '/opt/AVP/avpdc', 'avpdc' ], + "-f=$TEMPBASE {}", [0,8], [3,4,5,6], qr/infected: ([^\r\n]+)/m ], + # change the startup-script in /etc/init.d/kavd to: + # DPARMS="-* -Y -dl -f=/var/amavis /var/amavis" + # (or perhaps: DPARMS="-I0 -Y -* /var/amavis" ) + # adjusting /var/amavis above to match your $TEMPBASE. + # The '-f=/var/amavis' is needed if not running it as root, so it + # can find, read, and write its pid file, etc., see 'man kavdaemon'. + # defUnix.prf: there must be an entry "*/var/amavis" (or whatever + # directory $TEMPBASE specifies) in the 'Names=' section. + # cd /opt/AVP/DaemonClients; configure; cd Sample; make + # cp AvpDaemonClient /opt/AVP/ + # su - vscan -c "${PREFIX}/kavdaemon ${DPARMS}" + + ### http://www.centralcommand.com/ + ['CentralCommand Vexira (new) vascan', + ['vascan','/usr/lib/Vexira/vascan'], + "-a s --timeout=60 --temp=$TEMPBASE -y $QUARANTINEDIR ". + "--log=/var/log/vascan.log {}", + [0,3], [1,2,5], + qr/(?x)^\s* (?:virus|iworm|macro|mutant|sequence|trojan)\ found:\ ( [^\]\s']+ )\ \.\.\.\ /m ], + # Adjust the path of the binary and the virus database as needed. + # 'vascan' does not allow to have the temp directory to be the same as + # the quarantine directory, and the quarantine option can not be disabled. + # If $QUARANTINEDIR is not used, then another directory must be specified + # to appease 'vascan'. Move status 3 to the second list if password + # protected files are to be considered infected. + + ### http://www.avira.com/ + ### Avira AntiVir (formerly H+BEDV) or (old) CentralCommand Vexira Antivirus + ['Avira AntiVir', ['antivir','vexira'], + '--allfiles -noboot -nombr -rs -s -z {}', [0], qr/ALERT:|VIRUS:/m, + qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* ' ) | + (?i) VIRUS:\ .*?\ virus\ '?) ( [^\]\s']+ )/m ], + # NOTE: if you only have a demo version, remove -z and add 214, as in: + # '--allfiles -noboot -nombr -rs -s {}', [0,214], qr/ALERT:|VIRUS:/, + + ### http://www.commandsoftware.com/ + ['Command AntiVirus for Linux', 'csav', + '-all -archive -packed {}', [50], [51,52,53], + qr/Infection: (.+)/m ], + + ### http://www.symantec.com/ + ['Symantec CarrierScan via Symantec CommandLineScanner', + 'cscmdline', '-a scan -i 1 -v -s 127.0.0.1:7777 {}', + qr/^Files Infected:\s+0$/m, qr/^Infected\b/m, + qr/^(?:Info|Virus Name):\s+(.+)/m ], + + ### http://www.symantec.com/ + ['Symantec AntiVirus Scan Engine', + 'savsecls', '-server 127.0.0.1:7777 -mode scanrepair -details -verbose {}', + [0], qr/^Infected\b/m, + qr/^(?:Info|Virus Name):\s+(.+)/m ], + # NOTE: check options and patterns to see which entry better applies + +# ### http://www.f-secure.com/products/anti-virus/ version 4.65 +# ['F-Secure Antivirus for Linux servers', +# ['/opt/f-secure/fsav/bin/fsav', 'fsav'], +# '--delete=no --disinf=no --rename=no --archive=yes --auto=yes '. +# '--dumb=yes --list=no --mime=yes {}', [0], [3,6,8], +# qr/(?:infection|Infected|Suspected): (.+)/m ], + + ### http://www.f-secure.com/products/anti-virus/ version 5.52 + ['F-Secure Antivirus for Linux servers', + ['/opt/f-secure/fsav/bin/fsav', 'fsav'], + '--virus-action1=report --archive=yes --auto=yes '. + '--dumb=yes --list=no --mime=yes {}', [0], [3,4,6,8], + qr/(?:infection|Infected|Suspected|Riskware): (.+)/m ], + # NOTE: internal archive handling may be switched off by '--archive=no' + # to prevent fsav from exiting with status 9 on broken archives + +# ### http://www.avast.com/ +# ['avast! Antivirus daemon', +# \&ask_daemon, # greets with 220, terminate with QUIT +# ["SCAN {}\015\012QUIT\015\012", '/var/run/avast4/mailscanner.sock'], +# qr/\t\[\+\]/m, qr/\t\[L\]\t/m, qr/\t\[L\]\t([^[ \t\015\012]+)/m ], + +# ### http://www.avast.com/ +# ['avast! Antivirus - Client/Server Version', 'avastlite', +# '-a /var/run/avast4/mailscanner.sock -n {}', [0], [1], +# qr/\t\[L\]\t([^[ \t\015\012]+)/m ], + + ['CAI InoculateIT', 'inocucmd', # retired product + '-sec -nex {}', [0], [100], + qr/was infected by virus (.+)/m ], + # see: http://www.flatmtn.com/computer/Linux-Antivirus_CAI.html + + ### http://www3.ca.com/Solutions/Product.asp?ID=156 (ex InoculateIT) + ['CAI eTrust Antivirus', 'etrust-wrapper', + '-arc -nex -spm h {}', [0], [101], + qr/is infected by virus: (.+)/m ], + # NOTE: requires suid wrapper around inocmd32; consider flag: -mod reviewer + # see http://marc.theaimsgroup.com/?l=amavis-user&m=109229779912783 + + ### http://mks.com.pl/english.html + ['MkS_Vir for Linux (beta)', ['mks32','mks'], + '-s {}/*', [0], [1,2], + qr/--[ \t]*(.+)/m ], + + ### http://mks.com.pl/english.html + ['MkS_Vir daemon', 'mksscan', + '-s -q {}', [0], [1..7], + qr/^... (\S+)/m ], + +# ### http://www.nod32.com/, version v2.52 (old) +# ['ESET NOD32 for Linux Mail servers', +# ['/opt/eset/nod32/bin/nod32cli', 'nod32cli'], +# '--subdir --files -z --sfx --rtp --adware --unsafe --pattern --heur '. +# '-w -a --action-on-infected=accept --action-on-uncleanable=accept '. +# '--action-on-notscanned=accept {}', +# [0,3], [1,2], qr/virus="([^"]+)"/m ], + +# ### http://www.eset.com/, version v2.7 (old) +# ['ESET NOD32 Linux Mail Server - command line interface', +# ['/usr/bin/nod32cli', '/opt/eset/nod32/bin/nod32cli', 'nod32cli'], +# '--subdir {}', [0,3], [1,2], qr/virus="([^"]+)"/m ], + +# ### http://www.eset.com/, version 2.71.12 +# ['ESET Software ESETS Command Line Interface', +# ['/usr/bin/esets_cli', 'esets_cli'], +# '--subdir {}', [0], [1,2,3], qr/virus="([^"]+)"/m ], + + ### http://www.eset.com/, version 3.0 + ['ESET Software ESETS Command Line Interface', + ['/usr/bin/esets_cli', 'esets_cli'], + '--subdir {}', [0], [2,3], + qr/:\s*action="(?!accepted)[^"]*"\n.*:\s*virus="([^"]*)"/m ], + + ## http://www.nod32.com/, NOD32LFS version 2.5 and above + ['ESET NOD32 for Linux File servers', + ['/opt/eset/nod32/sbin/nod32','nod32'], + '--files -z --mail --sfx --rtp --adware --unsafe --pattern --heur '. + '-w -a --action=1 -b {}', + [0], [1,10], qr/^object=.*, virus="(.*?)",/m ], + +# Experimental, based on posting from Rado Dibarbora (Dibo) on 2002-05-31 +# ['ESET Software NOD32 Client/Server (NOD32SS)', +# \&ask_daemon2, # greets with 200, persistent, terminate with QUIT +# ["SCAN {}/*\r\n", '127.0.0.1:8448' ], +# qr/^200 File OK/m, qr/^201 /m, qr/^201 (.+)/m ], + +# Disabled as it conflicts with packaged /usr/bin/nvcc of "nvidia-cuda-toolkit" +# (LP: 1582318) +# ### http://www.norman.com/products_nvc.shtml +# ['Norman Virus Control v5 / Linux', 'nvcc', +# '-c -l:0 -s -u -temp:$TEMPBASE {}', [0,10,11], [1,2,14], +# qr/(?i).* virus in .* -> \'(.+)\'/m ], + + ### http://www.pandasoftware.com/ + ['Panda CommandLineSecure 9 for Linux', + ['/opt/pavcl/usr/bin/pavcl','pavcl'], + '-auto -aex -heu -cmp -nbr -nor -nos -eng -nob {}', + qr/Number of files infected[ .]*: 0+(?!\d)/m, + qr/Number of files infected[ .]*: 0*[1-9]/m, + qr/Found virus :\s*(\S+)/m ], + # NOTE: for efficiency, start the Panda in resident mode with 'pavcl -tsr' + # before starting amavisd - the bases are then loaded only once at startup. + # To reload bases in a signature update script: + # /opt/pavcl/usr/bin/pavcl -tsr -ulr; /opt/pavcl/usr/bin/pavcl -tsr + # Please review other options of pavcl, for example: + # -nomalw, -nojoke, -nodial, -nohackt, -nospyw, -nocookies + +# ### http://www.pandasoftware.com/ +# ['Panda Antivirus for Linux', ['pavcl'], +# '-TSR -aut -aex -heu -cmp -nbr -nor -nso -eng {}', +# [0], [0x10, 0x30, 0x50, 0x70, 0x90, 0xB0, 0xD0, 0xF0], +# qr/Found virus :\s*(\S+)/m ], + +# GeCAD AV technology is acquired by Microsoft; RAV has been discontinued. +# Check your RAV license terms before fiddling with the following two lines! +# ['GeCAD RAV AntiVirus 8', 'ravav', +# '--all --archive --mail {}', [1], [2,3,4,5], qr/Infected: (.+)/m ], +# # NOTE: the command line switches changed with scan engine 8.5 ! +# # (btw, assigning stdin to /dev/null causes RAV to fail) + + ### http://www.nai.com/ + ['NAI McAfee AntiVirus (uvscan)', 'uvscan', + '--secure -rv --mime --summary --noboot - {}', [0], [13], + qr/(?x) Found (?: + \ the\ (.+)\ (?:virus|trojan) | + \ (?:virus|trojan)\ or\ variant\ ([^ ]+) | + :\ (.+)\ NOT\ a\ virus)/m, + # sub {$ENV{LD_PRELOAD}='/lib/libc.so.6'}, + # sub {delete $ENV{LD_PRELOAD}}, + ], + # NOTE1: with RH9: force the dynamic linker to look at /lib/libc.so.6 before + # anything else by setting environment variable LD_PRELOAD=/lib/libc.so.6 + # and then clear it when finished to avoid confusing anything else. + # NOTE2: to treat encrypted files as viruses replace the [13] with: + # qr/^\s{5,}(Found|is password-protected|.*(virus|trojan))/ + + ### http://www.virusbuster.hu/en/ + ['VirusBuster', ['vbuster', 'vbengcl'], + "{} -ss -i '*' -log=$MYHOME/vbuster.log", [0], [1], + qr/: '(.*)' - Virus/m ], + # VirusBuster Ltd. does not support the daemon version for the workstation + # engine (vbuster-eng-1.12-linux-i386-libc6.tgz) any longer. The names of + # binaries, some parameters AND return codes have changed (from 3 to 1). + # See also the new Vexira entry 'vascan' which is possibly related. + +# ### http://www.virusbuster.hu/en/ +# ['VirusBuster (Client + Daemon)', 'vbengd', +# '-f -log scandir {}', [0], [3], +# qr/Virus found = (.*);/m ], +# # HINT: for an infected file it always returns 3, +# # although the man-page tells a different story + + ### http://www.cyber.com/ + ['CyberSoft VFind', 'vfind', + '--vexit {}/*', [0], [23], qr/##==>>>> VIRUS ID: CVDL (.+)/m, + # sub {$ENV{VSTK_HOME}='/usr/lib/vstk'}, + ], + + ### http://www.avast.com/ + ['avast! Antivirus', ['/usr/bin/avastcmd','avastcmd'], + '-a -i -n -t=A {}', [0], [1], qr/\binfected by:\s+([^ \t\n\[\]]+)/m ], + + ### http://www.ikarus-software.com/ + ['Ikarus AntiVirus for Linux', 'ikarus', + '{}', [0], [40], qr/Signature (.+) found/m ], + + ### http://www.bitdefender.com/ + ['BitDefender', 'bdscan', # new version + '--action=ignore --no-list {}', qr/^Infected files *:0+(?!\d)/m, + qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/m, + qr/(?:suspected|infected): (.*)(?:\033|$)/m ], + + ### http://www.bitdefender.com/ + ['BitDefender', 'bdc', # old version + '--arc --mail {}', qr/^Infected files *:0+(?!\d)/m, + qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/m, + qr/(?:suspected|infected): (.*)(?:\033|$)/m ], + # consider also: --all --nowarn --alev=15 --flev=15. The --all argument may + # not apply to your version of bdc, check documentation and see 'bdc --help' + + ### ArcaVir for Linux and Unix http://www.arcabit.pl/ + ['ArcaVir for Linux', ['arcacmd','arcacmd.static'], + '-v 1 -summary 0 -s {}', [0], [1,2], + qr/(?:VIR|WIR):[ \t]*(.+)/m ], + +# ['File::Scan', sub {Amavis::AV::ask_av(sub{ +# use File::Scan; my($fn)=@_; +# my($f)=File::Scan->new(max_txt_size=>0, max_bin_size=>0); +# my($vname) = $f->scan($fn); +# $f->error ? (2,"Error: ".$f->error) +# : ($vname ne '') ? (1,"$vname FOUND") : (0,"Clean")}, @_) }, +# ["{}/*"], [0], [1], qr/^(.*) FOUND$/m ], + +# ### fully-fledged checker for JPEG marker segments of invalid length +# ['check-jpeg', +# sub { use JpegTester (); Amavis::AV::ask_av(\&JpegTester::test_jpeg, @_) }, +# ["{}/*"], undef, [1], qr/^(bad jpeg: .*)$/m ], +# # NOTE: place file JpegTester.pm somewhere where Perl can find it, +# # for example in /usr/local/lib/perl5/site_perl + +# ### example: simpleminded checker for JPEG marker segments with +# ### invalid length (only checks first 32k, which is not thorough enough) +# ['check-jpeg-simple', +# sub { Amavis::AV::ask_av(sub { +# my($f)=@_; local(*FF,$_,$1,$2); my(@r)=(0,'not jpeg'); +# open(FF,$f) or die "jpeg: open err $f: $!"; +# binmode(FF) or die "jpeg: binmode err $f: $!"; +# defined read(FF,$_,32000) or die "jpeg: read err $f: $!"; +# close(FF) or die "jpeg: close err $f: $!"; +# if (/^\xff\xd8\xff/) { +# @r=(0,'jpeg ok'); +# while (!/\G(?:\xff\xd9|\z)/gc) { # EOI or eof +# if (/\G\xff+(?=\xff|\z)/gc) {} # fill-bytes before marker +# elsif (/\G\xff([\x01\xd0-\xd8])/gc) {} # TEM, RSTi, SOI +# elsif (/\G\xff([^\x00\xff])(..)/gcs) { # marker segment start +# my($n)=unpack("n",$2)-2; +# $n=32766 if $n>32766; # Perl regexp limit +# if ($n<0) {@r=(1,"bad jpeg: len=$n, pos=".pos); last} +# elsif (/\G.{$n}/gcs) {} # ok +# elsif (/\G.{0,$n}\z/gcs) {last} # truncated +# else {@r=(1,"bad jpeg: unexpected, pos=".pos); last} +# } +# elsif (/\G[^\xff]+/gc) {} # ECS +# elsif (/\G(?:\xff\x00)+/gc) {} # ECS +# else {@r=(2,"bad jpeg: unexpected char, pos=".pos); last} +# } +# }; @r}, @_) }, +# ["{}/*"], undef, [1], qr/^(bad jpeg: .*)$/m ], + +# ### an example/testing/template virus scanner (external), wastes 3 seconds +# ['wasteful sleeper example', +# '/bin/sleep', '3', # calls external program +# undef, undef, qr/no such/m ], + +# ### an example/testing/template virus scanner (internal), does nothing +# ['null', +# sub {}, ["{}"], # supplies its own subroutine, no external program +# undef, undef, qr/no such/m ], + +); + + +# If no virus scanners from the @av_scanners list produce 'clean' nor +# 'infected' status (i.e. they all fail to run or the list is empty), +# then _all_ scanners from the @av_scanners_backup list are tried +# (again, subject to $first_infected_stops_scan). When there are both +# daemonized and equivalent or similar command-line scanners available, +# it is customary to place slower command-line scanners in the +# @av_scanners_backup list. The default choice is somewhat arbitrary, +# move entries from one list to another as desired, keeping main scanners +# in the primary list to avoid warnings. + +@av_scanners_backup = ( + + ### http://www.clamav.net/ - backs up clamd or Mail::ClamAV + ['ClamAV-clamscan', 'clamscan', + "--stdout --no-summary -r --tempdir=$TEMPBASE {}", + [0], qr/:.*\sFOUND$/m, qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ], + + ### http://www.f-prot.com/ - backs up F-Prot Daemon, V6 + ['F-PROT Antivirus for UNIX', ['fpscan'], + '--report --mount --adware {}', # consider: --applications -s 4 -u 3 -z 10 + [0,8,64], [1,2,3, 4+1,4+2,4+3, 8+1,8+2,8+3, 12+1,12+2,12+3], + qr/^\[Found\s+[^\]]*\]\s+<([^ \t(>]*)/m ], + + ### http://www.f-prot.com/ - backs up F-Prot Daemon (old) + ['FRISK F-Prot Antivirus', ['f-prot','f-prot.sh'], + '-dumb -archive -packed {}', [0,8], [3,6], # or: [0], [3,6,8], + qr/(?:Infection:|security risk named) (.+)|\s+contains\s+(.+)$/m ], + + ### http://www.trendmicro.com/ - backs up Trophie + ['Trend Micro FileScanner', ['/etc/iscan/vscan','vscan'], + '-za -a {}', [0], qr/Found virus/m, qr/Found virus (.+) in/m ], + + ### http://www.sald.com/, http://drweb.imshop.de/ - backs up DrWebD + ['drweb - DrWeb Antivirus', # security LHA hole in Dr.Web 4.33 and earlier + ['/usr/local/drweb/drweb', '/opt/drweb/drweb', 'drweb'], + '-path={} -al -go -ot -cn -upn -ok-', + [0,32], [1,9,33], qr' infected (?:with|by)(?: virus)? (.*)$'m ], + + ### http://www.kaspersky.com/ + ['Kaspersky Antivirus v5.5', + ['/opt/kaspersky/kav4fs/bin/kav4fs-kavscanner', + '/opt/kav/5.5/kav4unix/bin/kavscanner', + '/opt/kav/5.5/kav4mailservers/bin/kavscanner', 'kavscanner'], + '-i0 -xn -xp -mn -R -ePASBME {}/*', [0,10,15], [5,20,21,25], + qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.*)/m, +# sub {chdir('/opt/kav/bin') or die "Can't chdir to kav: $!"}, +# sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"}, + ], + +# Commented out because the name 'sweep' clashes with Debian and FreeBSD +# package/port of an audio editor. Make sure the correct 'sweep' is found +# in the path when enabling. +# +# ### http://www.sophos.com/ - backs up Sophie or SAVI-Perl +# ['Sophos Anti Virus (sweep)', 'sweep', +# '-nb -f -all -rec -ss -sc -archive -cab -mime -oe -tnef '. +# '--no-reset-atime {}', +# [0,2], qr/Virus .*? found/m, +# qr/^>>> Virus(?: fragment)? '?(.*?)'? found/m, +# ], +# # other options to consider: -idedir=/usr/local/sav + +# Always succeeds and considers mail clean. +# Potentially useful when all other scanners fail and it is desirable +# to let mail continue to flow with no virus checking (when uncommented). +# ['always-clean', sub {0}], + +); + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/15-content_filter_mode b/config/mail/etc/amavis/conf.d/15-content_filter_mode new file mode 100644 index 0000000..9fccb4d --- /dev/null +++ b/config/mail/etc/amavis/conf.d/15-content_filter_mode @@ -0,0 +1,25 @@ +use strict; + +# You can modify this file to re-enable SPAM checking through spamassassin +# and to re-enable antivirus checking. + +# +# Default antivirus checking mode +# Please note, that anti-virus checking is DISABLED by +# default. +# If You wish to enable it, please uncomment the following lines: + +@bypass_virus_checks_maps = ( + \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re); + +# +# Default SPAM checking mode +# Please note, that anti-spam checking is DISABLED by +# default. +# If You wish to enable it, please uncomment the following lines: + + +@bypass_spam_checks_maps = ( + \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re); + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/20-debian_defaults b/config/mail/etc/amavis/conf.d/20-debian_defaults new file mode 100644 index 0000000..bbc486b --- /dev/null +++ b/config/mail/etc/amavis/conf.d/20-debian_defaults @@ -0,0 +1,213 @@ +use strict; + +# ADMINISTRATORS: +# Debian suggests that any changes you need to do that should never +# be "updated" by the Debian package should be made in another file, +# overriding the settings in this file. +# +# The package will *not* overwrite your settings, but by keeping +# them separate, you will make the task of merging changes on these +# configuration files much simpler... + +# see /usr/share/doc/amavisd-new/examples/amavisd.conf-default for +# a list of all variables with their defaults; +# see /usr/share/doc/amavisd-new/examples/amavisd.conf-sample for +# a traditional-style commented file +# [note: the above files were not converted to Debian settings!] +# +# for more details see documentation in /usr/share/doc/amavisd-new +# and at http://www.ijs.si/software/amavisd/amavisd-new-docs.html + +$QUARANTINEDIR = "$MYHOME/virusmails"; +$quarantine_subdir_levels = 1; # enable quarantine dir hashing + +$log_recip_templ = undef; # disable by-recipient level-0 log entries +$DO_SYSLOG = 1; # log via syslogd (preferred) +$syslog_ident = 'amavis'; # syslog ident tag, prepended to all messages +$syslog_facility = 'mail'; +#$syslog_priority = 'info'; # switch to info to drop debug output, etc + +#$enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and nanny) +$enable_db = 0; # 2020-10-08 work around DB not working +$enable_global_cache = 1; # enable use of libdb-based cache if $enable_db=1 + +$inet_socket_port = 10024; # default listening socket + +$sa_spam_subject_tag = '***SPAM*** '; +$sa_tag_level_deflt = 2.0; # add spam info headers if at, or above that level +$sa_tag2_level_deflt = 6.31; # add 'spam detected' headers at that level +$sa_kill_level_deflt = 6.31; # triggers spam evasive actions +$sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent + +$sa_mail_body_size_limit = 200*1024; # don't waste time on SA if mail is larger +$sa_local_tests_only = 0; # only tests which do not require internet access? + +# Quota limits to avoid bombs (like 42.zip) + +$MAXLEVELS = 14; +$MAXFILES = 1500; +$MIN_EXPANSION_QUOTA = 100*1024; # bytes +$MAX_EXPANSION_QUOTA = 300*1024*1024; # bytes + +# You should: +# Use D_DISCARD to discard data (viruses) +# Use D_BOUNCE to generate local bounces by amavisd-new +# Use D_REJECT to generate local or remote bounces by the calling MTA +# Use D_PASS to deliver the message +# +# Whatever you do, *NEVER* use D_REJECT if you have other MTAs *forwarding* +# mail to your account. Use D_BOUNCE instead, otherwise you are delegating +# the bounce work to your friendly forwarders, which might not like it at all. +# +# On dual-MTA setups, one can often D_REJECT, as this just makes your own +# MTA generate the bounce message. Test it first. +# +# Bouncing viruses is stupid, always discard them after you are sure the AV +# is working correctly. Bouncing real SPAM is also useless, if you cannot +# D_REJECT it (and don't D_REJECT mail coming from your forwarders!). + +$final_virus_destiny = D_DISCARD; # (data not lost, see virus quarantine) +$final_banned_destiny = D_BOUNCE; # D_REJECT when front-end MTA +$final_spam_destiny = D_DISCARD; +$final_bad_header_destiny = D_PASS; # False-positive prone (for spam) + +$enable_dkim_verification = 0; #disabled to prevent warning + +$virus_admin = "postmaster\@$mydomain"; # due to D_DISCARD default + +# Set to empty ("") to add no header +$X_HEADER_LINE = "Debian $myproduct_name at $mydomain"; + +# REMAINING IMPORTANT VARIABLES ARE LISTED HERE BECAUSE OF LONGER ASSIGNMENTS + +# +# DO NOT SEND VIRUS NOTIFICATIONS TO OUTSIDE OF YOUR DOMAIN. EVER. +# +# These days, almost all viruses fake the envelope sender and mail headers. +# Therefore, "virus notifications" became nothing but undesired, aggravating +# SPAM. This holds true even inside one's domain. We disable them all by +# default, except for the EICAR test pattern. +# + +@viruses_that_fake_sender_maps = (new_RE( + [qr'\bEICAR\b'i => 0], # av test pattern name + [qr/.*/ => 1], # true for everything else +)); + +@keep_decoded_original_maps = (new_RE( +# qr'^MAIL$', # retain full original message for virus checking (can be slow) + qr'^MAIL-UNDECIPHERABLE$', # recheck full mail if it contains undecipherables + qr'^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)'i, +# qr'^Zip archive data', # don't trust Archive::Zip +)); + + +# for $banned_namepath_re, a new-style of banned table, see amavisd.conf-sample + +$banned_filename_re = new_RE( +# qr'^UNDECIPHERABLE$', # is or contains any undecipherable components + + # block certain double extensions anywhere in the base name + qr'\.[^./]*\.(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)\.?$'i, + + qr'\{[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}\}?$'i, # Windows Class ID CLSID, strict + + qr'^application/x-msdownload$'i, # block these MIME types + qr'^application/x-msdos-program$'i, + qr'^application/hta$'i, + +# qr'^application/x-msmetafile$'i, # Windows Metafile MIME type +# qr'^\.wmf$', # Windows Metafile file(1) type + +# qr'^message/partial$'i, qr'^message/external-body$'i, # rfc2046 MIME types + +# [ qr'^\.(Z|gz|bz2)$' => 0 ], # allow any in Unix-compressed +# [ qr'^\.(rpm|cpio|tar)$' => 0 ], # allow any in Unix-type archives +# [ qr'^\.(zip|rar|arc|arj|zoo)$'=> 0 ], # allow any within such archives +# [ qr'^application/x-zip-compressed$'i => 0], # allow any within such archives + + qr'.\.(exe|vbs|pif|scr|bat|cmd|com|cpl)$'i, # banned extension - basic +# qr'.\.(ade|adp|app|bas|bat|chm|cmd|com|cpl|crt|emf|exe|fxp|grp|hlp|hta| +# inf|ins|isp|js|jse|lnk|mda|mdb|mde|mdw|mdt|mdz|msc|msi|msp|mst| +# ops|pcd|pif|prg|reg|scr|sct|shb|shs|vb|vbe|vbs| +# wmf|wsc|wsf|wsh)$'ix, # banned ext - long + +# qr'.\.(mim|b64|bhx|hqx|xxe|uu|uue)$'i, # banned extension - WinZip vulnerab. + + qr'^\.(exe-ms)$', # banned file(1) types +# qr'^\.(exe|lha|tnef|cab|dll)$', # banned file(1) types +); +# See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262631 +# and http://www.cknow.com/vtutor/vtextensions.htm + + +# ENVELOPE SENDER SOFT-WHITELISTING / SOFT-BLACKLISTING + +@score_sender_maps = ({ # a by-recipient hash lookup table, + # results from all matching recipient tables are summed + +# ## per-recipient personal tables (NOTE: positive: black, negative: white) +# 'user1@example.com' => [{'bla-mobile.press@example.com' => 10.0}], +# 'user3@example.com' => [{'.ebay.com' => -3.0}], +# 'user4@example.com' => [{'cleargreen@cleargreen.com' => -7.0, +# '.cleargreen.com' => -5.0}], + + ## site-wide opinions about senders (the '.' matches any recipient) + '.' => [ # the _first_ matching sender determines the score boost + + new_RE( # regexp-type lookup table, just happens to be all soft-blacklist + [qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou)@'i => 5.0], + [qr'^(greatcasino|investments|lose_weight_today|market\.alert)@'i=> 5.0], + [qr'^(money2you|MyGreenCard|new\.tld\.registry|opt-out|opt-in)@'i=> 5.0], + [qr'^(optin|saveonlsmoking2002k|specialoffer|specialoffers)@'i => 5.0], + [qr'^(stockalert|stopsnoring|wantsome|workathome|yesitsfree)@'i => 5.0], + [qr'^(your_friend|greatoffers)@'i => 5.0], + [qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i => 5.0], + ), + +# read_hash("/var/amavis/sender_scores_sitewide"), + +# This are some examples for whitelists, since envelope senders can be forged +# they are not enabled by default. + { # a hash-type lookup table (associative array) + #'nobody@cert.org' => -3.0, + #'cert-advisory@us-cert.gov' => -3.0, + #'owner-alert@iss.net' => -3.0, + #'slashdot@slashdot.org' => -3.0, + #'securityfocus.com' => -3.0, + #'ntbugtraq@listserv.ntbugtraq.com' => -3.0, + #'security-alerts@linuxsecurity.com' => -3.0, + #'mailman-announce-admin@python.org' => -3.0, + #'amavis-user-admin@lists.sourceforge.net'=> -3.0, + #'amavis-user-bounces@lists.sourceforge.net' => -3.0, + #'spamassassin.apache.org' => -3.0, + #'notification-return@lists.sophos.com' => -3.0, + #'owner-postfix-users@postfix.org' => -3.0, + #'owner-postfix-announce@postfix.org' => -3.0, + #'owner-sendmail-announce@lists.sendmail.org' => -3.0, + #'sendmail-announce-request@lists.sendmail.org' => -3.0, + #'donotreply@sendmail.org' => -3.0, + #'ca+envelope@sendmail.org' => -3.0, + #'noreply@freshmeat.net' => -3.0, + #'owner-technews@postel.acm.org' => -3.0, + #'ietf-123-owner@loki.ietf.org' => -3.0, + #'cvs-commits-list-admin@gnome.org' => -3.0, + #'rt-users-admin@lists.fsck.com' => -3.0, + #'clp-request@comp.nus.edu.sg' => -3.0, + #'surveys-errors@lists.nua.ie' => -3.0, + #'emailnews@genomeweb.com' => -5.0, + #'yahoo-dev-null@yahoo-inc.com' => -3.0, + #'returns.groups.yahoo.com' => -3.0, + #'clusternews@linuxnetworx.com' => -3.0, + #lc('lvs-users-admin@LinuxVirtualServer.org') => -3.0, + #lc('owner-textbreakingnews@CNNIMAIL12.CNN.COM') => -5.0, + + # soft-blacklisting (positive score) + #'sender@example.net' => 3.0, + #'.example.net' => 1.0, + + }, + ], # end of site-wide tables +}); + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/21-ubuntu_defaults b/config/mail/etc/amavis/conf.d/21-ubuntu_defaults new file mode 100644 index 0000000..e8dc67f --- /dev/null +++ b/config/mail/etc/amavis/conf.d/21-ubuntu_defaults @@ -0,0 +1,19 @@ +use strict; + +# +# These are Ubuntu specific defaults for amavisd-new configuration +# +# DOMAIN KEYS IDENTIFIED MAIL (DKIM) +$enable_dkim_verification = 1; +# Don't be verbose about sending mail: +@whitelist_sender_acl = qw( .$mydomain ); +$final_virus_destiny = D_DISCARD; # (defaults to D_BOUNCE) +$final_banned_destiny = D_DISCARD; # (defaults to D_BOUNCE) +$final_spam_destiny = D_DISCARD; # (defaults to D_REJECT) +$final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE suggested + +$virus_admin = undef; +$spam_admin = undef; + +#------------ Do not modify anything below this line ------------- +1; # insure a defined return diff --git a/config/mail/etc/amavis/conf.d/25-amavis_helpers b/config/mail/etc/amavis/conf.d/25-amavis_helpers new file mode 100644 index 0000000..ef399e4 --- /dev/null +++ b/config/mail/etc/amavis/conf.d/25-amavis_helpers @@ -0,0 +1,23 @@ +use strict; + +## +## Functionality required for amavis helpers like +## amavis-release. +## + +# Enable required AM.PDP protocol socket. +# +# this is incompatible with the old helpers, but one can +# have multiple inet (not unix) sockets to overcome this +# issue. Refer to the amavisd-new documentation for more +# information + +$unix_socketname = "/var/lib/amavis/amavisd.sock"; + +$interface_policy{'SOCK'} = 'AM.PDP-SOCK'; +$policy_bank{'AM.PDP-SOCK'} = { + protocol => 'AM.PDP', + auth_required_release => 0, # don't require secret-id for release +}; + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/30-template_localization b/config/mail/etc/amavis/conf.d/30-template_localization new file mode 100644 index 0000000..b808bd7 --- /dev/null +++ b/config/mail/etc/amavis/conf.d/30-template_localization @@ -0,0 +1,42 @@ +use strict; + +# l10n (localization) of the AMaViSd-new DSN templates +# Override or change as necessary + +# Select notifications text encoding when Unicode-aware Perl is converting +# text from internal character representation to external encoding (charset +# in MIME terminology). Used as argument to Perl Encode::encode subroutine. +# +# to be used in RFC 2047-encoded header field bodies, e.g. in Subject: +#$hdr_encoding = 'iso-8859-1'; # (default: 'iso-8859-1') +# +# to be used in notification body text: its encoding and Content-type.charset +#$bdy_encoding = 'iso-8859-1'; # (default: 'iso-8859-1') + +# Default template texts for notifications may be overruled by directly +# assigning new text to template variables, or by reading template text +# from files. A second argument may be specified in a call to read_text(), +# specifying character encoding layer to be used when reading from the +# external file, e.g. 'utf8', 'iso-8859-1', or often just $bdy_encoding. +# Text will be converted to internal character representation by Perl 5.8.0 +# or later; second argument is ignored otherwise. See PerlIO::encoding, +# Encode::PerlIO and perluniintro man pages. +# +# $notify_sender_templ = read_text('/var/amavis/notify_sender.txt'); +# $notify_virus_sender_templ= read_text('/var/amavis/notify_virus_sender.txt'); +# $notify_virus_admin_templ = read_text('/var/amavis/notify_virus_admin.txt'); +# $notify_virus_recips_templ= read_text('/var/amavis/notify_virus_recips.txt'); +# $notify_spam_sender_templ = read_text('/var/amavis/notify_spam_sender.txt'); +# $notify_spam_admin_templ = read_text('/var/amavis/notify_spam_admin.txt'); + +# If notification template files are collectively available in some directory, +# you can use read_l10n_templates which calls read_text for each known +# template. Name the files as above, and include a file named "charset" with +# the charset used in the files. This is how Debian ships l10n templates. +# +# syntax: read_l10n_templates(); OR +# read_l10n_templates(, ); +# +read_l10n_templates('en_US', '/etc/amavis'); + +1; # ensure a defined return diff --git a/config/mail/etc/amavis/conf.d/40-policy_banks b/config/mail/etc/amavis/conf.d/40-policy_banks new file mode 100644 index 0000000..dad8caf --- /dev/null +++ b/config/mail/etc/amavis/conf.d/40-policy_banks @@ -0,0 +1,33 @@ +# DKIM signing domain whitelist. The domain to use is the domain after +# d= in the DKIM header. + +@author_to_policy_bank_maps = ( { + # 'friends.example.net' => 'WHITELIST,NOBANNEDCHECK', + # 'user1@cust.example.net' => 'WHITELIST,NOBANNEDCHECK', + '.ebay.com' => 'WHITELIST', + '.ebay.co.uk' => 'WHITELIST', + 'ebay.at' => 'WHITELIST', + 'ebay.ca' => 'WHITELIST', + 'ebay.de' => 'WHITELIST', + 'ebay.fr' => 'WHITELIST', + '.paypal.co.uk' => 'WHITELIST', + '.paypal.com' => 'WHITELIST', # author signatures + './@paypal.com' => 'WHITELIST', # 3rd-party sign. by paypal.com + 'alert.bankofamerica.com' => 'WHITELIST', + 'amazon.com' => 'WHITELIST', + 'cisco.com' => 'WHITELIST', + '.cnn.com' => 'WHITELIST', + 'skype.net' => 'WHITELIST', + 'welcome.skype.com' => 'WHITELIST', + 'cc.yahoo-inc.com' => 'WHITELIST', + 'cc.yahoo-inc.com/@yahoo-inc.com' => 'WHITELIST', + # 'google.com' => 'MILD_WHITELIST', + # 'googlemail.com' => 'MILD_WHITELIST', + # './@googlegroups.com' => 'MILD_WHITELIST', + # './@yahoogroups.com' => 'MILD_WHITELIST', + # './@yahoogroups.co.uk' => 'MILD_WHITELIST', + # './@yahoogroupes.fr' => 'MILD_WHITELIST', + # 'yousendit.com' => 'MILD_WHITELIST', + # 'meetup.com' => 'MILD_WHITELIST', + # 'dailyhoroscope@astrology.com' => 'MILD_WHITELIST', + } ); diff --git a/config/mail/etc/amavis/conf.d/50-user b/config/mail/etc/amavis/conf.d/50-user new file mode 100644 index 0000000..efcd76a --- /dev/null +++ b/config/mail/etc/amavis/conf.d/50-user @@ -0,0 +1,14 @@ +use strict; + +# +# Place your configuration directives here. They will override those in +# earlier files. +# +# See /usr/share/doc/amavisd-new/ for documentation and examples of +# the directives you can use in this file +# +$myhostname = 'mail.ketrenos.net'; +@local_domains_acl = ( "ketrenos.com", "sketchitect.com", "kiaoramassage.com" ); + +#------------ Do not modify anything below this line ------------- +1; # ensure a defined return diff --git a/config/mail/etc/amavis/en_US/charset b/config/mail/etc/amavis/en_US/charset new file mode 100644 index 0000000..fd23d72 --- /dev/null +++ b/config/mail/etc/amavis/en_US/charset @@ -0,0 +1,4 @@ +# This is charset for en_US messages. +# If you are creating new messages, use 'iconv -l' to get possible encodings. +ascii # or iso-8859-1 +ignored lines after first one diff --git a/config/mail/etc/amavis/en_US/template-auto-response.txt b/config/mail/etc/amavis/en_US/template-auto-response.txt new file mode 100644 index 0000000..5b50baf --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-auto-response.txt @@ -0,0 +1,23 @@ +# +# ============================================================================= +# This is a template for the plain text part of an auto response (e.g. +# vacation, out-of-office), see RFC 3834. +# +From: %f +Date: %d +To: [? %#T |undisclosed-recipients:;|[%T|, ]] +[? %#C |#|Cc: [%C|, ]] +Reply-To: postmaster@%h +Message-ID: +Auto-Submitted: auto-replied +[:wrap|76||\t|Subject: Auto: autoresponse to: %s] +[? %m |#|In-Reply-To: %m] +Precedence: junk + +This is an auto-response to a message \ +[? %a |\nreceived on %d,|received from\nIP address \[%a\] on %d,] +envelope sender: %s +(author) From: [:rfc2822_from] +[? %j |#|[:wrap|78|| |Subject: %j]] +[?[:dkim|author]|#| +A first-party DKIM or DomainKeys signature is valid, d=[:dkim|author].] diff --git a/config/mail/etc/amavis/en_US/template-dsn.txt b/config/mail/etc/amavis/en_US/template-dsn.txt new file mode 100644 index 0000000..561d163 --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-dsn.txt @@ -0,0 +1,134 @@ +# +# ============================================================================= +# This is a template for (neutral: non-virus, non-spam, non-banned) +# DELIVERY STATUS NOTIFICATIONS to sender. +# For syntax and customization instructions see README.customize. +# The From, To and Date header fields will be provided automatically. +# Long header fields will be automatically wrapped by the program. +# +Subject: [?%#D|Undeliverable mail|Delivery status notification]\ +[? [:ccat|major] |||, MTA-BLOCKED\ +|, OVERSIZED message\ +|, invalid header section[=explain_badh|1]\ +[?[:ccat|minor]||: bad MIME|: unencoded 8-bit character\ +|: improper use of control char|: all-whitespace header line\ +|: header line longer than 998 characters|: header field syntax error\ +|: missing required header field|: duplicate header field|]\ +|, UNSOLICITED BULK EMAIL apparently from you\ +|, UNSOLICITED BULK EMAIL apparently from you\ +|, contents UNCHECKED\ +|, BANNED contents type (%F)\ +|, VIRUS in message apparently from you (%V)\ +] +Message-ID: + +[? %#D |#|Your message WAS SUCCESSFULLY RELAYED to:[\n %D] +[~[:dsn_notify]|["\\bSUCCESS\\b"]|\ +and you explicitly requested a delivery status notification on success.\n]\ +] +[? %#N |#|The message WAS NOT relayed to:[\n %N] +] +[:wrap|78|||This [?%#D|nondelivery|delivery] report was \ +generated by the program amavisd-new at host %h. \ +Our internal reference code for your message is %n/%i] + +# ccat_min 0: other, 1: bad MIME, 2: 8-bit char, 3: NUL/CR, +# 4: empty, 5: long, 6: syntax, 7: missing, 8: multiple +[? [:explain_badh] ||[? [:ccat|minor] +|INVALID HEADER +|INVALID HEADER: BAD MIME HEADER SECTION OR BAD MIME STRUCTURE +|INVALID HEADER: INVALID 8-BIT CHARACTERS IN HEADER SECTION +|INVALID HEADER: INVALID CONTROL CHARACTERS IN HEADER SECTION +|INVALID HEADER: FOLDED HEADER FIELD LINE MADE UP ENTIRELY OF WHITESPACE +|INVALID HEADER: HEADER LINE LONGER THAN RFC 5322 LIMIT OF 998 CHARACTERS +|INVALID HEADER: HEADER FIELD SYNTAX ERROR +|INVALID HEADER: MISSING REQUIRED HEADER FIELD +|INVALID HEADER: DUPLICATE HEADER FIELD +|INVALID HEADER +] +[[:wrap|78| | |%X]\n] +]\ +# +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From|100][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender|100]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +[? %#X|#|[? [:useragent] |#|[:wrap|78|| |[:useragent]]]] +[? %j |#|[:wrap|78|| |Subject: [:header_field|Subject|100]]] + +# ccat_min 0: other, 1: bad MIME, 2: 8-bit char, 3: NUL/CR, +# 4: empty, 5: long, 6: syntax, 7: missing, 8: multiple +[? [:explain_badh] ||[? [:ccat|minor] +|# 0: other +|# 1: bad MIME +|# 2: 8-bit char +WHAT IS AN INVALID CHARACTER IN A MAIL HEADER SECTION? + + The RFC 5322 document specifies rules for forming internet messages. + It does not allow the use of characters with codes above 127 to be + used directly (non-encoded) in a mail header section. + + If such characters (e.g. with diacritics) from ISO Latin or other + alphabets need to be included in a header section, these characters + need to be properly encoded according to RFC 2047. Such encoding + is often done transparently by mail reader (MUA), but if automatic + encoding is not available (e.g. by some older MUA) it is a user's + responsibility to avoid using such characters in a header section, + or to encode them manually. Typically the offending header fields + in this category are 'Subject', 'Organization', and comment fields + or display names in e-mail addresses of 'From', 'To' or 'Cc'. + + Sometimes such invalid header fields are inserted automatically + by some MUA, MTA, content filter, or other mail handling service. + If this is the case, such service needs to be fixed or properly + configured. Typically the offending header fields in this category + are 'Date', 'Received', 'X-Mailer', 'X-Priority', 'X-Scanned', etc. + + If you don't know how to fix or avoid the problem, please report it + to _your_ postmaster or system manager. +# +[~[:useragent]|^X-Mailer:\\s*Microsoft Outlook Express 6\\.00|[" + If using Microsoft Outlook Express as your MUA, make sure its + settings under: + Tools -> Options -> Send -> Mail Sending Format -> Plain & HTML + are: "MIME format" MUST BE selected, + and "Allow 8-bit characters in headers" MUST NOT be enabled! +"]]# +|# 3: NUL/CR +IMPROPER USE OF CONTROL CHARACTER IN A MESSAGE HEADER SECTION + + The RFC 5322 document specifies rules for forming internet messages. + It does not allow the use of control characters NUL and bare CR + to be used directly in a mail header section. +|# 4: empty +IMPROPERLY FOLDED HEADER FIELD LINE MADE UP ENTIRELY OF WHITESPACE + + The RFC 5322 document specifies rules for forming internet messages. + In section '3.2.2. Folding white space and comments' it explicitly + prohibits folding of header fields in such a way that any line of a + folded header field is made up entirely of white-space characters + (control characters SP and HTAB) and nothing else. +|# 5: long +HEADER LINE LONGER THAN RFC 5322 LIMIT OF 998 CHARACTERS + + The RFC 5322 document specifies rules for forming internet messages. + Section '2.1.1. Line Length Limits' prohibits each line of a header + section to be more than 998 characters in length (excluding the CRLF). +|# 6: syntax +|# 7: missing +MISSING REQUIRED HEADER FIELD + + The RFC 5322 document specifies rules for forming internet messages. + Section '3.6. Field Definitions' specifies that certain header fields + are required (origination date field and the "From:" originator field). +|# 8: multiple +DUPLICATE HEADER FIELD + + The RFC 5322 document specifies rules for forming internet messages. + Section '3.6. Field Definitions' specifies that certain header fields + must not occur more than once in a message header section. +|# other +]]# diff --git a/config/mail/etc/amavis/en_US/template-problem-feedback.txt b/config/mail/etc/amavis/en_US/template-problem-feedback.txt new file mode 100644 index 0000000..2f6b14e --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-problem-feedback.txt @@ -0,0 +1,37 @@ +# +# ============================================================================= +# This is a template for the plain text part of a problem/feedback report, +# with either the original message included in-line, or attached, +# or the message is structured as a FEEDBACK REPORT NOTIFICATIONS format. +# See RFC 5965 - "An Extensible Format for Email Feedback Reports". +# +From: %f +Date: %d +Subject: Fw: %j +To: [? %#T |undisclosed-recipients:;|[%T|, ]] +[? %#C |#|Cc: [%C|, ]] +Message-ID: +#Auto-Submitted: auto-generated + +This is an e-mail [:feedback_type] report for a message \ +[? %a |\nreceived on %d,|received from\nIP address [:client_addr_port] on %d,] + +[:wrap|78|| |Return-Path: %s] +[:wrap|78|| |From: [:header_field|From][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|[:wrap|78|| |Sender: [:header_field|Sender]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +[? %j |#|[:wrap|78|| |Subject: [:header_field|Subject|100]]] +[?[:dkim|author]|#| +A first-party DKIM or DomainKeys signature is valid, d=[:dkim|author].] + +Reporting-MTA: %h +Our internal reference code for the message is %n/%i + +[~[:report_format]|["^(arf|attach|dsn)$"]|["\ +A complete original message is attached. +[~[:report_format]|["^arf$"]|\ +For more information on the ARF format please see RFC 5965. +]"]|["\ +A complete original message in its pristine form follows: +"]]# diff --git a/config/mail/etc/amavis/en_US/template-release-quarantine.txt b/config/mail/etc/amavis/en_US/template-release-quarantine.txt new file mode 100644 index 0000000..affd42e --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-release-quarantine.txt @@ -0,0 +1,45 @@ +# +# ============================================================================= +# This is a template for the plain text part of a RELEASE FROM A QUARANTINE, +# applicable if a chosen release format is 'attach' (not 'resend'). +# +From: %f +Date: %d +Subject: \[released message\] %j +To: [? %#T |undisclosed-recipients:;|[%T|, ]] +[? %#C |#|Cc: [%C|, ]] +Message-ID: + +Please find attached a message which was held in a quarantine, +and has now been released. + +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +# [? %m |#|[:wrap|78|| |Message-ID: %m]] +# [? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +# [? [:useragent] |#|[:wrap|78|| |[:useragent]]] +[? %j |#|[:wrap|78|| |Subject: %j]] + +Our internal reference code for the message is %n/%i +# +[~[:report_format]|["^attach$"]|["[? [:attachment_password] |#| + +Contents of the attached mail message may pose a threat to your computer or +could be a social engineering deception, so it should be handled cautiously. +To prevent undesired automatic opening, the attached original mail message +has been wrapped in a password-protected ZIP archive. + +Here is the password that allows opening of the attached archive: + + [:attachment_password] + +Note that the attachment is not strongly encrypted and the password +is not a strong secret (being displayed in this non-encrypted text), +so this attachment is not suitable for guarding a secret contents. +The sole purpose of this password protection it to prevent undesired +accidental or automatic opening of a message, either by some filtering +software, a virus scanner, or by a mail reader. +]"]|]# diff --git a/config/mail/etc/amavis/en_US/template-spam-admin.txt b/config/mail/etc/amavis/en_US/template-spam-admin.txt new file mode 100644 index 0000000..317acc3 --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-spam-admin.txt @@ -0,0 +1,39 @@ +# +# ============================================================================= +# This is a template for spam ADMINISTRATOR NOTIFICATIONS. +# For syntax and customization instructions see README.customize. +# Long header fields will be automatically wrapped by the program. +# +From: %f +Date: %d +Subject: Spam FROM [?%l||LOCAL ][?%a||[:client_addr_port] ]%s +To: [? %#T |undisclosed-recipients:;|[%T|, ]] +[? %#C |#|Cc: [%C|, ]] +Message-ID: + +Content type: [:ccat|name|main]# +[? [:ccat|is_blocked_by_nonmain] ||, blocked for [:ccat|name]] +Internal reference code for the message is %n/%i + +[? %a |#|[:wrap|78|| |First upstream SMTP client IP address: \[%a\] %g]] +[? %e |#|[:wrap|78|| |According to a 'Received:' trace,\ + the message apparently originated at: \[%e\], %t]] + +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +[? [:useragent] |#|[:wrap|78|| |[:useragent]]] +[? %j |#|[:wrap|78|| |Subject: %j]] +[? %q |Not quarantined.|The message has been quarantined as: %q] + +[? %#D |#|The message WILL BE relayed to:[\n%D] +] +[? %#N |#|The message WAS NOT relayed to:[\n%N] +] +Spam scanner report: +[%A +]\ diff --git a/config/mail/etc/amavis/en_US/template-spam-sender.txt b/config/mail/etc/amavis/en_US/template-spam-sender.txt new file mode 100644 index 0000000..5d91afe --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-spam-sender.txt @@ -0,0 +1,48 @@ +# +# ============================================================================= +# This is a template for spam SENDER NOTIFICATIONS. +# For syntax and customization instructions see README.customize. +# The From, To and Date header fields will be provided automatically. +# Long header fields will be automatically wrapped by the program. +# +Subject: Considered UNSOLICITED BULK EMAIL, apparently from you +[? %m |#|In-Reply-To: %m] +Message-ID: + +A message from %s[ +to: %R] + +was considered unsolicited bulk e-mail (UBE). + +Our internal reference code for your message is %n/%i + +The message carried your return address, so it was either a genuine mail +from you, or a sender address was faked and your e-mail address abused +by third party, in which case we apologize for undesired notification. + +We do try to minimize backscatter for more prominent cases of UBE and +for infected mail, but for less obvious cases some balance between +losing genuine mail and sending undesired backscatter is sought, +and there can be some collateral damage on either side. + +[? %a |#|[:wrap|78|| |First upstream SMTP client IP address: \[%a\] %g]] +[? %e |#|[:wrap|78|| |According to a 'Received:' trace,\ + the message apparently originated at: \[%e\], %t]] + +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From|100][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender|100]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +# [? [:useragent] |#|[:wrap|78|| |[:useragent]]] +[? %j |#|[:wrap|78|| |Subject: [:header_field|Subject|100]]] +[? %#X |#|\n[[:wrap|78|| |%X]\n]] + +[? %#D |Delivery of the email was stopped! +]# +# +# Spam scanner report: +# [%A +# ]\ diff --git a/config/mail/etc/amavis/en_US/template-virus-admin.txt b/config/mail/etc/amavis/en_US/template-virus-admin.txt new file mode 100644 index 0000000..559b6d0 --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-virus-admin.txt @@ -0,0 +1,54 @@ +# +# ============================================================================= +# This is a template for non-spam (e.g. VIRUS,...) ADMINISTRATOR NOTIFICATIONS. +# For syntax and customization instructions see README.customize. +# Long header fields will be automatically wrapped by the program. +# +From: %f +Date: %d +Subject: [? [:ccat|major] |Clean mail|Clean mail|MTA-blocked mail|\ +OVERSIZED mail|INVALID HEADER in mail|Spammy|Spam|UNCHECKED contents in mail|\ +BANNED contents (%F) in mail|VIRUS (%V) in mail]\ + FROM [?%l||LOCAL ][?%a||[:client_addr_port] ]%s +To: [? %#T |undisclosed-recipients:;|[%T|, ]] +[? %#C |#|Cc: [%C|, ]] +Message-ID: + +[? %#V |No viruses were found. +|A virus was found: %V +|Two viruses were found:\n %V +|%#V viruses were found:\n %V +] +[? %#F |#|[:wrap|78|| |Banned [?%#F|names|name|names]: %F]] +[? %#X |#|Bad header:[\n[:wrap|78| | |%X]]] +[? %#W |#\ +|Scanner detecting a virus: %W +|Scanners detecting a virus: %W +] +Content type: [:ccat|name|main]# +[? [:ccat|is_blocked_by_nonmain] ||, blocked for [:ccat|name]] +Internal reference code for the message is %n/%i + +[? %a |#|[:wrap|78|| |First upstream SMTP client IP address: \[%a\] %g]] +[? %e |#|[:wrap|78|| |According to a 'Received:' trace,\ + the message apparently originated at: \[%e\], %t]] + +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +[? %j |#|[:wrap|78|| |Subject: %j]] +[? %q |Not quarantined.|The message has been quarantined as: %q] + +[? %#S |Notification to sender will not be mailed. + +]# +[? %#D |#|The message WILL BE relayed to:[\n%D] +] +[? %#N |#|The message WAS NOT relayed to:[\n%N] +] +[? %#V |#|[? %#v |#|Virus scanner output:[\n %v] +]] diff --git a/config/mail/etc/amavis/en_US/template-virus-recipient.txt b/config/mail/etc/amavis/en_US/template-virus-recipient.txt new file mode 100644 index 0000000..f8e579a --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-virus-recipient.txt @@ -0,0 +1,46 @@ +# +# ============================================================================= +# This is a template for VIRUS/BANNED/BAD-HEADER RECIPIENTS NOTIFICATIONS. +# For syntax and customization instructions see README.customize. +# Long header fields will be automatically wrapped by the program. +# +From: %f +Date: %d +Subject: [? [:ccat|major] |Clean mail|Clean mail|MTA-blocked mail|\ +OVERSIZED mail|INVALID HEADER in mail|Spammy|Spam|UNCHECKED contents in mail|\ +BANNED contents (%F) in mail|VIRUS (%V) in mail] TO YOU from %s +[? [:header_field|To] |To: undisclosed-recipients:;|To: [:header_field|To]] +[? [:header_field|Cc] |#|Cc: [:header_field|Cc]] +Message-ID: + +[? %#V |[? %#F ||BANNED CONTENTS ALERT]|VIRUS ALERT] + +Our content checker found +[? %#V |#|[:wrap|78| | |[?%#V|viruses|virus|viruses]: %V]] +[? %#F |#|[:wrap|78| | |banned [?%#F|names|name|names]: %F]] +[? %#X |#|[[:wrap|78| | |%X]\n]] + +in an email to you [? %#V |from:|from probably faked sender:] + %o +[? %#V |#|claiming to be: %s] + +Content type: [:ccat|name|main]# +[? [:ccat|is_blocked_by_nonmain] ||, blocked for [:ccat|name]] +Our internal reference code for your message is %n/%i + +[? %a |#|[:wrap|78|| |First upstream SMTP client IP address: \[%a\] %g]] +[? %e |#|[:wrap|78|| |According to a 'Received:' trace,\ + the message apparently originated at: \[%e\], %t]] + +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +[? [:useragent] |#|[:wrap|78|| |[:useragent]]] +[? %j |#|[:wrap|78|| |Subject: %j]] +[? %q |Not quarantined.|The message has been quarantined as: %q] + +Please contact your system administrator for details. diff --git a/config/mail/etc/amavis/en_US/template-virus-sender.txt b/config/mail/etc/amavis/en_US/template-virus-sender.txt new file mode 100644 index 0000000..5f254c8 --- /dev/null +++ b/config/mail/etc/amavis/en_US/template-virus-sender.txt @@ -0,0 +1,91 @@ +# +# ============================================================================= +# This is a template for VIRUS/BANNED SENDER NOTIFICATIONS. +# For syntax and customization instructions see README.customize. +# The From, To and Date header fields will be provided automatically. +# Long header fields will be automatically wrapped by the program. +# +Subject: [? [:ccat|major] +|Clean message from you\ +|Clean message from you\ +|Clean message from you (MTA blocked)\ +|OVERSIZED message from you\ +|BAD-HEADER in message from you\ +|Spam claiming to be from you\ +|Spam claiming to be from you\ +|A message with UNCHECKED contents from you\ +|BANNED contents from you (%F)\ +|VIRUS in message apparently from you (%V)\ +] +[? %m |#|In-Reply-To: %m] +Message-ID: + +[? [:ccat|major] |Clean|Clean|MTA-BLOCKED|OVERSIZED|INVALID HEADER|\ +Spammy|Spam|UNCHECKED contents|BANNED CONTENTS ALERT|VIRUS ALERT] + +Our content checker found +[? %#V |#|[:wrap|78| | |[? %#V |viruses|virus|viruses]: %V]] +[? %#F |#|[:wrap|78| | |banned [? %#F |names|name|names]: %F]] +[? %#X |#|[[:wrap|78| | |%X]\n]] + +in email presumably from you %s +to the following [? %#R |recipients|recipient|recipients]:[ +-> %R] + +Our internal reference code for your message is %n/%i + +[? %a |#|[:wrap|78|| |First upstream SMTP client IP address: \[%a\] %g]] +[? %e |#|[:wrap|78|| |According to a 'Received:' trace,\ + the message apparently originated at: \[%e\], %t]] + +[:wrap|78|| |Return-Path: %s[?[:dkim|envsender]|| (OK)]] +[:wrap|78|| |From: [:header_field|From|100][?[:dkim|author]|| (dkim:AUTHOR)]] +[? [:header_field|Sender]|#|\ +[:wrap|78|| |Sender: [:header_field|Sender|100]\ +[?[:dkim|sender]|| (dkim:SENDER)]]] +[? %m |#|[:wrap|78|| |Message-ID: %m]] +[? %r |#|[:wrap|78|| |Resent-Message-ID: %r]] +[? %j |#|[:wrap|78|| |Subject: [:header_field|Subject|100]]] + +[? %#D |Delivery of the email was stopped! + +]# +[? %#V ||Please check your system for viruses, +or ask your system administrator to do so. + +]# +[? %#V |[? %#F ||# +The message [?%#D|has been blocked|triggered this warning] because it contains a component +(as a MIME part or nested within) with declared name +or MIME type or contents type violating our access policy. + +To transfer contents that may be considered risky or unwanted +by site policies, or simply too large for mailing, please consider +publishing your content on the web, and only sending an URL of the +document to the recipient. + +Depending on the recipient and sender site policies, with a little +effort it might still be possible to send any contents (including +viruses) using one of the following methods: + +- encrypted using pgp, gpg or other encryption methods; + +- wrapped in a password-protected or scrambled container or archive + (e.g.: zip -e, arj -g, arc g, rar -p, or other methods) + +Note that if the contents is not intended to be secret, the +encryption key or password may be included in the same message +for recipient's convenience. + +We are sorry for inconvenience if the contents was not malicious. + +The purpose of these restrictions is to cut the most common propagation +methods used by viruses and other malware. These often exploit automatic +mechanisms and security holes in more popular mail readers (Microsoft +mail readers and browsers are a common target). By requiring an explicit +and decisive action from the recipient to decode mail, the danger of +automatic malware propagation is largely reduced. +# +# Details of our mail restrictions policy are available at ... + +]]# diff --git a/config/mail/etc/clamav/clamd.conf b/config/mail/etc/clamav/clamd.conf new file mode 100644 index 0000000..11955e3 --- /dev/null +++ b/config/mail/etc/clamav/clamd.conf @@ -0,0 +1,88 @@ +#Automatically Generated by clamav-daemon postinst +#To reconfigure clamd run #dpkg-reconfigure clamav-daemon +#Please read /usr/share/doc/clamav-daemon/README.Debian.gz for details +LocalSocket /var/run/clamav/clamd.ctl +FixStaleSocket true +LocalSocketGroup clamav +LocalSocketMode 666 +# TemporaryDirectory is not set to its default /tmp here to make overriding +# the default with environment variables TMPDIR/TMP/TEMP possible +User clamav +ScanMail true +ScanArchive true +ArchiveBlockEncrypted false +MaxDirectoryRecursion 15 +FollowDirectorySymlinks false +FollowFileSymlinks false +ReadTimeout 180 +MaxThreads 12 +MaxConnectionQueueLength 15 +LogSyslog false +LogRotate true +LogFacility LOG_LOCAL6 +LogClean false +LogVerbose false +PreludeEnable no +PreludeAnalyzerName ClamAV +DatabaseDirectory /var/lib/clamav +OfficialDatabaseOnly false +SelfCheck 3600 +Foreground false +Debug false +ScanPE true +MaxEmbeddedPE 10M +ScanOLE2 true +ScanPDF true +ScanHTML true +MaxHTMLNormalize 10M +MaxHTMLNoTags 2M +MaxScriptNormalize 5M +MaxZipTypeRcg 1M +ScanSWF true +ExitOnOOM false +LeaveTemporaryFiles false +AlgorithmicDetection true +ScanELF true +IdleTimeout 30 +CrossFilesystems true +PhishingSignatures true +PhishingScanURLs true +PhishingAlwaysBlockSSLMismatch false +PhishingAlwaysBlockCloak false +PartitionIntersection false +DetectPUA false +ScanPartialMessages false +HeuristicScanPrecedence false +StructuredDataDetection false +CommandReadTimeout 5 +SendBufTimeout 200 +MaxQueue 100 +ExtendedDetectionInfo true +OLE2BlockMacros false +AllowAllMatchScan true +ForceToDisk false +DisableCertCheck false +DisableCache false +MaxScanTime 120000 +MaxScanSize 100M +MaxFileSize 25M +MaxRecursion 10 +MaxFiles 10000 +MaxPartitions 50 +MaxIconsPE 100 +PCREMatchLimit 10000 +PCRERecMatchLimit 5000 +PCREMaxFileSize 25M +ScanXMLDOCS true +ScanHWP3 true +MaxRecHWP3 16 +StreamMaxLength 25M +LogFile /var/log/clamav/clamav.log +LogTime true +LogFileUnlock false +LogFileMaxSize 0 +Bytecode true +BytecodeSecurity TrustSigned +BytecodeTimeout 60000 +PidFile /var/run/clamav/clamd.pid +OnAccessMaxFileSize 5M diff --git a/config/mail/etc/clamav/clamd.conf.ucf-old b/config/mail/etc/clamav/clamd.conf.ucf-old new file mode 100644 index 0000000..72a66a0 --- /dev/null +++ b/config/mail/etc/clamav/clamd.conf.ucf-old @@ -0,0 +1,89 @@ +#Automatically Generated by clamav-daemon postinst +#To reconfigure clamd run #dpkg-reconfigure clamav-daemon +#Please read /usr/share/doc/clamav-daemon/README.Debian.gz for details +AllowSupplementaryGroups true +LocalSocket /var/run/clamav/clamd.ctl +FixStaleSocket true +LocalSocketGroup clamav +LocalSocketMode 666 +# TemporaryDirectory is not set to its default /tmp here to make overriding +# the default with environment variables TMPDIR/TMP/TEMP possible +User clamav +ScanMail true +ScanArchive true +ArchiveBlockEncrypted false +MaxDirectoryRecursion 15 +FollowDirectorySymlinks false +FollowFileSymlinks false +ReadTimeout 180 +MaxThreads 12 +MaxConnectionQueueLength 15 +LogSyslog false +LogRotate true +LogFacility LOG_LOCAL6 +LogClean false +LogVerbose false +PreludeEnable no +PreludeAnalyzerName ClamAV +DatabaseDirectory /var/lib/clamav +OfficialDatabaseOnly false +SelfCheck 3600 +Foreground false +Debug false +ScanPE true +MaxEmbeddedPE 10M +ScanOLE2 true +ScanPDF true +ScanHTML true +MaxHTMLNormalize 10M +MaxHTMLNoTags 2M +MaxScriptNormalize 5M +MaxZipTypeRcg 1M +ScanSWF true +DetectBrokenExecutables false +ExitOnOOM false +LeaveTemporaryFiles false +AlgorithmicDetection true +ScanELF true +IdleTimeout 30 +CrossFilesystems true +PhishingSignatures true +PhishingScanURLs true +PhishingAlwaysBlockSSLMismatch false +PhishingAlwaysBlockCloak false +PartitionIntersection false +DetectPUA false +ScanPartialMessages false +HeuristicScanPrecedence false +StructuredDataDetection false +CommandReadTimeout 5 +SendBufTimeout 200 +MaxQueue 100 +ExtendedDetectionInfo true +OLE2BlockMacros false +ScanOnAccess false +AllowAllMatchScan true +ForceToDisk false +DisableCertCheck false +DisableCache false +MaxScanSize 100M +MaxFileSize 25M +MaxRecursion 10 +MaxFiles 10000 +MaxPartitions 50 +MaxIconsPE 100 +PCREMatchLimit 10000 +PCRERecMatchLimit 5000 +PCREMaxFileSize 25M +ScanXMLDOCS true +ScanHWP3 true +MaxRecHWP3 16 +StreamMaxLength 25M +LogFile /var/log/clamav/clamav.log +LogTime true +LogFileUnlock false +LogFileMaxSize 0 +Bytecode true +BytecodeSecurity TrustSigned +BytecodeTimeout 60000 +PidFile /var/run/clamav/clamd.pid diff --git a/config/mail/etc/clamav/freshclam.conf b/config/mail/etc/clamav/freshclam.conf new file mode 100644 index 0000000..8316f36 --- /dev/null +++ b/config/mail/etc/clamav/freshclam.conf @@ -0,0 +1,27 @@ +# Automatically created by the clamav-freshclam postinst +# Comments will get lost when you reconfigure the clamav-freshclam package + +DatabaseOwner clamav +UpdateLogFile /var/log/clamav/freshclam.log +LogVerbose false +LogSyslog false +LogFacility LOG_LOCAL6 +LogFileMaxSize 0 +LogRotate true +LogTime true +Foreground false +Debug false +MaxAttempts 5 +DatabaseDirectory /var/lib/clamav +DNSDatabaseInfo current.cvd.clamav.net +ConnectTimeout 30 +ReceiveTimeout 30 +TestDatabases yes +ScriptedUpdates yes +CompressLocalDatabase no +Bytecode true +# Check for new database 24 times a day +Checks 24 +DatabaseMirror db.local.clamav.net +DatabaseMirror database.clamav.net +PidFile /var/run/clamav/freshclam.pid diff --git a/config/mail/etc/cron.d/mail b/config/mail/etc/cron.d/mail new file mode 100644 index 0000000..ece6e2f --- /dev/null +++ b/config/mail/etc/cron.d/mail @@ -0,0 +1,17 @@ +# m h dom mon dow command + +# Kick amavis every two hours in case it has died +0 */2 * * * /usr/sbin/service amavis stop ; /bin/ps aux | grep ^amavis | while read user pid rest; do sudo /bin/kill -9 $pid; done ; /usr/sbin/service amavis restart + +# Kick spamassassin in case it died +1 */2 * * * kill -9 $(cat /var/run/) + +# Kick postfix in case it died +5 */2 * * * /usr/sbin/service postfix restart + +# Kick mailman every two hours in case it has stopped running +#7 */2 * * * /usr/sbin/service mailman restart + +# Check the email log for bad IP sources +0 6 * * * /email-check + diff --git a/config/mail/etc/dovecot/README b/config/mail/etc/dovecot/README new file mode 100644 index 0000000..9dcc22a --- /dev/null +++ b/config/mail/etc/dovecot/README @@ -0,0 +1,2 @@ +Configuration files go to this directory. See example configuration files in +/usr/share/doc/dovecot-core/example-config/ diff --git a/config/mail/etc/dovecot/auth.d/01-mail-stack-delivery.auth b/config/mail/etc/dovecot/auth.d/01-mail-stack-delivery.auth new file mode 100644 index 0000000..b4cf0ae --- /dev/null +++ b/config/mail/etc/dovecot/auth.d/01-mail-stack-delivery.auth @@ -0,0 +1,9 @@ +mechanisms = plain login +socket listen { + client { + path = /var/spool/postfix/private/dovecot-auth + mode = 0660 + user = postfix + group = postfix + } +} diff --git a/config/mail/etc/dovecot/conf.d/01-mail-stack-delivery.conf b/config/mail/etc/dovecot/conf.d/01-mail-stack-delivery.conf new file mode 100644 index 0000000..2b3fa97 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/01-mail-stack-delivery.conf @@ -0,0 +1,51 @@ +# Some general options +protocols = imap pop3 sieve +disable_plaintext_auth = yes +ssl = yes +#ssl_cert = was automatically rejected:%n%r +} + +# Plugins configuration +plugin { + sieve=~/.dovecot.sieve + sieve_dir=~/sieve +} + +# Authentication configuration +auth_mechanisms = plain login + +service auth { + # Postfix smtp-auth + unix_listener /var/spool/postfix/private/dovecot-auth { + mode = 0660 + user = postfix + group = postfix + } +} diff --git a/config/mail/etc/dovecot/conf.d/10-auth.conf b/config/mail/etc/dovecot/conf.d/10-auth.conf new file mode 100644 index 0000000..79ec368 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-auth.conf @@ -0,0 +1,134 @@ +## +## Authentication processes +## + +# Disable LOGIN command and all other plaintext authentications unless +# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP +# matches the local IP (ie. you're connecting from the same computer), the +# connection is considered secure and plaintext authentication is allowed. +# See also ssl=required setting. +#disable_plaintext_auth = yes + +# Authentication cache size (e.g. 10M). 0 means it's disabled. Note that +# bsdauth, PAM and vpopmail require cache_key to be set for caching to be used. +#auth_cache_size = 0 +# Time to live for cached data. After TTL expires the cached record is no +# longer used, *except* if the main database lookup returns internal failure. +# We also try to handle password changes automatically: If user's previous +# authentication was successful, but this one wasn't, the cache isn't used. +# For now this works only with plaintext authentication. +#auth_cache_ttl = 1 hour +# TTL for negative hits (user not found, password mismatch). +# 0 disables caching them completely. +#auth_cache_negative_ttl = 1 hour + +# Space separated list of realms for SASL authentication mechanisms that need +# them. You can leave it empty if you don't want to support multiple realms. +# Many clients simply use the first one listed here, so keep the default realm +# first. +#auth_realms = + +# Default realm/domain to use if none was specified. This is used for both +# SASL realms and appending @domain to username in plaintext logins. +#auth_default_realm = + +# List of allowed characters in username. If the user-given username contains +# a character not listed in here, the login automatically fails. This is just +# an extra check to make sure user can't exploit any potential quote escaping +# vulnerabilities with SQL/LDAP databases. If you want to allow all characters, +# set this value to empty. +auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 + +# Username character translations before it's looked up from databases. The +# value contains series of from -> to characters. For example "#@/@" means +# that '#' and '/' characters are translated to '@'. +#auth_username_translation = + +# Username formatting before it's looked up from databases. You can use +# the standard variables here, eg. %Lu would lowercase the username, %n would +# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into +# "-AT-". This translation is done after auth_username_translation changes. +#auth_username_format = %Lu + +# If you want to allow master users to log in by specifying the master +# username within the normal username string (ie. not using SASL mechanism's +# support for it), you can specify the separator character here. The format +# is then . UW-IMAP uses "*" as the +# separator, so that could be a good choice. +#auth_master_user_separator = + +# Username to use for users logging in with ANONYMOUS SASL mechanism +#auth_anonymous_username = anonymous + +# Maximum number of dovecot-auth worker processes. They're used to execute +# blocking passdb and userdb queries (eg. MySQL and PAM). They're +# automatically created and destroyed as needed. +#auth_worker_max_count = 30 + +# Host name to use in GSSAPI principal names. The default is to use the +# name returned by gethostname(). Use "$ALL" (with quotes) to allow all keytab +# entries. +#auth_gssapi_hostname = + +# Kerberos keytab to use for the GSSAPI mechanism. Will use the system +# default (usually /etc/krb5.keytab) if not specified. You may need to change +# the auth service to run as root to be able to read this file. +#auth_krb5_keytab = + +# Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and +# ntlm_auth helper. +#auth_use_winbind = no + +# Path for Samba's ntlm_auth helper binary. +#auth_winbind_helper_path = /usr/bin/ntlm_auth + +# Time to delay before replying to failed authentications. +#auth_failure_delay = 2 secs + +# Require a valid SSL client certificate or the authentication fails. +#auth_ssl_require_client_cert = no + +# Take the username from client's SSL certificate, using +# X509_NAME_get_text_by_NID() which returns the subject's DN's +# CommonName. +#auth_ssl_username_from_cert = no + +# Space separated list of wanted authentication mechanisms: +# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey +# gss-spnego +# NOTE: See also disable_plaintext_auth setting. +auth_mechanisms = plain + +## +## Password and user databases +## + +# +# Password database is used to verify user's password (and nothing more). +# You can have multiple passdbs and userdbs. This is useful if you want to +# allow both system users (/etc/passwd) and virtual users to login without +# duplicating the system users into virtual database. +# +# +# +# User database specifies where mails are located and what user/group IDs +# own them. For single-UID configuration use "static" userdb. +# +# + +#!include auth-deny.conf.ext +#!include auth-master.conf.ext + +!include auth-system.conf.ext +#!include auth-sql.conf.ext +#!include auth-ldap.conf.ext +#!include auth-passwdfile.conf.ext +#!include auth-checkpassword.conf.ext +#!include auth-vpopmail.conf.ext +#!include auth-static.conf.ext + +#passdb { +# driver = pam +# args = %s +#} + diff --git a/config/mail/etc/dovecot/conf.d/10-director.conf b/config/mail/etc/dovecot/conf.d/10-director.conf new file mode 100644 index 0000000..31e97e9 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-director.conf @@ -0,0 +1,61 @@ +## +## Director-specific settings. +## + +# Director can be used by Dovecot proxy to keep a temporary user -> mail server +# mapping. As long as user has simultaneous connections, the user is always +# redirected to the same server. Each proxy server is running its own director +# process, and the directors are communicating the state to each others. +# Directors are mainly useful with NFS-like setups. + +# List of IPs or hostnames to all director servers, including ourself. +# Ports can be specified as ip:port. The default port is the same as +# what director service's inet_listener is using. +#director_servers = + +# List of IPs or hostnames to all backend mail servers. Ranges are allowed +# too, like 10.0.0.10-10.0.0.30. +#director_mail_servers = + +# How long to redirect users to a specific server after it no longer has +# any connections. +#director_user_expire = 15 min + +# TCP/IP port that accepts doveadm connections (instead of director connections) +# If you enable this, you'll also need to add inet_listener for the port. +#director_doveadm_port = 0 + +# How the username is translated before being hashed. Useful values include +# %Ln if user can log in with or without @domain, %Ld if mailboxes are shared +# within domain. +#director_username_hash = %Lu + +# To enable director service, uncomment the modes and assign a port. +service director { + unix_listener login/director { + #mode = 0666 + } + fifo_listener login/proxy-notify { + #mode = 0666 + } + unix_listener director-userdb { + #mode = 0600 + } + inet_listener { + #port = + } +} + +# Enable director for the wanted login services by telling them to +# connect to director socket instead of the default login socket: +service imap-login { + #executable = imap-login director +} +service pop3-login { + #executable = pop3-login director +} + +# Enable director for LMTP proxying: +protocol lmtp { + #auth_socket_path = director-userdb +} diff --git a/config/mail/etc/dovecot/conf.d/10-logging.conf b/config/mail/etc/dovecot/conf.d/10-logging.conf new file mode 100644 index 0000000..873dcfd --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-logging.conf @@ -0,0 +1,89 @@ +## +## Log destination. +## + +# Log file to use for error messages. "syslog" logs to syslog, +# /dev/stderr logs to stderr. +#log_path = syslog + +# Log file to use for informational messages. Defaults to log_path. +#info_log_path = +# Log file to use for debug messages. Defaults to info_log_path. +#debug_log_path = + +# Syslog facility to use if you're logging to syslog. Usually if you don't +# want to use "mail", you'll use local0..local7. Also other standard +# facilities are supported. +#syslog_facility = mail + +## +## Logging verbosity and debugging. +## + +# Log unsuccessful authentication attempts and the reasons why they failed. +#auth_verbose = no +auth_verbose = yes + +# In case of password mismatches, log the attempted password. Valid values are +# no, plain and sha1. sha1 can be useful for detecting brute force password +# attempts vs. user simply trying the same password over and over again. +# You can also truncate the value to n chars by appending ":n" (e.g. sha1:6). +#auth_verbose_passwords = no +#auth_verbose_passwords = yes + +# Even more verbose logging for debugging purposes. Shows for example SQL +# queries. +auth_debug = no +#auth_debug = yes + +# In case of password mismatches, log the passwords and used scheme so the +# problem can be debugged. Enabling this also enables auth_debug. +auth_debug_passwords = no +#auth_debug_passwords = yes + +# Enable mail process debugging. This can help you figure out why Dovecot +# isn't finding your mails. +mail_debug = yes + +# Show protocol level SSL errors. +verbose_ssl = no + +# mail_log plugin provides more event logging for mail processes. +plugin { + # Events to log. Also available: flag_change append + #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename + # Available fields: uid, box, msgid, from, subject, size, vsize, flags + # size and vsize are available only for expunge and copy events. + #mail_log_fields = uid box msgid size +} + +## +## Log formatting. +## + +# Prefix for each line written to log file. % codes are in strftime(3) +# format. +#log_timestamp = "%b %d %H:%M:%S " + +# Space-separated list of elements we want to log. The elements which have +# a non-empty variable value are joined together to form a comma-separated +# string. +#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c + +# Login log format. %s contains login_log_format_elements string, %$ contains +# the data we want to log. +#login_log_format = %$: %s + +# Log prefix for mail processes. See doc/wiki/Variables.txt for list of +# possible variables you can use. +#mail_log_prefix = "%s(%u): " + +# Format to use for logging mail deliveries. See doc/wiki/Variables.txt for +# list of all variables you can use. Some of the common ones include: +# %$ - Delivery status message (e.g. "saved to INBOX") +# %m - Message-ID +# %s - Subject +# %f - From address +# %p - Physical size +# %w - Virtual size +#deliver_log_format = msgid=%m: %$ diff --git a/config/mail/etc/dovecot/conf.d/10-logging.conf.ucf-dist b/config/mail/etc/dovecot/conf.d/10-logging.conf.ucf-dist new file mode 100644 index 0000000..6313c18 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-logging.conf.ucf-dist @@ -0,0 +1,89 @@ +## +## Log destination. +## + +# Log file to use for error messages. "syslog" logs to syslog, +# /dev/stderr logs to stderr. +#log_path = syslog + +# Log file to use for informational messages. Defaults to log_path. +#info_log_path = +# Log file to use for debug messages. Defaults to info_log_path. +#debug_log_path = + +# Syslog facility to use if you're logging to syslog. Usually if you don't +# want to use "mail", you'll use local0..local7. Also other standard +# facilities are supported. +#syslog_facility = mail + +## +## Logging verbosity and debugging. +## + +# Log unsuccessful authentication attempts and the reasons why they failed. +#auth_verbose = no + +# In case of password mismatches, log the attempted password. Valid values are +# no, plain and sha1. sha1 can be useful for detecting brute force password +# attempts vs. user simply trying the same password over and over again. +# You can also truncate the value to n chars by appending ":n" (e.g. sha1:6). +#auth_verbose_passwords = no + +# Even more verbose logging for debugging purposes. Shows for example SQL +# queries. +#auth_debug = no + +# In case of password mismatches, log the passwords and used scheme so the +# problem can be debugged. Enabling this also enables auth_debug. +#auth_debug_passwords = no + +# Enable mail process debugging. This can help you figure out why Dovecot +# isn't finding your mails. +#mail_debug = no + +# Show protocol level SSL errors. +#verbose_ssl = no + +# mail_log plugin provides more event logging for mail processes. +plugin { + # Events to log. Also available: flag_change append + #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename + # Available fields: uid, box, msgid, from, subject, size, vsize, flags + # size and vsize are available only for expunge and copy events. + #mail_log_fields = uid box msgid size +} + +## +## Log formatting. +## + +# Prefix for each line written to log file. % codes are in strftime(3) +# format. +#log_timestamp = "%b %d %H:%M:%S " + +# Space-separated list of elements we want to log. The elements which have +# a non-empty variable value are joined together to form a comma-separated +# string. +#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c + +# Login log format. %s contains login_log_format_elements string, %$ contains +# the data we want to log. +#login_log_format = %$: %s + +# Log prefix for mail processes. See doc/wiki/Variables.txt for list of +# possible variables you can use. +#mail_log_prefix = "%s(%u): " + +# Format to use for logging mail deliveries: +# %$ - Delivery status message (e.g. "saved to INBOX") +# %m / %{msgid} - Message-ID +# %s / %{subject} - Subject +# %f / %{from} - From address +# %p / %{size} - Physical size +# %w / %{vsize} - Virtual size +# %e / %{from_envelope} - MAIL FROM envelope +# %{to_envelope} - RCPT TO envelope +# %{delivery_time} - How many milliseconds it took to deliver the mail +# %{session_time} - How long LMTP session took, not including delivery_time +# %{storage_id} - Backend-specific ID for mail, e.g. Maildir filename +#deliver_log_format = msgid=%m: %$ diff --git a/config/mail/etc/dovecot/conf.d/10-logging.conf.ucf-old b/config/mail/etc/dovecot/conf.d/10-logging.conf.ucf-old new file mode 100644 index 0000000..d8ebac1 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-logging.conf.ucf-old @@ -0,0 +1,83 @@ +## +## Log destination. +## + +# Log file to use for error messages. "syslog" logs to syslog, +# /dev/stderr logs to stderr. +#log_path = syslog + +# Log file to use for informational messages. Defaults to log_path. +#info_log_path = +# Log file to use for debug messages. Defaults to info_log_path. +#debug_log_path = + +# Syslog facility to use if you're logging to syslog. Usually if you don't +# want to use "mail", you'll use local0..local7. Also other standard +# facilities are supported. +#syslog_facility = mail + +## +## Logging verbosity and debugging. +## + +# Log unsuccessful authentication attempts and the reasons why they failed. +#auth_verbose = no + +# In case of password mismatches, log the attempted password. Valid values are +# no, plain and sha1. sha1 can be useful for detecting brute force password +# attempts vs. user simply trying the same password over and over again. +#auth_verbose_passwords = no + +# Even more verbose logging for debugging purposes. Shows for example SQL +# queries. +#auth_debug = no + +# In case of password mismatches, log the passwords and used scheme so the +# problem can be debugged. Enabling this also enables auth_debug. +auth_debug_passwords = yes + +# Enable mail process debugging. This can help you figure out why Dovecot +# isn't finding your mails. +#mail_debug = no + +# Show protocol level SSL errors. +#verbose_ssl = no + +# mail_log plugin provides more event logging for mail processes. +plugin { + # Events to log. Also available: flag_change append + #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename + # Available fields: uid, box, msgid, from, subject, size, vsize, flags + # size and vsize are available only for expunge and copy events. + #mail_log_fields = uid box msgid size +} + +## +## Log formatting. +## + +# Prefix for each line written to log file. % codes are in strftime(3) +# format. +#log_timestamp = "%b %d %H:%M:%S " + +# Space-separated list of elements we want to log. The elements which have +# a non-empty variable value are joined together to form a comma-separated +# string. +#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c + +# Login log format. %$ contains login_log_format_elements string, %s contains +# the data we want to log. +#login_log_format = %$: %s + +# Log prefix for mail processes. See doc/wiki/Variables.txt for list of +# possible variables you can use. +#mail_log_prefix = "%s(%u): " + +# Format to use for logging mail deliveries. You can use variables: +# %$ - Delivery status message (e.g. "saved to INBOX") +# %m - Message-ID +# %s - Subject +# %f - From address +# %p - Physical size +# %w - Virtual size +#deliver_log_format = msgid=%m: %$ diff --git a/config/mail/etc/dovecot/conf.d/10-mail.conf b/config/mail/etc/dovecot/conf.d/10-mail.conf new file mode 100644 index 0000000..cc0d35e --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-mail.conf @@ -0,0 +1,385 @@ +## +## Mailbox locations and namespaces +## + +# Location for users' mailboxes. The default is empty, which means that Dovecot +# tries to find the mailboxes automatically. This won't work if the user +# doesn't yet have any mail, so you should explicitly tell Dovecot the full +# location. +# +# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u) +# isn't enough. You'll also need to tell Dovecot where the other mailboxes are +# kept. This is called the "root mail directory", and it must be the first +# path given in the mail_location setting. +# +# There are a few special variables you can use, eg.: +# +# %u - username +# %n - user part in user@domain, same as %u if there's no domain +# %d - domain part in user@domain, empty if there's no domain +# %h - home directory +# +# See doc/wiki/Variables.txt for full list. Some examples: +# +# mail_location = maildir:~/Maildir +# mail_location = mbox:~/mail:INBOX=/var/mail/%u +# mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n +# +# +# +mail_location = mbox:~/mail:INBOX=/var/mail/%u + +# If you need to set multiple mailbox locations or want to change default +# namespace settings, you can do it by defining namespace sections. +# +# You can have private, shared and public namespaces. Private namespaces +# are for user's personal mails. Shared namespaces are for accessing other +# users' mailboxes that have been shared. Public namespaces are for shared +# mailboxes that are managed by sysadmin. If you create any shared or public +# namespaces you'll typically want to enable ACL plugin also, otherwise all +# users can access all the shared mailboxes, assuming they have permissions +# on filesystem level to do so. +namespace inbox { + # Namespace type: private, shared or public + #type = private + + # Hierarchy separator to use. You should use the same separator for all + # namespaces or some clients get confused. '/' is usually a good one. + # The default however depends on the underlying mail storage format. + #separator = + + # Prefix required to access this namespace. This needs to be different for + # all namespaces. For example "Public/". + #prefix = + + # Physical location of the mailbox. This is in same format as + # mail_location, which is also the default for it. + #location = + + # There can be only one INBOX, and this setting defines which namespace + # has it. + inbox = yes + + # If namespace is hidden, it's not advertised to clients via NAMESPACE + # extension. You'll most likely also want to set list=no. This is mostly + # useful when converting from another server with different namespaces which + # you want to deprecate but still keep working. For example you can create + # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/". + #hidden = no + + # Show the mailboxes under this namespace with LIST command. This makes the + # namespace visible for clients that don't support NAMESPACE extension. + # "children" value lists child mailboxes, but hides the namespace prefix. + #list = yes + + # Namespace handles its own subscriptions. If set to "no", the parent + # namespace handles them (empty prefix should always have this as "yes") + #subscriptions = yes + + # See 15-mailboxes.conf for definitions of special mailboxes. +} + +# Example shared namespace configuration +#namespace { + #type = shared + #separator = / + + # Mailboxes are visible under "shared/user@domain/" + # %%n, %%d and %%u are expanded to the destination user. + #prefix = shared/%%u/ + + # Mail location for other users' mailboxes. Note that %variables and ~/ + # expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the + # destination user's data. + #location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u + + # Use the default namespace for saving subscriptions. + #subscriptions = no + + # List the shared/ namespace only if there are visible shared mailboxes. + #list = children +#} +# Should shared INBOX be visible as "shared/user" or "shared/user/INBOX"? +#mail_shared_explicit_inbox = no + +# System user and group used to access mails. If you use multiple, userdb +# can override these by returning uid or gid fields. You can use either numbers +# or names. +#mail_uid = +#mail_gid = + +# Group to enable temporarily for privileged operations. Currently this is +# used only with INBOX when either its initial creation or dotlocking fails. +# Typically this is set to "mail" to give access to /var/mail. +#mail_privileged_group = + +# Grant access to these supplementary groups for mail processes. Typically +# these are used to set up access to shared mailboxes. Note that it may be +# dangerous to set these if users can create symlinks (e.g. if "mail" group is +# set here, ln -s /var/mail ~/mail/var could allow a user to delete others' +# mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it). +#mail_access_groups = + +# Allow full filesystem access to clients. There's no access checks other than +# what the operating system does for the active UID/GID. It works with both +# maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/ +# or ~user/. +#mail_full_filesystem_access = no + +# Dictionary for key=value mailbox attributes. This is used for example by +# URLAUTH and METADATA extensions. +#mail_attribute_dict = + +# A comment or note that is associated with the server. This value is +# accessible for authenticated users through the IMAP METADATA server +# entry "/shared/comment". +#mail_server_comment = "" + +# Indicates a method for contacting the server administrator. According to +# RFC 5464, this value MUST be a URI (e.g., a mailto: or tel: URL), but that +# is currently not enforced. Use for example mailto:admin@example.com. This +# value is accessible for authenticated users through the IMAP METADATA server +# entry "/shared/admin". +#mail_server_admin = + +## +## Mail processes +## + +# Don't use mmap() at all. This is required if you store indexes to shared +# filesystems (NFS or clustered filesystem). +#mmap_disable = no + +# Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL +# since version 3, so this should be safe to use nowadays by default. +#dotlock_use_excl = yes + +# When to use fsync() or fdatasync() calls: +# optimized (default): Whenever necessary to avoid losing important data +# always: Useful with e.g. NFS when write()s are delayed +# never: Never use it (best performance, but crashes can lose data) +#mail_fsync = optimized + +# Locking method for index files. Alternatives are fcntl, flock and dotlock. +# Dotlocking uses some tricks which may create more disk I/O than other locking +# methods. NFS users: flock doesn't work, remember to change mmap_disable. +#lock_method = fcntl + +# Directory in which LDA/LMTP temporarily stores incoming mails >128 kB. +#mail_temp_dir = /tmp + +# Valid UID range for users, defaults to 500 and above. This is mostly +# to make sure that users can't log in as daemons or other system users. +# Note that denying root logins is hardcoded to dovecot binary and can't +# be done even if first_valid_uid is set to 0. +#first_valid_uid = 500 +#last_valid_uid = 0 + +# Valid GID range for users, defaults to non-root/wheel. Users having +# non-valid GID as primary group ID aren't allowed to log in. If user +# belongs to supplementary groups with non-valid GIDs, those groups are +# not set. +#first_valid_gid = 1 +#last_valid_gid = 0 + +# Maximum allowed length for mail keyword name. It's only forced when trying +# to create new keywords. +#mail_max_keyword_length = 50 + +# ':' separated list of directories under which chrooting is allowed for mail +# processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too). +# This setting doesn't affect login_chroot, mail_chroot or auth chroot +# settings. If this setting is empty, "/./" in home dirs are ignored. +# WARNING: Never add directories here which local users can modify, that +# may lead to root exploit. Usually this should be done only if you don't +# allow shell access for users. +#valid_chroot_dirs = + +# Default chroot directory for mail processes. This can be overridden for +# specific users in user database by giving /./ in user's home directory +# (eg. /home/./user chroots into /home). Note that usually there is no real +# need to do chrooting, Dovecot doesn't allow users to access files outside +# their mail directory anyway. If your home directories are prefixed with +# the chroot directory, append "/." to mail_chroot. +#mail_chroot = + +# UNIX socket path to master authentication server to find users. +# This is used by imap (for shared users) and lda. +#auth_socket_path = /var/run/dovecot/auth-userdb + +# Directory where to look up mail plugins. +#mail_plugin_dir = /usr/lib/dovecot/modules + +# Space separated list of plugins to load for all services. Plugins specific to +# IMAP, LDA, etc. are added to this list in their own .conf files. +#mail_plugins = + +## +## Mailbox handling optimizations +## + +# Mailbox list indexes can be used to optimize IMAP STATUS commands. They are +# also required for IMAP NOTIFY extension to be enabled. +#mailbox_list_index = no + +# The minimum number of mails in a mailbox before updates are done to cache +# file. This allows optimizing Dovecot's behavior to do less disk writes at +# the cost of more disk reads. +#mail_cache_min_mail_count = 0 + +# When IDLE command is running, mailbox is checked once in a while to see if +# there are any new mails or other changes. This setting defines the minimum +# time to wait between those checks. Dovecot can also use inotify and +# kqueue to find out immediately when changes occur. +#mailbox_idle_check_interval = 30 secs + +# Save mails with CR+LF instead of plain LF. This makes sending those mails +# take less CPU, especially with sendfile() syscall with Linux and FreeBSD. +# But it also creates a bit more disk I/O which may just make it slower. +# Also note that if other software reads the mboxes/maildirs, they may handle +# the extra CRs wrong and cause problems. +#mail_save_crlf = no + +# Max number of mails to keep open and prefetch to memory. This only works with +# some mailbox formats and/or operating systems. +#mail_prefetch_count = 0 + +# How often to scan for stale temporary files and delete them (0 = never). +# These should exist only after Dovecot dies in the middle of saving mails. +#mail_temp_scan_interval = 1w + +## +## Maildir-specific settings +## + +# By default LIST command returns all entries in maildir beginning with a dot. +# Enabling this option makes Dovecot return only entries which are directories. +# This is done by stat()ing each entry, so it causes more disk I/O. +# (For systems setting struct dirent->d_type, this check is free and it's +# done always regardless of this setting) +#maildir_stat_dirs = no + +# When copying a message, do it with hard links whenever possible. This makes +# the performance much better, and it's unlikely to have any side effects. +#maildir_copy_with_hardlinks = yes + +# Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only +# when its mtime changes unexpectedly or when we can't find the mail otherwise. +#maildir_very_dirty_syncs = no + +# If enabled, Dovecot doesn't use the S= in the Maildir filenames for +# getting the mail's physical size, except when recalculating Maildir++ quota. +# This can be useful in systems where a lot of the Maildir filenames have a +# broken size. The performance hit for enabling this is very small. +#maildir_broken_filename_sizes = no + +# Always move mails from new/ directory to cur/, even when the \Recent flags +# aren't being reset. +#maildir_empty_new = no + +## +## mbox-specific settings +## + +# Which locking methods to use for locking mbox. There are four available: +# dotlock: Create .lock file. This is the oldest and most NFS-safe +# solution. If you want to use /var/mail/ like directory, the users +# will need write access to that directory. +# dotlock_try: Same as dotlock, but if it fails because of permissions or +# because there isn't enough disk space, just skip it. +# fcntl : Use this if possible. Works with NFS too if lockd is used. +# flock : May not exist in all systems. Doesn't work with NFS. +# lockf : May not exist in all systems. Doesn't work with NFS. +# +# You can use multiple locking methods; if you do the order they're declared +# in is important to avoid deadlocks if other MTAs/MUAs are using multiple +# locking methods as well. Some operating systems don't allow using some of +# them simultaneously. +# +# The Debian value for mbox_write_locks differs from upstream Dovecot. It is +# changed to be compliant with Debian Policy (section 11.6) for NFS safety. +# Dovecot: mbox_write_locks = dotlock fcntl +# Debian: mbox_write_locks = fcntl dotlock +# +#mbox_read_locks = fcntl +#mbox_write_locks = fcntl dotlock + +# Maximum time to wait for lock (all of them) before aborting. +#mbox_lock_timeout = 5 mins + +# If dotlock exists but the mailbox isn't modified in any way, override the +# lock file after this much time. +#mbox_dotlock_change_timeout = 2 mins + +# When mbox changes unexpectedly we have to fully read it to find out what +# changed. If the mbox is large this can take a long time. Since the change +# is usually just a newly appended mail, it'd be faster to simply read the +# new mails. If this setting is enabled, Dovecot does this but still safely +# fallbacks to re-reading the whole mbox file whenever something in mbox isn't +# how it's expected to be. The only real downside to this setting is that if +# some other MUA changes message flags, Dovecot doesn't notice it immediately. +# Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK +# commands. +#mbox_dirty_syncs = yes + +# Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE, +# EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored. +#mbox_very_dirty_syncs = no + +# Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK +# commands and when closing the mailbox). This is especially useful for POP3 +# where clients often delete all mails. The downside is that our changes +# aren't immediately visible to other MUAs. +#mbox_lazy_writes = yes + +# If mbox size is smaller than this (e.g. 100k), don't write index files. +# If an index file already exists it's still read, just not updated. +#mbox_min_index_size = 0 + +# Mail header selection algorithm to use for MD5 POP3 UIDLs when +# pop3_uidl_format=%m. For backwards compatibility we use apop3d inspired +# algorithm, but it fails if the first Received: header isn't unique in all +# mails. An alternative algorithm is "all" that selects all headers. +#mbox_md5 = apop3d + +## +## mdbox-specific settings +## + +# Maximum dbox file size until it's rotated. +#mdbox_rotate_size = 2M + +# Maximum dbox file age until it's rotated. Typically in days. Day begins +# from midnight, so 1d = today, 2d = yesterday, etc. 0 = check disabled. +#mdbox_rotate_interval = 0 + +# When creating new mdbox files, immediately preallocate their size to +# mdbox_rotate_size. This setting currently works only in Linux with some +# filesystems (ext4, xfs). +#mdbox_preallocate_space = no + +## +## Mail attachments +## + +# sdbox and mdbox support saving mail attachments to external files, which +# also allows single instance storage for them. Other backends don't support +# this for now. + +# Directory root where to store mail attachments. Disabled, if empty. +#mail_attachment_dir = + +# Attachments smaller than this aren't saved externally. It's also possible to +# write a plugin to disable saving specific attachments externally. +#mail_attachment_min_size = 128k + +# Filesystem backend to use for saving attachments: +# posix : No SiS done by Dovecot (but this might help FS's own deduplication) +# sis posix : SiS with immediate byte-by-byte comparison during saving +# sis-queue posix : SiS with delayed comparison and deduplication +#mail_attachment_fs = sis posix + +# Hash format to use in attachment filenames. You can add any text and +# variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}. +# Variables can be truncated, e.g. %{sha256:80} returns only first 80 bits +#mail_attachment_hash = %{sha1} diff --git a/config/mail/etc/dovecot/conf.d/10-master.conf b/config/mail/etc/dovecot/conf.d/10-master.conf new file mode 100644 index 0000000..5fe7b4a --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-master.conf @@ -0,0 +1,112 @@ +#default_process_limit = 100 +#default_client_limit = 1000 + +# Default VSZ (virtual memory size) limit for service processes. This is mainly +# intended to catch and kill processes that leak memory before they eat up +# everything. +#default_vsz_limit = 256M + +# Login user is internally used by login processes. This is the most untrusted +# user in Dovecot system. It shouldn't have access to anything at all. +#default_login_user = dovenull + +# Internal user is used by unprivileged processes. It should be separate from +# login user, so that login processes can't disturb other processes. +#default_internal_user = dovecot + +service imap-login { + inet_listener imap { + #port = 143 + } + inet_listener imaps { + #port = 993 + #ssl = yes + } + + # Number of connections to handle before starting a new process. Typically + # the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0 + # is faster. + #service_count = 1 + + # Number of processes to always keep waiting for more connections. + #process_min_avail = 0 + + # If you set service_count=0, you probably need to grow this. + #vsz_limit = 64M +} + +service pop3-login { + inet_listener pop3 { + #port = 110 + } + inet_listener pop3s { + #port = 995 + #ssl = yes + } +} + +service lmtp { + unix_listener lmtp { + #mode = 0666 + } + + # Create inet listener only if you can't use the above UNIX socket + #inet_listener lmtp { + # Avoid making LMTP visible for the entire internet + #address = + #port = + #} +} + +service imap { + # Most of the memory goes to mmap()ing files. You may need to increase this + # limit if you have huge mailboxes. + #vsz_limit = 256M + + # Max. number of IMAP processes (connections) + #process_limit = 1024 +} + +service pop3 { + # Max. number of POP3 processes (connections) + #process_limit = 1024 +} + +service auth { + # auth_socket_path points to this userdb socket by default. It's typically + # used by dovecot-lda, doveadm, possibly imap process, etc. Its default + # permissions make it readable only by root, but you may need to relax these + # permissions. Users that have access to this socket are able to get a list + # of all usernames and get results of everyone's userdb lookups. + unix_listener auth-userdb { + #mode = 0600 + #user = + #group = + } + + # Postfix smtp-auth + unix_listener /var/spool/postfix/private/auth_client { + mode = 0666 + user = postfix + } + + # Auth process is run as this user. + #user = $default_internal_user +} + +service auth-worker { + # Auth worker process is run as root by default, so that it can access + # /etc/shadow. If this isn't necessary, the user should be changed to + # $default_internal_user. + #user = root +} + +service dict { + # If dict proxy is used, mail processes should have access to its socket. + # For example: mode=0660, group=vmail and global mail_access_groups=vmail + unix_listener dict { + #mode = 0600 + #user = + #group = + } +} diff --git a/config/mail/etc/dovecot/conf.d/10-master.conf.ucf-dist b/config/mail/etc/dovecot/conf.d/10-master.conf.ucf-dist new file mode 100644 index 0000000..e3d6260 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-master.conf.ucf-dist @@ -0,0 +1,119 @@ +#default_process_limit = 100 +#default_client_limit = 1000 + +# Default VSZ (virtual memory size) limit for service processes. This is mainly +# intended to catch and kill processes that leak memory before they eat up +# everything. +#default_vsz_limit = 256M + +# Login user is internally used by login processes. This is the most untrusted +# user in Dovecot system. It shouldn't have access to anything at all. +#default_login_user = dovenull + +# Internal user is used by unprivileged processes. It should be separate from +# login user, so that login processes can't disturb other processes. +#default_internal_user = dovecot + +service imap-login { + inet_listener imap { + #port = 143 + } + inet_listener imaps { + #port = 993 + #ssl = yes + } + + # Number of connections to handle before starting a new process. Typically + # the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0 + # is faster. + #service_count = 1 + + # Number of processes to always keep waiting for more connections. + #process_min_avail = 0 + + # If you set service_count=0, you probably need to grow this. + #vsz_limit = $default_vsz_limit +} + +service pop3-login { + inet_listener pop3 { + #port = 110 + } + inet_listener pop3s { + #port = 995 + #ssl = yes + } +} + +service lmtp { + unix_listener lmtp { + #mode = 0666 + } + + # Create inet listener only if you can't use the above UNIX socket + #inet_listener lmtp { + # Avoid making LMTP visible for the entire internet + #address = + #port = + #} +} + +service imap { + # Most of the memory goes to mmap()ing files. You may need to increase this + # limit if you have huge mailboxes. + #vsz_limit = $default_vsz_limit + + # Max. number of IMAP processes (connections) + #process_limit = 1024 +} + +service pop3 { + # Max. number of POP3 processes (connections) + #process_limit = 1024 +} + +service auth { + # auth_socket_path points to this userdb socket by default. It's typically + # used by dovecot-lda, doveadm, possibly imap process, etc. Users that have + # full permissions to this socket are able to get a list of all usernames and + # get the results of everyone's userdb lookups. + # + # The default 0666 mode allows anyone to connect to the socket, but the + # userdb lookups will succeed only if the userdb returns an "uid" field that + # matches the caller process's UID. Also if caller's uid or gid matches the + # socket's uid or gid the lookup succeeds. Anything else causes a failure. + # + # To give the caller full permissions to lookup all users, set the mode to + # something else than 0666 and Dovecot lets the kernel enforce the + # permissions (e.g. 0777 allows everyone full permissions). + unix_listener auth-userdb { + #mode = 0666 + #user = + #group = + } + + # Postfix smtp-auth + #unix_listener /var/spool/postfix/private/auth { + # mode = 0666 + #} + + # Auth process is run as this user. + #user = $default_internal_user +} + +service auth-worker { + # Auth worker process is run as root by default, so that it can access + # /etc/shadow. If this isn't necessary, the user should be changed to + # $default_internal_user. + #user = root +} + +service dict { + # If dict proxy is used, mail processes should have access to its socket. + # For example: mode=0660, group=vmail and global mail_access_groups=vmail + unix_listener dict { + #mode = 0600 + #user = + #group = + } +} diff --git a/config/mail/etc/dovecot/conf.d/10-ssl.conf b/config/mail/etc/dovecot/conf.d/10-ssl.conf new file mode 100644 index 0000000..2b811fd --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/10-ssl.conf @@ -0,0 +1,41 @@ +## +## SSL settings +## + +# SSL/TLS support: yes, no, required. +ssl = yes + +# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before +# dropping root privileges, so keep the key file unreadable by anyone but +# root. Included doc/mkcert.sh can be used to easily generate self-signed +# certificate, just make sure to update the domains in dovecot-openssl.cnf +ssl_cert = +#ssl = yes + +# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before +# dropping root privileges, so keep the key file unreadable by anyone but +# root. Included doc/mkcert.sh can be used to easily generate self-signed +# certificate, just make sure to update the domains in dovecot-openssl.cnf +ssl_cert = . %d expands to recipient domain. +#postmaster_address = + +# Hostname to use in various parts of sent mails (e.g. in Message-Id) and +# in LMTP replies. Default is the system's real hostname@domain. +#hostname = + +# If user is over quota, return with temporary failure instead of +# bouncing the mail. +#quota_full_tempfail = no + +# Binary to use for sending mails. +#sendmail_path = /usr/sbin/sendmail + +# If non-empty, send mails via this SMTP host[:port] instead of sendmail. +#submission_host = + +# Subject: header to use for rejection mails. You can use the same variables +# as for rejection_reason below. +#rejection_subject = Rejected: %s + +# Human readable error message for rejection mails. You can use variables: +# %n = CRLF, %r = reason, %s = original subject, %t = recipient +#rejection_reason = Your message to <%t> was automatically rejected:%n%r + +# Delimiter character between local-part and detail in email address. +recipient_delimiter = _ + +# Header where the original recipient address (SMTP's RCPT TO: address) is taken +# from if not available elsewhere. With dovecot-lda -a parameter overrides this. +# A commonly used header for this is X-Original-To. +#lda_original_recipient_header = + +# Should saving a mail to a nonexistent mailbox automatically create it? +lda_mailbox_autocreate = no + +# Should automatically created mailboxes be also automatically subscribed? +lda_mailbox_autosubscribe = no + +protocol lda { + # Space separated list of plugins to load (default is global mail_plugins). + #mail_plugins = $mail_plugins +} diff --git a/config/mail/etc/dovecot/conf.d/15-mailboxes.conf b/config/mail/etc/dovecot/conf.d/15-mailboxes.conf new file mode 100644 index 0000000..cd5b21b --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/15-mailboxes.conf @@ -0,0 +1,78 @@ +## +## Mailbox definitions +## + +# Each mailbox is specified in a separate mailbox section. The section name +# specifies the mailbox name. If it has spaces, you can put the name +# "in quotes". These sections can contain the following mailbox settings: +# +# auto: +# Indicates whether the mailbox with this name is automatically created +# implicitly when it is first accessed. The user can also be automatically +# subscribed to the mailbox after creation. The following values are +# defined for this setting: +# +# no - Never created automatically. +# create - Automatically created, but no automatic subscription. +# subscribe - Automatically created and subscribed. +# +# special_use: +# A space-separated list of SPECIAL-USE flags (RFC 6154) to use for the +# mailbox. There are no validity checks, so you could specify anything +# you want in here, but it's not a good idea to use flags other than the +# standard ones specified in the RFC: +# +# \All - This (virtual) mailbox presents all messages in the +# user's message store. +# \Archive - This mailbox is used to archive messages. +# \Drafts - This mailbox is used to hold draft messages. +# \Flagged - This (virtual) mailbox presents all messages in the +# user's message store marked with the IMAP \Flagged flag. +# \Junk - This mailbox is where messages deemed to be junk mail +# are held. +# \Sent - This mailbox is used to hold copies of messages that +# have been sent. +# \Trash - This mailbox is used to hold messages that have been +# deleted. +# +# comment: +# Defines a default comment or note associated with the mailbox. This +# value is accessible through the IMAP METADATA mailbox entries +# "/shared/comment" and "/private/comment". Users with sufficient +# privileges can override the default value for entries with a custom +# value. + +# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf. +namespace inbox { + # These mailboxes are widely used and could perhaps be created automatically: + mailbox Drafts { + special_use = \Drafts + } + mailbox Junk { + special_use = \Junk + } + mailbox Trash { + special_use = \Trash + } + + # For \Sent mailboxes there are two widely used names. We'll mark both of + # them as \Sent. User typically deletes one of them if duplicates are created. + mailbox Sent { + special_use = \Sent + } + mailbox "Sent Messages" { + special_use = \Sent + } + + # If you have a virtual "All messages" mailbox: + #mailbox virtual/All { + # special_use = \All + # comment = All my messages + #} + + # If you have a virtual "Flagged" mailbox: + #mailbox virtual/Flagged { + # special_use = \Flagged + # comment = All my flagged messages + #} +} diff --git a/config/mail/etc/dovecot/conf.d/20-imap.conf b/config/mail/etc/dovecot/conf.d/20-imap.conf new file mode 100644 index 0000000..b7dd95d --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/20-imap.conf @@ -0,0 +1,75 @@ +## +## IMAP specific settings +## + +# If nothing happens for this long while client is IDLEing, move the connection +# to imap-hibernate process and close the old imap process. This saves memory, +# because connections use very little memory in imap-hibernate process. The +# downside is that recreating the imap process back uses some resources. +#imap_hibernate_timeout = 0 + +# Maximum IMAP command line length. Some clients generate very long command +# lines with huge mailboxes, so you may need to raise this if you get +# "Too long argument" or "IMAP command line too large" errors often. +#imap_max_line_length = 64k + +# IMAP logout format string: +# %i - total number of bytes read from client +# %o - total number of bytes sent to client +# %{fetch_hdr_count} - Number of mails with mail header data sent to client +# %{fetch_hdr_bytes} - Number of bytes with mail header data sent to client +# %{fetch_body_count} - Number of mails with mail body data sent to client +# %{fetch_body_bytes} - Number of bytes with mail body data sent to client +# %{deleted} - Number of mails where client added \Deleted flag +# %{expunged} - Number of mails that client expunged +# %{trashed} - Number of mails that client copied/moved to the +# special_use=\Trash mailbox. +#imap_logout_format = in=%i out=%o + +# Override the IMAP CAPABILITY response. If the value begins with '+', +# add the given capabilities on top of the defaults (e.g. +XFOO XBAR). +#imap_capability = + +# How long to wait between "OK Still here" notifications when client is +# IDLEing. +#imap_idle_notify_interval = 2 mins + +# ID field names and values to send to clients. Using * as the value makes +# Dovecot use the default value. The following fields have default values +# currently: name, version, os, os-version, support-url, support-email. +#imap_id_send = + +# ID fields sent by client to log. * means everything. +#imap_id_log = + +# Workarounds for various client bugs: +# delay-newmail: +# Send EXISTS/RECENT new mail notifications only when replying to NOOP +# and CHECK commands. Some clients ignore them otherwise, for example OSX +# Mail ( + #service_count = 1 + + # Number of processes to always keep waiting for more connections. + #process_min_avail = 0 + + # If you set service_count=0, you probably need to grow this. + #vsz_limit = 64M +#} + +#service managesieve { + # Max. number of ManageSieve processes (connections) + #process_limit = 1024 +#} + +# Service configuration + +protocol sieve { + # Maximum ManageSieve command line length in bytes. ManageSieve usually does + # not involve overly long command lines, so this setting will not normally + # need adjustment + #managesieve_max_line_length = 65536 + + # Maximum number of ManageSieve connections allowed for a user from each IP + # address. + # NOTE: The username is compared case-sensitively. + #mail_max_userip_connections = 10 + + # Space separated list of plugins to load (none known to be useful so far). + # Do NOT try to load IMAP plugins here. + #mail_plugins = + + # MANAGESIEVE logout format string: + # %i - total number of bytes read from client + # %o - total number of bytes sent to client + #managesieve_logout_format = bytes=%i/%o + + # To fool ManageSieve clients that are focused on CMU's timesieved you can + # specify the IMPLEMENTATION capability that Dovecot reports to clients. + # For example: 'Cyrus timsieved v2.2.13' + #managesieve_implementation_string = Dovecot Pigeonhole + + # Explicitly specify the SIEVE and NOTIFY capability reported by the server + # before login. If left unassigned these will be reported dynamically + # according to what the Sieve interpreter supports by default (after login + # this may differ depending on the user). + #managesieve_sieve_capability = + #managesieve_notify_capability = + + # The maximum number of compile errors that are returned to the client upon + # script upload or script verification. + #managesieve_max_compile_errors = 5 + + # Refer to 90-sieve.conf for script quota configuration and configuration of + # Sieve execution limits. +} diff --git a/config/mail/etc/dovecot/conf.d/20-pop3.conf b/config/mail/etc/dovecot/conf.d/20-pop3.conf new file mode 100644 index 0000000..e0ba552 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/20-pop3.conf @@ -0,0 +1,99 @@ +## +## POP3 specific settings +## + +# Don't try to set mails non-recent or seen with POP3 sessions. This is +# mostly intended to reduce disk I/O. With maildir it doesn't move files +# from new/ to cur/, with mbox it doesn't write Status-header. +#pop3_no_flag_updates = no + +# Support LAST command which exists in old POP3 specs, but has been removed +# from new ones. Some clients still wish to use this though. Enabling this +# makes RSET command clear all \Seen flags from messages. +#pop3_enable_last = no + +# If mail has X-UIDL header, use it as the mail's UIDL. +#pop3_reuse_xuidl = no + +# Allow only one POP3 session to run simultaneously for the same user. +#pop3_lock_session = no + +# POP3 requires message sizes to be listed as if they had CR+LF linefeeds. +# Many POP3 servers violate this by returning the sizes with LF linefeeds, +# because it's faster to get. When this setting is enabled, Dovecot still +# tries to do the right thing first, but if that requires opening the +# message, it fallbacks to the easier (but incorrect) size. +#pop3_fast_size_lookups = no + +# POP3 UIDL (unique mail identifier) format to use. You can use following +# variables, along with the variable modifiers described in +# doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase) +# +# %v - Mailbox's IMAP UIDVALIDITY +# %u - Mail's IMAP UID +# %m - MD5 sum of the mailbox headers in hex (mbox only) +# %f - filename (maildir only) +# %g - Mail's GUID +# +# If you want UIDL compatibility with other POP3 servers, use: +# UW's ipop3d : %08Xv%08Xu +# Courier : %f or %v-%u (both might be used simultaneosly) +# Cyrus (<= 2.1.3) : %u +# Cyrus (>= 2.1.4) : %v.%u +# Dovecot v0.99.x : %v.%u +# tpop3d : %Mf +# +# Note that Outlook 2003 seems to have problems with %v.%u format which was +# Dovecot's default, so if you're building a new server it would be a good +# idea to change this. %08Xu%08Xv should be pretty fail-safe. +# +#pop3_uidl_format = %08Xu%08Xv + +# Permanently save UIDLs sent to POP3 clients, so pop3_uidl_format changes +# won't change those UIDLs. Currently this works only with Maildir. +#pop3_save_uidl = no + +# What to do about duplicate UIDLs if they exist? +# allow: Show duplicates to clients. +# rename: Append a temporary -2, -3, etc. counter after the UIDL. +#pop3_uidl_duplicates = allow + +# This option changes POP3 behavior so that it's not possible to actually +# delete mails via POP3, only hide them from future POP3 sessions. The mails +# will still be counted towards user's quota until actually deleted via IMAP. +# Use e.g. "$POP3Deleted" as the value (it will be visible as IMAP keyword). +# Make sure you can legally archive mails before enabling this setting. +#pop3_deleted_flag = + +# POP3 logout format string: +# %i - total number of bytes read from client +# %o - total number of bytes sent to client +# %t - number of TOP commands +# %p - number of bytes sent to client as a result of TOP command +# %r - number of RETR commands +# %b - number of bytes sent to client as a result of RETR command +# %d - number of deleted messages +# %{deleted_bytes} - number of bytes in deleted messages +# %m - number of messages (before deletion) +# %s - mailbox size in bytes (before deletion) +# %u - old/new UIDL hash. may help finding out if UIDLs changed unexpectedly +#pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s + +# Workarounds for various client bugs: +# outlook-no-nuls: +# Outlook and Outlook Express hang if mails contain NUL characters. +# This setting replaces them with 0x80 character. +# oe-ns-eoh: +# Outlook Express and Netscape Mail breaks if end of headers-line is +# missing. This option simply sends it if it's missing. +# The list is space-separated. +#pop3_client_workarounds = + +protocol pop3 { + # Space separated list of plugins to load (default is global mail_plugins). + #mail_plugins = $mail_plugins + + # Maximum number of POP3 connections allowed for a user from each IP address. + # NOTE: The username is compared case-sensitively. + #mail_max_userip_connections = 10 +} diff --git a/config/mail/etc/dovecot/conf.d/90-acl.conf b/config/mail/etc/dovecot/conf.d/90-acl.conf new file mode 100644 index 0000000..f0c0e7a --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/90-acl.conf @@ -0,0 +1,19 @@ +## +## Mailbox access control lists. +## + +# vfile backend reads ACLs from "dovecot-acl" file from mail directory. +# You can also optionally give a global ACL directory path where ACLs are +# applied to all users' mailboxes. The global ACL directory contains +# one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter +# specifies how many seconds to wait between stat()ing dovecot-acl file +# to see if it changed. +plugin { + #acl = vfile:/etc/dovecot/global-acls:cache_secs=300 +} + +# To let users LIST mailboxes shared by other users, Dovecot needs a +# shared mailbox dictionary. For example: +plugin { + #acl_shared_dict = file:/var/lib/dovecot/shared-mailboxes +} diff --git a/config/mail/etc/dovecot/conf.d/90-plugin.conf b/config/mail/etc/dovecot/conf.d/90-plugin.conf new file mode 100644 index 0000000..8c8fccf --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/90-plugin.conf @@ -0,0 +1,11 @@ +## +## Plugin settings +## + +# All wanted plugins must be listed in mail_plugins setting before any of the +# settings take effect. See for list of plugins and +# their configuration. Note that %variable expansion is done for all values. + +plugin { + #setting_name = value +} diff --git a/config/mail/etc/dovecot/conf.d/90-quota.conf b/config/mail/etc/dovecot/conf.d/90-quota.conf new file mode 100644 index 0000000..db1f718 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/90-quota.conf @@ -0,0 +1,80 @@ +## +## Quota configuration. +## + +# Note that you also have to enable quota plugin in mail_plugins setting. +# + +## +## Quota limits +## + +# Quota limits are set using "quota_rule" parameters. To get per-user quota +# limits, you can set/override them by returning "quota_rule" extra field +# from userdb. It's also possible to give mailbox-specific limits, for example +# to give additional 100 MB when saving to Trash: + +plugin { + #quota_rule = *:storage=1G + #quota_rule2 = Trash:storage=+100M + + # LDA/LMTP allows saving the last mail to bring user from under quota to + # over quota, if the quota doesn't grow too high. Default is to allow as + # long as quota will stay under 10% above the limit. Also allowed e.g. 10M. + #quota_grace = 10%% +} + +## +## Quota warnings +## + +# You can execute a given command when user exceeds a specified quota limit. +# Each quota root has separate limits. Only the command for the first +# exceeded limit is excecuted, so put the highest limit first. +# The commands are executed via script service by connecting to the named +# UNIX socket (quota-warning below). +# Note that % needs to be escaped as %%, otherwise "% " expands to empty. + +plugin { + #quota_warning = storage=95%% quota-warning 95 %u + #quota_warning2 = storage=80%% quota-warning 80 %u +} + +# Example quota-warning service. The unix listener's permissions should be +# set in a way that mail processes can connect to it. Below example assumes +# that mail processes run as vmail user. If you use mode=0666, all system users +# can generate quota warnings to anyone. +#service quota-warning { +# executable = script /usr/local/bin/quota-warning.sh +# user = dovecot +# unix_listener quota-warning { +# user = vmail +# } +#} + +## +## Quota backends +## + +# Multiple backends are supported: +# dirsize: Find and sum all the files found from mail directory. +# Extremely SLOW with Maildir. It'll eat your CPU and disk I/O. +# dict: Keep quota stored in dictionary (eg. SQL) +# maildir: Maildir++ quota +# fs: Read-only support for filesystem quota + +plugin { + #quota = dirsize:User quota + #quota = maildir:User quota + #quota = dict:User quota::proxy::quota + #quota = fs:User quota +} + +# Multiple quota roots are also possible, for example this gives each user +# their own 100MB quota and one shared 1GB quota within the domain: +plugin { + #quota = dict:user::proxy::quota + #quota2 = dict:domain:%d:proxy::quota_domain + #quota_rule = *:storage=102400 + #quota2_rule = *:storage=1048576 +} diff --git a/config/mail/etc/dovecot/conf.d/90-sieve-extprograms.conf b/config/mail/etc/dovecot/conf.d/90-sieve-extprograms.conf new file mode 100644 index 0000000..17dcb77 --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/90-sieve-extprograms.conf @@ -0,0 +1,44 @@ +# Sieve Extprograms plugin configuration + +# Don't forget to add the sieve_extprograms plugin to the sieve_plugins setting. +# Also enable the extensions you need (one or more of vnd.dovecot.pipe, +# vnd.dovecot.filter and vnd.dovecot.execute) by adding these to the +# sieve_extensions or sieve_global_extensions settings. Restricting these +# extensions to a global context using sieve_global_extensions is recommended. + +plugin { + + # The directory where the program sockets are located for the + # vnd.dovecot.pipe, vnd.dovecot.filter and vnd.dovecot.execute extension + # respectively. The name of each unix socket contained in that directory + # directly maps to a program-name referenced from the Sieve script. + #sieve_pipe_socket_dir = sieve-pipe + #sieve_filter_socket_dir = sieve-filter + #sieve_execute_socket_dir = sieve-execute + + # The directory where the scripts are located for direct execution by the + # vnd.dovecot.pipe, vnd.dovecot.filter and vnd.dovecot.execute extension + # respectively. The name of each script contained in that directory + # directly maps to a program-name referenced from the Sieve script. + #sieve_pipe_bin_dir = /usr/lib/dovecot/sieve-pipe + #sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter + #sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute +} + +# An example program service called 'do-something' to pipe messages to +#service do-something { + # Define the executed script as parameter to the sieve service + #executable = script /usr/lib/dovecot/sieve-pipe/do-something.sh + + # Use some unprivileged user for executing the program + #user = dovenull + + # The unix socket located in the sieve_pipe_socket_dir (as defined in the + # plugin {} section above) + #unix_listener sieve-pipe/do-something { + # LDA/LMTP must have access + # user = vmail + # mode = 0600 + #} +#} + diff --git a/config/mail/etc/dovecot/conf.d/90-sieve.conf b/config/mail/etc/dovecot/conf.d/90-sieve.conf new file mode 100644 index 0000000..271063e --- /dev/null +++ b/config/mail/etc/dovecot/conf.d/90-sieve.conf @@ -0,0 +1,138 @@ +## +## Settings for the Sieve interpreter +## + +# Do not forget to enable the Sieve plugin in 15-lda.conf and 20-lmtp.conf +# by adding it to the respective mail_plugins= settings. + +# The Sieve interpreter can retrieve Sieve scripts from several types of +# locations. The default `file' location type is a local filesystem path +# pointing to a Sieve script file or a directory containing multiple Sieve +# script files. More complex setups can use other location types such as +# `ldap' or `dict' to fetch Sieve scripts from remote databases. +# +# All settings that specify the location of one ore more Sieve scripts accept +# the following syntax: +# +# location = [:]path[;