Solved

JavaMail and spam

Posted on 2011-03-03
6
1,354 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
This video teaches viewers about errors in exception handling.

839 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