Skip to content
Merged

v1.1 #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: DumpName
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
EXTRA_OPTIONS=--nouser-config \
PYZOR_SITE=public.pyzor.org:24441 \
DETAILED_LOGGING="false" \
LIST_FOLDERS="false"
LIST_FOLDERS="false" \
INTERVAL_MINUTES=1

#Set Versions of used Software
ARG SPAMC_VERSION=4.0.0-6
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Configuration: There are 2 volumes, their content is initialized during containe

To configure your IMAP accounts, create a new .conf file in the `/var/lib/mailaccounts` volume for each IMAP account that you want to be filtered. The files are JSON files, see the example below to learn about mandatory and optional parameters.

The container runs a learning process on startup, so do not leave a configuration with a huge email directory active if you want the container to start in a reasonnable time.
The container runs a learning process on startup, so do not leave a configuration with a huge email directory active if you want the container to start in a reasonable time.

**Note: As this image needs to store your _password in cleartext_ you should only use it in an environment that you fully trust!** Be aware of the risk that this involves!

Expand Down Expand Up @@ -62,7 +62,7 @@ The following Docker Environment Variables can be set:
| CRON_HOUR | 1 | hour for daily spam learning |
| CRON_MINUTE | 30 | minute for daily spam learning |
| TZ | UTC | time zone |
| USERNAME | debian-spamd | username to run spammassin-deamon |
| USERNAME | debian-spamd | username to run spammassin-daemon |
| HAM_BATCH_SIZE | 50 | max amount of ham messages to learn per learning run |
| SPAM_BATCH_SIZE | 50 | max amount of spam messages to learn per learning run |
| FILTER_BATCH_SIZE | 50 | max amount of messages to filter per run |
Expand All @@ -71,5 +71,15 @@ The following Docker Environment Variables can be set:
| PYZOR_SITE | public.pyzor.org:24441 | pyzor URI |
| DETAILED_LOGGING | false | enables verbose logging of isbg/SA |
| LIST_FOLDERS | false | Print list of mailboxes and folders on startup. Settings this to "only" will terminate the container after listing. |
| INTERVAL_MINUTES | 1 | Interval in minutes in which the spam search should be run |

## Support

Docker-ISBG is a free docker image powered by other open source. I am not able to provide full support, however if you find any bugs or if you need a new feature you can create an issue.
If you want to support my work you can do this through my ko-fi page:

https://ko-fi.com/dumpname

## License

[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge)](http://perso.crans.org/besson/LICENSE.html)
4 changes: 3 additions & 1 deletion scripts/startup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

intervalSeconds=$(( INTERVAL_MINUTES * 60 ))

mkdir /root/currentState
source /usr/local/pythonVenv/bin/activate
if [ ! -f /root/currentState/startupDone ]; then
Expand Down Expand Up @@ -69,7 +71,7 @@ function main {
learnSpam
fi
findSpam
sleep $(( 60 - 10#$(date +%S) ))
sleep $(( intervalSeconds - 10#$(date +%S) ))
done
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ if [[ $(date +%s) -gt $nextScheduledLearn ]]; then
exit 1
fi

nextScheduledSearch=$(($(date -r /root/currentState/spamSearched +%s) + 60*3 ))
nextScheduledSearch=$(($(date -r /root/currentState/spamSearched +%s) + 60*3*INTERVAL_MINUTES ))
if [[ $(date +%s) -gt nextScheduledSearch ]]; then
if [[ $DETAILED_LOGGING == "true" ]]; then
>&2 echo "HELTHCHECK: No spam search in last 3 minutes"
>&2 echo "HELTHCHECK: No spam search in last $(( 3 * INTERVAL_MINUTES )) minutes"
fi
exit 1
fi
Expand Down
Loading