Roundcube Community Forum

 

0.5.1 - SOLVED: RC Originated Mail Marked as Spam

Started by Justin Gould, February 27, 2011, 07:45:04 PM

Previous topic - Next topic

Justin Gould

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

amoniak

thank you!

I applied this in my install of 0.5.1

all best
dan

ABerglund

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
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

forever710

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

alec

I don't understand what's the issue. Proposed change is wrong. What if user will write address with name, e.g. "User" .