Got message filtering working.
FossilOrigin-Name: 47c9a66b9c547f9af30bebd226b757d475f616b976baf315faae653a01cdf97a
This commit is contained in:
parent
312de83456
commit
105b21d9f7
4 changed files with 105 additions and 37 deletions
22
src/sieb.nim
22
src/sieb.nim
|
|
@ -1,14 +1,16 @@
|
|||
# vim: set et nosta sw=4 ts=4 :
|
||||
|
||||
import
|
||||
std/os
|
||||
std/os,
|
||||
std/strformat
|
||||
|
||||
import
|
||||
lib/config,
|
||||
lib/maildir,
|
||||
lib/message,
|
||||
lib/util
|
||||
|
||||
|
||||
# Without this, we got nuthin'!
|
||||
if not existsEnv( "HOME" ):
|
||||
deferral "Unable to determine HOME from environment."
|
||||
|
||||
|
|
@ -16,13 +18,13 @@ let
|
|||
home = getHomeDir()
|
||||
opts = parse_cmdline()
|
||||
conf = get_config( opts.config )
|
||||
default = newMaildir( home & "Maildir" )
|
||||
|
||||
let dest = default.subDir( ".wooo" )
|
||||
|
||||
let msg = default.newMessage
|
||||
msg.writeStdin()
|
||||
# msg.filter()
|
||||
msg.save( dest )
|
||||
default = newMaildir( joinPath( home, "Maildir" ) )
|
||||
|
||||
# let dest = default.subDir( "woo" )
|
||||
var msg = default.newMessage
|
||||
msg.writeStdin
|
||||
for filter in conf.pre_filter:
|
||||
debug "Running pre-filter: {filter}".fmt
|
||||
msg = msg.filter( filter )
|
||||
msg.save()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue