pilerimport error when importing using IMAP

Issue #140 resolved
Former user created an issue

When I try import email using the import utility I get a login failed error messsage however when I try another Linux utility such as offlineimap it works and downloads the email.

root@piler:/emails/testemailpiler/mail# pilerimport -i imap.gmail.com -u testemailpiler@gmail.com -p xxxxx -P 993 server cert: subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com issuer: /C=US/O=Google Inc/CN=Google Internet Authority

login failed, server reponse: * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH A2 OK testemailpiler@gmail.com Test Email authenticated (Success)

Any idea why this could be happening?

Comments (15)

  1. Janos SUTO repo owner

    Please download the latest master branch (perhaps you have to upgrade), and try with it. Or you may try it without upgrading by adding -D as dry run (=just download then remove messages and not actually import them).

  2. Bali

    I am running the 0.1.24-master-branch, which believe is the latest. root@piler:~# piler -v piler 0.1.24-master-branch, build 836, Janos SUTO sj@acts.hu

    Build Date: Sun Sep 1 21:35:24 CEST 2013 ldd version: ldd (Debian EGLIBC 2.13-38) 2.13 gcc version: gcc version 4.7.2 (Debian 4.7.2-5) Configure command: ./configure --localstatedir=/var --enable-starttls --enable-tcpwrappers --with-database=mysql

    I also tried using -D option with same error.

    root@piler:~# pilerimport -i imap.gmail.com -u testemailpiler@gmail.com -p xxxxx -P 993 -D server cert: subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com issuer: /C=US/O=Google Inc/CN=Google Internet Authority

    login failed, server reponse: * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH A2 OK testemailpiler@gmail.com Test Email authenticated (Success)

    Am I missing anything?

  3. Janos SUTO repo owner

    Just found a bug in the imap login routine. Please edit src/imap.c, locate function connect_to_imap_server() at line 231 (give or take), then go to its end, and around line 287 you may find the following:

    if(strncmp(buf, tagok, strlen(tagok))){

    please replace it with the following:

    if(!strstr(buf, tagok)){

    then recompile piler, and I believe it will work. If you don't want to hack the code, then I'll push this fix to the master branch tomorrow.

  4. Bali

    Thanks jsuto for prompt response, appreciate your help. I will wait for the fix, will there be instructions on applying the patch or I will have to perform an upgrade?

  5. Bali

    I tried recompiling however I get the following error now when I compile during make imap.c: In function âlist_foldersâ: imap.c:366:25: error: âstruct __dataâ has no member named âimapfoldersâ make[1]: [imap.o] Error 1 make[1]: Leaving directory `/root/piler-0.1.24/src' make: [all-recursive] Error 1

  6. Janos SUTO repo owner

    sorry, I forgot that some internal structures have changed. Please download the latest master branch, and recompile it, then you can just simply upgrade, expect no issues to worry about.

  7. Bali

    I downloaded the latest master branch jsuto-piler-97044f19e63c and used the following configure command: ./configure --localstatedir=/var --enable-starttls --enable-tcpwrappers --with-database=mysql

    I get an error on make:

    Making all in src make[1]: Entering directory /root/jsuto-piler-97044f19e63c/src' gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c dirs.c -o dirs.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c base64.c -o base64.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c misc.c -o misc.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c counters.c -o counters.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c cfg.c -o cfg.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c sig.c -o sig.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c decoder.c -o decoder.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c hash.c -o hash.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c parser.c -o parser.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c parser_utils.c -o parser_utils.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c rules.c -o rules.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c session.c -o session.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c message.c -o message.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c attachment.c -o attachment.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c digest.c -o digest.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c store.c -o store.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c archive.c -o archive.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c tai.c -o tai.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c import.c -o import.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c imap.c -o imap.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c pop3.c -o pop3.o gcc -O2 -Wall -g -fPIC -I. -I.. -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -D_GNU_SOURCE -DHAVE_TRE -DNEED_MYSQL -c extract.c -o extract.o extract.c: In function âextract_tnefâ: extract.c:108:48: error: âHAVE_TNEFâ undeclared (first use in this function) extract.c:108:48: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [extract.o] Error 1 make[1]: Leaving directory/root/jsuto-piler-97044f19e63c/src' make: *** [all-recursive] Error 1

  8. Bali

    Hello jsuto, I recompiled piler to the latest master branch.

    piler 0.1.25-master-branch, build 844, Janos SUTO sj@acts.hu

    Build Date: Tue Sep 24 20:44:23 CEST 2013 ldd version: ldd (Debian EGLIBC 2.13-38) 2.13 gcc version: gcc version 4.7.2 (Debian 4.7.2-5) Configure command: ./configure --localstatedir=/var --enable-starttls --enable-tcpwrappers --with-database=mysql

    Now it goes pass the stage of authetication however I still get errors when importing folders.

    root@piler:~/jsuto-piler-97044f19e63c# pilerimport -i imap.gmail.com -u testemailpiler@gmail.com -p xxxxxxx -P 993 server cert: subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com issuer: /C=US/O=Google Inc/CN=Google Internet Authority

    List of IMAP folders: => 'INBOX' => '[Gmail]' => '[Gmail]/All Mail' => '[Gmail]/Drafts' => '[Gmail]/Important' => '[Gmail]/Sent Mail' => '[Gmail]/Spam' => '[Gmail]/Starred' => '[Gmail]/Trash' processing folder: [Gmail]/Important... found 0 messages processing folder: [Gmail]... error: A5 NO [NONEXISTENT] Unknown Mailbox: [Gmail] (now in authenticated state) (Failure) processing folder: [Gmail]/Drafts... error: processing folder: [Gmail]/Starred... error: processing folder: [Gmail]/Trash... error: processing folder: [Gmail]/All Mail... error: processing folder: INBOX... error: processing folder: [Gmail]/Sent Mail... error: processing folder: [Gmail]/Spam... error:

  9. Bali

    I tried as you suggested and same error:

    root@piler:/tmp# pilerimport -i imap.gmail.com -u testemailpiler@gmail.com -p PilerTest1 -P 993 server cert: subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com issuer: /C=US/O=Google Inc/CN=Google Internet Authority

    List of IMAP folders: => 'INBOX' => '[Gmail]' => '[Gmail]/All Mail' => '[Gmail]/Drafts' => '[Gmail]/Important' => '[Gmail]/Sent Mail' => '[Gmail]/Spam' => '[Gmail]/Starred' => '[Gmail]/Trash' processing folder: [Gmail]/Important... found 0 messages processing folder: [Gmail]... error: A5 NO [NONEXISTENT] Unknown Mailbox: [Gmail] (now in authenticated state) (Failure) processing folder: [Gmail]/Drafts... error: processing folder: [Gmail]/Starred... error: processing folder: [Gmail]/Trash... error: processing folder: [Gmail]/All Mail... error: processing folder: INBOX... error: processing folder: [Gmail]/Sent Mail... error: processing folder: [Gmail]/Spam...

  10. Bali

    It works now after when i compiled build 845. When is the next version coming out? Will there be an ova for it just like the one now.

    Also, another question. Does piler import duplicate messages? Can I cron this job and will it only pull the emails that are not in piler already?

    root@piler:/tmp# pilerimport -i imap.gmail.com -u testemailpiler@gmail.com -p xxxxx -P 993 server cert: subject: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com issuer: /C=US/O=Google Inc/CN=Google Internet Authority G2

    List of IMAP folders: => 'INBOX' => '[Gmail]' => '[Gmail]/All Mail' => '[Gmail]/Drafts' => '[Gmail]/Important' => '[Gmail]/Sent Mail' => '[Gmail]/Spam' => '[Gmail]/Starred' => '[Gmail]/Trash' processing folder: [Gmail]/Important... found 0 messages processing folder: [Gmail]... error: A4 NO [NONEXISTENT] Unknown Mailbox: [Gmail] (now in authenticated state) (Failure) processing folder: [Gmail]/Drafts... found 0 messages processing folder: [Gmail]/Starred... found 0 messages processing folder: [Gmail]/Trash... found 0 messages processing folder: [Gmail]/All Mail... found 10 messages processed: 10 processing folder: INBOX... found 10 messages duplicate: imap-11.txt (id: 4000000052445f5f2d93d2e4004b50fd13bf) duplicate: imap-12.txt (id: 4000000052445f5f341a573c0025af7a15a8) duplicate: imap-13.txt (id: 4000000052445f5f3a1bdcb4004c0a683388) duplicate: imap-14.txt (id: 4000000052445f600493c69c0037c59c7c1e) duplicate: imap-15.txt (id: 4000000052445f600c92ecec00eb5349c319) duplicate: imap-16.txt (id: 4000000052445f6012f9d76c009a036fdaeb) duplicate: imap-17.txt (id: 4000000052445f60196e5a64003113e34aef) duplicate: imap-18.txt (id: 4000000052445f601fe2f4cc00dc446ad5c8) duplicate: imap-19.txt (id: 4000000052445f603007c4cc0061347289c7) duplicate: imap-20.txt (id: 4000000052445f6038e160e4005653d0557c)

    processing folder: [Gmail]/Sent Mail... found 0 messages processing folder: [Gmail]/Spam... found 0 messages

  11. Log in to comment