Catch-all SMTP server + GUI - java

I was reading this post about a NetBeans plugin which intercepts all SMTP traffic and stores it for display.
screenshot http://img216.imageshack.us/img216/4733/picture1ezb.png
I find it a great tool for developing locally when you have lots of email interaction and don't want to create {x} accounts.
Is there any such cross-platform tool available outside of NetBeans?

For JUnit testing I like to use Dumbster. It sets up a nice little server in your unit tests that holds the messages you send so you can then use JUnit assertions to validate your code is sending the right thing.

MailSnag is an Eclipse plugin that acts as a dummy SMTP server to capture and inspect emails sent out from an application during development. Each email can be viewed in a multi-tab editor displaying Text, HTML or raw format. A tab listing attachments is also displayed.

Related

Sending Dynamic Emails through a Java Cron Job using Microsoft Graph

I have a java (Spring boot) web service which does not have any UI.
I want to send a dynamic Email (created using Thymeleaf and injecting values from a database) using my web service on a daily Cron schedule, using Microsoft Graph and O365 APIs.
Right now I use SMTP to send emails, but I cannot use it anymore as that is no longer going to be supported by the O365 account that I am using.
I found the SendMail APIs on the Graph Documentation which looks pretty straightforward.
But, using the Graph AIPs requires you to create an Azure AD project first and use their Microsoft Identity platform - which I created.
Now, the problem is that most of the flows also require a user to manually login from a login window.
This is where things get complicated.
I do not have a place to show a Login window to any user from my web service, because it is just a backend service there is no UI. I intend to use a service account for sending the emails through the Application.
I found a Daemon support as well, but it seems to only support Python or .Net code.
Migrating my code from Java to either of those platforms just to be able to send emails
does not feel like a good solution.
And, I'm not even sure if they even offer similar capabilities of sending dynamic emails like Java+Thylemeaf do?
Is there a way to be able to continue doing this using my existing code in Java?
If not, then as the worst case scenario, are there any libraries in Python which can allow me to send dynamic emails like thymeleaf does in Java?
As you don't want to manually login from a login window, you can use the client credential flow.
Here is the guide regarding how to access graph api without user.
Reference:
msgraph-sdk-java-auth (You can choose to use Client credential provider)

How to fetch mails in Android using IMAP/POP3 protocols

I want to develop an Android application similar to Typeapp . I want to know the algorithm behind it. Basically it would be a customised inbox with all IMPS/POP3 emails in a one application. If we have to configure this in java/Android to connect with IMAP server how can I achieve this.
K-9 is an open-sourced email-client, if the license fits your project's requirements, then you can start from that code, and build on top of it:
See: https://k9mail.github.io/

USSD app automation testing

I am very new to automation and API testing. My current project is USSD based for banking. I am currently testing manually by giving inputs on browser simulator and reading the console output (ssh into the server). The basic function of the API is to generate POST requests with all the parameters and send it to respective bank. I am looking to to automate this process and validate the request sent and the response received. I was thinking of using Selenium for browser automation but I have no idea how would I extract the response from the terminal to validate.
Please suggest as how I should go about this and if this is the right process. If there is any other way to handle this please suggest.
If you're testing REST API You should use REST Assured for automated testing (postman tool) for manual testing. If You should test end to end - then Selenium is the right tool.

Web page sending an email from the user machine

I'm looking to create a web page that sends an email from the client machine to an uncontrolled server (not from the server, this is mandatory due to an IP check). This email needs to have specific MIME tags, so "mailto:" is not an option.
I want to do this the cleanest way possible. (The user will trust the web page so is ready to click on any security warning, but repeated warnings would be annoying). Assume that we will only have access to self-signing, even if a trusted certificate might be available in the future.
Java applets seem to be strongly deprecated and no longer supported in some browsers, so I looked at Java Web Start. It seems to be a bit better, but still requirements of whitelisting, and chrome support seems dubious.
Is there any way I overlooked? If i choose to use Java Web Start with all-permissions, what kind of problems am i looking at depending on browser?
Your best bet is to send the email from the server hosting the web-page. You would create a form doe the fields or whatever, post the form the web-server, let the web-server construct the email and send the mail through a sendmail type system or through you local mailserver to the server in question.
Look at JavaMail - http://www.oracle.com/technetwork/java/javamail/index.html
If you are using Spring Boot or Spring you could use their mail implementation - http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-email.html

Java Daemon For Reading Email and Creating JIRA Ticket?

So what I need is basically to create a java program that runs from command line and will continue to run until I decide to stop it. The goal of this program is to read email from a particular email address and create JIRA tickets using the contents of the email.
IE: subject of email will be title. Body will be description. Etc...
I am getting confused with how to go about with the design of how to do this. I know I can use JavaMail to gain access to the emails right? Then I just have to parse the email. But other than that I am a little stuck on how I should be making the JIRA Ticket
Thanks!
Your problem is an ideal use case for esb like mule or spring-integration. Basically these eip frameworks provide all building blocks you just need to connect.
First you need to define mail inbound. This component will automatically connect to an mail inbox and fetch all new messages.
Then define a transformation from e-mail message to json object. Finally POST that object using HTTP outbound. You can create ticket in JIRA using /rest/api/2/issue API method.
whole workflow can be implemented almost without coding. Of course you can do everything manually (using javamail and httpclient), but then threading, error handling and retrying is up to you.
For the future - if you're confused what requests are sent and so on - use Google Chrome.
Press Ctrl+Shift+I->Network and make request. If you need to login before etc. it is the same.
For handling HTTP requests (POST, GET, etc.) I recommend to use HttpClient or if you need to use JavaScript HtmlUnit.
So answer is this:
- Track what requests are made when you do certain things via web browser
- implements the same in Java code using HttpClient or HtmlUnit

Categories

Resources