Menu

#5236 SMTP via remote server fails

1.900
open
nobody
None
5
2019-03-07
2019-02-13
No

When sending email through a remote server, the action fails. I see the following on wireshark:

Webmin: helo <hostname>
Remote: Hello <hostname>
Webmin: auth login
Remote: 503 AUTH command used when not advertised</hostname></hostname>

webmin continues to send the message and gets a 550 relay not permitted as the ultimate error it reports on Send Test Email.

Mail Sending Options:
Via SMTP to remote mail server: <mail host="">
Use SSL encryption? not enabled
Use port number: 2500
Login as: <smtp acct="">
with password: <smtp password="">
SMTP authentication method: Login
From address for email from webmin: <smtp email="" address=""></smtp></smtp></smtp></mail>

Sending on this smtp server with the same configuration from evolution. From what I can find, in order to send the auth command, the initial helo should be ehlo to indicate extended SMTP. I couldn't find documentation to configure that behavior. Any insight would be helpful.

Discussion

  • Justin Slauson

    Justin Slauson - 2019-02-13

    My apologies. I didn't realize I was using notation that would get mangled. anything in angled brackets indicates proper connection details that are not shown. Thanks.

     
  • Ilia

    Ilia - 2019-02-13

    Extended SMTP option?

    What mail program do you use? Try Googling mentioned option. ;)

     
  • Justin Slauson

    Justin Slauson - 2019-02-13

    Hello,

    I'm not not sure what answer you're looking for with "Extended SMTP option?". Since you link to the wikipedia entry on it, I assume you're not asking what it is.

    As I stated in the initial bug report, sending on this mail host via Evolution (<- this is the email program I use) with the same credentials works.

    Extended SMTP (https://en.wikipedia.org/wiki/Extended_SMTP): "The main identification feature for ESMTP clients is to open a transmission with the command EHLO (Extended HELLO), rather than HELO (Hello, the original RFC 821 standard)."

    As stated in the initial report, webmin is incorrectly sending a helo request before sending the auth request. The server is rejecting the request because helo was given instead of ehlo as the spec requires.

     
  • Justin Slauson

    Justin Slauson - 2019-02-13

    Maybe I see the confusion now. This is when setting up Webmin to send email via remote SMTP (Webmin>Webmin Configuration>Sending Email: This page controls how Webmin sends email, such as from scheduled backups or background monitoring. It also effects email sent using the Read User Mail module.)

    This is not trying to use webmin as a SMTP server.

     
  • Ilia

    Ilia - 2019-02-13

    Have a look it Webmin/Webmin Configuration/Sending Email. Depending on Mail Server used (Postfix in my case), open used module (e.g. Postfix) in Webmin/Servers and configure SMTP options from there?

     
  • Justin Slauson

    Justin Slauson - 2019-02-13

    I'm not using a local mail server. I'm using the option: Via SMTP to remote mail server. My understanding is that Webmin acts as a SMTP client directly to the remote smtp server and sends mail.

    There is no mail server located on the webmin host.

    Webmin is incorrectly opening the connection with the remote host with a helo instead of ehlo.

     
  • Ilia

    Ilia - 2019-02-13

    We're might be talking about different things but I believe, that Webmin has global, configurable Send Mail options.

    I have attached a screenshot to for you to check the page I am talking about. You can also send test message from there.

     
  • Justin Slauson

    Justin Slauson - 2019-02-13

    That is the page I am talking about. You have selected "Local mail server command" as the first option. My setup uses "Via SMTP to remote mail server"

     
  • Ilia

    Ilia - 2019-02-13

    A little above, what is Mail Server set to?

     
  • Justin Slauson

    Justin Slauson - 2019-02-13

    nothing. see attached screenshot of my configuration

     
  • Jamie Cameron

    Jamie Cameron - 2019-02-14

    So from the original error, it looks like Webmin is trying to authenticate after making the SMTP connection, as expected based on the settings in your final screenshot. But the remote SMTP server is rejecting that because it doesn't require Webmin to login.

     
  • Ilia

    Ilia - 2019-02-14

    Giving it a closer look, in the morning, I can see, that it's also possible that AUTH command used when not advertised error could mean that you are trying to authenticate the server without using encryption, when most contemporary server's configurations doesn't support it.

     
  • Andy Snelson

    Andy Snelson - 2019-03-07

    I'm having the same issue using a remote mail server with ssl enabled.

    .. sending failed : SMTP command mail from: myserver@mydomain.com failed : 503 5.5.1 Error: send HELO/EHLO first .

    I use the same remote mail server within nextcloud, hosted on the same server as webmin without issue.

    Does anone have a resolution for this?

     
    • Justin Slauson

      Justin Slauson - 2019-03-07

      Unforetunately, I didn't feel that the problem was understood and movement wasn't being made, but rather talking in circles. I installed ssmtp and configured webmin to use it through the same smtp server.

      Webmin cannot talk to a remote smtp server and authenticate. My server requires authentication which means the request from webmin should start with ehlo, but it doesn't. It sends a helo.

      Any other client sends through the same smtp server with authentication and has no problems.

       

      Last edit: Justin Slauson 2019-03-07
      • Andy Snelson

        Andy Snelson - 2019-03-07

        I'll probably go the same route then, as like you say other clients handle this with ease it's only webmin that is struggling on my system.

         
      • Andy Snelson

        Andy Snelson - 2019-03-07

        Does Webmin detect sSMTP automatically or did you have to set it up manually?

        Thanks.

         
        • Justin Slauson

          Justin Slauson - 2019-03-07

          After it is installed and configured, set webmin to use "local mail server command"

           
  • Ilia

    Ilia - 2019-03-07

    Hi, Justin and Andy!

    I have just tested it with one of the local mail services (mail.ru) and I could send an email, authenticating on remove SMTP server with no issue.

    I expect that on your side the option called Use SSL encryption is checked to Yes. I also expect that you are entering correct port number and setting SMTP authentication method to Plain.

    It's also worth checking that your Firewall doesn't block outgoing connection to needed port.

    Please let me know more, if it still doesn't work for you right.

     
    • Andy Snelson

      Andy Snelson - 2019-03-07

      Hi Ilia,

      I have SSL set to yes, using port 465. I have tried each authentification method including plain. The port isn't blocked in the firewall and other applications are able to send from the same server using the same details.

      Unfortunately it seems the issue is unique to Webmin.

      Thanks

       
  • Ilia

    Ilia - 2019-03-07

    Okay, you are trying to send it using which service? Is it public mail service, like Hotmail or Gmail? Can you name it, so I could test it for you?

    In case it's your private mail server, there are options for SMTP that you could configure/tweak to make it work, right?

     
    • Andy Snelson

      Andy Snelson - 2019-03-07

      I'm trying to use my ovh.net account, I'll try my gmail account to see if that will work for me temporarily.

       
  • Justin Slauson

    Justin Slauson - 2019-03-07

    All my settings have been posted in text and screenshots. No SSL, port 2500. It is a paid hosting server with no public servers.

     
  • Ilia

    Ilia - 2019-03-07

    Using no SSL, while sending login and password in clear text, most likely, will not work out of the box on most contemporary MTAs. You would need to configure it manually (it's security issue, by the way) to let it work this way.

    Why not using SSL?

     

Log in to post a comment.

Auth0 Logo