[ 
https://issues.apache.org/jira/browse/NIFI-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123581#comment-15123581
 ] 

ASF GitHub Bot commented on NIFI-1434:
--------------------------------------

Github user JPercivall commented on the pull request:

    https://github.com/apache/nifi/pull/187#issuecomment-176807151
  
    @rpmiskin 
    Following the RFC 822 guideline (that the MimeMessage class is based on) it 
says this about the "From" header: 
    4.4.1. FROM / RESENT-FROM
    
       This field contains the identity of the person(s)  who  wished
       this  message to be sent.  The message-creation process should
       default this field  to  be  a  single,  authenticated  machine
       address,  indicating  the  AGENT  (person,  system or process)
       entering the message.  If this is not done, the "Sender" field
       MUST  be  present.  If the "From" field IS defaulted this way,
       the "Sender" field is  optional  and  is  redundant  with  the
       "From"  field.   In  all  cases, addresses in the "From" field
       must be machine-usable (addr-specs) and may not contain  named
       lists (groups).
    
    MimeMessage doesn't recognize the "Sender" field as being different from 
"From" (in comments uses the terms interchangeably) so I'd say leave the "From" 
header as required.
    
    I am on board with creating a custom validator for the internet addresses 
though, that would be great.


> ArrayIndexOutOfBoundsException in PutEmail if property expansion fails for 
> PutEmail.FROM
> ----------------------------------------------------------------------------------------
>
>                 Key: NIFI-1434
>                 URL: https://issues.apache.org/jira/browse/NIFI-1434
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.4.1
>            Reporter: Richard Miskin
>
> If the FROM property in PutEmail evaluates to an empty string an 
> ArrayIndexOutOfBoundsException is thrown from the following code:
> {code:java}
> message.setFrom(InternetAddress.parse(context.getProperty(FROM)
>                  .evaluateAttributeExpressions(flowFile).getValue())[0]);
> {code}
> This leads to the FlowFile not being transferred to the REL_FAILURE 
> relationship and the exception propagates out of the onTrigger method.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to