Ticket #1485294 (closed Bugs: fixed)

Opened 3 months ago

Last modified 6 weeks ago

Error when sending a mail from the adress book

Reported by: miniwark Owned by:
Priority: 5 Milestone: 0.2-stable
Component: PHP backend Version: 0.2-alpha
Severity: normal Keywords:
Cc:

Description

On of my users have try to send a message from adress book :

1) he go into the adress book
2) he choice a recipient and from here decide to send a message
3) in the To field he have something like:

supergirl <mygirl@hotmail.com>

And decide to change the display name when writing to:

mygirl <mygirl@hotmail.com>

Then when he send his message, sending is refused by the postfix server beacause of a bad recipiend adress format (see bellow. if he did not change the display name the message is well sended.

  • Maybe it will be better to just add mail adress in the To field and not display name in this case.
  • A specific roundcube error about the bad recipient adress would be cool to.

Here is my postfix error message :


Transcript of session follows.
Out: 220 www.somewhere.com ESMTP Postfix (Linux OpenSuSE)
In: EHLO www.somewhere.com
Out: 250-www.somewhere.com
Out: 250-PIPELINING
Out: 250-SIZE 26500000
Out: 250-ETRN
Out: 250-STARTTLS
Out: 250-ENHANCEDSTATUSCODES
Out: 250-8BITMIME
Out: 250 DSN
In: MAIL FROM:<machin@somewhere.com>
Out: 250 2.1.0 Ok
In: RCPT TO:<mygirl<mygirl@hotmail.com>
Out: 501 5.1.3 Bad recipient address syntax
In: RSET
Out: 250 2.0.0 Ok
In: QUIT
Out: 221 2.0.0 Bye

Change History

Changed 3 months ago by alec

  • milestone changed from later to 0.2-beta

Changed 3 months ago by thomasb

Works for me.

Changed 2 months ago by alec

  • component changed from Client Scripts to PHP backend

Works for me, but maybe he skip space between name and address. This isn't a problem for Thunderbird, so we can do this in such way:

-- sendmail.inc.old    2008-09-15 08:55:16.000000000 +0200
+++ sendmail.inc        2008-09-15 12:29:31.275592664 +0200
@@ -144,10 +144,10 @@
 $input_charset = $OUTPUT->get_charset();
 $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset;

-$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/');
-$mailto_replace = array(', ', ', ', '', ',');
+$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/');
+$mailto_replace = array(', ', ', ', '', ',', '\\1 \\2');

-// replace new lines and strip ending ', '
+// replace new lines, strip ending ', ' and make address strings more valid
 $mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset));
 $mailcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset));
 $mailbcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset));

Changed 2 months ago by tensor

Would not it be simpler to insert a space on a \S< boundary? But \S< my be in a quoted recepients name. So more complex handling for issue is needed.

Changed 6 weeks ago by alec

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

Fixed in r1958.

Note: See TracTickets for help on using tickets.