diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-11 14:25:33 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-11 14:25:33 +0100 |
commit | 87dd70bbd7b5bb5ea0d446f8cdb2552f8fb57600 (patch) | |
tree | aaa0bf2fc4180ce172a0797ca0db5713eb3e89e0 | |
parent | fcf5549584b69e62b6c2f0eb919f6799c7904211 (diff) |
bugfixes and minor version bump
-rw-r--r-- | lib/JWebmail.pm | 2 | ||||
-rw-r--r-- | lib/JWebmail/Controller/Webmail.pm | 2 | ||||
-rw-r--r-- | lib/JWebmail/Plugin/RenderMail.pm | 4 | ||||
-rwxr-xr-x | script/qmauth.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index 6963d44..eb03167 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -1,4 +1,4 @@ -package JWebmail v1.2.1; +package JWebmail v1.2.2; use Mojo::Base Mojolicious; diff --git a/lib/JWebmail/Controller/Webmail.pm b/lib/JWebmail/Controller/Webmail.pm index fd1c499..8325050 100644 --- a/lib/JWebmail/Controller/Webmail.pm +++ b/lib/JWebmail/Controller/Webmail.pm @@ -221,7 +221,7 @@ sub raw { my $content = $self->users->raw($auth, '', $mid, $path); $self->res->headers->content_disposition(qq[attachment; filename="$content->{head}{filename}"]) - if $content->{head}{content_disposition}; + if lc $content->{head}{content_disposition} eq 'attachment'; my $ct = $self->to_mime_type($content->{head}); if ($ct eq 'text/plain') { $ct .= '; charset=UTF-8' } $self->res->headers->content_type($ct); diff --git a/lib/JWebmail/Plugin/RenderMail.pm b/lib/JWebmail/Plugin/RenderMail.pm index 4417fae..22edbbd 100644 --- a/lib/JWebmail/Plugin/RenderMail.pm +++ b/lib/JWebmail/Plugin/RenderMail.pm @@ -69,8 +69,8 @@ sub render_multipart { } elsif (lc $_->{head}{content_disposition} eq 'attachment') { $R .= '<p>'; - $R .= $c->link_to($c->url_for(raw => id => $c->stash('id'))->query(path => join('.', @$path, $i))->to_abs, (download => $_->{head}{filename}) => sub { - 'Attachment ' . xml_escape($_->{head}{filename}) . ' of type ' . to_mime_type($c, $_->{head}); + $R .= $c->link_to($c->url_for(raw => id => $c->stash('id'))->query(path => join('.', @$path, $i)), (download => $_->{head}{filename}) => sub { + 'Attachment ' . xml_escape($_->{head}{filename}) . ' of type ' . to_mime_type($_->{head}); }); $R .= "</p>\n"; } diff --git a/script/qmauth.py b/script/qmauth.py index 662b39c..5874fc4 100755 --- a/script/qmauth.py +++ b/script/qmauth.py @@ -272,7 +272,7 @@ def read_mail(f, subfolder, mid): def _descent(xx): head = _get_mime_head_info(xx) if (mctype := head['content_maintype']) == 'message': - body = list(xx.iter_parts())[0] + body = xx.get_content() elif mctype == 'multipart': body = xx.iter_parts() else: |