[AusNOG] Issues receiving from TPG Mail servers.

Roy Adams roy at racs.com.au
Tue Jul 24 15:53:50 EST 2018


For those stuck in the blat.exe land forced to use tcp/25 , I moved to
mailsend recently and have not looked back
https://sourceforge.net/projects/mailsend.mirror/

Works great with Google Free, GSuite, Outlook Free, and Office 365
To save people reinventing the wheel, I have pasted below a cmd script I
wrote to act as a shell for whatever I need to email.
It's basically a wrapper.. of sorts
Note, it doesn't use the -attach option in this example.
You can specify -attach as many times as you need in a single command line
run to attach multiple files

It also writes so the event log.
*If you cannot read it, do not run it :)*

Comments welcomed, but no responsibility accepted of course :)


Kindly,

ROY ADAMS* | *P 07 3040 5010  | Web: http://www.racs.com.au/ | Wiki:
https://ex.racs.com.au:444/ | eMail: mailto:roy at racs.com.au
<roy at racs.com.au>
Please never upgrade to the latest Windows 10 - You don’t need the hassle,
and I don’t need the work.
If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur - Red Adair.
Life is a journey through a series of adventures.. Live them, love them,
hate them, but never give up on your dreams, desires, and goals.





@echo off
:: MailSend.EXE - https://github.com/muquit/mailsend/
:: GZIP.EXE - http://gnuwin32.sourceforge.net/packages/gzip.htm
:: forfiles.exe - Windows Vista and above. Windows XP does not have this -
get it from somewhere
:: @set GNUToolDir= - you can set this if you wish manually - IT MUST HAVE
TRAILING BACKSLASH - and comment/delete the detection stuff after it - e.g.
set GNUToolDir=C:\Utils\
:: %1 = IP Address of SMTP server THAT ALLOWS RELAY
:: %2 = SMTP Address to send Errors and Summaries
::
:: Google SMTP settings:
:: SMTP: smtp.gmail.com, port 587 (TLS) or port 465 (SSL)
:: Google 2-factor auth App-Specific Passwords -
https://security.google.com/settings/security/apppasswords
:: Microsoft SMTP settings:
:: SMTP: smtp-mail.outlook.com port 587 (TLS) - outlook.com free email
:: SMTP: smtp.office365.com port 587 (TLS) - Office 365 commercial email
:: Microsoft 2-factor auth App-Specific Passwords -
https://support.microsoft.com/en-us/help/12409/microsoft-account-app-passwords-two-step-verification

@SetLocal
1>>NUL: 2>>NUL: eventcreate /l application /t information /so "Script: %~n0
Start" /ID 555 /D "Script Start %date% - %time%"

:: ******* Set SMTP Server HERE
@set EmailServer=smtp.gmail.com
@IF /I "%1" NEQ "" @set EmailServer=%1

:: ******* Set Notify SMTP Prefix HERE (without @ or domain suffix)
@set BackupNotifyUser=%UserName%

:: ******* Set Email Send Domain to something real if you are using
@something.local by default instead of something.com.au
@set BackupDNSDomain=%UserDNSDomain%
@set BackupDNSDomain=dss.asia
@IF /I "2" NEQ "" @for /f "Tokens=2 Delims=@" %%d in ('@echo %2') do @set
BackupDNSDomain=%%d

:: ******* Set Email Address for Notifications/Logs here
@set EmailTo=%BackupNotifyUser%@%BackupDNSDomain%
@IF /I "%2" NEQ "" @set EmailTo=%2

@set ServerName=%ComputerName%
@set SMTPPort=587
@set EmailNameFrom=xx Sender Friendly Name Goes Here xx
@set EmailFrom=XXXSenderAddressXXX at gmail.com
@set EmailUserName=%EmailFrom%
@set EmailPassword=XXXpasswordXXX
@set CompletionStatus=FAILED
@set CompletionErrorInfo=
@set ScriptDrive=C:
@set ScriptPath=\Scripts
@set ScriptDir=%ScriptDrive%%ScriptPath%\
@set LogDrive=C:
@set LogPath=\Logs
@set LogDir=%LogDrive%%LogPath%\

::Make sure first our utilities exist - exit if not and write such to the
event log
@set GNUToolDir=&@for %%f in (MailSend.exe) do @set GNUToolDir=%%~dp$PATH:f
@set MailSendExe=&@for %%f in (MailSend.exe) do @set MailSendExe=%%~$PATH:f
@if /I "%MailSendExe%" EQU "" @set MailSendExe=%GNUToolDir%MailSend.exe
@if /I not exist "%MailSendExe%" @set
CompletionErrorInfo=%CompletionErrorInfo% - MailSend.exe missing or not in
PATH
@set GZipExe=&@for %%f in (GZip.exe) do @set GZipExe=%%~$PATH:f
@if /I "%GZipExe%" EQU "" @set GZipExe=%GNUToolDir%GZip.exe
@if /I not exist "%GZipExe%" @set CompletionErrorInfo=%CompletionErrorInfo%
- gzip.exe missing or not in PATH
@set ForFilesExe=&@for %%f in (ForFiles.exe) do @set ForFilesExe=%%~$PATH:f
@if /I "%ForFilesExe%" EQU "" @set ForFilesExe=%GNUToolDir%ForFiles.exe
@if /I not exist "%ForFilesExe%" @set
CompletionErrorInfo=%CompletionErrorInfo% - ForFiles.exe missing or not in
PATH

@if /I "%CompletionErrorInfo%" NEQ "" GOTO FinishError

:: Do Stuff Here

@set CompletionStatus=OK
@set CompletionErrorInfo=%CompletionErrorInfo% - Normal End

@"%MailSendExe%" -v -4 -ehlo -auth -starttls -port %SMTPPort% -smtp
%EmailServer% -user %EmailUserName% -pass %EmailPassword% -f %EmailFrom%
-name "%EmailNameFrom%" -t %EmailTo% -mime-type "text/plain" -sub "** -
%ComputerName% - %~n0 Started by %UserName% - **" -M "Hopefully this is the
body"

:FinishError
1>>NUL: 2>>NUL: eventcreate /l application /t information /so "Script: %~n0
End" /ID 555 /D "Finished with Status: %CompletionStatus% - %date% - %time%
- %CompletionErrorInfo%"
@EndLocal
@GOTO :EOF

:MailSend
@"%MailSendExe%" -4 -ehlo -auth -starttls -port %SMTPPort% -smtp
%EmailServer% -user %EmailUserName% -pass %EmailPassword% -f %EmailFrom%
-name "%EmailNameFrom%" -t %EmailTo% -mime-type "text/plain" -sub %1 -M %1
-attach %1
@move /y %1 "%Mailed%\"
@exit /B 0



On Tue, 24 Jul 2018 at 15:38, Scott Howard <scott at doc.net.au> wrote:

> On Mon, Jul 23, 2018 at 9:45 PM, Bradley Silverman <
> bsilverman at staff.ventraip.com> wrote:
>
>> It isn't possible to set TLSv1.0 for un-authenticated email, and TLSv1.1
>> for authenticated, though that would fix the problem.
>>
>
> Yes, it is.
>
> The problem is you're trying to use port 25 for both delivery
> ("unauthenticated") and submission ("authenticated")
>
> Move your "authenticated" email over to port 587 where it belongs.  Not
> only will this allow you to solve your problems, but will also solve any
> future potential issues with people blocking port 25 (eg, home ISPs)
>
>   Scott
>
> _______________________________________________
> AusNOG mailing list
> AusNOG at lists.ausnog.net
> http://lists.ausnog.net/mailman/listinfo/ausnog
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ausnog.net/pipermail/ausnog/attachments/20180724/a1335a33/attachment.html>


More information about the AusNOG mailing list