Bug 1123093

Summary: logwatch encode=base64 generates invalid mime block
Product: Red Hat Enterprise Linux 7 Reporter: Jerry McCarthy <jerry>
Component: logwatchAssignee: Jan Synacek <jsynacek>
Status: CLOSED ERRATA QA Contact: Mirek Długosz <mzalewsk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: jerry, jkejda, mzalewsk
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 14:43:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1465901    
Attachments:
Description Flags
naive fix
none
reproducer none

Description Jerry McCarthy 2014-07-24 20:32:42 UTC
Description of problem:
logwatch.pl base64 encodes multiple segments and concatenates the encoded parts instead of concatenating the segments and then encoding a single text block.  This creates imbedded "end" equal signs in the mime block which causes decode errors.

Version-Release number of selected component (if applicable):
7.4

How reproducible:
Any time any segment but the last has a length not divisible by three and encode = base64 was specified in the logwatch.conf file.

Steps to Reproduce:
1. specify encode = base64 in logwatch.conf
2. 
3.

Actual results:
invalid mime block in email.

Expected results:
valid mime block in email.

Additional info:

Comment 3 Jan Synacek 2016-03-16 13:25:55 UTC
How can I actually reproduce this? Making some parts not divisible by 3 before encoding them still produces valid output.

Comment 4 Jan Synacek 2016-03-16 13:29:51 UTC
Created attachment 1137033 [details]
naive fix

Comment 5 Jerry McCarthy 2016-03-19 23:58:42 UTC
The naive fix works for me.  Without the fix I get invalid email, with the fix I get valid email.  Not knowing perl it is difficult for me to provide a test case.

Comment 8 Mike McCune 2016-03-28 22:49:28 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 12 Jan Synacek 2017-10-03 11:25:15 UTC
Created attachment 1333603 [details]
reproducer

Comment 16 errata-xmlrpc 2018-04-10 14:43:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0822