Javamail performance

后端 未结 4 1451
南笙
南笙 2021-01-06 02:58

I\'ve been using javamail to retrieve mails from IMAP server (currently GMail). Javamail retrieves list of messages (only ids) in a particular folder from server very fast,

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-06 03:39

    Please set the Property mail.imap.fetchsize with the required size. the default is 16k. In case you increase the size of this property, retrieve speed will go up.

    props.put("mail.imap.fetchsize", "3000000");

    Note that if you're using the "imaps" protocol to access IMAP over SSL, all the properties would be named "mail.imaps.*".

    Good Luck.

    Yaniv

提交回复
热议问题