imap-spam-cleaner
A tool which can cleanup spam from your imap inbox
810
A tool to clean up spam in your imap inbox.
This application loads mails from configured imap inboxes and checks their contents using the defined provider. Depending on a spam score, the message can be moved to the spam folder, keeping your inbox clean.
config.yml matching your inboxes (example below)docker-compose.yml if using docker compose (example below)docker compose up -ddocker run -d --name imap-spam-cleaner -v ./config.yml:/app/config.yml dominicgisler/imap-spam-cleanerservices:
imap-spam-cleaner:
image: dominicgisler/imap-spam-cleaner:latest
container_name: imap-spam-cleaner
hostname: imap-spam-cleaner
restart: always
volumes:
- ./config.yml:/app/config.yml:ro
Use this configuration as an example for your own setup. Save the file as config.yml on your disk and mount the correct path into the docker container.
logging:
level: debug # logging level (panic, fatal, error, warn, info, debug, trace)
providers: # providers to be used for inboxes
prov1: # provider name
type: openai # provider type
config: # provider specific configuration
apikey: some-api-key # openai apikey
model: gpt-4o-mini # openai model to use
maxsize: 100000 # message size limit for prompt (bytes)
prov2: # provider name
type: ollama # provider type
config: # provider specific configuration
url: http://127.0.0.1:11434 # ollama url
model: gpt-oss:20b # ollama model to use
maxsize: 100000 # message size limit for prompt (bytes)
prov3: # provider name
type: spamassassin # provider type
config: # provider specific configuration
host: 127.0.0.1 # spamassassin host
port: 783 # spamassassin port
maxsize: 300000 # message size limit
inboxes: # inboxes to be checked
- schedule: "* * * * *" # schedule in cron format (when to execute spam analysis)
host: mail.domain.tld # imap host
port: 143 # imap port
tls: false # imap tls
username: [email protected] # imap user
password: mypass # imap password
provider: prov1 # provider used for spam analysis
inbox: INBOX # inbox folder
spam: INBOX.Spam # spam folder
minscore: 75 # min score to detect spam (0-100)
minage: 0h # min age of message
maxage: 24h # max age of message
Content type
Image
Digest
sha256:44f29fe45…
Size
11.9 MB
Last updated
4 days ago
Requires Docker Desktop 4.37.1 or later.