File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes james send email doesn't arrive at destination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "james send email doesn Watch "james send email doesn New topic
Author

james send email doesn't arrive at destination

Tudor Raneti
Ranch Hand

Joined: Nov 29, 2009
Posts: 145
I'm using the example here:
http://www.ibm.com/developerworks/java/library/j-james1/index.html
I've forwarded, virtual hosted, port 25. No firewall. Debug checks all ok but no email goes through!? Mail sends from one user to another at localhost, just not to my internet mail account.
What could be the problem please?


SENDING message from red@localhost to tudor.raneti@gmail.com

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 Desktop SMTP Server (JAMES SMTP Server 2.3.2) ready Sun, 5 Aug 2012 01:35:18 +0300 (EEST)
DEBUG SMTP: connected to host "localhost", port: 25

EHLO Desktop
250-Desktop Hello Desktop (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:<red@localhost>
250 2.1.0 Sender <red@localhost> OK
RCPT TO:<tudor.raneti@gmail.com>
250 2.1.5 Recipient <tudor.raneti@gmail.com> OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: tudor.raneti@gmail.com
DATA
354 Ok Send data ending with <CRLF>.<CRLF>
To: tudor.raneti@gmail.com
Message-ID: <23063136.2.1344119718490.JavaMail.red@localhost>
Subject: Testing blue from red
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This is a test message
.
250 2.6.0 Message received
QUIT
221 2.0.0 Desktop Service closing transmission channel
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Quite possibly Gmail is rejecting that mail because it doesn't come from a host which matches the from-address on the e-mail message. But that's just speculation. It would be better to look at the logs of your mail server and see exactly what happened when it tried to send that message.
Tudor Raneti
Ranch Hand

Joined: Nov 29, 2009
Posts: 145
I've also sent to yahoo.com, nothing arrives there. It's possible it's my ISP's blocking of port 25, but I'll see that in a few days. I made a request for unblocking.
In the meantime should I know anything else about mail server? Something I didn't configure?

EDIT: Ok, this is what happened:
when sending to yahoo:
05/08/12 02:05:27 INFO James.Mailet: RemoteDelivery: Could not connect to SMTP host: 98.136.216.26, port: 25

when sending to gmail:
05/08/12 01:59:51 INFO James.Mailet: RemoteDelivery: Could not connect to SMTP host: 74.125.127.26, port: 25

Any thoughts?
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1025
    
    5

You are using the wrong ports is my theory.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Well, if you're going to be running a responsible mail server, it should be configured correctly. So if you're using it to send e-mail messages from addresses in domain X, then your DNS should be set up so that anybody who wants to send e-mails to addresses in domain X can find your server.

Generally servers who see messages which claim to be from (say) GMail addresses will check to ensure that they are coming from GMail servers. If they aren't, then they may be considered to be forgeries.
Tudor Raneti
Ranch Hand

Joined: Nov 29, 2009
Posts: 145
I'll follow this tomorrow, and by that time maybe my ISP responds too.
http://www.warriorforum.com/programming-talk/161354-how-setup-email-namecheap-domains.html

I managed to get blacklisted by yahoo in the meantime , so I got an extra chore now...
http://help.yahoo.com/kb/index?page=content&y=PROD_MAIL_ML&locale=en_US&id=SLN5070&impressions=true

Will come back with outcome...
Tudor Raneti
Ranch Hand

Joined: Nov 29, 2009
Posts: 145
I've set my email server in my domain's MX record and configured the email server name as such. Thanks for pointing that out

The problem most probably was that public mail servers block "anonymous" emailing as spam, not even bothering to send it to spam or junk folders (sometimes it did, then it didn't catch my mails at all). After making my email server "legit", the mails arrive in yahoo and gmail safely.

P.S.
Also... keep in mind that most public or commercial email servers out there have a send email per hour limit, which is why it isn't a good idea to use gmail as your email sending device. Roll your own server for unconstrained mail services
Tudor Raneti
Ranch Hand

Joined: Nov 29, 2009
Posts: 145
Now I've run into another problem:
mailet*.log sais:
Exception delivering message (Mail1345880665225-8-to-gmail.com) - [EOF]

Upon some quick investigation (why do these happen when I'm out of time), it seems it may have to to with my PTR record:
http://old.nabble.com/emails-gets-spooled-but-not-delivered--td32509992.html
with more info on that here:

http://hosting.intermedia.net/support/kb/default.asp?id=1317

like
One common myth about PTR records is that they are created for domain names and your domain has to have one to make sure your mail will not be rejected by other mail servers.

and
http://en.wikipedia.org/wiki/List_of_DNS_record_types

Anyone has any help for me before I waste more time investigating setting a proper email server solution further?
Do I need to set reverse DNS?
 
GeeCON Prague 2014
 
subject: james send email doesn't arrive at destination