Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to check if an email contains an attachement just from the e-mail header?

I am developing an email client in Python.

Is it possible to check if an email contains an attachement just from the e-mail header without downloading the whole E-Mail?

like image 295
Avadhesh Avatar asked Dec 17 '22 21:12

Avadhesh


1 Answers

Try IMAP4.fetch(message_set, "BODYSTRUCTURE")

Read the RFC3501 for details about the FETCH BODYSTRUCTURE response.

like image 196
teukkam Avatar answered Jan 13 '23 15:01

teukkam