Roundcube Community Forum

Release Support => Pending Issues => Topic started by: Justin Gould on February 27, 2011, 07:45:04 PM

Title: 0.5.1 - SOLVED: RC Originated Mail Marked as Spam
Post by: Justin Gould on February 27, 2011, 07:45:04 PM
I was seeing an issue where mail composed in RoundCube was much more likely to be marked as spam by receiving servers.  I found and fixed the issue myself and thought I would share the fix so it could be included in the next release.

When a user composes an email and manually types in the recipient address, RC does not properly format the "To" MIME header.  It should be bracketed - but it is not.  It's just [email protected].  If you send to an address book contact, it IS properly bracketed - Justin Gould .  Improper bracketing like this is good for a couple points of Spam Confidence Level from Exchange and a couple points from SpamAssassin. 3.6 points from SA if it's direct to MX (local sender, local recipient) and the trust is not configured properly.

To fix this behavior, make the following changes to program/lib/Mail/mime.php:

In function setFrom($email), change:
$this->_headers['From'] = $email;
To:
$this->_headers['From'] = "<$email>";

In function addTo($email), change:
$this->_headers['To'] .= ", $email";
To:
$this->_headers['To'] .= ", <$email>";

AND change:
$this->_headers['To'] = $email;
To:
$this->_headers['To'] = "<$email>";

This will ensure manually entered recipient addresses are properly bracketed and reduce the chance of RC originated email being flagged as spam by remote mail hosts.

(This is already dealt with correctly in the SMTP PEAR library for the MAIL FROM and RCPT TO headers.)

Justin
Title: 0.5.1 - SOLVED: RC Originated Mail Marked as Spam
Post by: amoniak on February 28, 2011, 05:08:46 AM
thank you!

I applied this in my install of 0.5.1

all best
dan
Title: 0.5.1 - SOLVED: RC Originated Mail Marked as Spam
Post by: ABerglund on February 28, 2011, 07:15:38 PM
Please submit this as a bug (with your patch as a proposed solution) in the Bugtracker. That way it can be incorporated into a later update.

http://trac.roundcube.net/wiki/Howto_ReportIssues
Title: 0.5.1 - SOLVED: RC Originated Mail Marked as Spam
Post by: forever710 on February 28, 2011, 09:29:26 PM
This is my first time i visit here. I found so many entertaining stuff in your forum especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! Keep up the excellent work..
--------------------------

      Watch TV Online (http://www.tvonlinewatch.com)
Title: 0.5.1 - SOLVED: RC Originated Mail Marked as Spam
Post by: alec on March 01, 2011, 02:20:13 AM
I don't understand what's the issue. Proposed change is wrong. What if user will write address with name, e.g. "User" .