diff --git a/Bastillefile b/Bastillefile index f3407cc..f47b0f1 100644 --- a/Bastillefile +++ b/Bastillefile @@ -7,6 +7,7 @@ MOUNT /usr/local/etc/letsencrypt /usr/local/etc/letsencrypt nullfs ro 0 0 OVERLAY usr OVERLAY etc PKG postfix dovecot dovecot-pigeonhole spamassassin spamass-milter opendkim opendmarc +SYSRC hostname="lyrion.ch" SYSRC cron_flags="-J 60" SYSRC postfix_enable="YES" SYSRC spamd_enable="YES" @@ -24,3 +25,10 @@ SYSRC opendmarc_socketspec="local:/var/spool/postfix/private/opendmarc" SYSRC opendmarc_runas="postfix:mailnull" CMD rm -rf /usr/local/etc/ssl CMD ln -s /usr/local/etc/letsencrypt/live/lyrion.ch /usr/local/etc/ssl +CMD chmod -R 777 /var/log +CMD postalias /etc/aliases +SERVICE sa-spamd start +SERVICE opendmarc start +SERVICE milter-opendkim start +SERVICE postfix start +SERVICE dovecot start diff --git a/etc/internalhosts b/etc/internalhosts new file mode 100644 index 0000000..7bd95ab --- /dev/null +++ b/etc/internalhosts @@ -0,0 +1,6 @@ +127.0.0.1 +10.0.0.5 +localhost +lyrion.ch +mail.lyrion.ch +202.61.204.114 diff --git a/usr/local/lib/dovecot/sieve/report-ham.sieve b/usr/local/lib/dovecot/sieve/report-ham.sieve new file mode 100644 index 0000000..a6628cf --- /dev/null +++ b/usr/local/lib/dovecot/sieve/report-ham.sieve @@ -0,0 +1,15 @@ +require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; + +if environment :matches "imap.mailbox" "*" { + set "mailbox" ""; +} + +if string "" "Trash" { + stop; +} + +if environment :matches "imap.user" "*" { + set "username" ""; +} + +pipe :copy "sa-learn-ham.sh" [ "" ]; diff --git a/usr/local/lib/dovecot/sieve/report-spam.sieve b/usr/local/lib/dovecot/sieve/report-spam.sieve new file mode 100644 index 0000000..e122f2a --- /dev/null +++ b/usr/local/lib/dovecot/sieve/report-spam.sieve @@ -0,0 +1,7 @@ +require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; + +if environment :matches "imap.user" "*" { + set "username" ""; +} + +pipe :copy "sa-learn-spam.sh" [ "" ]; diff --git a/usr/local/lib/dovecot/sieve/sa-learn-ham.sh b/usr/local/lib/dovecot/sieve/sa-learn-ham.sh new file mode 100755 index 0000000..7f00261 --- /dev/null +++ b/usr/local/lib/dovecot/sieve/sa-learn-ham.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# you can also use tcp/ip here, consult spamc(1) +exec /usr/local/bin/spamc -u -L ham diff --git a/usr/local/lib/dovecot/sieve/sa-learn-spam.sh b/usr/local/lib/dovecot/sieve/sa-learn-spam.sh new file mode 100755 index 0000000..bae6ee5 --- /dev/null +++ b/usr/local/lib/dovecot/sieve/sa-learn-spam.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# you can also use tcp/ip here, consult spamc(1) +exec /usr/local/bin/spamc -u -L spam