Mostrando postagens com marcador email. Mostrar todas as postagens
Mostrando postagens com marcador email. Mostrar todas as postagens

Office 365 SMTP conf

smtp.office365.com:587
starttls
auth

mpro-mp-br.mail.protection.outlook.com:25
no auth

smtp-mail.outlook.com:587
tls
auth

Configure Postfix For Relaying to Office 365


To configure our Postfix server for relaying emails through smtp.example.com, we run

postconf -e 'relayhost = YOURDOAMIN.mail.protection.outlook.com'
postconf -e 'smtp_sasl_auth_enable = yes'
postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'
postconf -e 'smtp_sasl_security_options ='


Our username (someuser) and password (howtoforge) for smtp.example.com must be stored in /etc/postfix/sasl_passwd, therefore we do this:

echo "YOURDOAMIN.mail.protection.outlook.com  USERMAIL:PASSWORD" > /etc/postfix/sasl_passwd

/etc/postfix/sasl_passwd must be owned by root, and noone else should have read access to that file, so we do this:

chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd

Now we must convert /etc/postfix/sasl_passwd into a format that Postfix can read:

pico main,cf
setgid_group = postdrop
sendmail_path = /usr/sbin/sendmail

postmap /etc/postfix/sasl_passwd

This will create the file /etc/postfix/sasl_passwd.db.

All that is left to do is restart Postfix:

mkfifo /var/spool/postfix/public/pickup
/etc/init.d/postfix restart

That's it. You can now test by sending emails over your mailserver and having a look at your mail log. You should see that all your emails are now passed on to smtp.example.com (except the ones that have a local recipient). 


Sendemail (sendEmail) Ubuntu 22 TLS error

 


"ERROR => No TLS support!  SendEmail can't load required libraries. (try installing Net::SSLeay and IO::Socket::SSL)".

Install packages to fix error:

sudo apt-get update && sudo apt-get install libnet-ssleay-perl libio-socket-ssl-perl -y

 

 

Send e-mail with powershell

 Create a file with ps1 extension, like send_mail.ps1, with this content:


# Make Windows negotiate higher TLS version:
[System.Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Send-MailMessage -From from@example.com -To to@example.com -Credential (Get-Credential) -Subject "Hello World" -Body "Your text here" -SmtpServer "smtp.office365.com" -Port 587 -UseSsl 

 

 With cred:

# Make Windows negotiate higher TLS version:
[System.Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
$EmailTo = "myself@gmail.com"
$EmailFrom = "me@mydomain.com"
$Subject = "Test"
$Body = "Test Body"
$SMTPServer = "smtp.gmail.com"

Send-MailMessage -From $EmailFrom -To $EmailTo -Credential $Cred -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Port 587 -UseSsl

Monitoring response time with curl

   curl -s -o /dev/null -w "Conecction: %{time_connect}s | Start transfer: %{time_starttransfer}s | Total time: %{time_total}s\n" ...

Mais vistos