Spring Catch-All Email - spring

I want to create a gallery app which is automatically feed by emails. When you register on the app I will provide an email pseudo#domain.com When you send a picture to this email you will receive a push notification and then fetch the image when the app will be open.
To do so, I think about an smtp server (like https://github.com/docker-mailserver/docker-mailserver) and a spring boot to listen all emails (via imap or pop). When an email is received, I will check the from to find the user concerned, save the image until the user open the app to fetch it.
I saw some lib to have an embedded smtp server in a spring boot app (https://github.com/voodoodyne/subethasmtp). But if I understand well it's only for testing.
I didn't find so much information and use case. So maybe I have a bad approach, and read all email from a domain is not a good practice. Do you have some documentation about this ?

Related

Bot Framework dotnet Slack adapter fails to verify Slack request when changing the Events Request Url

I have a Slack bot that is working fine and interacting with users. I'm using Bot Framework composer and the Slack Adapter.
In the Slack API portal I'm trying to change the Events Request Url the app uses to send Slack Events to my bot.
When I do that, slack sends a challenge request to my bot. The bot first tries to verify that the request is really coming from Slack following: https://api.slack.com/authentication/verifying-requests-from-slack#a_recipe_for_security
The problem is that this is failing and I can't understand why.
I see that Slack is sending all the right content, and that the ClientSigningSecret is being read, otherwise the other calls to the bot wouldn't work.
I know it's a bit far fetched to ask this since it seems to be a problem on my side. But since the bot is validating the requests just fine when users talk to the bot, and the code is from the Slack Adapter which is open source and there's nothing else I can thing of..... maybe someone struggled with the same problem.
I created a support ticket to Slack and they came back pretty quickly.
Pre publish state
Before publishing a Slack app the only configs that exist are the ones you see in the App configuration page. Those are what you use to test your app, this includes the secrets to authenticate the incoming messages from Slack into your backend.
After you publish your Slack App for the first time
Once your app is published, the production version that your users use will see the original settings, including the secrets and these are the ones your backend will get.
The settings you see in the configuration page are like development mode and they won't be persisted into the published app until you request Slack to approve your changes. That's sounds great and is what one would expect, but what you don't see and have no way of imagining is happening is that there are some development time secrets that are different from the ones you see on the settings screen.
When you change the endpoint url to be sent to your backend so that it can return the challenge and Slack would accept the new url, the message payload goes with this development secret and not the one you configured your backend with. Thus your backend will reject the call since it thinks it's not coming from Slack.
Proposed solution from Slack
Don't validate the signature of the incoming request for this type of call in an already published app. I don't like it but there was no other workaround unless Slack changes this. So what I did was:
Remove that check only for this request from the backend and publish to production.
Make the url change in Slack.
Revert the change from the backend.
:(

Google Meet integration api (like Hangouts app for Slack)

I want to utilise Google Meet api, which is used in Hangouts integration for Slack, description follows
TL;DR:
Links such as https://meet.google.com/new?gid=123&gd=qwe987 can be generated, so a modal is shown which can ask user's confirmation and then some request is sent from user's browser (where the Google Meet page is opened) to some endpoint (probably it is determined from gid which seems to be google application id). Is there a way to configure my application to have a webhook, so I can generate these custom links?
There's Google+ Hangouts app for Slack. Here's how it works (after you add the app in your workspace):
you send /hangout command in any Slack channel
slackbot sends an "Only visible to you" message in this channel with a link to start a new hangout. it looks smth like this (I changed data in the link): https://meet.google.com/new?gid=691521906844&gd=THTJ30X6W%7CU01113BD13M%7CD01113BDB5Z%7Csuren%7C%7C1846381238693%7C1%7CB01QFGG5GJF%7CE1MDm4DWcuVa0RbN5ZT9o5KF
when you visit the link, a new meeting is started instantly, and the page shows modal with text "To bring others into this video call, post a link it to your Slack channel" with buttons 'Cancel' and 'Post'.
when you click 'Post', a new message is sent to the Slack channel, where the command was sent. Text is "#Suren Khorenyan has started a Google+ Hangout and would like you to join. Join Hangout." and contains a link to the meet, which was created previously
How can I utilise this integration for another app, like Mattermost (or anything else like Telegram chats via bots)?
As I see, data in the url slightly changes. Probably it's payload for Google Meet to trigger Slack to send a message with link to the channel.
gid seems to be something like google app id
gd seems to be something like google data. If I url-decode it, it becomes THTJ30X6W|U01113BD13M|D01113BDB5Z|suren||1846381238693|1|B01QFGG5GJF|E1MDm4DWcuVa0RbN5ZT9o5KF. This is some kind of payload, separated by pipes (obviously), but I don't know what any part of this means (suren is my username in the Slack workspace, probably this is used for creating an invitation message).
When I click Post, this happens:
a new POST request to https://hooks.slack.com/services/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 is sent with form-data
hangout_id: 1812381238693
hangout_url: https://meet.google.com//abc-iuqx-def
a new message is posted to the Slack channel
Google meet somehow knows where to post back! Is this configured at the Google application (application id is provided via gid)? How can I configure my application for such behaviour? Where can I setup webhook url?
If we breakdown the request, we can see that url contains some parts of the gd payload:
THTJ27X6W - this is the first part of the gd payload
B01ABCD5GJF - last but one
E1MDm4DWcuVa0RbK5ZT9o5KD - the last part of the gd payload
and form-data contains:
hangout_id - this is in the gd payload after my name
hangout_url - obviously, this is the url for the new created meeting
How can I change it for my needs?
I created a new application at Google APIs dashboard (here console.developers.google.com/apis), but can't find any docs for this integration. There's Google+ Hangouts API in API Library, but it says Apps will continue to function until April 25, 2017..
I tried to approach it from another side:
In the API Library there's Google Calendar. I found mattermost-hangout app on GitHub (had to update it a bit, so it works with updated api). Here's how it works:
oauth2 for authorising at google (single account)
it handles POST request, which is meant to be received from Mattermost (triggered by a slash command),
creates a new calendar event using Google Calendar API (with conference),
takes hangouts url from the response and sends a new message in the Mattermost channel with invitation to join the meeting.
But it has some downsides:
you have to use one account to authorise all event creation events (yeah, it can be upgraded to authorise any number of users, but it'll be inconvenient. why to force anyone to provide access to their Google Account, when Google Meet authorisation just happens in browser, we don't need to create events)
account, used for auth, now has events in his calendar. of course, events can be deleted, but it's not the way.
Is there any documentation on utilising gid and gd params?
Generally, I want to find a way to configure a webhook in my app, so when Google Meet finds my application's ID in the gid query param, it looks at the app's config and sends a request to my app (previously configured endpoint (I assume it works this way)).
Of course there's a chance that it's some kind of internal API and it cannot be used by everyone, but I could not find any information on this.

Get user email in windows 10 universal app

I am trying to build a control that the user can use to send feedback to developer. I am using email as a delivery method and I leverage sendgrid email service for this. Now I want to know the users email address so I can respond back to the user's concern. I am not sure how to get the user's email in window 10. Any help or pointers please?
I would strongly recommend to use the sharing approach that has been introduced with Windows 8 - instead of writing and maintaining your own mail functionality and trying to access additional user data.
Have a look at the existing and built in e-mail functionalities. They make use of the user's connected mail accounts and the mail app. This way you don't need to worry about handling the message transmission or anything but rather hand the information over to the mail client. This way you also know how to reply back.
And as a bonus, the user can still access their message via the Sent Mails folder :)
There is a specific class for that, the EmailMessageClass (https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.email.emailmessage.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) as well as a dedicated guide with code example.
https://msdn.microsoft.com/en-us/library/windows/apps/mt269391.aspx
Essentially you can prepopulate the Mail fields with necessary app information where applicable. The user gets to choose which accounts he wants to send the mail from, but it will open in the mail client.

Push Notification Service

I have read the article about Push Notification Service, but I am still confused. I’m a new for MS window phone application developing. My application needs to get the data in the whole class from web service that is for the specific organization. Hope someone can answer my question as below.
In my application, the phone rings and the user answer the phone during sending the request to the web request to get the data. What will happen if the web service sending back the respond?
In the above situation, do I need the Application Push Notification service?
I retrieve the data by using DataContractSerializer. If I need the Push Notification Service, is it meaning that I need to modify the webservice for returning the xml instead of the whole class?
The ongoing call will not disrupt the web request-response flow hence you need not be troubled about it

Joomla : Could not instantiate mail function

I have developed a website in joomla, and I have a contact us page, in that the form works fine only when I use to send an email from the same domain
Eg :
From : rimaz#abcd.com
To : john#abcd.com
But when I send to a different domain the form gives an error as "Could not instantiate mail function."
Eg :
From : rimaz#abcd.com
To : john#gmail.com
Can anyone explain me about this problem ??
Instead of debugging your providers SMTP / email setup you can use the new mandrill service from the guys who do mailchimp - Mandrill ( http://blog.mailchimp.com/public-beta-of-mandrill-smtp-email-service/ ) with the plugin :
http://extensions.joomla.org/extensions/content-sharing/mailing-a-distribution-lists/20624
Mandrill is a plugin that allows your Joomla installation to send transactional emails. The only thing you need to do is to provide your Mandrill API key and enable the plugin. After that all emails (new user registration, password reset etc) will be send through the Mandrill service.
Mandrill Features:
Uses MailChimp's awesome email delivery engine instead of your server
Tracks opens and clicks so you know how effective these emails are to your users . Now you can > see what you need to change to make them
more effective.
Has pretty, visual reports of the email results
Allows you to tag the emails and see your stats filtered by tag
Why would understanding transactional emails be important for you. An example is when a user signs > up on your site an email is sent via Joomla. But, you get no reports to understand how effective that email did. These emails are sent as instructions to your users telling them a message you want them to understand. Where they designed good? Was the content well written? Was it structured properly? This is hard to say when it goes thru Joomla but now you will understand all this when the emails goes thru Mandrill.
This is a setting from your host. YOu can ask them for help in figuring out how to make it work, but they are trying to prevent you from using their hosting to spam people.
Sometimes it is possible to work around it but not always.
This usually happens due to restrictive mail server settings, which you most likely don't have influence on with shared hosting.
If you have more control over the server, you should fix the mail server settings.
If not, the easiest way is to use Joomla's ability to send mails using any SMTP mail account. Create a mail account for Joomla, and enter the credentials in Joomla's configuration. Joomla will then use that account to send mails. So will extensions, if they are properly written.

Resources