Email отправил JamesServer помечают как спам. Я использую JavaMail для подключения к JamesServer для отправки электронной почты.JavaMail JamesServer: Email помечен как спам
Чтобы проверить спам, я использую сайт mail-tester.com. Этот сайт рассказывает мне письмо, помечены как спам с отрицательным порогом ниже:
-3.603 HELO_LOCALHOST HELO_LOCALHOST
я наткнулся на HELO и EHLO параметров на основе сайта. Чтобы переопределить helo и ehlo, я использовал свойство mail.smtp.localhost. Но я смог изменить ehlo, но я не могу изменить значение helo.
Как изменить значение параметра helo?
Вот мой Java пример кода:
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Properties;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class TestSendMail {
private String fromEmail = "[email protected]";
public void sendmail() {
Properties properties = new Properties();
final String smtpHost = "xxxxxxxxxx.com";
String port = "25";
String strHostName = smtpHost;
try {
strHostName = InetAddress.getLocalHost().getHostName();
System.out.println(strHostName);
} catch (UnknownHostException e) {
}
properties.put("helo", strHostName);
properties.put("mail.host", strHostName);
properties.put("mail.smtp.localhost", strHostName);
properties.put("mail.smtps.localhost", strHostName);
properties.put("mail.smtp.host", smtpHost);
properties.put("mail.smtp.port", port);
properties.put("mail.smtp.auth", "true");
properties.put("mail.transport.protocol", "smtp");
Session session = Session.getInstance(properties,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(fromEmail,"Welcome123!");
}
});
String toEmail = "[email protected]";
String replyTo = "[email protected]" + smtpHost;
String messageBody = "<html><body>Test body</body></html>";
try {
MimeMessage message = new MimeMessage(session);
message.setSentDate(new Date());
message.setFrom(new InternetAddress(fromEmail));
message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(toEmail));
message.setSubject("Test");
message.setReplyTo(new javax.mail.Address[]
{
new InternetAddress(replyTo)
});
message.setContent(messageBody, "text/html");
Transport.send(message);
System.out.println("Message sent successfully....");
} catch (MessagingException mex) {
mex.printStackTrace();
System.out.println(mex.getMessage());
}
}
public static void main(String[] args) {
TestSendMail send = new TestSendMail();
send.sendmail();
}
}
Вот мой электронный журнал, который я получил его от mail-tester.com
Received: by mail-tester.com (Postfix, from userid 500) id F01C8A0C53;
Fri, 5 Jun 2015 14:01:09 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail-tester.com
X-Spam-Flag: YES
X-Spam-Level: *****
X-Spam-Status: Yes/6.0/5.0
X-Spam-Test-Scores: FSL_HELO_NON_FQDN_1=0.001,HELO_LOCALHOST=3.603,
HTML_MESSAGE=0.001,MIME_HTML_ONLY=1.105,RDNS_NONE=1.274
X-Spam-Last-External-IP: 128.199.181.189
X-Spam-Last-External-HELO: localhost
X-Spam-Last-External-rDNS:
X-Spam-Date-of-Scan: Fri, 05 Jun 2015 14:01:09 +0200
X-Spam-Report: * 3.6 HELO_LOCALHOST No description available. * 0.0
FSL_HELO_NON_FQDN_1 No description available. * 1.1 MIME_HTML_ONLY BODY:
Message only has text/html MIME parts * 0.0 HTML_MESSAGE BODY: HTML
included in message * 1.3 RDNS_NONE Delivered to internal network by a
host with no rDNS
Received-SPF: None (no SPF record) identity=mailfrom;
client-ip=128.199.181.189; helo=localhost;
[email protected]; [email protected]
Authentication-Results: mail-tester.com; dmarc=none
header.from=xxxxxxxxxx.com
Received: from localhost (unknown [128.199.181.189])
by mail-tester.com (Postfix) with ESMTP id 2B6E09F862
for <[email protected]>; Fri, 5 Jun 2015 14:01:07 +0200 (CEST)
MIME-Version: 1.0
X-UserIsAuth: true
Received: from 122.175.7.239 (EHLO USER-PC) ([122.175.7.239])
by xxxxxxxxxx-01 (JAMES SMTP Server) with ESMTPA ID 1021366912
for <[email protected]>;
Fri, 05 Jun 2015 08:02:40 -0400 (EDT)
Date: Fri, 5 Jun 2015 17:32:44 +0530 (IST)
From: [email protected]
Reply-To: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Test
Return-Path: [email protected]
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<html><body>Test body</body></html>
Любая помощь приветствуется.