# [solved] upgrading roundcube to 1.4.1

## Elleni

I need help on upgrading roundcube from 1.3.8 to 1.4.1 

After webapp-config upgrade, I can login, but I can't send mails. Initially I got smtp 250 error. 

Does anyone know, which are the correct steps for this upgrade? Apparently webapp-config update is not enough. After complete re-install of roundcube 1.4.1 I can login into the new interface, but trying to send a testmail, I now (after re-install including re-creation of database) get smtp error 451, recipient could not be set 4.3.0, temporary lookup failure. I tried to completely uninstall 1.3.8 version, then installed 1.4.1 with webapp-config and finally re-created database and flushed /path/to/webroot/SQL/mysql.initial.sql. So I am back on working 1.3.8 now and I am hoping any hint can point me to the right direction. 

Maybe I need to change something within postfix in the end? 

On my mailclients I use mail.mydomain.com port 465 for smtp configuration, while I read that roundcube needing port 587?Last edited by Elleni on Sat Dec 28, 2019 11:28 pm; edited 1 time in total

----------

## Banana

roundcube is a PHP application, right?

Are there any lof files to look at?

Maybe this can be the problem / solution: https://forums.gentoo.org/viewtopic-t-1098880-highlight-.html

----------

## freke

While I see my server also listens on port 465 I found this *Quote:*   

> Port 465:
> 
> IANA has reassigned a new service to this port, and it should no longer be used for SMTP communications.
> 
> However, because it was once recognized by IANA as valid, there may be legacy systems that are only capable of using this connection method. As a result, Mailgun supports SSL connections via port 465. Typically, you will use this port only if your application demands it. A quick Google search, and you'll find many consumer Inbox Service Providers' (ISPs) articles that suggest port 465 as the recommended setup. Hopefully, this ends soon! It is not RFC compliant.

 Probably that's the smtps-entry in postfix' master.cf.

I see that the mail is processed by submission (port 587) when i try to send via my Roundcube (1.4.1).

It seems like you can set the port in Roundcube's config.inc.php though - 

```
$config['smtp_port'] = 465;
```

EDIT:

TBH I don't really know if port 465 should really be used or not, also found this https://www.linuxbabe.com/mail-server/enable-smtps-port-465-postfix - which seems to say that 465 is encouraged for submission?

----------

## Elleni

Although I have my server listening on port 587 too, I always used 465 on my clients (as it was the only working option). Now I tried to configure a mailclient with port 587 startls for smtp and watched the log, while trying to send a mail, and there is the following error. 

```
postfix/submission/smtpd[3710]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

postfix/submission/smtpd[3710]: warning: mysql:/etc/postfix/sql_virtual_alias_maps.cf lookup error for "user@mydomain.com"

postfix/submission/smtpd[3710]: NOQUEUE: reject: RCPT from unknown[1.2.3.4]: 451 4.3.0 <user@mydomain.com>: Temporary lookup failure; from=<user@mydomain.com> to=<anemail@adress.com> proto=ESMTP helo=<[4.3.2.1]>
```

 whitch explains why roundcube cannot send via 587 too. 

I doublechecked that credentials in /etc/postfix/sql_virtual_alias_maps.cf are correct by issuing: 

```
mysql -u mymailuser_account_for_sql -p and copy/pasted the password from sql_virtual_alias_maps.cf file which allowed me to login to sql from a ssh session on my mailserver. 

```

The socket file is there: 

```
ls -l /var/run/mysqld/mysqld.sock 

srwxrwxrwx 1 mysql mysql 0 28. Dez 23:27 /var/run/mysqld/mysqld.sock
```

sql_virtual_alias_maps.cf:

```
user = mymailuser_account_for_sql

password = somepassword

hosts = localhost

dbname = mailserver_database_name

query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
```

And as said, sending mails through smtps port 465 works fine on mailclients (wouldn't the same /etc/postfix/sql_virtual_alias_maps.cf be used for 465?). I will now try if I can enable roundcube 1.4.1 to send via 465, but it would be nice to know, why it is not working with 587..Last edited by Elleni on Sat Dec 28, 2019 11:30 pm; edited 1 time in total

----------

## Elleni

ok, got it working on port 465 by adding the following in config.inc.php of roundcube: 

```
$config['smtp_server'] = 'ssl://mailserver.hostname.com';

$config['smtp_port'] = 465;
```

 so I guess, I'll mark this thread as solved and try to find out howto enable 587 for startls too, maybe worth an own thread? 

Edit to add, I also tried with temporary disabled firewall to make sure it is not a firewall issue, and it apparently is not.Last edited by Elleni on Sat Dec 28, 2019 11:56 pm; edited 2 times in total

----------

## freke

A submission entry in /etc/postfix/master.cf should make it listen on port 587, ie. my submission andd smtps entries

```
submission inet n       -       n       -       -       smtpd

  -o syslog_name=postfix/submission

  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

  -o milter_macro_daemon_name=ORIGINATING

  -o smtpd_helo_restrictions=

  -o smtpd_milters=inet:localhost:11332

smtps     inet  n       -       n       -       -       smtpd

  -o syslog_name=postfix/smtps

  -o smtpd_tls_wrappermode=yes

  -o smtpd_sasl_auth_enable=yes

  -o smtpd_reject_unlisted_recipient=no

  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

  -o smtpd_helo_restrictions=

  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject

  -o milter_macro_daemon_name=ORIGINATING

  -o smtpd_milters=inet:localhost:11332
```

I don't really know why they're not enabled with the same options - probably should be, and something I should look into.

----------

## Elleni

My submission entries are

```
submission inet n       -       y       -       -       smtpd

    -o syslog_name=postfix/submission

    -o smtpd_tls_security_level=encrypt

    -o smtpd_sasl_auth_enable=yes

    -o smtpd_sasl_type=dovecot

    -o smtpd_sasl_path=private/auth

    -o smtpd_sasl_security_options=noanonymous

    -o milter_macro_daemon_name=ORIGINATING

    -o smtpd_helo_required=no

    -o smtpd_helo_restrictions=

    -o cleanup_service_name=submission-header-cleanup
```

And smtps

```
smtps     inet  n       -       n       -       -       smtpd

     -o syslog_name=postfix/smtps

     -o smtpd_tls_wrappermode=yes

     -o smtpd_sasl_auth_enable=yes

     -o smtpd_reject_unlisted_recipient=no

     -o smtpd_recipient_restrictions=

     -o smtpd_relay_restrictions=permit_sasl_authenticated,reject

     -o milter_macro_daemon_name=ORIGINATING
```

Last edited by Elleni on Sat Dec 28, 2019 11:53 pm; edited 2 times in total

----------

## freke

I'm nowhere qualified to guide you to edit those - I'm pretty sure I've been mostly following guides found to end up with what seems to work for my setup (on which I'm practically the only user)

----------

## Elleni

Dito. And I admit, that I am a bit scared of making changes in my postfix configs as I am afraid, I don't know enough about to understand, how and particularly why it works. I have plenty of commented out entries there too from different tries to get it to work   :Laughing: 

But maybe I'll do some try and error eventually  :Very Happy: 

Or maybe a more qualified mate will jump in and perhaps see the maybe obvious for him reason, why the sql query is not working for submission port 587 here   :Twisted Evil: 

----------

## Elleni

One final question on elastic skin. I can't find an option to have the same layout as in larry skin where mails are displayed under the mails list, and not right of the list as its the default. I guess that is not possible in new skin?

----------

## freke

I didn't like the elastic skin layout which is why I ended up with

```
$config['skin'] = 'larry';
```

in config.inc.php  :Wink:  - dunno how configurable the layout of each skin is though.

----------

## Banana

What happends if you use 127.0.0.1 (or even the real IP) instead of localhost in your SQL settings?

----------

## Elleni

For testing I replaced localhost with 127.0.0.1 in /etc/postfix/sql_virtual_alias_maps. That does not work either, its even worse as expected, because sql databases/users are setup related to host: localhost. 

```
postfix/trivial-rewrite: warning: connect to mysql server 127.0.0.1: Lost connection to MySQL server at 'reading initial communication packet', system error: 2

postfix/trivial-rewrite: warning: virtual_alias_domains: mysql:/etc/postfix/sql_virtual_alias_maps.cf: table lookup problem

postfix/trivial-rewrite: warning: virtual_alias_domains lookup failure

postfix/trivial-rewrite: warning: virtual_alias_domains: mysql:/etc/postfix/sql_virtual_alias_maps.cf: table lookup problem

postfix/trivial-rewrite: warning: virtual_alias_domains lookup failure

postfix/trivial-rewrite: warning: virtual_alias_domains: mysql:/etc/postfix/sql_virtual_alias_maps.cf: table lookup problem

postfix/trivial-rewrite: warning: virtual_alias_domains lookup failure

postfix/submission/smtpd: NOQUEUE: reject: RCPT from unknown[1.2.3.4]: 451 4.3.0 <user@mydomain.com>: Temporary lookup failure; from=<user@mydomain.com> to=<anemailadress@somedomain.com> proto=ESMTP helo=<[4.3.2.1]>

postfix/submission/smtpd: lost connection after RCPT from unknown[1.2.3.4]

postfix/submission/smtpd: disconnect from unknown[1.2.3.4] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 commands=5/6
```

I think, it could work with submission settings from freke, and I will try and test them as soon as I find some time, to enable port 587. But for now, I am already happy, it works with port 465. Although it was stated that this port is depricated, I prefer using this one, as that way ssl connection is required. On 587 with startls encryption is optional and not mandatory if I understand startls correctly.

----------

