Authentification SMTP failed

Discussion in 'Installation/Configuration' started by Oitsuki, Jul 27, 2024.

  1. Oitsuki

    Oitsuki Member

    hello,
    The port 25 is blocked on my server and I change inside the roundcub config by 587.
    But on the port 25 or 587 when I try to send an email fom rouncube to gmail I have this error Authentification SMTP failed appear.
    Thank you

    $config = [];

    // Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure da>
    include_once("/etc/roundcube/debian-db-roundcube.php");


    Code:
    $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:
    //$config['smtp_server'] = '%h';
    $config['smtp_server'] = 'localhost';
    
    // SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (>
    //$config['smtp_port'] = 25;
    $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 t>
    $config['product_name'] = 'Roundcube Webmail';
    
    // This key is used to encrypt the users imap password which is stored
    // in the session record. For the default cipher method it must be
    // exactly 24 characters long.
    // YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
    $config['des_key'] = 'xxxxxxxxxxxxxxxxxxxxxxx';
     
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    any chance your hosting provider of choise happens to be hetzner.com?
    They block port 25 and 587 until you've been a customer for about a month / payed your first bill.
    You can request unblocking at the limits page on your cloud console ; if you need it on dedicated servers, you'd need to request there aswell.
     
  3. Oitsuki

    Oitsuki Member

    no I am at ovh.com ,you can test on this link clicshopping.org
    It vps
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Does it work with other FTP clients like Thunderbird or Outlook to send authenticated through that mail account?

    Besides that, if port 25 is blocked, it will still work for Roundcube on localhost to connect to postfix, as the block does not apply to localhost connections. So you should just revert your RoundCube config. Then login to Roundcube and send an email to the same address that you used for the RounfCube login, does it arrive in RoundCube? If yes, then you configured your mail system correctly now. If you can'ts end emails to the outside in RoundCube, then you have a different problem, which is that port 25 outgoing is blocked. This can be solved only by configuring an external relay service in ISPConfig under system > server config > mail for all outgoing emails.
     
    ahrasis likes this.
  5. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    Attached Files:

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    As a side note, most cloud providers block port 25 today, so it's not just Hetzner but also AWS and likely OVH too.
     
    ahrasis likes this.
  7. Oitsuki

    Oitsuki Member

    @til,
    tk,
    I reconfigure the smtp on port 25. It does not work
    As a side note, most cloud providers block port 25 today, so it's not just Hetzner but also AWS and likely OVH too. ==> In this case we must to set smtp port on 587 for example inside the rouncube ?
    upload_2024-7-28_9-11-24.png

    @ztk.me
    About Networks tools, it's correct
    upload_2024-7-28_9-13-15.png
    About the port
    upload_2024-7-28_9-25-49.png

    maybe there is a problem with the firewall ?


    upload_2024-7-28_9-20-42.png
    Note: I can receive an email from google, yahoo.fr. My problem is just to sent an email.

    A last image
    upload_2024-7-28_9-24-5.png


    Thank you
     

    Attached Files:

  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Post the error from mail.log file that you get when you send an email in RoundCube.

    Btw, these are two different issues, sending in RoundCube and contacting external servers, so don't mix them up as it just makes things more complicated for you to solve. Solve them one after another.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    No. Changing RoundCube port won't help for that. As mentioned above, these are two issues. So first, change port in RoundCube back to 25 and take care that mail server is set to localhost in RoundCube config.
     
  10. Oitsuki

    Oitsuki Member

    there response, connexion refused

    upload_2024-7-28_14-39-43.png
     
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Milter service seems not available. That is Mail Filter.
    Is some service not running?
    Code:
    systemctl --state=failed
    Is system using rspamd or amavis?
    Code:
    systemctl status rspamd.service 
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Which tutorial did you use to install the server?
    How much RAM does the server has?

    Rspamd is not running on your server and this causes mail sending to fail, try to start rspamd:

    service rspamd start
     
  13. Oitsuki

    Oitsuki Member

    thank you
    about memory : 4go
    usage is around 40%

    service rspamd start
    Failed to start rspamd.service: Unit rspamd.service is masked.
    root@vps:/home/ubuntu# systemctl --state=failed
    UNIT LOAD ACTIVE SUB DESCRIPTION
    ● clamav-daemon.service loaded failed failed Clam AntiVirus userspace daemon
    ● snap.lxd.activate.service loaded failed failed Service for snap application lxd.activate
    ● systemd-quotacheck.service loaded failed failed File System Quota Check
    That's not good !
     
  14. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    regarding your smtp banner, might be aswell that /etc/hostname only contains sub part of your full hostname.
    e.G. it contains "vps". Just checked a few ispconfig installations and they all have $hostname in their banner config.
    So I suspect your /etc/hostname does not and usually need not contain the fqdn, /etc/mailname was used for that
    anyway long story short;
    check your /etc/postfix/main.cf
    smtpd_banner

    should be at the top, you can remove $myhostname and set it to vps.clicshopping.eu

    assuming this is the correct hostname, set as reverse dns and used internally.
     
  15. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    hmm
    could you try

    Code:
    apt update
    apt install -f
    systemctl daemon-reload
    systemctl enable rspamd
    systemctl enable clamav-daemon
    
     
  16. Oitsuki

    Oitsuki Member

    @ztk.m, Thanky you for your recommendation

    nano /etc/hostname
    Here do I need todo somethig ?

    nano /etc/postfix/main.cf
    # Debian specific: Specifying a file name will cause the first
    # line of that file to be used as the name. The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname

    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no

    HereI change $myhostname by vps.clicshopping.eu


    Just above
    apt update
    apt install -f
    Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
    Hit:2 http://archive.ubuntu.com/ubuntu noble-updates InRelease
    Hit:3 http://archive.ubuntu.com/ubuntu noble-backports InRelease
    Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    All packages are up to date.
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.



    systemctl daemon-reload
    systemctl enable rspamd
    systemctl enable clamav-daemon
    Synchronizing state of rspamd.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install enable rspamd
    Failed to enable unit: Unit file /etc/systemd/system/rspamd.service is masked.

    Synchronizing state of clamav-daemon.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install enable clamav-daemon

    clamav-daemon seems ok
     
  17. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    my bad, sorry I forgot the two lines

    Code:
    systemctl unmask rspamd
    systemctl unmask clamav-daemon
    edit: and after this the enable + start commands :)

    yes, main.cf
    smtpd_banner = vps.clicshopping.eu ESMTP
    should be fine


    if the services do not start after this
    Code:
    journalctl -xeu clamav-daemon
    journalctl -xeu rspamd
    not sure top of my head if it's available on ispconfig
     
  18. Oitsuki

    Oitsuki Member

    I insert that :

    #smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    smtpd_banner = vps.clicshopping.eu ESMTP $mail_name (Ubuntu)
    /etx/init.d/postfix restart ==> ok

    systemctl umask rspamd
    Unknown command verb 'umask', did you mean 'mask'?
    root@vps:/home/ubuntu# systemctl unmask rspamd
    Removed "/etc/systemd/system/rspamd.service".
    root@vps:/home/ubuntu# systemctl unmask clamav-daemon
    root@vps:/home/ubuntu# systemctl daemon-reload
    systemctl enable rspamd
    systemctl enable clamav-daemon
    rspamd.service is not a native service, redirecting to systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install enable rspamd
    Synchronizing state of clamav-daemon.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install enable clamav-daemon

    seems fine !
     
  19. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    Hah you figured I made a typo and misspelled unmask :)

    Also edited my post in regards of rerunning systemctl enable / start / status
    afterwards.
     
  20. Oitsuki

    Oitsuki Member

    yes I know :)

    But I can not sent email to rouncube to gmail for example. I have always the same message
    There the result after a reboot


    systemctl --state=failed

    root@vps:/home/ubuntu# systemctl --state=failed
    UNIT LOAD ACTIVE SUB DESCRIPTION >
    ● clamav-daemon.service loaded failed failed Clam AntiVirus userspace daemon
    ● snap.lxd.activate.service loaded failed failed Service for snap application l>

    Legend: LOAD → Reflects whether the unit definition was properly loaded.
    ACTIVE → The high-level unit activation state, i.e. generalization of S>
    SUB → The low-level unit activation state, values depend on unit typ>


    telnet smtp-relay.clicshopping.org 25
    Server lookup failure: smtp-relay.clicshopping.org:25, Name or service not known
    You have new mail in /var/mail/root
    root@vps:/home/ubuntu# telnet smtp-relay.clicshopping.org 587
    Server lookup failure: smtp-relay.clicshopping.org:587, Name or service not known
     

Share This Page