Changeset 4235 in subversion
- Timestamp:
- Nov 19, 2010 3:45:19 AM (3 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 edited
-
program/steps/mail/compose.inc (modified) (2 diffs)
-
program/steps/mail/sendmail.inc (modified) (6 diffs)
-
skins/default/mail.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/compose.inc
r4223 r4235 473 473 else if (!empty($_SESSION['compose']['param']['from'])) 474 474 $from_id = $_SESSION['compose']['param']['from']; 475 else if (count($user_identities) > 1){475 else { 476 476 $return_path = $MESSAGE->headers->others['return-path']; 477 477 … … 502 502 $OUTPUT->set_env('signatures', $a_signatures); 503 503 } 504 else 505 { 504 // no identities, display text input field 505 else { 506 $field_attrib['class'] = 'from_address'; 506 507 $input_from = new html_inputfield($field_attrib); 507 $out = $input_from->show($ _POST['_from']);508 $out = $input_from->show($from_id); 508 509 } 509 510 -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r4232 r4235 213 213 214 214 if ($EMAIL_FORMAT_ERROR) { 215 $OUTPUT->show_message('emailformaterror', 'error', array('email' => $EMAIL_FORMAT_ERROR)); 215 $OUTPUT->show_message('emailformaterror', 'error', array('email' => $EMAIL_FORMAT_ERROR)); 216 216 $OUTPUT->send('iframe'); 217 217 } … … 224 224 $mailto = 'undisclosed-recipients:;'; 225 225 226 // get sender name and address226 // Get sender name and address... 227 227 $from = get_input_value('_from', RCUBE_INPUT_POST, true, $message_charset); 228 $identity_arr = rcmail_get_identity($from); 229 230 if (!$identity_arr && ($from = rcmail_email_input_format($from))) { 231 if (preg_match('/(\S+@\S+)/', $from, $m)) 232 $identity_arr['mailto'] = $m[1]; 233 } else 234 $from = $identity_arr['mailto']; 235 236 if (empty($identity_arr['string'])) 237 $identity_arr['string'] = $from; 228 // ... from identity... 229 if (is_numeric($from)) { 230 if (is_array($identity_arr = rcmail_get_identity($from))) { 231 if ($identity_arr['mailto']) 232 $from = $identity_arr['mailto']; 233 if ($identity_arr['string']) 234 $from_string = $identity_arr['string']; 235 } 236 else { 237 $from = null; 238 } 239 } 240 // ... if there is no identity record, this might be a custom from 241 else if ($from_string = rcmail_email_input_format($from)) { 242 if (preg_match('/(\S+@\S+)/', $from_string, $m)) 243 $from = trim($m[1], '<>'); 244 else 245 $from = null; 246 } 247 248 if (!$from_string && $from) 249 $from_string = $from; 238 250 239 251 // compose headers array … … 282 294 283 295 $headers['Date'] = rcmail_user_date(); 284 $headers['From'] = rcube_charset_convert($ identity_arr['string'], RCMAIL_CHARSET, $message_charset);296 $headers['From'] = rcube_charset_convert($from_string, RCMAIL_CHARSET, $message_charset); 285 297 $headers['To'] = $mailto; 286 298 … … 332 344 $headers['References'] = $_SESSION['compose']['references']; 333 345 334 if (!empty($_POST['_priority'])) 335 { 346 if (!empty($_POST['_priority'])) { 336 347 $priority = intval($_POST['_priority']); 337 348 $a_priorities = array(1=>'highest', 2=>'high', 4=>'low', 5=>'lowest'); 338 349 if ($str_priority = $a_priorities[$priority]) 339 350 $headers['X-Priority'] = sprintf("%d (%s)", $priority, ucfirst($str_priority)); 340 } 341 342 if (!empty($_POST['_receipt'])) 343 { 344 $headers['Return-Receipt-To'] = $identity_arr['string']; 345 $headers['Disposition-Notification-To'] = $identity_arr['string']; 346 } 351 } 352 353 if (!empty($_POST['_receipt'])) { 354 $headers['Return-Receipt-To'] = $from_string; 355 $headers['Disposition-Notification-To'] = $from_string; 356 } 347 357 348 358 // additional headers … … 527 537 528 538 // encoding subject header with mb_encode provides better results with asian characters 529 if (function_exists('mb_encode_mimeheader')) 530 { 539 if (function_exists('mb_encode_mimeheader')) { 531 540 mb_internal_encoding($message_charset); 532 541 $headers['Subject'] = mb_encode_mimeheader($headers['Subject'], … … 538 547 $MAIL_MIME->headers($headers); 539 548 540 // Begin SMTP Delivery Block 549 // Begin SMTP Delivery Block 541 550 if (!$savedraft) 542 551 { 543 // check for'From' address (identity may be incomplete)544 if ( $identity_arr && !$identity_arr['mailto']) {552 // check 'From' address (identity may be incomplete) 553 if (empty($from)) { 545 554 $OUTPUT->show_message('nofromaddress', 'error'); 546 $OUTPUT->send('iframe'); 555 $OUTPUT->send('iframe'); 547 556 } 548 557 -
trunk/roundcubemail/skins/default/mail.css
r4184 r4235 1330 1330 } 1331 1331 1332 input.from_address 1333 { 1334 width: 80% !important; 1335 } 1336 1332 1337 #compose-cc, 1333 1338 #compose-bcc,
Note: See TracChangeset
for help on using the changeset viewer.
