Skip to content

Uses IMAP to monitors mail folders for changes and acts on mail it finds in the folder.

License

Notifications You must be signed in to change notification settings

oposs/unspammer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unspammer the IMAP robot

Unspammer watches IMAP folders of your choice and acts on mail arriving in these folders.

Unspammer can do the following:

  • remove SpamAssassin headers from mail, accidentally tagged as spam
  • forward mail to another address
  • add a running counter to the subject of the mail to act as a ticket number

Unspammer is written on golang. It can act on multiple IMAP accounts in parallel.

If you have complex configuration needs, you can use jsonnet for configuration.

Installation

To install unspammer as a service, run unspammer -config path/to/config.yaml -service install

Sample Config File

Config formats supported: yaml, json and jsonnet

imapAccounts:
  support:
    username: "tobi@xxx.ch"
    password: "asdfasdf"
    server: "aaa.xxx.ch:993"

smtpAccounts:
  smtp:
    server: "bbb.xxx.ch:25"

tasks:
  unspam:
    imapAccount: support
    smtpAccount: smtp
    watchFolder: INBOX/DeSpamMe
    # we only act on SpamAssassin detected spam
    selectMessage: spam
    # remove SpamAssassin Headers
    editCopy: un-spam
    # save copy into folder UnSpammed
    storeCopyIn: INBOX/UnSpammed
    # delete original message
    deleteMessage: true
  minrt:
    imapAccount: support
    smtpAccount: smtp
    watchFolder: INBOX/UnSpammed
    # we only act on non-spam
    selectMessage: ham
    # we add a running counter to the subject
    editCopy: rt-tag
    # forward the mail
    forwardCopiesTo:
      - somewhere@other.xxx
    # remove the original
    deleteMessage: true
  forward:
    imapAccount: support
    smtpAccount: smtp
    watchFolder: Inbox
    # we only act on non-spam
    selectMessage: ham
    # no message editing
    editCopy: no
    # forward the mail
    forwardCopiesTo:
      - rt@cloud-mail.oetiker.ch    
    # remove the original
    deleteMessage: true