Allow Email Interaction - Java Server - java

First of all, this is a kinda broad question, and I believe it belongs partially on Serverfault also, so bear with me. I tried googling and searching here, but only found parts of this question but not the whole idea of it. Here goes:
My problem is:
Im writing a web application, and my server is Java. I want to add a feature where my users can do BY EMAIL some of the possible interactions they can already do on the interface. For this part I believe to setup a mail server (any server recommendations?), and from my Java app (Tomcat) connect to the mail server and read the emails via POP3 or something (any API recommendations?).
The tricky part is that I dont want to use a single email address for that purpose. I want, for example, that if my user Joe want to CREATE an object in my application, then he would send an email to joe#create.mydomain.com, if he would like to DELETE an object, he would send to joe#delete.mydomain.com. The possible actions are previously known and limited, of course (since I would have to mess with the DNS for that purpose). This is just an example, most likely I would have to "tokenize" the left part of the email address (before the #), or else any user would be able to create and delete other userĀ“s objects (since email is semi-anonymous).
And the extra-tricky part is that I already have an email server running on mydomain.com, for the corporate emails. How to make that all emails from the actions words ("subdomains"?) go to my "application email server" and those without action words go to my "corporate email server"?
I guess thats it!
Thanks all

Since you're already using Java, it sounds like Apache James might be a good fit for you.
It allows you to create Matchers and Mailets which pick out and process emails based on your defined criteria (which could be address based sender/receiver matching, subject lines, etc). The process could insert records into a database, invoke a web service, anything you want to write in Java.

Related

Best way to receive images uploaded by a user on Android app?

I'm working on an app that lets users submit orders, and also make custom orders where they upload an image. I then want to receive all this information by email. Initially, I was using JavaMail API with Gmail, but I heard that it can cause a blocking of the account due to "Suspicious Activity". Apparently a way around this is to use the Amazon SES SMTP server, but with that I cannot seem to find any documentation whatsoever on sending emails with attachments for Android (there is one but it's for general Java and it does not work on Android).
There must be a better way to to do this, I'm just not sure where to start looking. This is my first dev project (I'm in my 2nd year of computer science), so I'm pretty green with this stuff. If someone could point me in the right direction I would be so grateful. I'm open to learning new things, I'm just not even sure about what I need to learn in the first place for this.
your email will be blocked if you are sending emails in huge amount like hundreds of email in a second if you are not sending email in such amount so don't worry about getting blocked and if you are sending in email in such amount then you can take external email service theirs a lot of marketing via email services i hope this might help

Regarding wireless lan messaging system

i am developing a chat application for local environment where our office employees can chat easily so here I am getting some conflicts when I am trying to send message over the IP but there IP being change dynamically so how can i resolve it .
First of all, I recommend using a well established solution like a local Jabber Server installation and using a client that supports the required features.
If you really want to pull this off on your own, you'll need at least a central controlling point (Server) to abstract Users from their Endpoint.
Configured user would then have to login to that server to signal they are ready to receive messages. Doing this, you have the momentarily correct IP that you can then use to relay messages or to give to other clients wanting to send to that user. Also consider that users may want to use more than one client (they have 2 PCs?). You probably wouldn't want to bind one user to one client device.
Also note that you will have to create a decent protocol for all this. This can be quite tedious if you want similar features to for example Skype Chat or ICQ, or some derivate of XMPP / Jabber.
This leads me again back to my first suggestion: Better use something that already exists. Installing and configuration of that can already be effort enough. Coding all that by yourself, though will take way more effort.
And I didn't even go into status/statusmessages, groupchats, sending/sharing Files, sending messages while User is away/offline ...

Encrypting/hiding portions of the source code

I've made a simple mailing app that takes in email credentials and uses it to send emails of certain kinds to selected addresses. Problem is, I've had to input the credentials right into the code, so anyone who uses dex2jar can get the source code and get the email used for forwarding and easily make the app obsolete.
I imagine I'm not the only one facing this issue, so what are some ways to make my code secure?
No matter how good of a technique you use to hide the credentials, if it's in the code then it can always be found.
Instead of hard coding them in, you could perhaps let the user specify them when he starts the app? If that can't be avoided you could instead have a remote service that will do the sending and forward your request to that.
You can not both connect to an e-mail account and keep those same users out of said e-mail account. Consider using a hosted server as part of the project to securely connect to the e-mail account from the server level and process these e-mails remotely.

How to establish an automated email service for a website?

I seem to fail at googling this specific thing: Like almost every website I too want to provide an automated email service for stuff like "password reset" or "validate email" after user registration.
However, I have not really an idea how I would do that and/or where to start. There must be some fast, easy and cheap solutions out there since this is quite a common issue for websites and I do not intend to re-invent the wheel for this problem.
So: What do I have to do to get such an automated email service for my website that works with my domain of course and where can I get started?
I am aware that I can use e.g. JavaMail to send emails as I like but do I still have to do everything by hand here or can I use an existing service?
On my site, I custom built it. You send the email out with the "guid" for password resets and validate emails and then you handle that on your website when they click the links. I think doing it yourself will be just as easy as trying to use a third party imo. Setting up a mail server isn't that hard, it might seem daunting at first, but theirs plenty of good ones available without charge. Configuring it to send mail properly, takes a little work (A lot of it is configured out of the box), but an excellent resource you can use is Unlock The Inbox. Just go through the free resources on the left about all the different things to be aware of. Then you can hook in 3rd party email marketing campaign managers without cost as well like phplist. It will give you more flexibility over time.

how to check a mail sent by java application is read or not? [duplicate]

This question already has answers here:
How Can I Know when a User Reads an Important Email Notice? [closed]
(5 answers)
Closed 8 years ago.
Please help me on this requirement.
We are sending mails to users using java application.
Now, we want to implement the below features.
When the mail is open/read by the user, then we want to save the time stamp in the database.
How many times the person opens the mail which we sent to him/her.
Please help me how to do this.
Thanks for your help.
In general, this is impossible to get with 100% certainty. Email is normally fire and forget. However, there are some commonly used tricks to get an idea.
You can make the email an html email with a 1 pixel image embedded. As you send out the emails, you make a new image url for each outgoing email (I'd go for one per recipient) and save that url somewhere (for example in a database). You also have to set up a very simple server that will accept requests to the image urls you're creating. That server then responds to those calls sending each of them the same simple 1pixel image and noting which url was called (this can be done with a simple Apache server, using access logs to track the urls). Every time a user opens your email, his email client would normally go and load the image. Your server then gets a request and since you made the url unique for every recipient, you know who opened the email when. Caveats: if the email is forwarded, other people can activate that same link; the user can configure the client to not open images; etc.
If you look around a bit, you might find some off the shelf solutions as well.
If you happen to also have control over the email server and/or the email clients of your users, you have a lot of other possibilities.

Categories