lzb4616 / skpsmtpmessage

Automatically exported from code.google.com/p/skpsmtpmessage
0 stars 0 forks source link

SpamAssassin Scores SKPSMTPMessages Higher Than It Should #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an app to send an email with rev 21 of the software.
2. Send a test email with content and a subject line.
3. SpamAssassin assigns a score of 2+ to the email and indicates that there are 
missing header fields in the email. 

What is the expected output? 
Low SpamAssassin score. 

What do you see instead?
We see missing header fields causing the higher score. Here is the field from 
the received email:
X-Spam-Score: 2.419 (AWL,MISSING_DATE,MSGID_FROM_MTA_HEADER)

What version of the product are you using? On what operating system?
Mail is being received through Yahoo on a Mac running Mac OS X (10.5.6).

Please provide any additional information below.

There are basically two fields missing from the mail header: Message-id and 
Date. After the addition of this code the spam score drops significantly and 
the 
spam field in the email looks like this:
X-Spam-Score: 1.351 (AWL)

The patch is trivially simple add the following to SKPSMTPMessage.m in the 
method sendParts staring at line 576:

    CFUUIDRef   uuidRef   = CFUUIDCreate(kCFAllocatorDefault);
    NSString    *uuid     = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
    NSDate      *now;
    NSDateFormatter *dateFormatter;

    now = [NSDate date];
    dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss Z"];

    [message appendFormat:@"Date: %@\r\n", [dateFormatter stringFromDate:now]];
    [message appendFormat:@"Message-id: <%@@%@>\r\n", [(NSString *)uuid stringByReplacingOccurrencesOfString:@"-" withString:@""], self.relayHost];
    CFRelease(uuidRef);

Original issue reported on code.google.com by thaddeus...@gmail.com on 17 Feb 2009 at 12:16

GoogleCodeExporter commented 9 years ago
Added to latest.

Original comment by ibaird@gmail.com on 20 Feb 2009 at 3:26