Skip to content

Commit

Permalink
Merge branch 'master' of github.com:webmin/usermin
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Jun 17, 2024
2 parents cff31c2 + 2a562a5 commit fb7e011
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion mailbox/view_mail.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ if ($userconfig{'auto_mark'}) {
my ($deccode, $decmessage) = &decrypt_attachments($mail);
my @attach = @{$mail->{'attach'}};

# Calendar attachments
my @calendars;
eval {
foreach my $i (grep { $_->{'data'} }
grep { $_->{'type'} =~ /^text\/calendar/ } @attach) {
my $calendars = &parse_calendar_file($i->{'data'});
push(@calendars, @{$calendars});
}};

# Find body attachment and type
my ($textbody, $htmlbody, $body) = &find_body($mail, $userconfig{'view_html'});
$body = $htmlbody if ($in{'body'} == 2);
Expand Down Expand Up @@ -247,10 +256,13 @@ my $image_mode = int(defined($in{'images'}) ? $in{'images'}
: $userconfig{'view_images'});
my @bodyright;
my $bodycontents;
my $calendars = &get_calendar_data(\@calendars);
if ($body && $body->{'data'} =~ /\S/) {
if ($body eq $textbody) {
# Show plain text
$bodycontents = "<pre>";
$bodycontents .= $calendars->{'text'}
if ($calendars->{'text'});
foreach my $l (&wrap_lines(&eucconv($body->{'data'}),
$userconfig{'wrap_width'})) {
$bodycontents .= &link_urls_and_escape($l,
Expand All @@ -264,7 +276,9 @@ if ($body && $body->{'data'} =~ /\S/) {
}
elsif ($body eq $htmlbody) {
# Attempt to show HTML
$bodycontents = $body->{'data'};
$bodycontents = $calendars->{'html'}
if ($calendars->{'html'});
$bodycontents .= $body->{'data'};
my @imageurls;
$bodycontents = &disable_html_images($bodycontents, $image_mode,
\@imageurls);
Expand Down
2 changes: 1 addition & 1 deletion makerpm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
Provides: %{name}-%{version}
Requires(pre): /bin/sh /usr/bin/perl
Requires: /bin/sh /usr/bin/perl perl(lib) perl(open) perl(Net::SSLeay) perl(Time::Local) perl(Data::Dumper) perl(File::Path) perl(File::Basename) perl(Digest::SHA) perl(Digest::MD5) openssl unzip tar gzip
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) lynx shared-mime-info perl-File-Basename perl-File-Path
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) lynx shared-mime-info perl-File-Basename perl-File-Path
AutoReq: 0
License: BSD-3-clause
Group: System/Tools
Expand Down

0 comments on commit fb7e011

Please sign in to comment.