0

I am trying to write a simple POP3 server and I have a problem with authentication. I run the server and try to connect to it with help of Icedove. When the client connects to the server, the following occurs:

Server:+OK POP3 server ready.\r\n
Client:CAPA\r\n
Server:-ERR incorrect operation\r\n
Client:USER sti@blabla.ru\r\n
Server:+OK please send PASS command\r\n
Client:PASS sadsd\r\n
Server:+OK sti@blabla.ru is welcome here\r\n
Client:QUIT\r\n

socket closed

I can't understand why client close connection after "+OK sti@blabla.ru is welcome here\r\n" and just says me that the user name or pass incorrect. I am trying to experiment so new log is slightly different.

Wireshark log:

00000000  2b 4f 4b 20 50 4f 50 33  20 73 65 72 76 65 72 20 +OK POP3  server 
00000010  72 65 61 64 79 2e 0d 0a                          ready... 

00000000  41 55 54 48 0d 0a                                AUTH..
00000018  2d 45 52 52 20 69 6e 63  6f 72 72 65 63 74 20 6f -ERR inc orrect o
00000028  70 65 72 61 74 69 6f 0d  0a                      peratio. .

00000006  43 41 50 41 0d 0a                                CAPA..
00000031  2d 45 52 52 20 69 6e 63  6f 72 72 65 63 74 20 6f -ERR inc orrect o
00000041  70 65 72 61 74 69 6f 0d  0a                      peratio. .

0000000C  55 53 45 52 20 73 74 69  0d 0a                   USER sti ..
0000004A  2b 4f 4b 20 70 6c 65 61  73 65 20 73 65 6e 64 20 +OK plea se send 
0000005A  50 41 53 53 20 63 6f 6d  6d 61 6e 64 0d 0a       PASS com mand..

00000016  50 41 53 53 20 73 61 64  73 64 0d 0a             PASS sad sd..
00000068  2b 4f 4b 20 73 74 69 27  73 20 6d 61 69 6c 64 72 +OK sti' s maildr
00000078  6f 70 20 68 61 73 20 35  20 6d 65 73 73 61 67 65 op has 5  message
00000088  73 20 28 35 35 20 6f 63  74 65 74 73 29 0d 0a    s (55 oc tets)..

00000022  51 55 49 54 0d 0a                                QUIT..
localhost
  • 375
  • 1
  • 3
  • 15
user2674414
  • 113
  • 2
  • 8
  • I don't send QUIT command. Icedove does it. I use Icedove client to test my simple server. – user2674414 Jul 23 '14 at 22:58
  • From what you have shown, the login transaction looks ok. There must be something else going on here. Can you perhaps capture the login using tcpdump so we can see *all* the bytes that are sent and received? – Greg Hewgill Jul 23 '14 at 23:06
  • Ok, so the wireshark log doesn't seem to show any problem either. Does it work differently if you use a different POP3 client? Or perhaps Icedove is logging in twice, and the first one is as captured above but the second one fails for some reason? – Greg Hewgill Jul 23 '14 at 23:31
  • So icedove actually makes two attempts. this two attempts absolutely identical. May this give me some information. I will try use some think else(not icedove). But i want to icedove work too. – user2674414 Jul 23 '14 at 23:48
  • Fortunately Icedove is open source, so you can either look at its source or build and debug it directly, to get more insight into why it fails. – Greg Hewgill Jul 23 '14 at 23:53
  • The problem have been solved. i just forget send +OK after QUIT – user2674414 Jul 24 '14 at 00:29

0 Answers0