]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
Fixed missing sudo, improved local mail in vagrant.
[friendica.git] / include / enotify.php
index 51263871b6aad1d4d5d8716ed65a3c1d34f0d304..4327e75b837d5c25fb36fbad03c7f123e861b5eb 100644 (file)
@@ -21,13 +21,21 @@ function notification($params) {
        $thanks = t('Thank You,');
        $sitename = $a->config['sitename'];
        $site_admin = sprintf( t('%s Administrator'), $sitename);
+       $nickname = "";
 
-       $sender_name = $product;
+       $sender_name = $sitename;
        $hostname = $a->get_hostname();
        if(strpos($hostname,':'))
                $hostname = substr($hostname,0,strpos($hostname,':'));
+       
+       $sender_email = $a->config['sender_email'];
+       if (empty($sender_email)) {
+               $sender_email = t('noreply') . '@' . $hostname;
+       }
 
-       $sender_email = t('noreply') . '@' . $hostname;
+       $user = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($params['uid']));
+       if ($user)
+               $nickname = $user[0]["nickname"];
 
        // with $params['show_in_notification_page'] == false, the notification isn't inserted into
        // the database, and an email is sent if applicable.
@@ -37,6 +45,7 @@ function notification($params) {
        $additional_mail_header = "";
        $additional_mail_header .= "Precedence: list\n";
        $additional_mail_header .= "X-Friendica-Host: ".$hostname."\n";
+       $additional_mail_header .= "X-Friendica-Account: <".$nickname."@".$hostname.">\n";
        $additional_mail_header .= "X-Friendica-Platform: ".FRIENDICA_PLATFORM."\n";
        $additional_mail_header .= "X-Friendica-Version: ".FRIENDICA_VERSION."\n";
        $additional_mail_header .= "List-ID: <notification.".$hostname.">\n";
@@ -344,7 +353,7 @@ function notification($params) {
                        $show_in_notification_page = false;
        }
 
-
+       $subject .= " (".$nickname."@".$hostname.")";
 
        $h = array(
                'params'    => $params,
@@ -592,6 +601,7 @@ function notification($params) {
                // use the Emailer class to send the message
 
                return Emailer::send(array(
+                       'uid' => $params['uid'],
                        'fromName' => $sender_name,
                        'fromEmail' => $sender_email,
                        'replyTo' => $sender_email,