• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Plesk SMTP authentication Error through Python script

happycoding.ai

New Pleskian
Server operating system version
Centos 7
Plesk version and microupdate number
18.0.43
I have one VPS with a Plesk server configuration. On the same VPS Plesk-Mail server is running. I am able to send mail through webmail.

But whenever using a script and using the below values to send mail through SMTP, it gives an authentication error.
MAIL_SERVER ='smtp.<domain>'
MAIL_PORT = 587/465
USER=
PASS=
MAIL_USE_TLS = False
MAIL_USE_SSL = True
How to solve this problem?

Note: Same above config working with sSMTP tool
 
hello @happycoding.ai ,
please check to which IP resolves smtp.<domain> when you doing ping or telnet from the same server where SMTP daemon is running.
probably you need to use an IP address or even an localhost as MAIL_SERVER
 
hello @happycoding.ai ,
please check to which IP resolves smtp.<domain> when you doing ping or telnet from the same server where SMTP daemon is running.
probably you need to use an IP address or even an localhost as MAIL_SERVER

Thanks @Nik G

ping -a smtp.<domain>
Pinging us2.smtp.mailhostbox.com [208.91.198.38] with 32 bytes of data:
Reply from 208.91.198.38: bytes=32 time=341ms TTL=43
Reply from 208.91.198.38: bytes=32 time=307ms TTL=43
Reply from 208.91.198.38: bytes=32 time=371ms TTL=43
Reply from 208.91.198.38: bytes=32 time=310ms TTL=43
(Not sure why it is pointing to this)

Now the next question is if I point to localhost or VPS IP, what would be the SMTP port?
 
it depends from your settings, but usually it is 465.

you can check what port listen with command like
Code:
ss -nptl|grep -i master
also command
Code:
grep '<domain>' /etc/postfix/*
should help to understand at what IP address MTA listen for this domain.
 
Back
Top