• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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