Ticket #1485654 (closed Bugs: fixed)

Opened 20 months ago

Last modified 20 months ago

Fail to send mail if the name of the sender contains a @

Reported by: Hosteurope Owned by:
Priority: 2 Milestone: 0.2.1
Component: Core functionality Version: 0.2-beta
Severity: normal Keywords: quote fail send
Cc:

Description

If the Name of the From/CC/BCC/To contains a @ the mailserver doesn't acceppt the message because the name issn't correctly quoted.

Change History

  Changed 20 months ago by alec

  • milestone changed from 0.2.1 to 0.2-stable

There's no problem with names from addressbook and identities.

in reply to: ↑ description ; follow-up: ↓ 3   Changed 20 months ago by Hosteurope

  • summary changed from Fail to send mail if the name of the recepient or sender contains a @ to Fail to send mail if the name of the sender contains a @

Replying to Hosteurope:

If the Name of the From/CC/BCC/To contains a @ the mailserver doesn't acceppt the message because the name issn't correctly quoted.

Ok, To/CC/BCC is correkt quoted, but From is not.

If you use an identity with xyz@… as name and xyz@… as E-Mail-Adress the name isn't quoted.

in reply to: ↑ 2   Changed 20 months ago by alec

Replying to Hosteurope:

If you use an identity with xyz@… as name and xyz@… as E-Mail-Adress the name isn't quoted.

Fixed in r2193.

  Changed 20 months ago by robin

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

Closing the ticket, fix is confirmed.

follow-up: ↓ 6   Changed 20 months ago by alec

  • status changed from closed to reopened
  • resolution fixed deleted

Not exactly, we should add quoting for names entered by users in compose fields. Those from addressbook and identities don't need this now.

in reply to: ↑ 5   Changed 20 months ago by robin

Replying to alec:

Not exactly, we should add quoting for names entered by users in compose fields.

Sorry, missed that...

Does following break any existing functionallity?

--- program/steps/mail/sendmail.inc     (revision 2196)
+++ program/steps/mail/sendmail.inc     (working copy)
@@ -153,8 +153,8 @@
 $input_charset = $OUTPUT->get_charset();
 $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset;

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

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

I modified only the 5th expression.

  Changed 20 months ago by alec

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

Fixed in r2234.

Note: See TracTickets for help on using tickets.