Commit 02cfec5d by nilu

S34694741 # Client - Incoming Issues (raised by Client) #Email Ingest not working (quickly)

parent f3119510
......@@ -275,14 +275,22 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
if(message.getAllRecipients() != null && message.getAllRecipients().length > 0)
{
tmpRecipient = ((InternetAddress) message.getAllRecipients()[0]).getAddress();
for(Address receipientAddress : message.getAllRecipients())
{
tmpRecipient = ((InternetAddress)receipientAddress).getAddress();
if(StringUtils.subBlanks(tmpRecipient) != null && tmpRecipient.contains("job"))
{
tmpJobId = getJobIdentifierFromEmail(tmpRecipient);
if(tmpJobId != null && !tmpJobId.isEmpty() && StringUtils.isNumber(tmpJobId))
{
break;
}
}
}
}
if(StringUtils.subBlanks(tmpRecipient) != null)
{
tmpJobId = getJobIdentifierFromEmail(tmpRecipient);
}
tmpEmailText = EmailFetcher.getText(message, new ArrayList<>());
tmpContents = getAttachments(message);
}
......@@ -476,8 +484,8 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
public static String getJobIdentifierFromEmail(String strReceipient)
{
int index = strReceipient.indexOf('@');
return strReceipient.substring(0, index).replace("job", "");
return strReceipient.substring(0, index).replace("job", "");
}
private static List<FileBinaryContent> getAttachments(Message message) throws IOException, MessagingException
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment