Showing posts with label telnet. Show all posts
Showing posts with label telnet. Show all posts

Monday, October 18, 2021

Test telnet smpt office 365 port 587 with Powershell

Rum powershell command with

$creds = get-credential

Enter username & Password Email

copy and paste with this command

Send-MailMessage –From test@tv.com –To akka@global.net –Subject "Fwd: Test Email" –Body "Test SMTP Service from Powershell on Port 587" -SmtpServer smtp.office365.com -Credential $creds -UseSsl -Port 587

with attach file

Send-MailMessage –From test@tv.com –To akka@global.net –Subject "Fwd: Test Email" –Body "Test SMTP Service from Powershell on Port 587" -Attachments "C:\PS\SampleAttachment.txt" -SmtpServer smtp.office365.com -Credential $creds -UseSsl -Port 587

Ref. uncaoffice-365-test-smtp-on-port-587

https://infra.engineer/azure/56-office-365-test-smtp-on-port-587-using-powershell


Monday, July 29, 2013

Set Postfix with SSL Port 465, 587

แก้ไข #vi /etc/postfix/master.cf

เพิ่มเข้าไปในไฟล์ดังกล่าว

## Enable SMTP on port 587 only for authenticated/TLS clients
submission inet n       -       n       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

## Enable SMTP on port 465 only for authenticated/SSL clients
smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
   
Restart Service postfix 
 
Ref.
www.brandonchecketts.com 

new link: PostfixAndSASL




Command to test smtps -Linux
#openssl s_client -connect mymailserver:myport
#openssl s_client -connect mailserver:465
Command to test smtps -Windows (Powershell)
C:\Windows\system32> cd "C:\Program Files\OpenSSL-Win64"
C:\Program Files\OpenSSL-Win64\bin> .\openssl.exe s_client -connect mail.server.org:465
Ref. testing-smtps-certificate

 
ถ้าเจอ Err. SASL authentication failure: cannot connect to saslauthd server: No such file or directory 

ให้แก้ไขดังนี้
--------------------------------------------------- 
rm -r /var/run/saslauthd/
mkdir -p /var/spool/postfix/var/run/saslauthd
ln -s /var/spool/postfix/var/run/saslauthd /var/run
chgrp sasl /var/spool/postfix/var/run/saslauthd
adduser postfix sasl
---------------------------------------------------
อ้างอิง www.jimmy.co.at