Ticket #1485927 (closed Feature Requests: fixed)

Opened 15 months ago

Last modified 3 months ago

show smtp error in browser

Reported by: corbosman Owned by:
Priority: 5 Milestone: 0.4-stable
Component: SMTP connection Version: svn-trunk
Severity: normal Keywords:
Cc: darklight.xdarklight@…

Description

Looking at the code this is probably going to be wishful thinking, but im wondering if it's possible to be able to show the actual SMTP error to end users trying to send mails. We provide sensible errors in our mailservers, but we cant show them to people now.

Attachments

smtp_error.patch (4.3 KB) - added by alec 15 months ago.
smtp_error_v2.patch (4.7 KB) - added by darklight 15 months ago.

Change History

Changed 15 months ago by alec

Changed 15 months ago by alec

  • milestone changed from later to 0.3-stable

I've created a patch some time ago but it require review and some style modification for multiline error messages.

Changed 15 months ago by alec

#1485293 marked as duplicate of this request.

Changed 15 months ago by darklight

Changed 15 months ago by darklight

  • cc darklight.xdarklight@… added

Hi,

I've attached an updated version of alec's patch multiline messages do work now -> the solution to this should be pushed upstream since it looks like someone forgot to remove the "height: 22px; " (the height is minimum 22px anyway, and stuff that requires more text will be broken by the fixed height)

Regards, Martin

Changed 14 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Done in r2713.

Changed 4 months ago by corbosman

  • status changed from closed to reopened
  • resolution fixed deleted

sorry to re-open this ticket, but ive been playing with this a bit and it seems like we can improve on this without touching Net::SMTP.

It would be nice if we could get the actual SMTP error. Not something RC creates itself, but the real response string from the SMTP server. It can probably be done in different ways, but as a proof of concept here is what I did.

program/include/rcube_smtp.php: change send_mail():

$this->error = array('label' => 'smtptoerror', 'vars' => array('to' => $recipient, 'code' => $this->conn->_code, 'response' => $this->conn->_arguments[0]));

What I added was the $response, which is added by Net::SMTP as _arguments.

Now you can add $response as a label parameter:

$messagessmtptoerror? = 'SMTP Error ($code): Failed to add recipient "$to" ($response)';

This gives me the following error:

SMTP Error (553): Failed to add recipient "wewfeewfw@…" (5.1.2 <wewfeewfw@…>... Domain wfwefwfwefw.com does not exist)

We provide many useful SMTP responses in our SMTP server. Anything from normal SMTP errors, to spam errors, virus errors, payment problems, etc etc. So directing that error to the GUI can be useful.

Changed 3 months ago by alec

  • milestone changed from 0.3-stable to 0.4-stable

Changed 3 months ago by alec

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in r3727.

Note: See TracTickets for help on using tickets.