0

While working with JavaMail API, I used below two properties to create a session and then to download emails from server. This (setting below properties) will cause data to be fetched from the server in larger chunks and hence to download large message bodies efficiently. I am looking for similar option in python so that data to be fetched from the server should be in larger chunks. Can someone help me achieve this in Python?.

       props.setProperty("mail.imaps.partialfetch","true");
       props.setProperty("mail.imaps.fetchsize", "2000000");
6
  • what library are you using for python? Commented Jul 20, 2020 at 13:20
  • Using these - import email , import imaplib Commented Jul 20, 2020 at 13:21
  • you probably just need to set the socket buffer size since imaplib uses sockets to send and receive. I'm not confident enough in that to post a proper answer though. How would you even detect the difference for this kind of performance change? Commented Jul 20, 2020 at 13:37
  • I compared the time taken to download an email of particular size to check the performance. Increasing fetch size in java takes less time. Commented Jul 20, 2020 at 14:04
  • @ Tadhg McDonald-Jensen , So is it possible to pass socket buffer size to the imaplib so that the library can pick the user specified buffer size? Commented Jul 20, 2020 at 14:29

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.