Want to test something but not sure if possible

I tried to install roundcubemail on a testserver which is used only for zabbix atm. I realized that the mailserver is installed as a dependency. My intention is to use the existing imap server I installed on another nethserver and not one locally installed on the testbox.

Is that possible and if so where to modify the imap and smtp settings of roundcubemail? And can I somehow change the dependencies on this roundcube mail application as I have no need for an additional mailserver locally installed on the testbox?

Furthermore I would like to use an external smtp server on this roundcube mail for sending mails.

I certainly could install webmail on the prod (mail-) nethserver, but then again I want to use a newer roundcubemail version which is not available in official nethserver repo. Thats why I tried the above in the first place so I can tinker on a testbox and ex. install community version of newer roundcubemail without touching the production mailserver.

I would really love to see an updated roundcubemail version in the main repo anyway, mostly because of the elastic theme supported by roundcube >1.4 :wink:

Thanks in advance for your comments and maybe hints.

I started this as the nextcloud mailclient is not satisfying our needs although it can exactly being configured with local imap but external smtp server. But way to often it is unavailable because of a nextcloud update till the app is separately re-activated after an update.

Thus I also thought I should maybe test rainloop mail app within nextcloud, but there I also would need to know if it is possible to configure an other smtp server domain then the imap domain.

You need to overwrite the roundcube configuration with custom templates but I’d just install the community module by @stephdl, it includes the recent roundcubemail version.
I use it on production systems without issues.

1 Like

Thanks for your comment. I assume that roundcube is supposed to serve a local mailserver only then, right? I still hesitate to install a community module on a subscribed nethserver in prod.

But its good to know that it should not make any problems and that it would probably work with custom tempates.

Maybe I’ll first check if the intended setup with ext. smtp domain is configurable within rainloop. That way I could stay in subscribed stable repo while still using a more modern looking webmail interface - hopefully more reliable then the other webmail client app within nextcloud.

Do you happen to know if external/different smtp domain is possible with rainloop?

It seems, it’s possible:

I’ve seen this and looking into it it works for one single emailadress where in the admin panel you can configure its smtp credentials. Unfortunatelly I don’t see an option to configure an individual smtp password for each emailadress. :confused:

I hoped it works for any mail address but with one account and one password.

1 Like

That would work if our mailprovider would allow this. It’s a pitty they don’t, else I also could have configured a smarthost with a user - lets say named smtpsender@externaldomain.com and configure our nethserver to use it to send mails through it and I could then configure our internal smtp server on mailclients. Because its not allowed we decided to go with sending directly through external smtp server while sent mails are stored in our imapserver sent folder anyway…

Did you already try this?

1 Like

Thanks for the reminder. No, I didn’t yet, tough it could be a nice solution, totally forgot about it. Do you think I can risk that on a prod. server without fear of killing something on the prod. mailserver? Maybe it would be a good thing to test this on my textbox where zabbix is installed, so I don’t touch the prod. environnement until I get some experience with it.

Thanks again for this reminder of a great post from @saitobenkei

1 Like

Yes, that’s a good idea.

1 Like

Use virtualization, never test on a prod server

2 Likes

Do I understand correctly you have roundcube installed on a different server than you have your IMAP and SMTP services?
Since rondcube is ‘just’ an imap client, it should be possible to connect to a remote mailserver:

For nethserver-roundcube these settings are handled by templates which means you will need to create a custom template to override them.

2 Likes

As ever when we provide a workable solution in one click, it is hard to go alone on your own with our rpm. We provide a workable solution for roundcubemail with our rpm as server dependency. If you want to quit the road, then install alone roundcubemail from the epel rpm (or mine) and provide the configuration you need.

Probably you have to install some php rpm if they are not required by roundcubemail itself

2 Likes

@robb Yes - you understand correctly, for testing purpose. How would this template be created, to override sending mails through an external smtp server?

@stephdl I am still thinking about which route to go. It’s a pitty that rainloop nextcloud app - that even has a smtp override plugin only allows one single user and password within this smtp override plugin, so thats unfortunatelly not an option. It would have been a solution without the need of an additional repo or custom templates. So before implementing it on our prod mailserver, I see two options. Either, as you propose, install roundcubemail from your repo on a testserver and reconfigure its imap and smtp settings including custom credentials for smtp, if I get some informations on howto create said custom template(s), or tests the scripts that @saitobenkei kindly provided which would allow me to use our neth imap and smtp settings while mails are sent through smarthost with individual external smtp credentials.

I did now, but although it works, I was afraid of the problems it creates with the locally served maildomain.

Can you please tell me how to create a custom template that would enable roundcube to use an external smtp server for sending mails?

Edit to add, that I retried and it now works.

Create the custom template dir:

mkdir -p /etc/e-smith/templates-custom/etc/roundcubemail/config.inc.php/

In this case we copy a template fragment but there could be issues when the original fragment is updated by a package update because it’s overwritten by the custom template. You may test if it works if you name the fragment 29IMAP_SMTP or 31IMAP_SMTP to avoid overriding a template fragment.

cp /etc/e-smith/templates/etc/roundcubemail/config.inc.php/30IMAP_SMTP /etc/e-smith/templates-custom/etc/roundcubemail/config.inc.php/

Edit /etc/e-smith/templates-custom/etc/roundcubemail/config.inc.php/30IMAP_SMTP and change the SMTP settings to fit your needs.

Apply the configuration:

signal-event nethserver-roundcubemail-update

You should now see your SMTP configuration in /etc/roundcubemail/config.inc.php

If something goes wrong you can easily delete the custom template fragment and reapply the config.

2 Likes

Hi MrMarkuz and thanks for sharing, although I did not implement this until now, but could be usefull for others. Reason is, that I finally got this to work. But I have a question posted there in my last post, that I wanted to ask you if you consider this a bug, and if this should be made aware to devs, or if this is normal.