Mails sent using Apache James are not delivered

2.9k views Asked by At

I've setup Apache James Server v2.3.2 and configured it as described in HOW TO section.

It works OK, sends mails as expected but on my Gmail account only and filtered as spam. Have no idea why other my emails accounts reject it i could find them in inbox.

I've tried to find a solution in mail list archive but with no result.

Did somebody face this problem? Did I miss some required SMTP headers or something?

Typical raw message (java mail session debug mode) looks like this ([email protected]_domain):

DEBUG: setDebug: JavaMail version 1.4.3
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "localhost", port 25, isSSL false
220 alex SMTP Server (JAMES SMTP Server 2.3.2) ready Mon, 21 Feb 2011 23:15:02 +0200 (EET)
DEBUG SMTP: connected to host "localhost", port: 25

EHLO alex
250-alex Hello alex (localhost [127.0.0.1])
250-PIPELINING
250 ENHANCEDSTATUSCODES
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<alex@localhost>
250 2.1.0 Sender <alex@localhost> OK
RCPT TO:<[email protected]_domain>
250 2.1.5 Recipient <[email protected]_domain> OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP:   [email protected]_domain
DATA
354 Ok Send data ending with <CRLF>.<CRLF>
From: alex@localhost
To: [email protected]_domain
Message-ID: <7704521.0.1298322902328.JavaMail.Administrator@alex>
Subject: re[2]: hello
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

body is here
.
250 2.6.0 Message received
QUIT
221 2.0.0 alex Service closing transmission channel
2

There are 2 answers

0
Chris On

There is nothing obvious wrong with your debug log. But it looks like your server is running on a test or development machine with a dynamic IP address? Many mail servers reject mails from a dynamic IP range.

0
Alireza Mazloumi On

I think problem caused by this:

Email servers before accepting any mail do a reverse dns query. They check the ip for domain that the email came from and the ip that email is really came from.

If ip of domain and ip of email sender does not match, mail servers think that email is junk or spam.

Here since your domain (localhost) is not a valid address when Email server send a reverse dns query does not get an IP and think your mail is junk or spam.

For more information check this: http://wiki.junkemailfilter.com/index.php/Fixing_Reverse_DNS