title: How to receive and distinguish between regular attachments and inline attachments in Apache Commons Email 1.4
body: <p>Currently we receive an email which gets parsed by </p>
  
  <pre><code>MimeMessageParser mimeMessageParser = parse(message);
  </code></pre>
  
  <p>and later pull out the attachments with</p>
  
  <pre><code> if (mimeMessageParser.hasAttachments()) {
       List&lt;DataSource&gt; attachments = mimeMessageParser.getAttachmentList();
       for (DataSource dataSource : attachments) {
           saveAttachment(dataSource, subjectLineProperties, documentToUpload, firstHeaders);
       }
   }
  </code></pre>
  
  <p>The issue is that getAttachmentList is also returning inline images like in the signature line the business logo, and we do not want to pull out the inline images as attachments. We just want the actual email attachments. ATTACHMENT versus INLINE, but we also have no access to java.mail disposition via the Apache Commons Email 1.4 version, and can't find a solution. I checked their documentation <a href="https://commons.apache.org/proper/commons-email/javadocs/api-1.4/index.html" rel="nofollow noreferrer">https://commons.apache.org/proper/commons-email/javadocs/api-1.4/index.html</a></p>
  
  <p>No luck. It seems that the attachments DataSource only allows me to get content and content type and name, but not if it is an inline attachment/image or a regular attachment like Mime Parts can.</p>