summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-03-21 13:33:21 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-03-21 13:33:21 +0100
commit0b588dff194f5dbf55ee49e88e0ca396b1bed858 (patch)
treed41c4cfb64f505658a9b3edb0f9877c6a63102dd
parent6fe35cbd50d318bed8d12c5d9fc2602f8936f883 (diff)
Bundle of small changes
-rw-r--r--Makefile.PL2
-rw-r--r--README.md2
-rw-r--r--jwebmail.service.tmpl1
-rw-r--r--lib/JWebmail/I18N/de.pm2
-rw-r--r--lib/JWebmail/Model/ReadMails/Role.pm20
-rwxr-xr-xscript/qmauth.py4
6 files changed, 16 insertions, 15 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 4209f3b..1567881 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;
WriteMakefile(
AUTHOR => '"Jannis M. Hoffmann" <jannis@fehcom.de>',
ABSTRACT_FROM => 'lib/JWebmail.pm',
- MIN_PERL_VERSION => 'v5.22',
+ MIN_PERL_VERSION => 'v5.24',
NAME => 'JWebmail',
VERSION_FROM => 'lib/JWebmail.pm',
LICENSE => 'gpl_3',
diff --git a/README.md b/README.md
index 3ab120c..cffa47d 100644
--- a/README.md
+++ b/README.md
@@ -222,6 +222,8 @@ Stateless Service - `net.fehcom.JWebmail.QMAuth.Maildir.repository` v0.1.0
fn read(folder: unicode_text, mid: unicode_text) -> Message
+ fn raw(folder: unicode_text, mid: unicode_text, path: unicode_text) -> MIMEHeader+Array[uint8]
+
fn folders() -> Array[unicode_text]
fn move(mid: unicode_text, from_folder: unicode_text, to_folder: unicode_text)
diff --git a/jwebmail.service.tmpl b/jwebmail.service.tmpl
index b4d0c50..bbd7e39 100644
--- a/jwebmail.service.tmpl
+++ b/jwebmail.service.tmpl
@@ -7,6 +7,7 @@ Type=exec
User=$JWM_USER
ExecStart=/usr/bin/hypnotoad -f $JWM_HOME/script/jwebmail
ExecReload=/usr/bin/hypnotoad -f $JWM_HOME/script/jwebmail
+PIDFile=$JWM_HOME/script/hypnotoad.pid
WorkingDirectory=$JWM_HOME
Environment=MOJO_LOG_LEVEL=$JWM_LOG_LEVEL MOJO_LOG_SHORT=1
diff --git a/lib/JWebmail/I18N/de.pm b/lib/JWebmail/I18N/de.pm
index 725244b..c1d7bcb 100644
--- a/lib/JWebmail/I18N/de.pm
+++ b/lib/JWebmail/I18N/de.pm
@@ -82,7 +82,7 @@ our %Lexicon = (
## Controller
'No active session.' => 'Keine aktive Sitzung.',
- 'Login failed!' => 'Einloggen fehlgeschlagen!',
+ 'Login failed!' => 'Anmelden fehlgeschlagen!',
'no_folder' => 'Dieses Verzeichnis gibt es nicht.',
'error_send' => 'Die Nachricht konnte nicht gesendet werden.',
'succ_send' => 'Die Nachricht wurde verschikt.',
diff --git a/lib/JWebmail/Model/ReadMails/Role.pm b/lib/JWebmail/Model/ReadMails/Role.pm
index ae113de..f094190 100644
--- a/lib/JWebmail/Model/ReadMails/Role.pm
+++ b/lib/JWebmail/Model/ReadMails/Role.pm
@@ -32,20 +32,16 @@ sub Auth {
}
my @methods = (
- # name:type parmeter of type
- # *key key => value
- # key=value default argument of value
- # ^ throws exception
- # ^type throws exception of type
+ # Conduct the README for specification
# Read operations
- 'count', # auth:Auth, folder -> ^ size:int count:int new:int
- 'folders', # auth:Auth -> ^ :arrayref
- 'verify_user', # auth:Auth -> :truthy
+ 'count',
+ 'folders',
+ 'verify_user',
# Write operations
- 'move', # auth:Auth, mid, folder -> ^ 1
- 'read_headers_for', # auth:Auth, *folder='', *start=0, *end=24, *sort='date' -> ^ :hashref
- 'search', # auth:Auth, pattern, folder -> ^ :hashref
- 'show', # auth:Auth, mid -> ^ :hashref
+ 'move',
+ 'read_headers_for',
+ 'search',
+ 'show',
'raw',
);
diff --git a/script/qmauth.py b/script/qmauth.py
index 1dcc8e3..c306e1f 100755
--- a/script/qmauth.py
+++ b/script/qmauth.py
@@ -219,8 +219,10 @@ def _get_body(mail):
ret = mail.get_content()
if ret.isascii():
return ret.decode(encoding='ascii')
- else:
+ elif len(ret) <= 512*1024:
return b64encode(ret).decode(encoding='ascii')
+ else:
+ raise QMAuthError("non attachment part too large (>512kB)", size=len(ret))
if (mctype := mail.get_content_maintype()) == 'message':
msg = mail.get_content()