user4711/isbg

By user4711

Updated 6 days ago

This is a Docker Image for the Tool isbg

Image
Networking
2

10K+

user4711/isbg repository overview

This is a Docker Image for the Tool isbg

GitHub Repository

Generic badge Docker Image Size (tag)

Docker container that uses isbg and imapfilter to filter out spam from a remote IMAP server. The Docker Image is based on Debians slim Stable Image.

Configuration: There are 2 volumes, their content is initialized during container startup:

  • /var/lib/spamassassin/ : holds the SpamAssassin data files, to keep them between container resets.
  • /var/lib/mailaccounts : holds the IMAP accounts configuration.

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 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!

Dependencies:

Generic badge Generic badge Generic badge Generic badge Generic badge Generic badge Generic badge Generic badge

Configuration:

Each account config file must be a valid json file like the .example file located in /accounts/. The following configurations are supported:

VariableReq. / Opt.DefaultDescription
serverrequiredYour mail server address
usernamerequiredyour username for logging into your mailaccount
passwordrequiredyour password for logging in
spamHandlingoptionalyesThis Flag defines if the given spam filter should be used on the account, e.g. if only old mails should be deleted
isGmailoptionalnoGmail has a few unique ways that they interact with a mail client. isbg must be considered to be a client due to interacting with the Gmail servers over IMAP, and thus, should conform to these special requirements for proper integration.
spamSubjectoptionalMessages with this prefix will automatically sorted to spam without scoring them, useful if your mailbox provider is offering this feature
reportoptionalnoFlag whether or not the --noreport for isbg should be set or not. yes = Flag is not set, no (Default) = Flag is set
spamLifetimeoptionalDuration in days after which the spam-messages in your spambox should be automatically deleted
mailLifetimeoptionalDuration in days after which the INBOX-messages should be automatically deleted. USE THIS OPTION WITH CAUTION, YOUR MAILBOX WILL BE CLEARED!
folders.inboxrequiredName of your inbox folder / mailbox. You might want to run the container with LIST_FOLDERS set to either true or only first to identify this.
folders.spamrequiredName of your spam folder.
folders.hamoptionalHam folder where you can move wrong spam detections. Spamassassin will learn these in the next learning run as ham. Messages placed here will automatically be moved in your inbox after they have been learned.
folders.sentoptionalYour mailbox for sent messages. Spamassassin will use this folder to learn ham messages.

Variables:

The following Docker Environment Variables can be set:

VariableDefaultDescription
CRON_HOUR1hour for daily spam learning
CRON_MINUTE30minute for daily spam learning
TZUTCtime zone
USERNAMEdebian-spamdusername to run spammassin-daemon
HAM_BATCH_SIZE50max amount of ham messages to learn per learning run
SPAM_BATCH_SIZE50max amount of spam messages to learn per learning run
FILTER_BATCH_SIZE50max amount of messages to filter per run
MAX_MAIL_SIZE120000mails bigger than this size will be skipped by SA. (BYTES)
EXTRA_OPTIONS--nouser-configadditional options for spamasssassin
PYZOR_SITEpublic.pyzor.org:24441pyzor URI
DETAILED_LOGGINGfalseenables verbose logging of isbg/SA
LIST_FOLDERSfalsePrint list of mailboxes and folders on startup. Settings this to "only" will terminate the container after listing.
INTERVAL_MINUTES1Interval in minutes in which the spam search should be run

Custom SpamAssassin user preferences

SpamAssassin settings such as the required spam score or individual rule scores can be customized by using a user_prefs file.

This can be useful if you want to override SpamAssassin scoring settings without changing the default rule files provided by SpamAssassin or this project.

For example, your user_prefs file could contain settings like:

required_score 5.0
score BAYES_99 9.0

Your user_prefs file should be located in your mounted volume /var/lib/spamassassin/.

For a detailed explanation of available options, please refer to the official SpamAssassin configuration documentation:

https://spamassassin.apache.org/full/4.0.x/doc/Mail_SpamAssassin_Conf.html

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 or even a pull request in the GitHub Repository. If you want to support my work you can do this through my ko-fi page:

https://ko-fi.com/dumpname

License

GPLv3 license

Tag summary

Content type

Image

Digest

sha256:903c4dfef

Size

168.3 MB

Last updated

6 days ago

docker pull user4711/isbg