Install Roundcube Webmail on Ubuntu 20.04 with Apache/Nginx

Roundcube is a free and open source webmail client written in PHP. A webmail is a mail client in your browser, which means instead of reading and sending emails from a desktop mail client like Mozilla Thunderbird, you can access your email from a web browser. Roundcube functionality includes MIME support, address book, folder management, message searching, message filter and spell checking. This tutorial is going to show you how to install Roundcube webmail on Ubuntu 20.04 with Apache or Nginx web server.

Roundcube 1.4 Release

Roundcube 1.4 was released on November 10, 2019 after two years of development. This release features:

  • A responsive skin called Elastic with full mobile device support
  • Email Resent (Bounce) feature
  • Improved Mailvelope integration
  • Support for Redis and Memcached cache
  • Support for SMTPUTF8 and GSSAPI
  • Plus numerous improvements and bug fixes

Prerequisites

To follow this tutorial, it’s assumed that

If not, please click the above links and follow the instructions to complete prerequisites. Note that if you set up your email server using iRedMail before, then your server meets all requirements and Roundcube is already installed on your server.

Now let’s proceed to install Roundcube.

Step 1: Download Roundcube Webmail on Ubuntu 20.04

Log in to your Ubuntu server via SSH, then run the following command to download the latest 1.4 stable version from Roundcube Github repository.

wget https://github.com/roundcube/roundcubemail/releases/download/1.4.6/roundcubemail-1.4.6-complete.tar.gz

Note: You can always use the above URL format to download Roundcube from command line. If a new version comes out, simply replace 1.4.6 with the new version number. You can check if there’s new release at Roundcube downloade page.

Extract the tarball, move the newly created folder to web root (/var/www/) and rename it as roundcube at the same time.

tar xvf roundcubemail-1.4.6-complete.tar.gz

sudo mv roundcubemail-1.4.6 /var/www/roundcube

Step 2: Install Dependencies

Run the following command to install required PHP extensions.

sudo apt install php-net-ldap2 php-net-ldap3 php-imagick php7.4-common php7.4-gd php7.4-imap php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-intl php7.4-gmp

Install Composer, which is a dependency manager for PHP.

sudo apt install composer

Change into the roundcube directory.

cd /var/www/roundcube

Use Composer to install all needed dependencies (3rd party libraries) for Roundcube Webmail.

composer install --no-dev

If you see the nothing to install or update message, then all dependencies are installed.

roundcube-webmail-install-dependency-ubuntu-20.04

Make the web server user (www-data) as the owner of the temp and logs directory so that web server can write to these two directories.

sudo chown www-data:www-data temp/ logs/ -R

Step 3: Create a MariaDB Database and User for Roundcube

Log into MariaDB shell as root.

sudo mysql -u root

Then create a new database for Roundcube using the following command. This tutorial name it roundcube, you can use whatever name you like for the database.

CREATE DATABASE roundcube DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Next, create a new database user on localhost using the following command. Again, this tutorial name it roundcubeuser, you can use whatever name you like. Replace password with your preferred password.

CREATE USER roundcubeuser@localhost IDENTIFIED BY 'password';

Then grant all permission of the new database to the new user so later on Roundcube webmail can write to the database.

GRANT ALL PRIVILEGES ON roundcube.* TO roundcubeuser@localhost;

Flush the privileges table for the changes to take effect.

flush privileges;

Exit MariaDB Shell:

exit;

Import the initial tables to roundcube database.

sudo mysql roundcube < /var/www/roundcube/SQL/mysql.initial.sql

Step 4: Create Apache Virtual Host or Nginx Config File for Roundcube

Apache

If you use Apache web server, create a virtual host for Roundcube.

sudo nano /etc/apache2/sites-available/roundcube.conf

Note: If you followed my Postfix/Dovecot tutorial, a virtual host already exists. you should edit the following file.

sudo nano /etc/apache2/sites-available/mail.example.com.conf

Put the following text into the file. Replace mail.example.com with your real domain name and don’t forget to set DNS A record for it.

<VirtualHost *:80>
  ServerName mail.example.com
  DocumentRoot /var/www/roundcube/

  ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
  CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>

  <Directory /var/www/roundcube/>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>

</VirtualHost>

Save and close the file. Then enable this virtual host with:

sudo a2ensite roundcube.conf

Reload Apache for the changes to take effect.

sudo systemctl reload apache2

Now you should be able to see the Roundcube web-based install wizard at http://mail.example.com/installer.

Nginx

If you use Nginx web server, create a virtual host for Roundcube.

sudo nano /etc/nginx/conf.d/roundcube.conf

Note: If you followed my Postfix/Dovecot tutorial, a virtual host already exists. you should edit the following file.

sudo nano /etc/nginx/conf.d/mail.example.com.conf

Put the following text into the file. Replace the domain name and don’t forget to set DNS A record for it.

server {
  listen 80;
  listen [::]:80;
  server_name mail.example.com;
  root /var/www/roundcube/;
  index index.php index.html index.htm;

  error_log /var/log/nginx/roundcube.error;
  access_log /var/log/nginx/roundcube.access;

  location / {
    try_files $uri $uri/ /index.php;
  }

  location ~ \.php$ {
   try_files $uri =404;
    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }

  location ~ /.well-known/acme-challenge {
    allow all;
  }
 location ~ ^/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
    deny all;
  }
  location ~ ^/(bin|SQL)/ {
    deny all;
  }
 # A long browser cache lifetime can speed up repeat visits to your page
  location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
       access_log        off;
       log_not_found     off;
       expires           360d;
  }
}

Save and close the file. Then test Nginx configurations.

sudo nginx -t

If the test is successful, reload Nginx for the changes to take effect.

sudo systemctl reload nginx

Now you should be able to see the Roundcube web-based install wizard at http://mail.example.com/installer.

Step 5: Enabling HTTPS

It’s highly recommended that you use TLS to encrypt your webmail. We can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Ubuntu 20.04 server.

sudo apt install certbot

If you use Nginx, then you also need to install the Certbot Nginx plugin.

sudo apt install python3-certbot-nginx

Next, run the following command to obtain and install TLS certificate.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d mail.example.com

If you use Apache, install the Certbot Apache plugin.

sudo apt install python3-certbot-apache

And run this command to obtain and install TLS certificate.

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d mail.example.com

Where

  • --nginx: Use the nginx plugin.
  • --apache: Use the Apache plugin.
  • --agree-tos: Agree to terms of service.
  • --redirect: Force HTTPS by 301 redirect.
  • --hsts: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.
  • --staple-ocsp: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.

The certificate should now be obtained and automatically installed.

roundcube webmail https letsencrypt

Note: If you followed my Postfix/Dovecot tutorial, and now you install Roundcube on the same server, then certbot will probably tell you that a certificate for mail.example.com already exists as shown below, so you can choose to install the existing TLS certificate to your web server configuration file.

roundcube postfix dovecot certbot https certificate

Step 6: Finish the Installation in Web Browser

In your web browser, go to the Roundcube installer page.

https://mail.example.com/installer

The web installer will first check if PHP extensions, database and 3rd party libraries are installed. If you follow this tutorial, then all requirements should be met.

roundcube-ubuntu-20.04

Click Next button. In the 2nd page, go to the Database setup section. You need to fill in MariaDB database details that you created in step 3.

roundcube mariadb user

The IMAP and SMTP section allows you to configure how to receive and submit email. Enter the following values for IMAP.

  • IMAP host: ssl://mail.example.com port: 993

Enter the following values for SMTP settings.

  • SMTP port: tls://mail.example.com port: 587

roundcube smtp settings

Next, you can scroll down to the Plugins section to enable some plugins. For example the password plugin, mark as junk plugin, and so on. I enabled all of them.

roundcube enable plugins

Once that’s done, click create config button which will create configuration based on the information you entered. You need to copy the configuration and save it as config.inc.php under the /var/www/roundcube/config/ directory.

roundcube webmail installer

Once the config.inc.php file is created, click continue button. In the final step, test your SMTP and IMAP settings by sending a test email and checking IMAP login.

roundcube webmail test smtp & imap config

If the test fails, then you can click the 2. Create config link on the top of page to go back to step 2 and recreate the config.inc.php file.

If test is successful, go to your Webmail domain without /installer and login.

roundcube webmail elastic skin

Roundcube Webmail interface

roundcube ubuntu server apache nginx

Now you should remove the whole installer folder from the document root or make sure that enable_installer option in config.inc.php file is disabled.

sudo rm /var/www/roundcube/installer/ -r

These files may expose sensitive configuration data like server passwords and encryption keys to the public. Make sure you cannot access the installer page from your browser.

Step 7: Configure the Sieve Message Filter

You can create folders in Roundcube webmail and then create rules to filter email messages into different folders. In order to do this, you need to install the ManageSieve server with the following command.

sudo apt install dovecot-sieve dovecot-managesieved

By default, Postfix uses its builtin local delivery agent (LDA) to move inbound emails to the message store (inbox, sent, trash, Junk, etc). We can configure it to use Dovecot to deliver emails, via the LMTP protocol, which is a simplified version of SMTP. LMTP allows for a highly scalable and reliable mail system and it is required if you want to use the sieve plugin to filter inbound messages to different folders.

Install the Dovecot LMTP Server.

sudo apt install dovecot-lmtpd

Edit the Dovecot main configuration file.

sudo nano /etc/dovecot/dovecot.conf

Add lmtp and sieve to the supported protocols.

protocols = imap lmtp sieve

Save and close the file. Then edit the Dovecot 10-master.conf file.

sudo nano /etc/dovecot/conf.d/10-master.conf

Change the lmtp service definition to the following.

service lmtp {
 unix_listener /var/spool/postfix/private/dovecot-lmtp {
   group = postfix
   mode = 0600
   user = postfix
  }
}

Next, edit the Postfix main configuration file.

sudo nano /etc/postfix/main.cf

Add the following lines at the end of the file. The first line tells Postfix to deliver emails to local message store via the dovecot LMTP server. The second line disables SMTPUTF8 in Postfix, because Dovecot-LMTP doesn’t support this email extension.

mailbox_transport = lmtp:unix:private/dovecot-lmtp
smtputf8_enable = no

Save and close the file. Open the /etc/dovecot/conf.d/15-lda.conf file.

sudo nano /etc/dovecot/conf.d/15-lda.conf

Scroll to the end of the file, uncomment the mail_plugins line and add the sieve plugin to local delivery agent (LDA).

protocol lda {
    # Space separated list of plugins to load (default is global mail_plugins).
    mail_plugins = $mail_plugins sieve
}

Save and close the file. If you can find the 20-lmtp.conf file under /etc/dovecot/conf.d/ directory, then you should also enable the sieve plugin in that file like below.

protocol lmtp {
      mail_plugins = quota sieve
}

Edit the /etc/dovecot/conf.d/10-mail.conf file.

sudo nano /etc/dovecot/conf.d/10-mail.conf

Sieve scripts are stored under each user’s home directory. If you followed my PostfixAdmin tutorial and are using virtual mailbox domains, then you need to enable mail_home for the virtual users by adding the following line in the file, because virtual users don’t have home directories by default.

mail_home = /var/vmail/%d/%n

Save and close the file.

Finally, restart Postfix and Dovecot.

sudo systemctl restart postfix dovecot

Now you can go to Roundcube webmail, open an email message and click the more button and select create filters to create message filters. For example, I create a filter that moves every email sent from redhat.com to the Red Hat folder.

roundcube sieve filter

Note that if you move a sieve filter set from an old mail server to your new mail server, you need to go to Settings -> Filters, then click Actions and enable the filter set, or Dovecot LMTP server won’t execute the sieve filter.

Step 8: Adding Local DNS Entry

It’s recommended to edit the /etc/hosts file and add the following entry, so that Roundcube won’t have to query the public DNS, which will speed up web page loading a little bit.

127.0.0.1  localhost mail.example.com

Step 9: Removing Sensitive Information from Email Headers

By default, Roundcube will add a User-Agent email header, indicating that you are using Roundcube webmail and the version number. You can tell Postfix to ignore it so recipient can not see it. Run the following command to create a header check file.

sudo nano /etc/postfix/smtp_header_checks

Put the following lines into the file.

/^User-Agent.*Roundcube Webmail/            IGNORE

Save and close the file. Then edit the Postfix main configuration file.

sudo nano /etc/postfix/main.cf

Add the following line at the end of the file.

smtp_header_checks = regexp:/etc/postfix/smtp_header_checks

Save and close the file. Then run the following command to rebuild hash table.

sudo postmap /etc/postfix/smtp_header_checks

Reload Postfix for the change to take effect.

sudo systemctl reload postfix

Now Postfix won’t include User-Agent: Roundcube Webmail in the headers when sending outgoing emails.

Step 10: Configure the Password Plugin in Roundcube

Roundcube includes a password plugin that allows users to change their password from the webmail interface. However, we need to configure it before it will work. Run the following command to copy the distributed password plugin config file to a new file.

sudo cp /var/www/roundcube/plugins/password/config.inc.php.dist /var/www/roundcube/plugins/password/config.inc.php

Edit the password plugin configuration file.

sudo nano /var/www/roundcube/plugins/password/config.inc.php

Find the following line:

$config['password_db_dsn'] = '';

This parameter is used to tell the password plugin where the user passwords are stored. By default, the value is empty and it will query the roundcube database, which doesn’t store user passwords. If you followed my PostfixAdmin tutorial, then user passwords are stored in the postfixadmin.mailbox table, so we need to change the value to:

$config['password_db_dsn'] = 'mysql://postfixadmin:postfixadmin_database_password@127.0.0.1/postfixadmin';

The tells the password plugin to connect to the postfixadmin database. If you don’t remember your postfixadmin database password, you can find it in the /etc/dovecot/dovecot-sql.conf.ext file.

Then find the following line.

$config['password_query'] = 'SELECT update_passwd(%c, %u)';

Change it to the following.

$config['password_query'] = "UPDATE mailbox SET password=%D,modified=NOW() WHERE username=%u";

I recommend enabling a password strength checker to prevent users from setting week passwords. Go to the beginning of this file, you can find the following line.

$config['password_strength_driver'] = null;

We can use the zxcvbn password strength driver, so change it to:

$config['password_strength_driver'] = 'zxcvbn';

Add the following line in this file to allow strong passwords only.

$config['password_zxcvbn_min_score'] = 5;

Note: The $config['password_minimum_score'] parameter doesn’t work with the zxcvbn driver, so leave it alone.

You can also set a minimum length for the password. Find the following line.

$config['password_minimum_length'] = 0;

Change it to:

$config['password_minimum_length'] = 8;

Recall that we used the ARGON2I password scheme in the PostfixAdmin tutorial, so we also need to configure the password plugin to use ARGON2I. Find the following lines in the file.

$config['password_algorithm'] = 'clear';

By default, the password will be stored as clear text, change the value to the following to use Dovecot’s builtin password algorithm.

$config['password_algorithm'] = 'dovecot';

Then find the following line, which tells where the Dovecot’s password hash generator is located.

$config['password_dovecotpw'] = '/usr/local/sbin/dovecotpw'; // for dovecot-1.x

Change it to the following.

$config['password_dovecotpw'] = '/usr/bin/doveadm pw -r 5';

Then find the following line, which tells which password scheme will be used.

$config['password_dovecotpw_method'] = 'CRAM-MD5';

Change it to:

$config['password_dovecotpw_method'] = 'ARGON2I';

Find the following line.

$config['password_dovecotpw_with_method'] = false;

Change false to true. This will add a {ARGON2I} prefix to the hashed password, so you will recognize which password scheme is used.

$config['password_dovecotpw_with_method'] = true;

Save and close the file. Since this file contains the database password, we should allow only the www-data user to read and write to this file.

sudo chown www-data:www-data /var/www/roundcube/plugins/password/config.inc.php
sudo chmod 600 /var/www/roundcube/plugins/password/config.inc.php

Now users should be able to change their passwords in the Roundcube webmail interface.

roundcube webmail change password

How to Set Up Vacation/Out-of-Office Messages

We can use the sieve filter to create vacation/out-of-office messages. Go to Roundcube Settings -> Filters. Then click the create button to create a filter.

  • Give this filer a name like “out of office”.
  • New filters are not disabled, so you can leave the button alone.
  • In the Scope field, select all messages.
  • Select Replay with message in the Actions settings, and enter the message that will be automatically sent.
  • Enter 1 in how ofter send messages. Leave other text field empty.
  • Click the Save button and you are done.

roundcube vacation out of office message

When you are back to office, you can toggle the “Filter disabled” button, and click the Save button to disable this filter.

Increase Upload File Size Limit

If you use PHP-FPM to run PHP scripts, then files such as images, PDF files uploaded to Roundcube can not be larger than 2MB. To increase the upload size limit, edit the PHP configuration file.

sudo nano /etc/php/7.4/fpm/php.ini

Find the following line (line 846).

upload_max_filesize = 2M

Change the value like below. Note that this value should not be larger than the attachment size limit set by Postfix SMTP server.

upload_max_filesize = 50M

Then find the following line (line 694).

post_max_size = 8M

Change the maximum size of POST data that PHP will accept.

post_max_size = 50M

Save and close the file. Alternatively, you can run the following two commands to change the value without manually opening the file.

sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php/7.4/fpm/php.ini

sudo sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php/7.4/fpm/php.ini

Then restart PHP-FPM.

sudo systemctl restart php7.4-fpm

Nginx also sets a limit of upload file size. The default maximum upload file size limit set by Nginx is 1MB. If you use Nginx, edit the Nginx configuration file.

sudo nano /etc/nginx/conf.d/mail.example.com.conf

Add the following line in the SSL virtual host.

client_max_body_size 50M;

Save and close the file. Then reload Nginx for the changes to take effect.

sudo systemctl reload nginx

Troubleshooting Tips

If you encounter errors, you can check the error logs at /var/log/apache2/roundcube_error.log (if you are using Apache), or /var/log/nginx/roundcube.error (if you are using Nginx.)

Wrapping Up

I hope this tutorial helped you install Roundcube Webmail on Ubuntu 20.04. As always, if you found this post useful, subscribe to our free newsletter to get more tips and tricks 🙂

Rate this tutorial
[Total: 1 Average: 5]

33 Responses to “Install Roundcube Webmail on Ubuntu 20.04 with Apache/Nginx

  • Harrison
    3 months ago

    Hi! Thank you very much for the tutorials you provide. I am wondering if it’s possible to allow users to register for free on my own mail server. Just like what Gmail is providing. Thanks awaiting your response.

    • I didn’t find any open-source web applications that allow you to do that with PostfixAdmin/Roundcube. I think you need to develop this kind of web app by yourself.

  • Hi! Excellent tutorials!

    How would one go about configuring roundcube (on the same server with: postfix, dovecot and postfixadmin) running behind haproxy?

    SSL is terminated in haproxy and roundcube is running on the mail server.
    Ports 587 and 993 are forwarded respectively as send-proxy and send-proxy-v2 to the mail server.
    Postfix is listening to 10587(STARTTLS) and dovecot to 10993(SSL) on the mail server.

    Just can’t get a connection from roundcube to smtp and imap. Everything else is running smoothly thanks to your HAProxy tutorial! Any advice would be much appreciated. Cheers!

    • You can add a custom DNS record in /etc/hosts file on the mail server, pointing the A record to the mail server itself, instead of pointing it to the HAProxy server.

  • Hello Xiao,
    before starting the roundcube installation I want to ask you a question, please:
    So, if we have already our mail.example.com.conf virtual host file from the previousDovecot/Postfix tutorial file from previous we do not need to create a roundcube.conf file and to use our mail.example.com instead, right? Then, this file is already populated with content, much of it on behalf of certbot. So, what should we do, adding extra the text you provide us or delete all the old content and add this new one?
    Thank You!

  • Ângelo Oliveira
    1 month ago

    Hello I followed you steps but apache doesn’t show me anything i can’t see the installer could you give a hand ?

    • If you encounter errors, you can check the error logs at /var/log/apache2/roundcube_error.log (if you are using Apache), or /var/log/nginx/roundcube.error (if you are using Nginx.)

  • Sebka97
    1 month ago

    Hello i’m getting this error when trying to send a mail

    SMTP Error (451): Failed to add recipient “mail.mail.com” (4.3.0) “mail.mail.com” Temporary lookup failure

  • Sebka97
    1 month ago

    It is I’m sending it to my Gmail to test it and I get this error

    • Sebka97
      1 month ago

      Is there anything I can check why I’m getting this error tried different emails same error I get

    • Check your mail log (/var/log/mail.log)

      • Sebka97
        1 month ago

        This is the error.

        Jun 28 06:24:18 mail postfix/submission/smtpd[50421]: warning: proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf lookup error for “[email protected]”
        Jun 28 06:24:18 mail postfix/submission/smtpd[50421]: NOQUEUE: reject: RCPT from cpc85848-haye24-2-0-cust113.17-4.cable.virginm.net[82.44.14.114]: 451 4.3.0 : Temporary lookup failure; from= to= proto=ESMTP helo=
        Jun 28 06:24:18 mail postfix/submission/smtpd[50421]: disconnect from cpc85848-haye24-2-0-cust113.17-4.cable.virginm.net[82.44.14.114] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=7/8
        
    • Open the /etc/postfix/sql/mysql_virtual_alias_domain_maps.cf file. Make sure you have entered the correct password for the postfixadmin user.

    • Perhaps the postfixadmin password contains some special characters that are interpreted as meta-characters.

      • Sebka97
        4 weeks ago

        Only letters and numbers

        • Sebka97
          4 weeks ago

          I will try and install maybe IRedMail but could you tell me how can I run more then just the mail website as I don’t understand how to use the templates there to run the mail and other subdomains

    • You can edit the /etc/postfix/master.cf file

      sudo nano /etc/postfix/master.cf

      Find the following line

      smtp      inet  n       -       y       -       -       smtpd

      Add the -v flag.

      smtp      inet  n       -       y       -       -       smtpd -v

      Save and close the file. Then restart Postfix

      sudo systemctl restart postfix

      Postfix will produce more verbose debugging logs in /var/log/mail.log

  • Sebka97
    3 weeks ago
     Jul  8 10:35:24 mail postfix/proxymap[491828]: warning: mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf: query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''1' at line 1
    Jul  8 10:35:24 mail postfix/submission/smtpd[491827]: warning: proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf lookup error for "[email protected]"
    Jul  8 10:35:24 mail postfix/submission/smtpd[491827]: NOQUEUE: reject: RCPT from cpc85848-haye24-2-0-cust113.17-4.cable.virginm.net[82.44.14.114]: 451 4.3.0 : Temporary lookup failure; from= to= proto=ESMTP helo=
    Jul  8 10:35:24 mail postfix/submission/smtpd[491827]: disconnect from cpc85848-haye24-2-0-cust113.17-4.cable.virginm.net[82.44.14.114] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=7/8 
    query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1
    • Sebka97
      3 weeks ago

      I’ve fixed it but now I get this error

       host gmail-smtp-in.l.google.com[173.194.76.26] said:
          550-5.7.1 [82.44.14.114] The IP you're using to send mail is not authorized
          to 550-5.7.1 send email directly to our servers. Please use the SMTP relay
          at your 550-5.7.1 service provider instead. Learn more at 550 5.7.1
          https://support.google.com/mail/?p=NotAuthorizedError b18si22548156wrs.358
          - gsmtp (in reply to end of DATA command) 
    • It seems you are running a mail server with a residential IP address. That’s why Gmail refused to receive emails from your mail server. Consider using a data center IP address.

  • Sebka97
    3 weeks ago

    Hmm do why when I was using IRedMail it worked normally

  • Many thanks for this fantastic setup guide.

  • Kevin Hanrahan
    6 days ago

    I’ve followed all the steps above, and my set up is from your tutorials on how to set up a mail server from scratch, got all the way through DMARC and decided to set up Roundcube. Get to the installer, and everything checks out OK. Make the config file and everything checks OK, and then I try to test the IMAP and SMTP, and get NOT OK.

    SMTP send:  NOT OK(Invalid sender or recipient)
    IMAP connect:  NOT OK(Login failed for [email protected] against mail.example.com from 192.168.1.1. Could not connect to ssl://mail.kevinghanrahan.com:993: Unknown reason)

    Checked error logs and the apache2 roundcube log says there is an issue with deprecated {}. The error log in /var/www/roundcube/logs says:

    IMAP Error: Login failed for [email protected] against mail.example.com from 192.168.1.1. Could not connect to ssl://mail.example.com:993: Unknown reason in /var/www/roundcube/program/lib/Roundcube/rcube_imap.php on line 200 (POST /?_task=login&_action=login

    Mail log give:

     imap-login: Disconnected (no auth attempts in 0 secs): user=, rip=192.168.1.1, lip=192.168.1.105, TLS handshaking: SSL_accept() failed: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca: SSL alert number 48, session=
    

    My SSL is a wildcard SSL. Can you help me figure this out? I’ve googled until my fingers hurt, and there seems to be no answer.

    BTW: Thunderbird can send and receive just fine, as can my phone email client. Just seems this web thing is problematic.

    • Kevin Hanrahan
      6 days ago

      UPDATE: So I was able to get the login to work. Had to add the ssl config from defaults.inc.php and point to my certificate chain. Still having trouble with SMTP Invalid sender or recipient. Can’t seem to see what the issue is.

      • Kevin Hanrahan
        6 days ago

        UPDATE: So, after fiddling and fiddling, I just decided to log into Roundcube, since I could, and see if I could send an email. I was able. So, I guess it is fixed.

  • dilyan
    3 days ago

    Hello,

    Thank’s a lot fo tutorial everything works perfect.
    Is someone find a way to fix The maximum upload file size: 2 MB?
    I try many things but no result. I remember that in old Roundcube е versions there is such options in installer , but now when I make the configurations there is no such option.

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.


The maximum upload file size: 2 MB.
You can upload: image.