ac000 / popx

A simple command line interface to POP3 mailbox's.
GNU General Public License v2.0
2 stars 0 forks source link

popx dont work #1

Closed evilxyz closed 7 years ago

evilxyz commented 7 years ago

when i run popx and after input password, popx get stuck, Cpu occupies 100 percent

ac000 commented 7 years ago

Hi,

Did you get anything printed on the screen after entering your password?. After entering your password it will try to log you into your pop server and should give you some output at that point.

Unfortunately I don't have ready access to a POP server these days. I'll look at setting one up here to test with.

In the meantime if you could reproduce your issue, then from another terminal attach to the popx process with strace (strace -p pidof popx). That may produce a lot of output. Let if run a couple of seconds then terminate strace Ctrl-C (and popx) and paste a few of the repeating lines here, that would be helpful.

Cheers, Andrew

ac000 commented 7 years ago

Done some simple testing against dovecot to at least make sure it's not just simply bit rotted.

$ ./popx -h localhost -u poptest Password: +OK Dovecot ready. +OK Logged in. 1: Test 1 Andrew Clayton andrew@... Mon, 23 Jan 2017 19:08:02 +0000 2: Test 2 Andrew Clayton andrew@... Mon, 23 Jan 2017 19:08:02 +0000 ... popx localhost> quit popx localhost> +OK Logging out. popx localhost> Connection closed by foreign host

That's the kind of thing you should see.

evilxyz commented 7 years ago

when i run popx, this is all print.

╭─xyz@evilxyz  ~/Develop/c/web  
╰─$ ./popx -h pop.163.com -u xyz____xyz@163.com
Password: 
+OK Welcome to coremail Mail Pop3 Server (163coms[726cd87d72d896a1ac393507346040fas])
+OK 1339 message(s) [8893844 byte(s)]

and my cpu start 100%.

I debug popx find the problem is here get_message_list() read_pop_response_sync(sockfd, buf, BUF_SIZE);

                   -`
                  .o+`                 xyz@evilxyz
                 `ooo/                 OS: Arch Linux 
                `+oooo:                Kernel: x86_64 Linux 4.8.13-1-ARCH
               `+oooooo:               Uptime: 4d 21h 51m
               -+oooooo+:              Packages: 689
             `/:-:++oooo+:             Shell: zsh 5.3.1
            `/++++/+++++++:            Resolution: 1366x768
           `/++++++++++++++:           DE: KDE5
          `/+++ooooooooooooo/`         WM: KWin
         ./ooosssso++osssssso+`        GTK Theme: Breeze [GTK2/3]
        .oossssso-````/ossssss+`       Icon Theme: breeze
       -osssssso.      :ssssssso.      Font: Noto Sans Regular
      :osssssss/        osssso+++.     CPU: Intel Core i5-3230M CPU @ 3.2GHz
     /ossssssss/        +ssssooo/-     GPU: GeForce GT 750M
   `/ossssso+/:-        -:/+osssso+-   RAM: 3848MiB / 7935MiB
  `+sso+:-`                 `.-/+oso: 
 `++:.                           `-/+/
 .`                                 `/
ac000 commented 7 years ago

Thanks for the info. I've managed to reproduce the problem here.

ac000 commented 7 years ago

If you change #define BUF_SIZE to be 32768, that'll probably get you going. But it's not a real fix...

evilxyz commented 7 years ago

I changed BUF_SIZE to 32768, and cpu is ok, but same print

╭─xyz@evilxyz  ~/Develop/c/web  
╰─$ ./popx -h pop.163.com -u xyz____xyz@163.com
Password: 
+OK Welcome to coremail Mail Pop3 Server (163coms[726cd87d72d896a1ac393507346040fas])
+OK 1339 message(s) [8893844 byte(s)]
ac000 commented 7 years ago

I've pushed up a proper fix (fbaa43b3 Re-work read_pop_response_sync()) for the 100% problem.

However that may still not fully fix your issue as it's possible your pop server isn't giving the responses I'm expecting (I'm expecting multi-line responses to end in CRLF.CRLF).

Still, let me know how you get on with the latest version.

Cheers, Andrew

ac000 commented 7 years ago

It could of course just be slow in downloading the message headers. I noticed while testing against qpopper that qpopper took much longer to send the headers and so popx looked like it had hung.

I've added a message header download progress so you can at least tell if it's doing anything.

evilxyz commented 7 years ago

It really works !!! thanks a lot !!!

╭─xyz@evilxyz  ~/Develop/c/web/tmp  
╰─$ ./popx -h pop.163.com -u xyz____xyz@163.com                                                                                 130 ↵
Password: 
+OK Welcome to coremail Mail Pop3 Server (163coms[726cd87d72d896a1ac393507346040fas])
+OK 11 message(s) [121215 byte(s)]
Retrieving summary for message : 11
   1: =?GBK?B?zfjJz7m6xrHPtc2zLdPDu6fD3MLr1dK72A==?=
        "12306@rails.com.cn" <12306@rails.com.cn>
        Mon, 1 Dec 2014 15:31:45 +0800 (CST)
   2: =?gbk?B?zfjJz7m6xrHPtc2zLdPDu6fWp7i2zajWqg==?=
        "12306@rails.com.cn" <12306@rails.com.cn>
        Mon, 1 Dec 2014 16:25:13 +0800 (CST)
   3: =?GB2312?B?R29vZ2xlINXKu6fD3MLr0tG4/LjE?=
        Google <no-reply@accounts.google.com>
        Sat, 13 Dec 2014 14:06:09 +0000 (UTC)
   4: =?gbk?b?zfjS19PKz+Qz0tq78LO1xrHWsbz1uuyw/LTzxcnLzaOsyMvIy9PQo6zKudPDzt4=?=
        =?gbk?b?zfjS19PKvP7W0NDE?= <mail@service.netease.com>
        Wed, 17 Dec 2014 07:38:10 +0800
   5: =?UTF-8?B?572R5piT5b6u5Y2a6YKA6K+35L2g5pCs5a625YiwTE9GVEVS?=
        LOFTER <notice@lofter.com>
        Wed, 17 Dec 2014 23:28:22 +0800 (CST)
   6: =?GBK?B?zfjJz7m6xrHPtc2zLdPDu6fD3MLr1dK72A==?=
        "12306@rails.com.cn" <12306@rails.com.cn>
        Thu, 25 Dec 2014 13:43:31 +0800 (CST)
   7: =?gbk?b?zfjS19PKz+Qz0tq78LO1xrHWsbz1uuyw/LTzxcnLzaOsyMvIy9PQo6zKudPDzt4=?=
        =?gbk?b?zfjS19PKvP7W0NDE?= <mail@service.netease.com>
        Mon, 29 Dec 2014 17:26:30 +0800
   8: =?gb2312?B?z7XNs83L0MU=?=
        Postmaster@163.com
        Tue, 13 Jan 2015 20:22:31 +0800 (CST)
   9: =?GB2312?B?R29vZ2xlINXKu6fD3MLr0tG4/LjE?=
        Google <no-reply@accounts.google.com>
        Mon, 19 Jan 2015 03:34:49 +0000 (UTC)
  10: =?UTF-8?B?572R5piT5b6u5Y2a6YKA6K+35L2g5pCs5a625YiwTE9GVEVS?=
        LOFTER <notice@lofter.com>
        Wed, 11 Feb 2015 19:49:31 +0800 (CST)
popx pop.163.com> help
popx pop.163.com> 
List of useful commands:- 
    TOP n [l]   View the headers of message n with optional number of lines
                [l] of body
    RETR n      Retrieve message n
    DELE n      Delete message n
    RSET        Reset the session to its initial state
    LIST        List messages (POP)
    LISTX       popx message list
    QUIT

    n           Display the next page of headers
    p           Display the previous page of headers
popx pop.163.com> RETR 1
+OK 5353 octets