Monthly Archives: February 2021

Outgoing email problem with Roundcube, ISPConfig 3.2 and Ubuntu 20.04 on AWS

I had setup an ISPConfig system with Roundcube on Ubuntu 20.04 hosted with AWS EC2.

The setup was all fine, logged in into Roundcube and tried to send a mail. There was the problem – Roundcube says Error 250: Authentication failed.

It seems others also faced the same issue and different solutions worked for different people. I tested the most popular solutions and below are the results

  1. Changing $config[‘smtp_port’] = 587;  to   $config[‘smtp_port’] = 25; in /etc/roundcube/config.inc.php worked instantly but didn’t want to send things over plain text port
  2. Most popular solution was to remove the values of the below settings in /etc/roundcube/config.inc.php:
    $config[‘smtp_user’] = ‘%u’;
    $config[‘smtp_pass’] = ‘%p’;
    The suggested solution is to remove the %u and %p. Though it worked for many but not for me.
  3. Tried setting the $config[‘smtp_server’] = ‘localhost’;  to  $config[‘smtp_server’] = ‘tls://localhost’;
    $config[‘default_host’] = ‘localhost’;  to  $config[‘default_host’] = ‘tls://localhost’;

    But didn’t work
    With these changes was unable to login to Roundcube.
  4. Tried using $config[‘smtp_auth_type’] = ‘PLAIN’;  Didn’t work.
  5. There were also other suggestions to tweak smtpd_use_tls, smtpd_sasl_auth_enable,  smtpd_tls_auth_only etc. But none of these worked either.
  6. The configuration that worked was 
    
    $config['default_host'] = 'localhost';
    $config['smtp_server'] = 'tls://localhost';
    $config['smtp_port'] = 587;
    $config['smtp_user'] = '%u';
    $config['smtp_pass'] = '%p';
    ....
    ....
    $config['imap_conn_options'] = array(
       'ssl' => array(
          'verify_peer' => false,
          'verfify_peer_name' => false,
        ),
    );
    
    $config['smtp_conn_options'] = array(
       'ssl' => array(
           'verify_peer' => false,
           'verify_peer_name' => false,
        ),
    );

    Which indicates it was a SSL issue. But changing the default SSL set by Postfix is a lot work, someday will delve into it.

There was another issue due to which mails were not going out sometimes. The error was “Our
system has detected that 550-5.7.1 this message does not meet IPv6 sending
guidelines regarding PTR 550-5.7.1 records and authentication. Please
review 550-5.7.1

Needed to set
inet_protocols = all  to  inet_protocols = ipv4 in /etc/postfix/main.cf  to force Postfix to use IPv4 only