You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Kamil (JIRA)" <ji...@apache.org> on 2019/05/27 12:09:00 UTC

[jira] [Commented] (CAMEL-13560) Mail component is not reading attachments in OSGi

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

Kamil commented on CAMEL-13560:
-------------------------------

[~davsclaus], [~acosentino]
I've started to dig into the issue, and it looks like the same code receives attachment just fine, when I run it in JUnit test (without mocking, just using DefaultCamelContext), but when I deploy it as a bundle in Apache Karaf, then email is received, but attachments are empty.

Do you have any idea why?

> Mail component is not reading attachments in OSGi
> -------------------------------------------------
>
>                 Key: CAMEL-13560
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13560
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mail
>    Affects Versions: 2.24.0
>            Reporter: Kamil
>            Priority: Minor
>
> I have such route (taken from [documentation|https://camel.apache.org/mail.html]):
> {code:java}
>   @Override
>   public void configure() throws Exception {    
>     from("imaps://login@host:993?password=pass&debugMode=true")
>       .process(new Processor() {
>         @Override
>         public void process(final Exchange exchange) throws Exception {
>           final Message in = exchange.getIn();
>       
>           Map<String, DataHandler> attachments = in.getAttachments();
>           System.out.println("ATTACHMENTS: "+attachments.size());
>         }
>       });
>   }
> {code}
> When I sent email with images.jpg attachment, email is read, but attachment Map is empty.
> Debug shows:
> {code:java}
> DEBUG: setDebug: JavaMail version 1.6.1
> DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle,1.6.1]
> DEBUG IMAPS: mail.imap.fetchsize: 16384
> DEBUG IMAPS: mail.imap.ignorebodystructuresize: false
> DEBUG IMAPS: mail.imap.statuscachetimeout: 1000
> DEBUG IMAPS: mail.imap.appendbuffersize: -1
> DEBUG IMAPS: mail.imap.minidletime: 10
> DEBUG IMAPS: closeFoldersOnStoreFailure
> DEBUG IMAPS: trying to connect to host "XXXXXX.com", port 993, isSSL true
> * OK IMAP4 ready
> A0 CAPABILITY
> * CAPABILITY IMAP4rev1 UIDPLUS LITERAL+ CHILDREN NAMESPACE XLIST IDLE MOVE XAOL-MOVE AUTH=PLAIN
> A0 OK completed
> DEBUG IMAPS: AUTH: PLAIN
> DEBUG IMAPS: protocolConnect login, host=XXXXXX.com, user=XXXXXXX, password=<non-null>
> DEBUG IMAPS: AUTHENTICATE PLAIN command trace suppressed
> DEBUG IMAPS: AUTHENTICATE PLAIN command result: A1 OK Login completed
> A2 CAPABILITY
> * CAPABILITY IMAP4rev1 UIDPLUS LITERAL+ CHILDREN NAMESPACE XLIST ID IDLE MOVE XAOL-MOVE
> A2 OK CAPABILITY completed
> A3 LIST "" INBOX
> * LIST (\Noinferiors) "/" "INBOX"
> A3 OK List completed
> DEBUG IMAPS: connection available -- size: 1
> A4 SELECT INBOX
> * 13 EXISTS
> * 0 RECENT
> * OK [UNSEEN 13] UIDs valid
> * OK [UIDVALIDITY 1549376878] UIDs valid
> * OK [UIDNEXT 36] Predicted next UID
> * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
> * OK [NOMODSEQ] Sorry, this mailbox format doesn't support modsequences
> A4 OK [READ-WRITE] SELECT completed
> A5 SEARCH UNSEEN 1:13
> * SEARCH 13
> A5 OK Search completed
> A6 FETCH 13 (BODY.PEEK[HEADER.FIELDS (Message-ID)])
> * 13 FETCH (BODY[HEADER.FIELDS (Message-ID)] {65}
> Message-ID: <17...@XXXXXX.com>
> )
> A6 OK Fetch completed
> A7 FETCH 13 (FLAGS)
> * 13 FETCH (FLAGS ())
> A7 OK Fetch completed
> A8 FETCH 13 (BODYSTRUCTURE)
> * 13 FETCH (BODYSTRUCTURE (("text" "plain" ("charset" "utf-8" "format" "flowed") NIL NIL "7bit" 10 3 NIL NIL NIL)("image" "jpeg" ("name" "images.jpg") NIL NIL "base64" 16794 NIL ("attachment" ("filename" "images.jpg")) NIL) "mixed" ("boundary" "------------53A9AD932142735A4433B153") NIL NIL))
> A8 OK Fetch completed
> A9 FETCH 13 (BODY.PEEK[HEADER])
> * 13 FETCH (BODY[HEADER] {3286}
> Return-Path: <XX...@XXXXXX.com>
> Delivered-To: XXXXXX@XXXXXX.com
> Received: (wp-smtpd mx.XXXXXX.com 31103 invoked from network); 22 May 2019 16:14:00 +0200
> Received: from mail-XXX.google.com ([209.85.167.54])
>           (envelope-sender <XX...@XXXXXX.com>)
>           by mx.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP
>           for <XX...@XXXXXX.com>; 22 May 2019 16:14:00 +0200
> Received: by mail-XXX.google.com with SMTP id d8so1XXXb.8
>         for <XX...@XXXXXX.com>; Wed, 22 May 2019 07:14:00 -0700 (PDT)
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
>         d=XXX.gappssmtp.com; s=XXX;
>         h=to:from:subject:message-id:date:user-agent:mime-version
>          :content-language;
>         bh=8Bw7uLBuofXm3FHknjhDSjXXX=;
>         b=kqcK74fTrzyDas7Wsn7EJfSxJuXXX==
> X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
>         d=1e100.net; s=20161025;
>         h=x-gm-message-state:to:from:subject:message-id:date:user-agent
>          :mime-version:content-language;
>         bh=8Bw7uLBuofXmXXXX6oDyAiCFLfHU=;
>         b=F1EsLfk3qaiJXiNX0XXXXXXX==
> X-Gm-Message-State: APXXXXXX=
> X-Google-Smtp-Source: APXvXXXXXWYQ==
> X-Received: by 2002:a19:c517:: with SMTP id w23mr27342169lfe.73.1558534439904;
>         Wed, 22 May 2019 07:13:59 -0700 (PDT)
> Return-Path: <XX...@XXXXXX.com>
> Received: from [XXXXXX] (host-XXXXXX.com. [XXXXXX])
>         by smtp.gmail.com with ESMTPSA id XXXX
>         for <XX...@XXXXXX.com>
>         (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
>         Wed, 22 May 2019 07:13:59 -0700 (PDT)
> To: XXXXXX@XXXXXX.com
> From: =?UTF-8?Q?XXX=c5=9bXX?= <XX...@XXXXXX.com>
> Subject: Test attachment
> Message-ID: <17...@XXXXXX.com>
> Date: Wed, 22 May 2019 16:13:58 +0200
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101
>  Thunderbird/60.6.1
> MIME-Version: 1.0
> Content-Type: multipart/mixed;
>  boundary="------------53A9AD932142735A4433B153"
> Content-Language: pl
> X-WP-DKIM-Status: good (id: XXXXXX.com.gappssmtp.c)
> X-WP-MailID: 3f705f51c9402ad04c3cda34f72497b2
> X-WP-SPAM: NO (U9) 0W0001A [0QMk]
> )
> A9 OK Fetch completed
> ATTACHMENTS: 0
> {code}
> I've check all: imap, imaps, pop3 and pop3s



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)