Skip to content

Commit

Permalink
fixed encr padding size, message flags on import
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Tsipenyuk committed Jan 28, 2015
1 parent 0074262 commit a959290
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions email_parse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ let parse (message:Mailbox.Message.t) ~save_message ~save_attachment =
add_boundary buffer ~boundary ~suffix:"\n" ;
walk email boundary false map
) map elist >>= fun map ->
Buffer.add_string buffer "\n";
add_boundary buffer ~boundary ~suffix:"--\n" ;
return map
in
Expand Down
6 changes: 2 additions & 4 deletions imap_crypto.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ open Nocrypto
let pad c_data padding =
let len = Cstruct.len c_data in
let m = Pervasives.(mod) len 32 in
(32-m,
if m > 0 then
Cstruct.of_string (Bytes.cat (Cstruct.to_string c_data) (Bytes.sub (Cstruct.to_string padding) 0 (32-m)))
(32-m,Cstruct.of_string (Bytes.cat (Cstruct.to_string c_data) (Bytes.sub (Cstruct.to_string padding) 0 (32-m))))
else
c_data
)
(0,c_data)

let aes_encrypt ?(compress=false) data pub secrets =
let open Nocrypto.Cipher_block in
Expand Down
5 changes: 3 additions & 2 deletions imaplet_irmin_build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ let mailbox_of_gmail_label message =
| "Starred" -> (label,inferred,(Flags_Keyword "Starred") :: flags)
| "Sent" -> (label,(Some "Sent Messages"),Flags_Answered :: flags)
| "Trash" -> (label,(Some "Deleted Messages"),Flags_Deleted :: flags)
| "Unread" -> (label,inferred,Flags_Recent :: flags)
| "Unread" ->
(label,inferred,Flags_Recent :: ((List.filter (fun f -> f <> Flags_Seen)) flags))
| "Draft" -> (label,(Some "Drafts"),Flags_Draft :: flags)
| label -> ((Some label),inferred, flags)
) (None,None,[]) labels
) (None,None,[Flags_Seen]) labels
in
match label with
| None ->
Expand Down

0 comments on commit a959290

Please sign in to comment.