Error when posting invalid email address


(Ixeft) #1

When creating a subject containing a quote block with an email address, user get an «internal server error»,

The problem appeared since upgrade to last version of discourse.


User can't post: 500 internal server error
(Ixeft) #2

i can reproduce trying to create a discussion«citing» this message on our instance :

NB : it also fail on meta.discourse.org

> 
> This message was created automatically by mail delivery software.
> 
> A message that you sent could not be delivered to one or more of its
> recipients. This is a permanent error. The following address(es) failed:
> 
>   some-email@gmail.com
>     host smtp.someprovider.com [00.225.33.366]
>     SMTP error from remote mail server after end of data:
>     550 5.7.1 Unconfigured Sending Domain <somedomain.com>
> 
> Action: failed
> Final-Recipient: rfc822;name@domain.com
> Status: 5.0.0
> Remote-MTA: dns; smtp.someprovider.com
> Diagnostic-Code: smtp; 550 5.7.1 Unconfigured Sending Domain <somedomain.com>

Log :

URI::InvalidComponentError (unrecognised opaque part for mailtoURL: rfc822;name@domain.com)
/usr/local/lib/ruby/2.4.0/uri/mailto.rb:150:in `initialize'

(Gerhard Schlager) #3

It doesn’t have to be inside a quote block. Trying to post an invalid email address like rfc822;name@domain.com is enough to trigger the error.


(Régis Hanol) #5

Thanks @ixeft for reporting this issue. It’s now fixed :pizza:


(Régis Hanol) #6