• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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