Tcl Library Source Code

View Ticket
Login
Ticket UUID: aff22194d70682b503270354bab689df39f1091d
Title: imap4 - BODY.PEEK fails
Type: Bug Version: 0.5.3
Submitter: vonandraste Created on: 2016-12-27 15:55:07
Subsystem: imap4 Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2017-05-26 17:31:21
Resolution: None Closed By: nobody
    Closed on:
Description:
When using BODY.PEEK[*] as a parameter, this seems to break imaptotcl_symbol due to the nested '[]' in the imap response. The match is incorrect (regex and nested patterns not a good mix) and the subsequent data var is incorrectly updated.

When using just BODY, than all seems fine:The line "1 FETCH (BODY[HEADER.FIELDS (BODY FROM)] {46})" is processed and the element "BODY[HEADER.FIELDS (BODY FROM)]" is set, and appended to the list that is eventually returned to the proc prcoessfetchline, from 'imaptotcl'.

Using BODY.PEEK[1], breaks that flow, setting the element to 'BODY', then 'HEADER.FIELDS', then 'S', then 'BODY.PEEK[1] FROM)]', which fails.

Example usage:
set fields {BODY from:}
imap4::fetch $chan :1 -inline {*}$fields - Ok

set fields {BODY.PEEK[1] from:}
imap4::fetch $chan :1 0inline {*}$fields - fails
User Comments: aku added on 2017-05-26 17:31:21:
Do you have a patch for the issue ?
Alternatively it would be good to have an example of the response itself.

I am asking these because I do not have an imap server to play with.