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

pop3 error message too generic 'last request failed' #187

Open
soleuu opened this issue Jun 2, 2022 · 1 comment
Open

pop3 error message too generic 'last request failed' #187

soleuu opened this issue Jun 2, 2022 · 1 comment

Comments

@soleuu
Copy link

soleuu commented Jun 2, 2022

Bug Report

Hello,

Pop3 error are generic and hide real error messageand are difficult to debug.

Q A
Version(s) all (since ZF1 to latest laminas version 2.17.0)

Summary

I was having problem with some pop3 authentication and was unable to see real error message without patching some Laminas file.
I needed error message send by pop3 server. Laminas doesn't include this message in generated exception.

https://github.com/laminas/laminas-mail/blob/2.17.x/src/Protocol/Pop3.php#L156

in laminas-mail/src/Protocol/Pop3.php:156 it should be added $message and $status (or $result directly) to be able to understand what is the problem.

Exemple of patch :

throw new Exception\RuntimeException('last request failed ['.$status.'].['.$message.']');

Current behavior

error shown was :

[Laminas\Mail\Protocol\Exception\RuntimeException]                                                                             
last request failed

How to reproduce

Connect to some pop3 server with wrong credentials.

Expected behavior

Expect to be able to read server error messages. Here are two exemples of real error messages :

Exemple 1 :

  [Laminas\Mail\Protocol\Exception\RuntimeException]                                                                             
  last request failed [-ERR].[[AUTH] Application-specific password required: https://support.google.com/accounts/answer/185833] 

Example 2 :

  [Laminas\Mail\Protocol\Exception\RuntimeException]                       
  last request failed [-ERR].[[AUTH] Username and password not accepted.]
@soleuu soleuu added the Bug Something isn't working label Jun 2, 2022
@Ocramius
Copy link
Member

Ocramius commented Jun 2, 2022

@soleuu send a patch: can certainly be included in here :-)

Important: needs an automated test too.

@Ocramius Ocramius added Feature Request and removed Bug Something isn't working labels Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants