summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--CHANGES161
-rw-r--r--MANIFEST1
-rw-r--r--Makefile.PL12
-rw-r--r--README.md158
-rw-r--r--lang/de.lang4
-rw-r--r--lang/en.lang2
-rw-r--r--t/Extract.t84
8 files changed, 266 insertions, 163 deletions
diff --git a/.gitignore b/.gitignore
index 39b5f0d..154a85b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
log/*
MYMETA.*
-msg*.json
Makefile
-*.tar.gz \ No newline at end of file
+*.tar.gz
+*.old
+.vscode/*
+t/private
+extract/target
diff --git a/CHANGES b/CHANGES
new file mode 100644
index 0000000..28ee9f6
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,161 @@
+Past and Upcoming Changes
+=========================
+
+v1.0.0 release plan
+-------------------
+✓ consider renaming, relicensing
+ ✓ License
+ ✓ GPLv3+ and enter copyright info
+ * Maybe the translation/documentation can be made available under a different license
+ * may relicense this under the AGPL.
+ ✓ Rename
+ ✓ JWebmail
+✓ make github ready
+ ✓ remove sensitive files (gitignore)
+ ✓ add git vcs
+ ✓ remove part of the english translation
+* check legal requirements
+✓ BUG: home not displaying
+✓ show new messages per folder
+✓ BUG: empty folder not displaying correctly
+✓ better documentation
+ ✓ document i18n snippets
+ ✓ cleanup comments
+ ✓ list functionality for ReadMails#communicate
+ ✓ OMail
+ ✓ OMail::Helper
+ ✓ OMail::Controller::All
+ ✓ OMail::Plugin::I18N
+ ✓ OMail::Plugin::INIConfig
+ ✓ OMail::Plugin::ServerSideSessionData
+ ✓ OMail::Model::WriteMails
+ ✓ OMail::Model::ReadMails
+ ✓ OMail::Model::Driver::QMailAuthuser
+ ✓ OMail::Model::Driver::QMailAuthuser::Extract
+✓ better pagination
+ ✓ BUG: pagination forward -> backward is shifting by 1 (page start needs to be decremented)
+ ✓ move out to helper
+ ✓ more generic names
+✓ advance ini config plugin
+ ✓ set global section to global scope
+ ✓ introduce arrays
+ ✓ make nesting sections more explicit
+✓ write more tests
+ ✓ test pagination
+ ✓ test mail_line
+ ✓ test for ini parser
+ ✓ basic test for application
+✓ improve i18n
+ ✓ german translation
+ ✓ look into i18n configuration
+ ✓ remove TXT alias
+✓ more configuration (for model)
+ ✓ disable cram
+ ✓ select mock read model
+ ✓ lazy init for mock model
+ ✓ add switch disabling message send
+ ✓ Extract: user to switch to
+ ✓ Extract: adjustable maildir directory
+✓ read secret from config file
+✓ Extract: configurable perl lib
+✓ Extract: encoding issues
+✓ improve session data security
+ ✓ use a server side cookie implementation
+ ✓ use a one time pad
+ ✓ resolve server/client session duration issues
+ ✓ use cryptographically secure random data
+ ✓ hide password length
+✓ handle empty folders
+✓ logging support for Extract.pm
+✓ true perl 5.16 support
+✓ cpan build and deploy script
+✓ remove prefs
+✓ file upload for attachment
+ ✓ file type detection
+ ✓ move WriteMails from Email::Simple to Email::MIME
+✓ configuration as plugin (Mojo::Plugin::Config)
+✓ model as helpers, initialized in startup
+✓ send
+ ✓ multiple mails for cc etc.
+ * content-transfer encoding, research (currently 8bit)
+✓ better design for send and read
+ ✓ send
+ ✓ read
+✓ sandbox html mails
+✓ i18n as ini files
+✓ rework mail folders
+✓ rewrite about
+✓ search in subject
+
+
+v1.1.0 release plan
+-------------------
+* INV: wrong subject being shown
+* INV: new mails are not highlighted
+✓ better back buttons
+ ✓ writemail
+ ✓ read mail
+✓ improve server side session cleanup process coordination
+✓ consider using Crypt::URandom instead of Crypt::Random
+✓ factor out date format function
+✓ add a delete session function for s3d, maybe
+ ✓ simply remove key from cookie
+* separate development and production configuration
+* create base configuration
+* repurpose status field in displayheader
+ ✓ currently just renamed
+* improve performance
+ * async read for extract
+ ✓ async version of driver
+ ✓ async version of model
+ * async version of controller
+ * async wait for send
+ * add wait_for_child to event loop
+* consider using more mojo functions
+ ✓ use Mojolicious::Types to replace File::Type
+ ✓ Helper
+ * QMailAuthuser
+* moving mails to other folders
+ * creating new folders
+ * backend
+* add more mime types
+ * jpeg
+ * png
+ * giv
+
+
+v1.2.0 release plan
+-------------------
+* advance ini config plugin
+ * allow non-leaf nodes to be arrays
+ * allow quotes
+ * allow continuation over multiple lines
+ * warn about overrides
+ * add template support, maybe
+* improve i18n
+ * add localization of dates and time
+* better pagination
+ * merge with partial templates, maybe
+* improve performance, consider alternatives to Extract.pm
+ * based on Maildir::Light
+* add config validation
+* click on sender to answer
+* mobile optimize
+* download mail and attachments
+* cleanup css
+* allow multiple attachments
+* consider using more mojo functions
+ * base64
+ * encoding
+ * json
+ * filepaths
+ * dump
+ * mail?
+* add mails to Sent folder
+
+
+v1.3.0 release plan
+-------------------
+* smtp send model, maybe
+* pop read model, maybe
+* add icons for navigation
diff --git a/MANIFEST b/MANIFEST
index 826af1e..e13ab59 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -9,6 +9,7 @@ lib/JWebmail/Model/WriteMails.pm
lib/JWebmail/Plugin/Helper.pm
lib/JWebmail/Plugin/INIConfig.pm
lib/JWebmail/Plugin/I18N.pm
+lib/JWebmail/Plugin/I18N2.pm
lib/JWebmail/Plugin/ServerSideSessionData.pm
README
LICENSE
diff --git a/Makefile.PL b/Makefile.PL
index ea55cd8..3633f63 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,16 +5,16 @@ use ExtUtils::MakeMaker;
WriteMakefile(
AUTHOR => '"Jannis M. Hoffmann" <jannis@fehcom.de>',
- MIN_PERL_VERSION => 'v5.18',
+ MIN_PERL_VERSION => 'v5.22',
NAME => 'JWebmail',
VERSION_FROM => 'lib/JWebmail.pm',
LICENSE => 'GPL',
PREREQ_PM => {
- 'Mojolicious' => '8.57',
- 'File::Type' => 0,
+ 'Mojolicious' => '8.64',
+ 'Config::Tiny' => 'v2.24',
+ 'Crypt::URandom' => 0,
'Email::MIME' => 0,
- 'Config::Tiny' => 0,
- 'Mail::Box::Manager' => 0,
+ 'Mail::Box::Manager' => 'v3.9',
},
test => {TESTS => 't/*.t'}
-); \ No newline at end of file
+);
diff --git a/README.md b/README.md
index b4b5037..8b7fdbd 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@ This is a rewrite of oMail by Oliver Müller <om@omnis.ch>.
oMail has not seen much progress in the last two decades
so my <jannis@fehcom.de> goal is to bring it up to date.
+OMail was tied to qmail. JWebmail is not so tightly bound.
## This includes:
- Using a perl web framework and leave the deprecated CGI behind.
@@ -36,154 +37,6 @@ an external web server.
- [ ] add links on email addresses in header : click = add into addressbook
-v1.0.0 release plan
--------------------
-✓ consider renaming, relicensing
- ✓ License
- ✓ GPLv3+ and enter copyright info
- * Maybe the translation/documentation can be made available under a different
- * may relicense this under the AGPL.
- ✓ Rename
- ✓ JWebmail
-✓ make github ready
- ✓ remove sensitive files (gitignore)
- ✓ add git vcs
- ✓ remove part of the english translation
-* check legal requirements
-✓ BUG: home not displaying
-✓ show new messages per folder
-✓ BUG: empty folder not displaying correctly
-✓ better documentation
- ✓ document i18n snippets
- ✓ cleanup comments
- ✓ list functionality for ReadMails#communicate
- ✓ OMail
- ✓ OMail::Helper
- ✓ OMail::Controller::All
- ✓ OMail::Plugin::I18N
- ✓ OMail::Plugin::INIConfig
- ✓ OMail::Plugin::ServerSideSessionData
- ✓ OMail::Model::WriteMails
- ✓ OMail::Model::ReadMails
- ✓ OMail::Model::Driver::QMailAuthuser
- ✓ OMail::Model::Driver::QMailAuthuser::Extract
-✓ better pagination
- ✓ BUG: pagination forward -> backward is shifting by 1 (page start needs to be decremented)
- ✓ move out to helper
- ✓ more generic names
-✓ advance ini config plugin
- ✓ set global section to global scope
- ✓ introduce arrays
- ✓ make nesting sections more explicit
-✓ write more tests
- ✓ test pagination
- ✓ test mail_line
- ✓ test for ini parser
- ✓ basic test for application
-✓ improve i18n
- ✓ german translation
- ✓ look into i18n configuration
- ✓ remove TXT alias
-✓ more configuration (for model)
- ✓ disable cram
- ✓ select mock read model
- ✓ lazy init for mock model
- ✓ add switch disabling message send
- ✓ Extract: user to switch to
- ✓ Extract: adjustable maildir directory
-✓ read secret from config file
-✓ Extract: configurable perl lib
-✓ Extract: encoding issues
-✓ improve session data security
- ✓ use a server side cookie implementation
- ✓ use a one time pad
- ✓ resolve server/client session duration issues
- ✓ use cryptographically secure random data
- ✓ hide password length
-✓ handle empty folders
-✓ logging support for Extract.pm
-✓ true perl 5.16 support
-✓ cpan build and deploy script
-✓ remove prefs
-✓ file upload for attachment
- ✓ file type detection
- ✓ move WriteMails from Email::Simple to Email::MIME
-✓ configuration as plugin (Mojo::Plugin::Config)
-✓ model as helpers, initialized in startup
-✓ send
- ✓ multiple mails for cc etc.
- * content-transfer encoding, research (currently 8bit)
-✓ better design for send and read
- ✓ send
- ✓ read
-✓ sandbox html mails
-✓ i18n as ini files
-✓ rework mail folders
-✓ rewrite about
-✓ search in subject
-
-
-v1.1.0 release plan
--------------------
-* INV: wrong subject being shown
-* INV: new mails are not highlighted
-* separate development and production configuration
-* create base configuration
-* improve server side session cleanup process coordination
-* add a delete session function for s3d, maybe
-* repurpose status field in displayheader
-* improve performance
- * async read for extract
- * async wait for send
-* consider using Crypt::URandom instead of Crypt::Random
-* consider using more mojo functions
- * use Mojolicious::Types to replace File::Type
-* moving mails to other folders
- * creating new folders
- * backend
-* add more mime types
- * jpeg
- * png
- * giv
-
-
-v1.2.0 release plan
--------------------
-* advance ini config plugin
- * allow non-leaf nodes to be arrays
- * allow quotes
- * allow continuation over multiple lines
- * warn about overrides
- * add template support, maybe
-* improve i18n
- * add localization of dates and time
-* better pagination
- * merge with partial templates, maybe
-* improve performance, consider alternatives to Extract.pm
- * based on Maildir::Light
-* add config validation
-* click on sender to answer
-* mobile optimize
-* download mail and attachments
-* cleanup css
-* allow multiple attachments
-* consider using more mojo functions
- * base64
- * encoding
- * json
- * filepaths
- * dump
- * mail?
-* add mails to Sent folder
-
-
-v1.3.0 release plan
--------------------
-* smtp send model, maybe
-* pop read model, maybe
-* add icons for navigation
-
-
Posts
-----
* Complain about IPC::Open2 ignoring 'open' pragma
@@ -222,6 +75,9 @@ route that has the language as parameter. But omitting the language leads to pro
One can use a redirect on root. Very easy but also not very effective.
+I am now using a global route containing the language after the changes to
+matching have been published. No need to monkey_patch and it works well enough.
+
Concepts
--------
@@ -247,9 +103,7 @@ Dependencies
- M & V
- Mojolicious
- Config::Tiny
- - Digest::HMAC_MD5 (optional)
- - File::Type
- - Crypt::Random
+ - Crypt::URandom
- C
- Mail::Box::Manager
- - Email::MIME \ No newline at end of file
+ - Email::MIME
diff --git a/lang/de.lang b/lang/de.lang
index 88ac8b4..7aaf598 100644
--- a/lang/de.lang
+++ b/lang/de.lang
@@ -19,7 +19,7 @@ content = inhalt
check_all = alle markieren
move = verschieben
nr = nummer
-status = status
+status = mehrteilig
logout = abmelden
compose = schreiben
search = suche
@@ -48,4 +48,4 @@ no_folder = Dieses Verzeichnis gibt es nicht.
error_send = Die Nachricht konnte nicht gesendet werden.
succ_send = Die Nachricht wurde verschikt.
succ_move = Nachrichten wurden verschoben.
-empty_folder = Dies Verzeichnis ist leer. \ No newline at end of file
+empty_folder = Dies Verzeichnis ist leer.
diff --git a/lang/en.lang b/lang/en.lang
index aef8649..6e3d447 100644
--- a/lang/en.lang
+++ b/lang/en.lang
@@ -30,7 +30,7 @@ new = new
compose = compose
logout = logout
page = page
-status = status
+status = multipart
date = date
sender = sender
subject = subject
diff --git a/t/Extract.t b/t/Extract.t
new file mode 100644
index 0000000..1d20d0f
--- /dev/null
+++ b/t/Extract.t
@@ -0,0 +1,84 @@
+use v5.22;
+use warnings;
+use utf8;
+
+use Test::More;
+
+use JSON::PP 'decode_json';
+no warnings 'experimental::smartmatch';
+
+
+my $EXTRACT = {
+ perl_mail_box => 'perl lib/JWebmail/Model/Driver/QMailAuthuser/Extract.pm ',
+ rust_maildir => 'extract/target/debug/jwebmail-extract',
+}->{perl_mail_box};
+my $MAILDIR = 't/';
+my $SYS_USER = $ENV{USER};
+my $MAIL_USER = 'maildir';
+
+my $PROG = "$EXTRACT $MAILDIR $SYS_USER $MAIL_USER";
+
+
+subtest start => sub {
+ my @res = `$PROG invalid`;
+
+ is($? >> 8, 3);
+ is @res, 1;
+ my $result = decode_json $res[0];
+
+ ok($result->{error})
+};
+
+subtest folders => sub {
+ my @res = `$PROG folders`;
+
+ is($? >> 8, 0);
+ is @res, 1;
+ my $result = decode_json $res[0];
+
+ is(@$result, 2);
+ ok($_ ~~ ['SUB.FOLDER', 'SENT']) for @$result;
+};
+
+subtest count => sub {
+ my @res = `$PROG count ''`;
+
+ is($? >> 8, 0);
+ is @res, 1;
+ my $result = decode_json $res[0];
+
+ is($result->{count}, 2);
+ #is($result->{new}, 0);
+};
+
+subtest list => sub {
+ my @res = `$PROG list 0 10 date ''`;
+
+ is($? >> 8, 0);
+ is @res, 1;
+ my $result = decode_json $res[0];
+
+ is(@$result, 2);
+ ok($result->[0]{mid});
+ ok($result->[0]{from});
+ ok($result->[0]{to});
+};
+
+subtest read => sub {
+ my @pre_res = `$PROG list 0 10 date ''`;
+
+ is($? >> 8, 0);
+ is @pre_res, 1;
+ my $pre_result = decode_json $pre_res[0];
+ ok(my $mid = $pre_result->[0]{mid});
+
+ my @res = `$PROG read-mail '$mid'`;
+
+ is($? >> 8, 0);
+ is @res, 1;
+ my $result = decode_json $res[0];
+
+ is($result->{from}, 'test');
+};
+
+done_testing;