Your difficulty is being caused by the
earlytalker plugin, which is enabled by default for remote connections and disabled by default for local connections.
Here are some ideas -
Use SSL on port 465First I would try re-configuring kmail to use ssl on port 465 instead of tls on port 25. I use ssl/465 for smtp out of habit due to a problem I ran into long ago, and find (for me, on my server) that it solves some problems.
Disable earlytalkerYou can disable 'earlytalker' on your external interface, but that may result in an increase in spam emails, dictionary attacks, or other issues -
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0
echo '# earlytalker disabled by custom template' > 10earlytalker
signal-event email-update
verify earlytalker reconfiguration:
grep earlytalker /var/service/qpsmtpd/config/peers/0
disable this change:
'rm' earlytalker /var/service/qpsmtpd/config/peers/0/10earlytalker
signal-event email-update
Use a VPNI have never used a VPN contrib on SME, but they should work:
*
OpenVPN_Bridge - I think this would be considered the 'standard' SME VPN contrib -- but it has always looked pretty complicated to setup (to me)
*
SoftEther_VPN - I found this looking for an answer to your question; I know nothing about it.
Use an SSH tunnelIf you enable remote ssh access to your SME server you can create an ssh tunnel for port 25 or port 465, then create a second SMTP server in kmail talking to 'localhost'. This tunneled smtp server would work from outside your network.
Fix/reconfigure kmailWork with KDE to learn how to get kmail to stop talking out of turn. If there is no configuration option for this, they may feel they have a bug worth fixing.
EXPERIMENTAL - See if kmail supports ActiveSync or EWS with SOGoI use SOGo on my home SME. It looks enough like an exchange server to fool my iphone and outlook 2016.
* Install
SOGo (sadly, the wiki page has not been updated since Sogo 4 was released in 2018...)
* See if kmail will let you setup your email as an exchange server account