Here is another small script from the Quick and Dirty series. The script was actually created to monitor an AntiSPAM gateway, which was often overloaded and no longer processed any mails. Unfortunately, "text-only" mails without hyperlinks or other content turned out to be not very meaningful, as they were practically always processed. The script was supposed to sound the alarm if the mails were stuck in the AntiSPAM gateway for longer than a certain time, i.e. to measure the SMTP roundtrip. However, it was never used in this way. So here is a slightly modified version to at least measure the time a mail takes from sending to receiving. The script can be executed in the Exchange Management Shell:
If you can use it, you can also customize it a little, for example to sound an alarm if no more mails arrive or can be sent.
Simply copy the following script into a PS1 file and adapt the first 3 lines accordingly:
$recipient = "frank@frankysweb.de" $smtpserver = "smtp.frankysweb.local" $sleep = 15 write-host "" $start = (get-date).AddMinutes(-20) $end = (get-date).AddMinutes(+20) $subject = get-random write-host "Sendig Testmail with Subject: $subject" $sendtime = get-date Send-MailMessage -SmtpServer $smtpserver -From $recipient -To echo@tu-berlin.de -Subject $subject -Body $subject write-host "Waiting $sleep Seconds" sleep -seconds $sleep write-host "Getting Message Tracking Logs" try { $tracking = Get-TransportServer | Get-MessageTrackingLog -EventId RECEIVE -Recipients $recipient -start $start -end $end | where {$_.messagesubject -match "$subject"} | select timestamp,MessageSubject } catch { } write-host "" write-host "Results:" write-host "" if ($tracking) { $receivetime = $tracking.TimeStamp $roundtrip = ($receivetime - $sendtime).totalseconds $roundtrip = [math]::Round($roundtrip,2) write-host "Found Message with Subject: $subject" -foregroundcolor green write-host "SMTP Roundtrip: $roundtrip Seconds" -foregroundcolor green } else { write-host "Message with Subject not found: $subject" -foregroundcolor red write-host "Roundtrip TimeOut" }
"Sleep" specifies the time in seconds that is waited before the message tracking logs are searched for the sent mail.
Aktuelle Alternativen zum Mirror TU-Berlin sind echo@tu-chemnitz.de; echo@univie.ac.at
Immer noch ein perfekt passendes Script, falls man von On-Prem testen muß.
Für Tests aus dem Internet habe ich bisher außer MXAlert nichts wirklich passendes oder sogar kostenloses gefunden.
Hi,
hier gibt es eine Alternative:
echo(at)charite.de
Die Mail benötigt allerdings gut 10 Minuten bis zur Antwort. Bitte auch die Nutzungsbedingung beachten:
If you want to use this service for routine monitoring, you *MUST* ask postmaster(at)charite.de for permission before doing so.
Gruß,
Frank
Schade eigentlich :-(
Sehr geehrte Damen und Herren,
echo.tu-berlin.de wurde zum 1.1.2018 eingestellt, Ihre E-Mails werden nicht gelesen.
Technische Universitaet Berlin, Germany
Hallo markus, Hallo Alexander,
ich schaue mal ob ich eine Alternative dazu finde.
Gruß, Frank