Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Sending binary content in Mail step

  1. #1
    Join Date
    Aug 2015
    Posts
    16

    Default Sending binary content in Mail step

    In an attempt to send binary content through the mail step, the delivered attachment becomes corrupt. When viewing the content of the original file and the file received via email, it seems that all text within the file (such as file type descriptors, etc.) are correct, but the non-text portions become mangled. It is almost as if a text encoding is being applied to the content. Additionally, the received file is about roughly 2x the size of the original file.

    Can the mail step not send binary content?

    I was originally reading the binary content using the "Load File Content in Memory" step, but because I was suspicious if this step was the one corrupting my content, I did a search and found this issue with a workaround provided by Matt Tucker http://jira.pentaho.com/browse/PDI-14296. I'm using Matt's workaround to ensure that the problem isn't because of Load File Content in Memory.

    Any insight would be appreciated.

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by ryno1234 View Post
    Can the mail step not send binary content?
    I send zipped result files daily without problems.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Aug 2015
    Posts
    16

    Default

    Thanks, marabu. Now I will just need to figure out what I'm doing wrong here. How are you going about attaching the files in the Mail step? I'm using the option to attach a single file by using the content from an existing field.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    To date I send mails from the job level only.
    That's not because I had problems doing it from a transformation - I just never tried to do it that way.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Aug 2015
    Posts
    16

    Default

    For anyone wondering, I've looked into this issue digging through the source code of Kettle and have come across the root causes of this problem:

    - Load File Content in Memory assumes that the data read is a string. It will process it as such and thus mangles any data outside of whatever the specified encoding is.
    - The mail step ALSO assumes that the Binary data is a string and uses an internal function to read the data as a string thus mangling the data there as well.

    Both of these are undocumented behaviors. A workaround (or update to Kettle) is necessary.
    Last edited by ryno1234; 11-04-2015 at 03:21 PM.

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Obviously, a workaround would be to let a Kettle job handle the mailing.
    Jobs deal with files, while transformations see rows and fields.
    Try the Job-Executor from the Flow category.
    So long, and thanks for all the fish.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.