0
votes

I want the command syntaxe for imap to get juste header et text body from a message without attachments.

I have try this command but don't work : UID FETCH uid (BODY[HEADER] BODY[1])

Thanks

1
Why doesn't it work? What is the error? BODY[1] isn't necessarily the text body, depending on the formatting of the message. You would need to get the BODYSTRUCTURE and interpret that. - Max

1 Answers

1
votes

There exists a raw fetch command to fetch mail data

UID FETCH 2 (BODY[]<0.size>)

for example if you want to fetch first 100 bytes of mail then you can fire a command as

UID FETCH 2 (BODY[]<0.100>)

but then you will have to parse the data yourself.