carlostrub / sisyphus Goto Github PK
View Code? Open in Web Editor NEWIntelligent Junk Mail Handler
License: BSD 3-Clause "New" or "Revised" License
Intelligent Junk Mail Handler
License: BSD 3-Clause "New" or "Revised" License
./sisyphus i
INFO[0000] Create missing directories dir=/home/admin/Maildir/
INFO[0000] All databases loaded
INFO[0000] Database closed maildir=/home/admin/Maildir/
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x4e1847]
goroutine 1 [running]:
github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt.(*Bucket).Cursor(...)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt/bucket.go:91
github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt.(*Bucket).Get(0x0, 0xc42003b798, 0xd, 0x20, 0xd, 0x20, 0xc42001c000)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt/bucket.go:267 +0x37
github.com/carlostrub/sisyphus.Info.func1(0xc4200f2000, 0x73ab90, 0xc4200f2000)
/home/cs/go/src/github.com/carlostrub/sisyphus/info.go:13 +0xf8
github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt.(*DB).View(0xc4200ec000, 0xc42003b890, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt/db.go:629 +0x9a
github.com/carlostrub/sisyphus.Info(0xc4200ec000, 0x0, 0x0, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/info.go:11 +0x83
main.main.func3(0xc420070580)
/home/cs/go/src/github.com/carlostrub/sisyphus/sisyphus/sisyphus.go:242 +0x1c4
github.com/carlostrub/sisyphus/vendor/github.com/urfave/cli.HandleAction(0x6c8120, 0xc42000a3a0, 0xc420070580, 0xc420052300, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/urfave/cli/app.go:492 +0x7c
github.com/carlostrub/sisyphus/vendor/github.com/urfave/cli.Command.Run(0x727f82, 0x5, 0x0, 0x0, 0xc4200447d0, 0x1, 0x1, 0x72d83d, 0xf, 0x0, ...)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/urfave/cli/command.go:210 +0xa95
github.com/carlostrub/sisyphus/vendor/github.com/urfave/cli.(*App).Run(0xc4200664e0, 0xc42000a080, 0x2, 0x2, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/urfave/cli/app.go:255 +0x6f8
main.main()
/home/cs/go/src/github.com/carlostrub/sisyphus/sisyphus/sisyphus.go:254 +0x62e
and again:
INFO[0008] All mails learned
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4e7989]
goroutine 7 [running]:
github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt.(*DB).beginTx(0x0, 0x0, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt/db.go:470 +0x29
github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt.(*DB).Begin(0x0, 0xc42005d500, 0x0, 0x0, 0x1)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt/db.go:463 +0x6e
github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt.(*DB).View(0x0, 0xc420105be0, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/vendor/github.com/boltdb/bolt/db.go:613 +0x46
github.com/carlostrub/sisyphus.classificationStatistics(0x0, 0x0, 0x0, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/classify.go:64 +0x84
github.com/carlostrub/sisyphus.classificationPrior(0x0, 0x0, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/classify.go:18 +0x2b
github.com/carlostrub/sisyphus.classificationWord(0x0, 0xc4200f687e, 0x4, 0x20, 0x0, 0x0)
/home/cs/go/src/github.com/carlostrub/sisyphus/classify.go:128 +0x2f
github.com/carlostrub/sisyphus.Junk(0x0, 0xc4201ea400, 0x1f, 0x20, 0x0, 0x0, 0x3f, 0x13)
/home/cs/go/src/github.com/carlostrub/sisyphus/classify.go:202 +0xbc
github.com/carlostrub/sisyphus.(*Mail).Classify(0xc420105f10, 0x0, 0xc420050000, 0x13, 0x8f60c0, 0x2)
/home/cs/go/src/github.com/carlostrub/sisyphus/classify.go:161 +0xa9
main.main.func2.2(0xc42006a690, 0xc420044860, 0xc420060fc0)
/home/cs/go/src/github.com/carlostrub/sisyphus/sisyphus/sisyphus.go:189 +0x277
created by main.main.func2
/home/cs/go/src/github.com/carlostrub/sisyphus/sisyphus/sisyphus.go:179 +0x2a6
Make it part of the package rather the binary.
Glide is obsolete. Switch to dep.
On my mail server, i don't store spams in .Junks but in .Spam , i created a symlink but it would be better to add a way to tell sisyphus where to find spams.
Put changelog into the distribution in the future
I'm hesitant of trying sisyphus because afaik it potentially moves messaged on the first run.
It would be great to that a --noop
flag (or sth similar) to see what it would do instead of actually doing.
Implement logging with sirupsen/logrus and --verbose and --debug flags to adjust log level.
Instead of setting a hard limit of words to analyze, select a random number of words for analysis, but learn all.
Handle file paths cleaner. See comment from Reddit.
Hi and thanks for this great project! I have used it for about 3 weeks now and it already works better than my previous solution.
What do you think about adding an option to add more mailboxes to learn from? I am trying to keep my inbox tidy. This means I only keep mails I have to catch up on in my inbox. Other things go to the .Archive
folder as soon as I have read them. This means Sisyphus cannot learn from these archived mails, unless I keep them in the inbox until Sisyphus had the chance to learn it.
The folder structure looks (simplified) like this:
|- cur
|- new
|- .Archive
|- cur
|- new
So what Sisyphus should do is to learn from either all of the cur
folders in the mailbox directory (except ./.Junk/cur
). Or better, accept an option to configure which ones.
Like this I could keep my workflow and additionally Sisyphus could learn from all my 20'000 e-mails in the archive.
It would be good if a user can get help right away, before setting required env vars. Warn instead of bailing out ?
» sisyphus --help
FATA[0000] Environment variable SISYPHUS_DIRS not set.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.