Hi,
below I've included a patch for sendmail.inc to enable multilines
(and semicolons) in the mailto, cc, and bcc fields. I hope you find
it useful.
Really enjoying RoundCube mail!
cheers, Corey
----- BEGIN PATCH ----- 69,73c69,77 < < $mailto_regexp = '/,\s*$/'; < < // trip ending ', ' from
// regex patterns $mailto_regexp_newlines = '/[,;]*\s*\r\n/'; $mailto_regexp_trail = '/,\s*$/';
$mailto = $_POST['_to'];
// convert newlines/semicolons and strip trailing ', ' in mailto $mailto = preg_replace($mailto_regexp_newlines, ',', $mailto); $mailto = preg_replace($mailto_regexp_trail, '', $mailto);
94,98c98,108 < if ($_POST['_cc']) < $headers['Cc'] = preg_replace($mailto_regexp, '', $_POST['_cc']); < < if ($_POST['_bcc'])
if ($_POST['_cc']) { $mailcc = $_POST['_cc']; $mailcc = preg_replace($mailto_regexp_newlines, ',', $mailcc); $headers['Cc'] = preg_replace($mailto_regexp_trail, '', $mailcc); }
if ($_POST['_bcc']) { $mailbcc = $_POST['_bcc']; $mailbcc = preg_replace($mailto_regexp_newlines, ',', $mailbcc); $headers['Bcc'] = preg_replace($mailto_regexp_trail, '', $mailbcc); }
267c277 < ?> \ No newline at end of file
?>
----- END PATCH -----
On Sun, Nov 27, 2005 at 06:06:02PM -0800, Corey Innis wrote:
// regex patterns $mailto_regexp_newlines = '/[,;]*\s*\r\n/';
Not sure, but shouldn't that one be changed to something like
'/[,;]*\s*(\r|\n|\r\n)/'
Because of all the different line endings on windows, mac, unix, etc?
Balu
This was already added to the CVS: $mailto_regexp = array('/,\s*[\r\n]+/', '/[\r\n]+/', '/,\s*$/m'); $mailto_replace = array(', ', ', ', '');
Only the semicolon is not accepted as an address delimiter. How do other mail clients handle semicolons in the address line?
Regards, Thomas
Corey Innis wrote:
Hi,
below I've included a patch for sendmail.inc to enable multilines (and semicolons) in the mailto, cc, and bcc fields. I hope you find it useful.
Really enjoying RoundCube mail!
cheers, Corey
----- BEGIN PATCH ----- 69,73c69,77 < < $mailto_regexp = '/,\s*$/'; < < // trip ending ', ' from
< $mailto = preg_replace($mailto_regexp, '', $_POST['_to']);
// regex patterns $mailto_regexp_newlines = '/[,;]*\s*\r\n/'; $mailto_regexp_trail = '/,\s*$/';
$mailto = $_POST['_to'];
// convert newlines/semicolons and strip trailing ', ' in mailto $mailto = preg_replace($mailto_regexp_newlines, ',', $mailto); $mailto = preg_replace($mailto_regexp_trail, '', $mailto);
94,98c98,108 < if ($_POST['_cc']) < $headers['Cc'] = preg_replace($mailto_regexp, '', $_POST['_cc']); < < if ($_POST['_bcc'])
< $headers['Bcc'] = preg_replace($mailto_regexp, '', $_POST['_bcc']);
if ($_POST['_cc']) { $mailcc = $_POST['_cc']; $mailcc = preg_replace($mailto_regexp_newlines, ',', $mailcc); $headers['Cc'] = preg_replace($mailto_regexp_trail, '', $mailcc); }
if ($_POST['_bcc']) { $mailbcc = $_POST['_bcc']; $mailbcc = preg_replace($mailto_regexp_newlines, ',', $mailbcc); $headers['Bcc'] = preg_replace($mailto_regexp_trail, '', $mailbcc); }
267c277 < ?> \ No newline at end of file
?>
----- END PATCH -----
Yeah, that seems to make sense to me.
On Nov 28, 2005, at 3:00 AM, Thomas -Balu- Walter wrote:
On Sun, Nov 27, 2005 at 06:06:02PM -0800, Corey Innis wrote:
// regex patterns $mailto_regexp_newlines = '/[,;]*\s*\r\n/';
Not sure, but shouldn't that one be changed to something like
'/[,;]*\s*(\r|\n|\r\n)/'
Because of all the different line endings on windows, mac, unix, etc?
Balu
Great! Sorry that I hadn't looked at the CVS version first.
I added the semicolon because I believe MS Outlook uses that a the
delimiter. Not that I'm a fan of MS-proprietary techniques (or
further propagating them), but I thought users might be accustomed to
using semicolons.
On Nov 28, 2005, at 3:15 AM, Thomas Bruederli wrote:
This was already added to the CVS: $mailto_regexp = array('/,\s*[\r\n]+/', '/[\r\n]+/', '/,\s*$/m'); $mailto_replace = array(', ', ', ', '');
Only the semicolon is not accepted as an address delimiter. How do
other mail clients handle semicolons in the address line?Regards, Thomas
Corey Innis wrote:
Hi,
below I've included a patch for sendmail.inc to enable multilines
(and semicolons) in the mailto, cc, and bcc fields. I hope you find it
useful.Really enjoying RoundCube mail!
cheers, Corey
----- BEGIN PATCH ----- 69,73c69,77 < < $mailto_regexp = '/,\s*$/'; < < // trip ending ', ' from
< $mailto = preg_replace($mailto_regexp, '', $_POST['_to']);
// regex patterns $mailto_regexp_newlines = '/[,;]*\s*\r\n/'; $mailto_regexp_trail = '/,\s*$/';
$mailto = $_POST['_to'];
// convert newlines/semicolons and strip trailing ', ' in mailto $mailto = preg_replace($mailto_regexp_newlines, ',', $mailto); $mailto = preg_replace($mailto_regexp_trail, '', $mailto);
94,98c98,108 < if ($_POST['_cc']) < $headers['Cc'] = preg_replace($mailto_regexp, '', $_POST['_cc']); < < if ($_POST['_bcc']) < $headers['Bcc'] = preg_replace($mailto_regexp, '', $_POST ['_bcc']);
if ($_POST['_cc']) { $mailcc = $_POST['_cc']; $mailcc = preg_replace($mailto_regexp_newlines, ',', $mailcc); $headers['Cc'] = preg_replace($mailto_regexp_trail, '', $mailcc); }
if ($_POST['_bcc']) { $mailbcc = $_POST['_bcc']; $mailbcc = preg_replace($mailto_regexp_newlines, ',', $mailbcc); $headers['Bcc'] = preg_replace($mailto_regexp_trail, '',
$mailbcc); }267c277 < ?> \ No newline at end of file
?>
----- END PATCH -----
this should work as well using:
(r?n)
not sure if it matters to regex/performance (if at all)
On Mon, 28 Nov 2005 12:28:58 -0800, Corey Innis corey@coolerator.net wrote:
Yeah, that seems to make sense to me.
- corey
On Nov 28, 2005, at 3:00 AM, Thomas -Balu- Walter wrote:
On Sun, Nov 27, 2005 at 06:06:02PM -0800, Corey Innis wrote:
// regex patterns $mailto_regexp_newlines = '/[,;]*s*rn/';
Not sure, but shouldn't that one be changed to something like
'/[,;]*s*(r|n|rn)/'
Because of all the different line endings on windows, mac, unix, etc?
Balu
i ment (\r?\n).
it seems roundcube enjoys 'un-escaping' text before sending it.
On Mon, 28 Nov 2005 15:36:30 -0500, Zachery Hostens roundcube@plastik.us wrote:
this should work as well using:
(r?n)
not sure if it matters to regex/performance (if at all)
- Zachery
On Mon, 28 Nov 2005 12:28:58 -0800, Corey Innis corey@coolerator.net wrote:
Yeah, that seems to make sense to me.
- corey
On Nov 28, 2005, at 3:00 AM, Thomas -Balu- Walter wrote:
On Sun, Nov 27, 2005 at 06:06:02PM -0800, Corey Innis wrote:
// regex patterns $mailto_regexp_newlines = '/[,;]*s*rn/';
Not sure, but shouldn't that one be changed to something like
'/[,;]*s*(r|n|rn)/'
Because of all the different line endings on windows, mac, unix, etc?
Balu