From 7b5c1abf0bac5147efa468f50a384310b4376a7e Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 9 Nov 2018 16:18:11 +0000 Subject: feature parity! --- bayes | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bayes') diff --git a/bayes b/bayes index 0843976..e3814fc 100644 --- a/bayes +++ b/bayes @@ -3,6 +3,7 @@ use v6.d.PREVIEW; use lib 'lib'; use MaildirIndexer::ScanDir; use MaildirIndexer::Store; +use MaildirIndexer::Parser; sub MAIN($maildir) { my $store = MaildirIndexer::Store.new; @@ -23,10 +24,24 @@ sub MAIN($maildir) { } } + my $listener = IO::Socket::Async.listen( + '127.0.0.1', + 9000, + :enc, + ); + react { whenever signal(SIGINT) { exit } whenever signal(SIGHUP) { $store.dump(); } + whenever $listener -> $conn { + LEAVE { $conn.close } + with parse-email($conn) -> $email { + with $store.mailbox-for-email($email) -> $mailbox { + await $conn.print("$mailbox\x0d\x0a"); + } + } + } } } -- cgit v1.2.3