imapfilter hinzugefügt

This commit is contained in:
borgal
2022-10-26 16:01:00 +00:00
parent 1fff77ff62
commit ce2c9481a6
3 changed files with 67 additions and 0 deletions

18
imapfilter/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM alpine:edge
ENV IMAPFILTER_HOME=/volume/configuration
VOLUME ${IMAPFILTER_HOME}
WORKDIR ${IMAPFILTER_HOME}
RUN set -xe \
&& addgroup --gid 2000 app \
&& adduser --uid 2000 --disabled-password --no-create-home --ingroup app app
RUN set -xe \
&& apk update \
&& apk upgrade \
&& apk add --no-cache \
libcrypto3 libssl3 \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
imapfilter \
&& apk del --progress --purge \
&& rm -rf /var/cache/apk/*
USER app
ENTRYPOINT ["imapfilter"]

View File

@@ -0,0 +1,38 @@
---------------
-- Options --
---------------
options.timeout = 120
options.subscribe = true
options.limit = 50
----------------
-- Accounts --
----------------
account1 = IMAP {
server = 'imap.server.de',
username = 'ChangeMe',
password = 'ChangeMe',
ssl = 'ssl3',
}
-----------------
-- Mailboxes --
-----------------
check = account1.INBOX:check_status()
-- SPAM --
while true do
account1.INBOX:enter_idle()
results = account1.INBOX:contain_field('X-Spam-Status','Yes') +
account1.INBOX:contain_subject('Betreff Inhalt 1') +
account1.INBOX:contain_subject('Betreff Inhalt 2') +
account1.INBOX:contain_message('Text Inhalt 1') +
account1.INBOX:contain_message('Text Inhalt 2')
results:move_messages(account1['Spam'],results)
end

View File

@@ -0,0 +1,11 @@
version: "2"
services:
imapfilter:
build: .
container_name: imapfilter
volumes:
- ./:/volume/configuration
- ./config.lua:/volume/configuration/config.lua:ro
labels:
com.centurylinklabs.watchtower.enable: "false"
restart: always