Why not send telegrams request to webhook? - webhooks

I create a new bot using BotFather.
Next, I use the following package https://github.com/akalongman/php-telegram-bot
Successfully established address webhook https://tg.fryazino.net/hook.php
Sends a message to the bot - webhook no answer to no.
The apache logs except my IP others do not.
As far as I understood from the documents and other sources, following the appointment of webHook, all he has to send messages to this address. Why is this not?

I had the same question for NGINX and node.js but the cause was my SSL certificate. You can check your certificate with an online SSL checker like this: https://www.sslshopper.com/ssl-checker.html which also helps to solve the problem if there is any.
Also check this out: Why telegram does not send the updates after setting webhook?

Related

Communicating with a remote server via microsoft Teams

Scenario:
I have a remote server which is monitored (via DataDog) and sends out a warning when some anomaly is detected. This warning can be fetched via a webhook. Now I want to connect that webhook (https://docs.datadoghq.com/integrations/webhooks/) with MS Teams (probably via Bot), to receive a warning. Then I want to send a command back to the remote server to resolve the warning.
Technology:
MS Teams, Python flask/Django, remote server
Expected Results:
I can receive a warning from my remote server to MS Teams via a bot. Then send a command back to the remote server. My initial plan is doing this using Python Flask/Django but not tied to a specific language.
Environment:
Remote server is a LINUX based system. we have a internal network that is used within our company, so might need to resolve a firewall problem potentially (idk whole lot about it tho).
Things I have tried:
I just want to see if this is possible or not, so i havent coded up any. But I found some information relevant to our problem:
https://docs.datadoghq.com/integrations/webhooks/
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams
https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/what-are-webhooks-and-connectors
One last note, I am not also tied down to Teams bot. Our company also uses Azure Devops, so that is another resource I can use to realize the solution.
Btw, this question was posted on here but was told to post on MSDN, but I couldn't find an appropriate forum. Hence, I am posting on stack overflow instead
As you have limited requirements, you could achieve this without a bot.
MS Teams has income and outgoing webhooks. You could create a Incoming webhook inside a Teams channel. It provides an URL which you could use inside the monitoring remote server and POST the message in JSON format to the webhook url. It will be posted in teams channel like below
For sending message back to the server you need to configure the Outgoing webhook in the channel.

implementing docusign connect api

Since connect api sends the response to the "listner api" IMMEDIETELY after the last recipient signs the document. If my "listner api" is down at that perticular time. How will I get the response again from connect api?
Does connect api provide any option to send it again?
You're looking for the option to Require Acknowledgement. As per the documentation:
Require Acknowledgement: Select this option to log posting failures.
The acknowledgement failure messages are logged in the Failures page,
which is accessed b clicking Failures on the DocuSign Connect Settings
page. When this option is selected, DocuSign will automatically
attempt to repost any failures. Alternately, you can manually repost
from the Failures page. See the Publish Failures section for more
information
As long as your application can return a 200 status code when it does successfully accept a Connect publish, having Require Acknowledgement on means that failures will be logged and retried.
The answer from Drew is correct, but here's some additional information: the Connect resend algorithm, used if require acknowledgement is on, does not try to resend immediately. And if the Connect Send Individual Messages (SIM) option is off (the default), then a message won't be resent if the message is superseded by another message about the same envelope.
Better is to not have your server (your "listener") ever go down. Best way to do that: have Connect send to AWS or similar, then your app pulls from AWS SQS or similar. See the code examples named connect- here: https://github.com/docusign

Not receiving when posting a message through bot using an outgoing webhook on teams

I'm running a node.js server as my local using the method specified here. Although, I'm unable to receive anything at the ngrok server itself when I #mention my bot and send the message. I've followed all the steps as provided in the link diligently. Is there any way I could debug this?

NodeRed: How to get reply from Slack app interactive message

I'm trying to make it so that NodeRed uses a webhook to send an interactive message to a slack app to ask permission to activate something. I can POST to the webhook without any issues from my custom node, but how do I get the reply?
Do I need to use the "http in" node to create an endpoint Slack can use? Is there a way to handle it from the same node that POSTs the message?
Also, I'm running NodeRed locally. Can I use ngrok so that Slack can access the http endpoint (in case I need to use that)?
You can define your own http endpoints that are private to your custom node, this is how nodes that need to do oAuth handle the callback. Also nodes like the serial port node do this to supply information to the config dialog.
Make sure to give the endpoint a unique route so it's unlikely to clash with any other nodes.
You can look at the source for the serial port node here
How you ensure that Node-RED is safely made accessible from the internet should be a separate question.
1) Yes, ngrok works nicely for exposing your local webserver securely to the Internet and Slack. I use it every day for my Slack app development. Keep in mind that if your app can't be reached from the Internet, then also Slack can not reach it.
2) Interactive Messages only work with Slack apps. One reason being that you need to provide the route to your app, so that Slack knows where to send the requests when someone uses your interactive messages (e.g. clicks on a button). But you can use interactive messages with webhooks, as long as both are setup within the same Slack app.
3) Don't believe the "http-in node" approach will work. As said, you need to configure the route to your app for receiving messages from Slack in your Slack appp.

IIS SMTP Message Inspection

Is there a way to peek or see a message before it hits the SMTP on IIS. This is not an Exchange Server, it's just running SMTP. I am trying to see if I can look at the message and then pass it to SMTP?
Thanks
Edit ~ Instead of adding another listner, I am wondering if there is a way to bind to the default SMTP listner and intercept the message then pass it on.
2nd Edit~ Ok, here is my problem. I have a spam filter in front of my exchange box, unfortunately (due to software design) the filter is limited when it comes to "Directory Harvesting Loookup". This is the process where the email addresses are checked if they exists in AD and the mail is dropped if they don't. My current filter drops the mail if one of the addresses does not exists in AD which is not good. I spoke with the vendor and there is nothing they can do at this time. I am looking put an app in front of this filter which would intercept (open, read, parse) the mail, validate the addresses, and then pass on the email to the filter for additional scanning. I'll then trun off this feature in their software. Don't get me wrong, their filter works great with this one exception which I must fix since I have tons of emails send to nonexistent users in my domain.
You can write your own Proxy SMTP service that you connect to to send messages. You can forward all messages directly to your actual SMTP service and pass all responses back. Then you can evesdrop on all these messages and deal with them accordingly.
Might be a bit overkill for what you're after but it's fairly simple to code as you dont need to know anything about the protocol as all you're being is a proxy.
If you're using .NET 2.0 then you can log SMTP sessions to a file:
How do I create a log file of the SMTP session? (System.Net.Mail)
Updated:
Take a look at this question:
Testing SMTP with .net (Stack Overflow)
From your edit:
"I am wondering if there is a way to bind to the default SMTP listener and intercept the message then pass it on?"
...and from your comment below:
"I am looking to inspect the actual message before the SMTP gets it."
I'm not sure if you fully understand the SMTP protocol. SMTP messages aren't just monolithic fire-and-forget entities. SMTP is session based and there is a conversation between client and server, of which, the message is just a part. The tracing method (linked to above) will record the entire exchange between client and server and does intercept the whole message before passing it on. The alternative, a proxy or mock server, will still require your application to engage in the SMTP client/server exchange. The closest solution to your requirement would be to use something like Papercut which is linked to in the answer above.
Kev
In .Net you can tell the SmtpClient to send email to a different folder than the SMTP service is monitoring. That way you could check each message, then move it to the real pickup folder. (See SmtpClient.PickupDirectory)
IIRC, you can still write up event sinks for the IIS SMTP service (even though it's not full blown exchange). It's been many years since I've done this, but you may want to google for "exchange event sink" to see if that helps.
Seems like a something like Ethereal will let you accomplish the sniffing portion of your request. Its not clear to me what you mean by "intercept" and "pass on". Do you want to filter some traffic or just delay traffic long enough for you to inspect before you pass it on, or both?

Resources