View Issue Details

IDProjectCategoryView StatusLast Update
0007521mantisbtemailpublic2008-10-27 14:24
Reporterseiji Assigned Tovboctor  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
OSGentoo Linux 
Product Version1.1.0a1 
Target Version1.1.0Fixed in Version1.1.0a3 
Summary0007521: wrong Message-ID when "Mail Queuing" is used.
Description

If I set up according to "Setting up Mail Queuing"(http://www.mantisbt.org/wiki/doku.php/mantisbt:setting_up_mail_queuing), the Message-Id of mail which is sent by cron looks wrong, as follows.

"bfda4367087f229be890b9a5bf757862@localhost.localdomain"

should be

"bfda4367087f229be890b9a5bf757862@example.com"

Steps To Reproduce

http://www.mantisbt.org/wiki/doku.php/mantisbt:setting_up_mail_queuing

Additional Information

class.phpmailer.php, 1441L

"function ServerHostname()" rerurns "localhost.localdomain" when email is sent by cron.

TagsNo tags attached.
Attached Files
patch.txt (1,059 bytes)   
--- email_api.php.old	2006-10-23 22:36:18.000000000 +0900
+++ email_api.php	2006-10-23 22:36:26.000000000 +0900
@@ -646,6 +646,9 @@
         $t_email_data->metadata['priority'] = config_get( 'mail_priority' );               # Urgent = 1, Not Urgent = 5, Disable = 0
         $t_email_data->metadata['charset'] =  lang_get( 'charset', lang_get_current() );
 
+        $_SERVER = ( isset( $_SERVER ) ) ? $_SERVER : $HTTP_SERVER_VARS;
+        $t_email_data->metadata['server_name']  = ( isset( $_SERVER['SERVER_NAME'] ) ) ? $_SERVER['SERVER_NAME'] : '';
+
         $t_email_id = email_queue_add( $t_email_data );
         
         return $t_email_id; 
@@ -694,6 +697,8 @@
 
         $mail = new PHPMailer;
 
+        $mail->Hostname = $t_email_data->metadata['server_name'];
+
         $mail->PluginDir = PHPMAILER_PATH;
 
         # @@@ should this be the current language (for the recipient) or the default one (for the user running the command) (thraxisp)
@@ -1132,4 +1137,4 @@
 
         return $t_bug_data;
     }
-?>
\ �ե��������˲��Ԥ�����ޤ���
+?>
patch.txt (1,059 bytes)   

Relationships

related to 0009753 closedgiallu second Message-Id fails to contain hostname 

Activities

seiji

seiji

2006-12-22 08:38

reporter   ~0013861

If message-Id includes "localhost.localdomain", Spam detection Software like SpamAssassin will identify mail as spam.

Content analysis details: (10.4 points, 10.0 required)

pts rule name description


-0.1 CONTENT_TYPE_PRESENT exists:Content-Type
1.0 NO_REAL_NAME From: does not include a real name
0.1 X_MAILER_PRESENT exists:X-Mailer
1.5 MSGIDLOCALMTA seems to be sent from local MTA with dynamic IP
7.5 BAYES_99 BODY: Bayesian spam probability is 99 to 100%
[score: 1.0000]
0.2 QENCPTR1 FULL: Quoted-Printable mime pattern
0.2 AWL AWL: From: address is in the auto white-list

vboctor

vboctor

2006-12-27 20:28

manager   ~0013867

In your patch you set the server to '' if server host is not set. Shouldn't we set it to the domain part of the email address we are sending the message from?

seiji

seiji

2006-12-28 01:52

reporter   ~0013869

Last edited: 2006-12-28 01:54

Yes, we should set it.

In email_store,

    $t_hostname = '';
    $_SERVER = ( isset( $_SERVER ) ) ? $_SERVER : $HTTP_SERVER_VARS;
    if ( isset( $_SERVER['SERVER_NAME'] ) ) {
        $t_hostname = $_SERVER['SERVER_NAME'];
    } else {
        $t_address = explode( '@', config_get( 'from_email' ) );            
        if ( isset( $t_address[1] ) ) {
            $t_hostname = $t_address[1];
        } 
    }
    $t_email_data->metadata['hostname'] = $t_hostname;

and In email_send,

$mail->Hostname = $t_email_data->metadata['hostname'];