2023-06-15 17:58:22 +00:00
|
|
|
# vim: set et nosta sw=4 ts=4 :
|
|
|
|
|
|
|
|
|
|
import
|
2023-06-20 11:26:41 +00:00
|
|
|
std/os,
|
|
|
|
|
std/strformat
|
2023-06-18 02:37:25 +00:00
|
|
|
|
|
|
|
|
import
|
|
|
|
|
lib/config,
|
2023-06-20 11:26:41 +00:00
|
|
|
lib/message,
|
2023-06-18 02:37:25 +00:00
|
|
|
lib/util
|
2023-06-15 17:58:22 +00:00
|
|
|
|
|
|
|
|
|
2023-06-20 11:26:41 +00:00
|
|
|
# Without this, we got nuthin'!
|
2023-06-18 02:37:25 +00:00
|
|
|
if not existsEnv( "HOME" ):
|
|
|
|
|
deferral "Unable to determine HOME from environment."
|
2023-06-15 17:58:22 +00:00
|
|
|
|
2023-06-18 02:37:25 +00:00
|
|
|
let
|
|
|
|
|
home = getHomeDir()
|
|
|
|
|
opts = parse_cmdline()
|
|
|
|
|
conf = get_config( opts.config )
|
2023-06-20 11:26:41 +00:00
|
|
|
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()
|
2023-06-15 17:58:22 +00:00
|
|
|
|