Piler import fail to import only one mail that remain on the server

Issue #1176 resolved
Francesco Barcella created an issue

I’m using Piler import to import an imap mailbox, only one mail still remain on the server and I cannot figure out why.

Thanks

Cipher: ECDHE-RSA-AES128-GCM-SHA256

List of IMAP folders:

=> '"Drafts" [\HasNoChildren \Drafts]'

=> '"INBOX" [\HasNoChildren]'

=> '"Junk" [\NoInferiors \Junk]'

=> '"Sent" [\HasNoChildren \Sent]'

=> '"Trash" [\HasNoChildren \Trash]'

processing folder: "INBOX"... found 1 messages

failed to import: 3540-imap-1.txt (id: 5000000060a647080c75914c009426228a81)

processing folder: "Trash"... found 0 messages

processing folder: "Junk"... found 0 messages

processing folder: "Sent"... found 0 messages

processing folder: "Drafts"... found 0 messages

Comments (10)

  1. Janos SUTO repo owner

    Assuming that 3540-imap-1.txt is still present in the directory, try importing it, ie. pilerimport -e 3540-imap-1.txt, then check the output as well as the mail log for clues what might be wrong.

  2. Francesco Barcella reporter

    Hi, thanks.

    No txt file present in /tmp/ folder after import, so I tried with -j /tmp/failed/

    /usr/local/bin/pilerimport -i ########## -u ############## -p ############# -P 993 -r -j /tmp/failed/ 
    

    OUTPUT

    Cipher: ECDHE-RSA-AES128-GCM-SHA256
    List of IMAP folders:
    => '"Drafts" [\HasNoChildren \Drafts]'
    => '"INBOX" [\HasNoChildren]'
    => '"Junk" [\NoInferiors \Junk]'
    => '"Sent" [\HasNoChildren \Sent]'
    => '"Trash" [\HasNoChildren \Trash]'
    processing folder: "INBOX"... found 1 messages
    failed to import: 5501-imap-1.txt (id: 5000000060a682350f030e4400e548c0ce34)
    
    processing folder: "Trash"... found 0 messages
    processing folder: "Junk"... found 0 messages
    processing folder: "Sent"... found 0 messages
    processing folder: "Drafts"... found 0 messages
    

    so I tried with

    pilerimport -e failed/5501-imap-1.txt 
    

    OUTPUT

    failed to import: failed/5501-imap-1.txt (id: 5000000060a68254176d2b640015675f1a00)
    

    There is a way to make a verbose output ?

  3. Francesco Barcella reporter

    When you say mail log do you mean on the mailserver? Sorry for my confusion.

    The file is the complete mail present on the server , I’ve checked and it isn’t truncated , so pilerimport is able to get it from the server but it cannot complete the import for some reasons.

    Thanks

  4. Francesco Barcella reporter

    OK Got it

    May 20 17:35:59 piler pilerimport[5493]: ERROR: 5000000060a681e910f38fbc005b8d16cf5d: mysql_stmt_execute() 'Data too long for column 'name' at row 1' (errno: 1406)
    May 20 17:37:15 piler pilerimport[5501]: ERROR: 5000000060a682350f030e4400e548c0ce34: mysql_stmt_execute() 'Data too long for column 'name' at row 1' (errno: 1406)
    May 20 17:37:46 piler pilerimport[5509]: ERROR: 5000000060a68254176d2b640015675f1a00: mysql_stmt_execute() 'Data too long for column 'name' at row 1' (errno: 1406)
    May 20 17:48:38 piler pilerimport[5598]: ERROR: 5000000060a684e0070da80c00e906e6a5de: mysql_stmt_execute() 'Data too long for column 'name' at row 1' (errno: 1406)
    May 20 17:56:35 piler pilerimport[5657]: ERROR: 5000000060a686bd2a8162c400d7ccda1cbc: mysql_stmt_execute() 'Data too long for column 'name' at row 1' (errno: 1406)
    

  5. Janos SUTO repo owner

    Open the eml file pilerimport cannot process, and verify that the attachment name is pretty long. The attachment table ‘name’ column is a tinyblob which should be fine up to ~254 bytes. If you can see that the attachment is indeed longer than that then you may change the name column to be varbinary(512) perhaps.

    Anyway, if it’s not a sensitive email, then can I see it somehow?

  6. Francesco Barcella reporter

    OK, the problem maybe is that there are 3 attachment with a name log 462 characters.

    It seem to be RFC 2822 compliant but too long I suppose for many other software

  7. Janos SUTO repo owner

    Thank you for the email. The attachment names are crazy long ~460 characters. I doubt that a unix filesystem supports it. Anyway, you may import it after you execute the following sql query:

    alter table attachment change column name name blob(512) default null;
    

  8. Log in to comment