SMTP dummy - testing Email sending with powershell

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello friends today we are taking a look at some of exchange functionality and specifically i want to demonstrate a usage of a very small utility which is immensely helpful in troubleshooting workflow of your smtp server it also helps to figure out how the emails are delivered and without further ado let's get on with it so we'll start on the exchange server which i have set up recently i actually have two vod videos from stream which still use my old equipment but you can see how i set it up and now in order to access my exchange server i just need to use https double slash the server name dchu x01 twitchcom and then at the end add slash owa which stands for outlook web access that will log me in into the web version of outlook which comes with the exchange server as we connect you will be able to see that there is a specific email which was sent as a test email and before we continue uh with testing with smtp dummy uh i am going to show you how do i send a message without using anything special so this is the email which i got from myself somehow this user eures got it from eurist so in order to send an email message uh especially when you're troubleshooting you can simply use powershell let me show you a couple of commands for that so you would want to start the powershell uh on the mail server and in order to use the necessary commands you would want to actually integrate the exchange powershell snap you see it in the previous vod video but i will show it here as well so we are going to add ps snap in snap lines are basically modules which you can load to use extra functionality and in this case it's called microsoft exchange management power shell power fill snapping okay so as soon as this template loads we should be able to use such commands as uh get mailbox uh get mailbox user etc the command we're interested in uh oh before we do that let's check that it works get mailbox it should return the list of mailboxes on the mail server but the command we are going to be using is send mail message it's somewhat deprecated it's an old command but it works for troubleshooting purposes we are going to specify smtp server which is in this case uh dc hu ex01 twitch.com uh we'll use from and here you can use any name i just say test user but you can put any name here and specify the email because you are basically just making the header of the message it will be our user eurist at twitch.com don't forget to close the triangle brackets and the to user so we know to deliver it to specific user will be target user again any name you want to do you can use the real name from outlook and the mailbox is our wrist at twitch.com that should be enough i'm missing subject let's say test mail too okay so once this command goes through we should have the email delivered and we'll use the default smtp server on this server it will probably take a moment to get here but it will be sent here it is and interestingly enough we don't have anything in the send items because this user didn't send anything it came from powershell but because we used uh the email address here it looked like it was sent from us so now we have these two emotes delivered in some cases where the emails go through multiple servers uh the email may be stuck somewhere or maybe not delivered so you could want to set up a smtp server on specific machine and check how does your mail delivery work you can even play with different tcp ports to verify connectivity on various ports the tool i'm going to use today is called smtp dummy by scilog software you can see the address here cylog.org tools slash smtp dynamic.jsp and it's a very small program just one megabyte which you can run on any server you have and as soon as you start it it starts the smtp server you can go to the settings and you can change the port from default 25 to any other that's going to be useful if you want to set up multiple smtp servers listening on different ports or something like that default configuration is 25 so that's what we are going to use so this server is not actually sending anything it's just receiving but it is a very useful tool for capturing the email flow so let's do what we did but in this case instead of sntp server that we know is our exchange server we are going to specify the second computer which is dc01.twitch.com and in this case i will specifically say port 25 but you don't need to do it if it's default port if your port would be different you could set it here so let me show you how so you will go to the settings say report let's say port 26 now we can stop and start the server again and in this case we would have to specify port 26 here but we are going to test this default port for now because the other port is blocked by firewall so by doing this and also this time i will not forget to say subject smtp test this went through we are not receiving any messages right now as you can see because it went to a different smtp server but on this computer you can see that there is an email message which you can actually observe which has our froman tool and it has a specific information inside of the message you can see the body which is empty subject the date time target source user it says where it came from it tells the ip address it shows the hello value of the server and in this case you can also look at the logs if necessary to see the information so this is a very simple tool to set up we basically just run it and if necessary change the port and that allows you to track any possible problems with your emails especially if you don't have a visibility over the log of the server itself that was a short video it showed you how to send messages through powershell and how to capture smtp using this small smtp server i can give you an example where it can be useful when i support my web application sometimes the users may report that there are no emails delivered so we could set it up on the target server that we want to let's say test and we don't want to flood the real server with messages and we can configure uh the target server as sntp server in my backup application i support and then we'll be able to see whether it goes through or not what i can also do i can find some servers closer to my computer with the backup application and test connection to that server first using the standard tcp tricks and the smtp dummy and this way i can find on which step of the connectivity will lose the ability to receive the emails and that makes it much easier for the networking team to figure out what's wrong thank you very much for watching if you like the video feel free to leave a comment or a like or maybe suggest any improvements you think are important and i wish you a great day see you in the next video bye bye [Music] you
Info
Channel: Virtual Denis
Views: 4,885
Rating: undefined out of 5
Keywords: SMTP, Exchange, Powershell, Troubleshooting, Microsoft, Networking, IT, Engineer
Id: 778A2Fe82m4
Channel Id: undefined
Length: 9min 30sec (570 seconds)
Published: Sun Apr 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.