JMeter how to send email through MS Exchange? - outlook

For my machine, after logging in the windows system, the outlook logon automatically with Anonymous Authentication.
The outlook connects to Microsoft Exchange using HTTP, and connects using SSL only.
The principal name in the certificate is known when connecting to proxy servers.
Header:email.server.sample
The URL to connect to my proxy server for Exchange is known.
https://email.server.sample
"Negotiate Authentication" is used when connecting to the proxy server for Exchange.
Now, the question is, how can JMeter sends out the email with this kind of situation?

Out of the box JMeter can only send emails via SMTP protocol with SMTP Sampler and/or receive emails using POP3 and/or IMAP protocols with Mail Reader Sampler
If you have to work with Exchange protocol you basically have 2 options:
Send SOAP requests using HTTP Request sampler
Use a wrapper library, i.e. ews-java-api from the JSR223 Sampler or Java Request sampler

Related

HTTPS over Socks5 server implementation

I am trying to implement a Socks5 server that could relay both HTTP and HTTPS traffic.
As the RFC1928 mentions, the following steps to establish a connection and forward the data must be taken :
Client sends a greeting message to the proxy.
Client & proxy authentication (assuming it is successful).
Client sends a request to the proxy to connect to the destination.
The proxy connects to the destination and sends back a response to the client to indicate a successful open tunnel.
The proxy reads the data from the client and forwards it to the destination.
The proxy reads the data from the destination and forwards it to the client.
So far, the proxy works as it should. It is able to relay HTTP traffic using its basic data forwarding mechanism. However, any request from the client to an HTTPS website will be aborted because of SSL/TLS encryption.
Is there another sequence/steps that should be followed to be able to handle SSL/TLS (HTTPS) traffic?
The sequence you have described is correct, even for HTTPS. When the client wants to send a request to an HTTPS server through a proxy, it will request the proxy to connect to the target server's HTTPS port, and then once the tunnel is established, the client will negotiate a TLS handshake with the target server, then send an (encrypted) HTTP request and receive an (encrypted) HTTP response. The tunnel is just a passthrough of raw bytes, the proxy has no concept of any encryption between the client and server. It doesn't care what the bytes represent, its job is just to pass them along as-is.

SMTP Emails Sending out Intermittently from application

I'm facing kind of SMTP mail problem sending through the application using coding as below
SmtpClient SMTPServer = new SmtpClient("smtp.office365.com");
SMTPServer.UseDefaultCredentials = false;
SMTPServer.Credentials = new System.Net.NetworkCredential("xxx#xxx.org","xxxxx")
SMTPServer.Port = 587;
SMTPServer.EnableSsl = true;
So been using this method 2 years ago until recently where we face email not able to send out intermittently with error message "Smtp Error: Failure sending mail". There are times where emails could send out with only average 12 emails per day. Plus, the sender email address from the application is active with correct credential login and password.
I checked our Windows 2008 R2 server and tested with our disabled firewall on server. Problem still persists. And there were no patches update to the server as well.
Is there anything to do with authentication type level? Or certain communication protocol conflicts? How do I check further to determine the root of cause? Our firewall already allowed the port 587 to send out.
There could be many issues to check. You say that the application is sending emails as a "client" to an Exchange 365 SMTP server to sent onwards, that's what the example looks like.
Check that Exchange is not rejecting the request. Microsoft can be very picky about application clients connecting directly. Look in the logs.
Check that your email application client uses TLS 1.2 or above. Many SMTP servers will reject requests below that level.
Exchange might be insisting on a STARTTLS for negotiation on credentials, so check if that is the issue.
Check that the application client is whitelisted in MS Exchange 365 if it is rejecting requests.
Check that the user you are connecting as has privilege to accept connections from remote clients. I often lock this down to prevent brute force password attacks.
Normally I would test all this out on the command line first. Get an email client for your OS like:
sendemail-1.56 by Brandon Zehm <caspian#dotconf.net>
Which is very good at initiating a connection to a remote server. Test from your application client email server and see what happens.

IIS SMTP : is it a real SMTP server or does it only relay?

I was trying to understand if the SMTP virtual server in IIS can only relay mails or if it can act as the final SMTP server. All the tutorials I've found on how to configure it always show it acting as a relay.
It can delivery directly mails (SMTP Server) also relay them

Jmeter Mail support

I am trying to check my gmail with a mail reader sampler in jmeter and enabled both imap and pop3 in my gmail account.
Everytime I try to connect to gmail, I keep getting this error:
Response message: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: imap.gmail.com, 993; timeout -1;
nested exception is:
java.net.ConnectException: Connection timed out: connect
imaps://xyz#gmail.com#imap.gmail.com/INBOX[1]
I tried both SSL and TLS option at the bottom. I tried adding and leaving out the port.
Your configuration looks good (given you tick Use SSL radio) , most likely you are sitting behind a corporate proxy server so JMeter is not able to establish connection with the IMAP Gmail endpoint.
You can configure JMeter to use proxy for Internet access as described in Using JMeter behind a proxy User Manual chapter, just launch it as:
jmeter -H proxy_host -P proxy_port ...
For more information on working with email protocols in JMeter tests check out Load Testing Your Email Server: How to Send and Receive E-mails with JMeter article

Mule connection to Exchange Server

I need to connect to Exchange Server in Mule but Mule provided OOB IMAP and POP3 are not enabled on our exchange server hence we cannot use them.
Can anyone shed some light here on other alternative ways to connect to exchange server and read the emails.
Mule mail transport implements standard transports, these being IMAP, POP3 and SMTP.
If you need anything beside these to access your mail server you should consider writing a custom connector using devkit.
An example of such an approach is the gmail connector that leverages google API to retrieve emails rather than the standard mail transport.
Most of the connections from the Internet are handled by IIS on the Exchange Server. The options can be:
RPC Over Https. Well known as “Outlook Anywhere”.
EWS. Mostly used by MAC Outlook.
Activesync – Mobility
ECP – management console, configuration via OWA
Thanks,
hope answer the question

Resources