Bug 1317122 - Report mail has wrong content type application/octet-stream instead of text/plain; charset=us-ascii
Report mail has wrong content type application/octet-stream instead of text/p...
Status: ASSIGNED
Product: Fedora
Classification: Fedora
Component: amanda (Show other bugs)
25
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Josef Ridky
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-12 01:05 EST by Peter Bieringer
Modified: 2017-05-11 04:58 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Bieringer 2016-03-12 01:05:27 EST
Description of problem:
Perhaps since last update (to fix #1262571) the report got wrong content type

Version-Release number of selected component (if applicable):
amanda-3.3.8-1.fc23.x86_64


How reproducible:
Configure sending report by e-mail

Actual results:
...
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: application/octet-stream
Content-Transfer-Encoding: 8bit
...

Expected results:

(from Amanda 3.3.3 on EL7)
...
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
...

Additional info:
content application/octet stream e-mails are not displayed but can be downloaded as attachment only

contents can be only viewed displaying raw e-mail contents
Comment 1 Peter Bieringer 2016-03-24 17:02:01 EDT
Further analysis shows that this issue is caused by LANG which is not en_US and as result the displayed date is not displayed in 7bit ascii.

$ echo $LANG
de_DE.UTF-8

$ amreport backuphost 
Hostname: amandahost
Org     : backuphost
Config  : backuphost
Date    : M�rz 21, 2016 <-!!!


Proper output with LANG=C

$ LC_TIME=C amreport backuphost
Hostname: amandahost
Org     : backuphost
Config  : backuphost
Date    : March 21, 2016

=> in case sent by e-mail then contents is displayed proper

As Amanda/Report/human.pm only supports English LC_TIME should be proper set somewhere before entering

    my $date  = POSIX::strftime('%B %e, %Y', 0, 0, 0, $day, $month - 1, $year - 1900);

%B is the problematic placeholder

Following patch would fix the bug:
--- vendor_perl/Amanda/Report/human.pm.orig	2016-02-09 10:44:43.000000000 +0100
+++ vendor_perl/Amanda/Report/human.pm	2016-03-24 22:01:08.671869798 +0100
@@ -24,7 +24,7 @@
 use warnings;
 use Carp;
 
-use POSIX;
+use POSIX qw(locale_h strftime);
 use Data::Dumper;
 
 use Amanda::Config qw(:getconf config_dir_relative);
@@ -377,6 +377,7 @@
     # TODO: this should be a shared method somewhere
     my $timestamp = $report->get_timestamp();
     my ($year, $month, $day) = ($timestamp =~ m/^(\d\d\d\d)(\d\d)(\d\d)/);
+    setlocale(LC_TIME, "C");
     my $date  = POSIX::strftime('%B %e, %Y', 0, 0, 0, $day, $month - 1, $year - 1900);
     $date =~ s/  / /g; # get rid of intervening space
Comment 2 Fedora Admin XMLRPC Client 2016-07-11 06:13:25 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Josef Ridky 2016-08-11 06:15:44 EDT
This problem was reported to upstream. 

Their previous suggestion for this issue is change LOCAL variable settings in system. I have posted them patch from #c1. 

We should wait for their response.
Comment 4 Fedora End Of Life 2016-11-24 11:02:30 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora Update System 2017-03-01 10:03:59 EST
amanda-3.4.2-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0ac18bda03
Comment 6 Fedora Update System 2017-03-01 10:04:16 EST
amanda-3.4.2-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-41e61e4f94
Comment 7 Peter Bieringer 2017-03-05 06:31:12 EST
amanda-3.4.2-4 has not a fix for this problem included

/usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm

is unchanged :-(

Note You need to log in before you can comment on or make changes to this bug.