Error when posting invalid email address

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.

3 Likes

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'
3 Likes

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.

4 Likes

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

https://github.com/discourse/discourse/commit/45850a0cd63b29ea29941665f656459750c86367

2 Likes