Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User can't login with POP3 until after logging in with IMAP. #268

Closed
SJrX opened this issue Jan 11, 2019 · 5 comments
Closed

User can't login with POP3 until after logging in with IMAP. #268

SJrX opened this issue Jan 11, 2019 · 5 comments
Labels
Milestone

Comments

@SJrX
Copy link

SJrX commented Jan 11, 2019

$docker run -t -i -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 greenmail/standalone:1.5.9
$echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: [email protected] doesn't exist
$echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: [email protected] doesn't exist
$echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: [email protected] doesn't exist
$echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: [email protected] doesn't exist
$echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: [email protected] doesn't exist
$echo "1 LOGIN [email protected] [email protected]" | netcat -q 1 localhost 3143
* OK IMAP4rev1 Server GreenMail v1.5.9 ready
1 OK LOGIN completed.
$echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
+OK
@davidnewcomb
Copy link
Contributor

I ran through your tests again and did not see the same behaviour (as of 1.5.15).

Server started without -Dgreenmail.auth.disabled option:

$ echo "USER test" | nc -v 127.0.0.1 3110
Connection to 127.0.0.1 port 3110 [tcp/sim-control] succeeded!
+OK POP3 GreenMail Server v1.5.12 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: User <test> doesn't exist
$ 
$ echo "1 LOGIN test t123" | nc -v 127.0.0.1 3143
Connection to 127.0.0.1 port 3143 [tcp/seaview] succeeded!
* OK IMAP4rev1 Server GreenMail v1.5.12 ready
1 NO LOGIN failed. Invalid login/password for user id test
$ 
$ echo "USER test" | nc -v 127.0.0.1 3110
Connection to 127.0.0.1 port 3110 [tcp/sim-control] succeeded!
+OK POP3 GreenMail Server v1.5.12 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: User <test> doesn't exist
$ 

Server started with -Dgreenmail.auth.disabled option:

$ 
$ echo "USER test" | nc -v 127.0.0.1 3110
Connection to 127.0.0.1 port 3110 [tcp/sim-control] succeeded!
+OK POP3 GreenMail Server v1.5.12 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: User <test> doesn't exist
$ 
$ echo "1 LOGIN test t123" | nc -v 127.0.0.1 3143
Connection to 127.0.0.1 port 3143 [tcp/seaview] succeeded!
* OK IMAP4rev1 Server GreenMail v1.5.12 ready
1 OK LOGIN completed.
$ 
$ echo "USER test" | nc -v 127.0.0.1 3110
Connection to 127.0.0.1 port 3110 [tcp/sim-control] succeeded!
+OK POP3 GreenMail Server v1.5.12 ready
+OK
$ 

The documentation states that using the -Dgreenmail.auth.disabled option will create a user when the client tries to log in and will automatically create an account. This happened with IMAP but not with POP.

@SJrX
Copy link
Author

SJrX commented Apr 8, 2020

@davidnewcomb I don't understand your comment, it's been a while since I opened (and I completely forgot about this), this but my read of your test suggests it's still a problem:

I ran through your tests again and did not see the same behaviour...
The documentation states that using the -Dgreenmail.auth.disabled option will create a user when the client tries to log in and will automatically create an account. This happened with IMAP but not with POP.

That fact that it happens with IMAP and not with POP is the behaviour that I was filing the bug report for.

@davidnewcomb
Copy link
Contributor

Here is your original log without all the duplicate information:

$ docker run -t -i -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 greenmail/standalone:1.5.9
$
$ echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
-ERR com.icegreen.greenmail.user.NoSuchUserException: [email protected] doesn't exist
$
$ echo "1 LOGIN [email protected] [email protected]" | netcat -q 1 localhost 3143
* OK IMAP4rev1 Server GreenMail v1.5.9 ready
1 OK LOGIN completed.
$
$ echo "USER [email protected]" | netcat -q 1  localhost 3110
+OK POP3 GreenMail Server v1.5.9 ready
+OK

When you run the above now (on 1.5.15), you do not get the same result: the login to IMAP fails and the second POP request also fails. If you add -Dgreenmail.auth.disabled to the server options then it automatically creates a new user on login and the second POP request succeeds.

Bug #260 addresses the disparage (between POP and IMAP) with creating accounts at login when using -Dgreenmail.auth.disabled.

The submitted fix creates a POP account when clients connect, in the same way as IMAP when -Dgreenmail.auth.disabled is used.

@SJrX
Copy link
Author

SJrX commented Apr 9, 2020

👍 thanks

@marcelmay marcelmay added the bug label Apr 10, 2020
@marcelmay marcelmay added this to the 1.5.13 milestone Apr 10, 2020
davidnewcomb added a commit to davidnewcomb/greenmail that referenced this issue Apr 13, 2020
marcelmay pushed a commit that referenced this issue Apr 13, 2020
@marcelmay
Copy link
Member

Fixed by #308

marcelmay pushed a commit that referenced this issue Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants