SMTP Error (250) authentication failed

Discussion in 'Installation/Configuration' started by peterv1231, Jan 19, 2021.

  1. peterv1231

    peterv1231 New Member

    Hey there, HowToForge Forum! :)

    I've looked for a solution for this all around the internet, and usually, I don't post but I couldn't really find any useful post or tutorial. Therefore I really hope that one of you clever minds can help me out on this problem.

    I've just installed ISPConfig on a fresh machine and followed "The perfect server" on ubuntu 20.04, but when I try sending a mail I get SMTP error 250.

    config.inc.php
    Code:
    <?php
    $config = array();
    
    // Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database!
    include_once("/etc/roundcube/debian-db-roundcube.php");
    
    // The IMAP host chosen to perform the log-in.
    // Leave blank to show a textbox at login, give a list of hosts
    // to display a pulldown menu or set one host as string.
    // Enter hostname with prefix ssl:// to use Implicit TLS, or use
    // prefix tls:// to use STARTTLS.
    // Supported replacement variables:
    // %n - hostname ($_SERVER['SERVER_NAME'])
    // %t - hostname without the first part
    // %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
    // %s - domain name after the '@' from e-mail address provided at login screen
    // For example %n = mail.domain.tld, %t = domain.tld
    $config['default_host'] = 'localhost';
    
    // SMTP server host (for sending mails).
    // Enter hostname with prefix ssl:// to use Implicit TLS, or use
    // prefix tls:// to use STARTTLS.
    // Supported replacement variables:
    // %h - user's IMAP hostname
    // %n - hostname ($_SERVER['SERVER_NAME'])
    // %t - hostname without the first part
    // %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
    // %z - IMAP domain (IMAP hostname without the first part)
    // For example %n = mail.domain.tld, %t = domain.tld
    $config['smtp_server'] = 'localhost';
    
    // SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
    $config['smtp_port'] = 587;
    
    // SMTP username (if required) if you use %u as the username Roundcube
    // will use the current username for login
    $config['smtp_user'] = '%u';
    
    // SMTP password (if required) if you use %p as the password Roundcube
    // will use the current user's password for login
    $config['smtp_pass'] = '%p';
    
    // provide an URL where a user can get support for this Roundcube installation
    // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
    $config['support_url'] = '';
    
    // Name your service. This is displayed on the login screen and in the window title
    $config['product_name'] = 'Roundcube Webmail';
    
    // this key is used to encrypt the users imap password which is stored
    // in the session record (and the client cookie if remember password is enabled).
    // please provide a string of exactly 24 chars.
    // YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
    $config['des_key'] = 'removed this for security reasons I guess o.O';
    
    // List of active plugins (in plugins/ directory)
    // Debian: install roundcube-plugins first to have any
    $config['plugins'] = array(
    );
    
    // skin name: folder from skins/
    $config['skin'] = 'elastic';
    
    // Disable spellchecking
    // Debian: spellshecking needs additional packages to be installed, or calling external APIs
    //         see defaults.inc.php for additional informations
    $config['enable_spellcheck'] = false;
    
    master.cf
    PHP:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master" or
    # on-line: http://www.postfix.org/master.5.html).
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (no)    (never) (100)
    # ==========================================================================
    smtp      inet  n       -       y       -       -       smtpd
    #smtp      inet  n       -       y       -       1       postscreen
    #smtpd     pass  -       -       y       -       -       smtpd
    #dnsblog   unix  -       -       y       -       0       dnsblog
    #tlsproxy  unix  -       -       y       -       0       tlsproxy
    submission inet n       -       y       -       -       smtpd
      
    -o syslog_name=postfix/submission
      
    -o smtpd_tls_security_level=encrypt
      
    -o smtpd_sasl_auth_enable=yes
      
    -o smtpd_tls_auth_only=yes
      
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o smtpd_reject_unlisted_recipient=no
    #  -o smtpd_client_restrictions=$mua_client_restrictions
    #  -o smtpd_helo_restrictions=$mua_helo_restrictions
    #  -o smtpd_sender_restrictions=$mua_sender_restrictions
    #  -o smtpd_recipient_restrictions=
    #  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    smtps     inet  n       -       y       -       -       smtpd
      
    -o syslog_name=postfix/smtps
      
    -o smtpd_tls_wrappermode=yes
      
    -o smtpd_sasl_auth_enable=yes
      
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o smtpd_reject_unlisted_recipient=no
    #  -o smtpd_client_restrictions=$mua_client_restrictions
    #  -o smtpd_helo_restrictions=$mua_helo_restrictions
    #  -o smtpd_sender_restrictions=$mua_sender_restrictions
    #  -o smtpd_recipient_restrictions=
    #  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628       inet  n       -       y       -       -       qmqpd
    pickup    unix  n       -       y       60      1       pickup
    cleanup   unix  n       
    -       y       -       0       cleanup
    qmgr      unix  n       
    -       n       300     1       qmgr
    #qmgr     unix  n       -       n       300     1       oqmgr
    tlsmgr    unix  -       -       y       1000?   1       tlsmgr
    rewrite   unix  
    -       -       y       -       -       trivial-rewrite
    bounce    unix  
    -       -       y       -       0       bounce
    defer     unix  
    -       -       y       -       0       bounce
    trace     unix  
    -       -       y       -       0       bounce
    verify    unix  
    -       -       y       -       1       verify
    flush     unix  n       
    -       y       1000?   0       flush
    proxymap  unix  
    -       -       n       -       -       proxymap
    proxywrite unix 
    -       -       n       -       1       proxymap
    smtp      unix  
    -       -       y       -       -       smtp
    relay     unix  
    -       -       y       -       -       smtp
            
    -o syslog_name=postfix/$service_name
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       y       -       -       showq
    error     unix  
    -       -       y       -       -       error
    retry     unix  
    -       -       y       -       -       error
    discard   unix  
    -       -       y       -       -       discard
    local     unix  
    -       n       n       -       -       local
    virtual   unix  
    -       n       n       -       -       virtual
    lmtp      unix  
    -       -       y       -       -       lmtp
    anvil     unix  
    -       -       y       -       1       anvil
    scache    unix  
    -       -       y       -       1       scache
    postlog   unix
    -dgram n  -       n       -       1       postlogd
    Code:
    [19-Jan-2021 00:16:38 +0100]: <44lferjs> PHP Error: SMTP server does not support authentication (POST /webmail/?_task=mail&_unlock=loading1611011797809&_framed=1&_action=send)
    [19-Jan-2021 00:16:38 +0100]: <44lferjs> SMTP Error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1702 (POST /webmail/?_task=mail&_unlock=loading1611011797809&_framed=1&_action=send)
    
    
    Thanks!
    Peter.
     
    Last edited: Jan 19, 2021
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    You must include tls: in the smtp_server if using port 587. The next issue you hit may be the server name is not in the certificate, for which you can use a different server name, configure roundcube to not verify the server name, or change to port 25.
     
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    If the smtp_server is on localhost, it's fine to use port 25, so change $config['smtp_port'] = 587; to $config['smtp_port'] = 25;
     
  4. peterv1231

    peterv1231 New Member

    Hey there,

    Thank you guys so much for your help.

    Now I can send emails successfully, but I don't receive them.

    I have changed smtp_port to 25.
     
  5. peterv1231

    peterv1231 New Member

    I got this in my imap.log
    [19-Jan-2021 18:39:04 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:04 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:04 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:04 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:04 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:05 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:10 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:39:41 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:40:41 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
    [19-Jan-2021 18:41:41 +0100]: <clj2i3th> Connecting to IMAP server attempt:0
     

Share This Page