]> git.mxchange.org Git - friendica.git/commitdiff
mail: "reply-to" now triggers the "sender"-header instead of the "reply-to"-header.
authorMichael Vogel <icarus@dabo.de>
Mon, 17 Dec 2012 23:47:55 +0000 (00:47 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 17 Dec 2012 23:47:55 +0000 (00:47 +0100)
include/delivery.php
include/notifier.php
mod/settings.php

index 4280359735c7ab317f1ec484b8f9a9aa6c375adc..c56d7d2884526dd399ca14eec91a029a1cf03185 100644 (file)
@@ -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-");
index 3398254b6a43961f241ff1a69ac937a5c6eae8da..b685e1b99872a32518558d4ad6fd0e603a5efef6 100644 (file)
@@ -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-");
index 1e464de18c8dadd888433f2eb7776537e9015390..7cfdbb1cd5f60e580b9cf22ecaf6851321a37e1f 100644 (file)
@@ -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, ''),