Solved

JavaMail and spam

Posted on 2011-03-03
6
1,294 Views
Last Modified: 2012-05-11
Hi,

I have upgraded java mail to version 1.4.4. And i notice that my messages are recognized as spam.
Normal sending is ok, but clone of message dont.
I do something like:

MimeMessage newMsg = new MimeMessage(org_msg);
      newMsg.setRecipients(Message.RecipientType.TO, addr);
      newMsg.setRecipients(Message.RecipientType.CC, new Address[0]);
      newMsg.setRecipients(Message.RecipientType.BCC, new Address[0]);
      newMsg.saveChanges();

0
Comment
Question by:lavitz
  • 4
  • 2
6 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 35026144
Usually in Spam-Marked Mails you can see a comment of the filter telling you exactly why the mail was treated as spam.
Did you have a look at this? If not I doubt we can guess the reason for this.
0
 

Author Comment

by:lavitz
ID: 35036278
Here is spam log

 pts rule name              description
---- ---------------------- --------------------------------------------------
 3.1 BAD_ENC_HEADER         Message has bad MIME encoding in the header
 0.1 FORGED_RCVD_HELO       Received: contains a forged HELO
 4.0 RCVD_HELO_IP_MISMATCH  Received: HELO and IP do not match, but should
 1.5 RCVD_NUMERIC_HELO      Received: contains an IP address used for HELO
-2.6 BAYES_00               BODY: Bayesian spam probability is 0 to 1%
                            [score: 0.0000]
 0.0 HTML_MESSAGE           BODY: HTML included in message
 0.0 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
 2.3 HTML_TINY_FONT         RAW: body contains 1 or 0-point font
 1.3 FROM_EXCESS_BASE64     From: base64 encoded unnecessarily
-3.5 AWL                    AWL: From: address is in the auto white-list


0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 35036316
Well I guess having a look at this, it seems that the mime-encoding set in the header is not set or incorrect and the ip-address sent in the HELO command of the SMTP connection is wrong (if the remote server uses the name provided by the HELO to lookup the IP of the sender and this check fails). This usually happens when your sending server has local names and ip-addresses (it is inside a local network which accesses the internet via NAT or a Proxy).
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 35036325
From the 4th response your server is propably sending it's local IP adress, which the recieving host cannot access.
0
 

Author Comment

by:lavitz
ID: 35175259
Iam not responsible for making mails. Java mail do this. Iam interested why changing java version make mail spam
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 35381546
Well I think the problem is that your Application is sending emails. And naturally your machine is posting it's local IP address in the EHLO SMTP command (Lets say you have the local ip 10.10.10.123) If you now use a Gateway (10.10.10.1 with the ip 1.2.3.4 from the Internet) then the remote Server will recieve an EHLO from the IP 1.2.3.4 but will say that he's 10.10.10.123 in the EHLO. This is the reason for your spam-rating.

I think the best solution (The one I allways use) is to use your fully configured company mailserver, create a dedicated account for your application (or a shared one to support all your applications) and to make the SMTP Server relay the mails to the final destination ... this way you should no longer have these problems.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now