From: Michael Vogel Date: Mon, 17 Dec 2012 23:47:55 +0000 (+0100) Subject: mail: "reply-to" now triggers the "sender"-header instead of the "reply-to"-header. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9ab34f885793a7962f3269d8255198a4f209b518;p=friendica.git mail: "reply-to" now triggers the "sender"-header instead of the "reply-to"-header. --- diff --git a/include/delivery.php b/include/delivery.php index 4280359735..c56d7d2884 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -458,13 +458,17 @@ function delivery_run(&$argv, &$argc){ // only expose our real email address to true friends - if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked'])) - $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . $local_user[0]['email'] . '>' . "\n"; - else + if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked'])) { + if($reply_to) { + $headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$reply_to.'>'."\n"; + $headers .= 'Sender: '.$local_user[0]['email']."\n"; + } else + $headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n"; + } else $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; - if($reply_to) - $headers .= 'Reply-to: ' . $reply_to . "\n"; + //if($reply_to) + // $headers .= 'Reply-to: ' . $reply_to . "\n"; // for testing purposes: Collect exported mails // $file = tempnam("/tmp/friendica/", "mail-out-"); diff --git a/include/notifier.php b/include/notifier.php index 3398254b6a..b685e1b998 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -771,14 +771,17 @@ function notifier_run(&$argv, &$argc){ $subject = (($it['title']) ? email_header_encode($it['title'],'UTF-8') : t("\x28no subject\x29")) ; // only expose our real email address to true friends - if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked'])) - $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . $local_user[0]['email'] . '>' . "\n"; + if($reply_to) { + $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . $reply_to . '>' . "\n"; + $headers .= 'Sender: '.$local_user[0]['email']."\n"; + } else + $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . $local_user[0]['email'] . '>' . "\n"; else $headers = 'From: ' . email_header_encode($local_user[0]['username'],'UTF-8') . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; - if($reply_to) - $headers .= 'Reply-to: ' . $reply_to . "\n"; + //if($reply_to) + // $headers .= 'Reply-to: ' . $reply_to . "\n"; // for testing purposes: Collect exported mails //$file = tempnam("/tmp/friendica/", "mail-out2-"); diff --git a/mod/settings.php b/mod/settings.php index 1e464de18c..7cfdbb1cd5 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -209,6 +209,7 @@ function settings_post(&$a) { intval($mail_pubmail), intval(local_user()) ); + logger("mail: updating mailaccount. Response: ".print_r($r, true)); $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1", intval(local_user()) ); @@ -731,7 +732,7 @@ function settings_content(&$a) { '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')), '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''), '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), - '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), + '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'), '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''), '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder'))), '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''),