Connecting microsoft Exchange server with java - java

I have a problem in connecting microsoft exchange server active directory with java using Java Mail. it is throwing an exception
javax.mail.MessagingException: No login methods supported!;
or sometimes
com.sun.mail.iap.ConnectionException: 220
i just want a simple idea to how to actually connect with an exchange server active dirrectory.

I am afraid that you did not enable SNMP support on your exchange server. Check it. Exchange server supports various protocols but its default protocol is proprietary, while Java mail API works with SNMP.

Related

I need to send emails from an email hosted on a Microsoft Exchange server

I successfully created a java program that can send emails from a gmail account, however, now I need to do the same with an email account using a Microsoft Exchange Server.
The difference is when I was creating the gmail application I had all the information I needed to just plug into the JavaMail API program to make it work. For example, the SMTP server is smtp.gmail.com, the port is 587, the account needs to be set to "Less secure login requirements", etc...
I do not have access to any of this information for the Exchange Server. I am wondering if this is possible to do? I would assume I probably wont be able to use the JavaMail API like I did with gmail seeing as i don't have any of the information that is required for the fields. Is there some other library out there that I can use?
If some of this sounds like I don't really know what I'm talking about it's probably because I don't. This is kind of new territory for me, and I seem to have hit a wall. Basically I just need a program that can send an email from an account hosted on a Microsoft Exchange server. Hopefully this make since. Thanks.
Ms Exchange and GMail are both email providers, they rely on the same protocol : SMTP. So your JavaMail API should also work with Exchange, provided the required features are enabled :
SMTP : should be enabled by default, unless your admin disabled it.
SMTP Authentication, or SMTP relay for your sender IP address : Some authentication mechanisms (AUTH LOGIN) are disabled by default on latest versions of Exchange. Relay also has to be configured by the admin.
The easiest way to find out your exchange server address and port is to contact your Exchange administrator. However, you can find it by yourself by :
If you're not on the exchange local network, you can try "nslookup -q=mx senderdomain.com" to find out the Exchange IP adderss
Else, you can try and follow this procedure
Once you have the Exchange IP address, confirm that SMTP delivery port (25) is opened, it should be. If relay is authorized for your IP, you should be done.
Else, test if SMTP submission port (587) is opened, that should be the one you use to send authenticated emails.
Alternatively, you can try and use Exchange Web Services API, provided it's enabled on the server. There seems to be a Microsoft JAVA libray to use EWS : ews-java-api.

Investigating SSL Handshaking details in JAVA

One of my applications uses socket for making connection for network message handling. It uses https and everything is ok with message handling.
I need to log whatever happens in handshake process for any possible problems in SSL connection handling. Is there any way to do this in java code. Or even Is there any tool to monitor handshaking process.
Development environment is windows server 2003 uses JDK 6.

Java SSO using waffle on Windows 2003 Server from a C++ client

We have a legacy client-server application with the client written in C++ and server in Java (both running on Windows) using CORBA for communication.
Note that the Java application on the server doesn't use TomCat or other application servers.
To enable Active Directory authentication of the client I'm using the Waffle library on the server and Windows APIs on the client to perform a Negotiate SSPI exchange loop as mentioned in this post: Authenticating users using Active Directory in Client-Server Application
The MSDN sample for the SSPI Exchange loop has multiple send-receive calls between client and server (probably to account for NTLM auth too) but I've been able to successfully authenticate the client by sending the auth token just once to the server.
If our server runs on Windows Server 2003 and greater, and our client runs on Windows XP and greater, is it safe for me to assume that Kerberos will be used and multiple send-receive calls are not required?
If I were to authenticate using Java+waffle on Tomcat, I notice that the auth token is sent just once.

Java application to access MAILBOX using MAPI

I am trying to establish a connection between my mail server and a java program to parse the mail using protocol MAPI.. now the connection is working fine with a mock mailbox using IMAPS..but my mail server does not support MAPI..So is thr any option like JMAPI..
It seems like Java Supports POP3 and IMAP very well out of the box.
But for other protocols you can use one of the vendors found at JavaMail API - Third Party Products.
I've had problems communicating with the Novell Groupwise Protocol, luckily they have a IMAP bridge I could have used instead.
The Moonrug Exchange Connector looks like the one you are looking for, but you will have to purchase.
OpenMAPI looks like a promising one, but it is still in development.

How to put email to my own mailbox with Java mail API

I am trying to send simple text mail to myself from a servlet using Java Mail API. I wonder how to best approach this in order to avoid daily sent limits meant to restrict sending mail to other people.
How does a mail server receive email? From what information I could find, it is through the SMTP protocol? When the receiver happens to be local, instead of a relay the SMTP server assumes the role of local mail delivery agent. Is that correct? Any problems I could bump into when I connect directly to my SMTP server?
To avoid any confusion, I want my servlet to act as an SMTP server, NOT a mail client that connects to one. I want to make a mail server to RECEIVE a message going to my mail box, not relay one to other people.
Yes, SMTP is the protocol that a client uses to send an email message to a remote server.
Depending on the server software, there may be ways to send a message to a local server without using SMTP, but (as far as I know) the Java mail framework doesn't know about any of those, it can only use SMTP. So if there are limits on how much you can send, you'll just have to fix those limits directly.
If you want to test sending mail from your java application, and you have no development server to connect to, then install a local email server (hmailserver for windows, postfix for *nix).
Configure your email server to only receive email from localhost, and to only deliver to local clients (that way you wont spam the world with your test emails).
Once your happy with your application, you can point it at a production email server. How you connect and the amount of emails you can send will depend on your provider. If you are hosting your own email server you should get professional advice (or do a lot of reasearch) to prevent becoming a spammer, or having a spammer abuse your service (google for open relay).
The postfix site has plenty of good documentation and hmail server has a very good gui.

Categories

Resources