Use packages instead of ports ?
REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER:
- iRedMail version (check /etc/iredmail-release): 1.7.1
- Deployed with iRedMail Easy or the downloadable installer? No
- Linux/BSD distribution name and version: Freebsd 14.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
Hello,
I have not used ports in ages. I did not used to mind it but
- 3 Gb of ports take a while to compile
- I chose LDAP for a backend and it ended up downloading MySQL & PGSQL any way along with all of their dependencies
If all is going to be installed anyway - wouldn't it be much better to use packages ?
We tried years ago, but pre-built packages don't have required compile options. e.g. LDAP support, MySQL support, etc. Not sure how it works nowadays.
the same say it should be possible to install cmake, mariadb and rust at least from pkg. that will save like couple of hours and my disks.
Mixing ports and packages is not good idea. if you don't want to wait for compile, try Linux or OpenBSD instead. :(
I have considered OpenBSD but there is a lot more running on that machine and who has the time to patch Linux boxes as often as needed.
I m sure most admins would deploy iRedMail in a jail that will be used for that purpose alone. Long term maintenance using ports is no picnic either
Hi @bozhinov
Would you like to give it a try? Update functions/packages_freebsd.sh to install packages with pkg instead of ports tree.
Hi,
I have it all setup for trying out the packages and the sequence is done and tested. Post new years I just ve got few things to take care of first.
I have added you to my private repo. apart from that stupid SSL bug it is OK says fixed in FreeBSD 15-dev branch
Hi @bozhinov
could you fork the iRedMail repo directly instead of copying repo and make it private? So that we can easily create pull request after finished.
Hi, I m definitely doing that. Need few days. My schedule is hectic these days.
Hello there, On ports there is now flavors. As a FreeBSD ports commiter I can adapt (if needed) the ports to have such flavors already done. Also I can help to have a mail/iredmail port as well. What do you think of that? Kind regards
Hi @xbeaudouin
That's wonderful.
Flavors should be enough. We need few packages with MySQL, PostgreSQL, OpenLDAP support. For example, postfix, Dovecot, Amavisd. If you can help make it happen, we can work together. :)
Well dovecot has already flavors. I am trying to understand functions/packages_freebsd.sh and have a check about current port tree.
Really I would like this project works to replace my old mail server.
By the way why should you need openssl from ports? Since on FreeBSD 14.2 we already have openssl v3.0.15:
$ openssl version
OpenSSL 3.0.15 3 Sep 2024 (Library: OpenSSL 3.0.15 3 Sep 2024)
Hi @xbeaudouin,
Do you mean we should remove ssl=openssl from /etc/make.conf?
https://github.com/iredmail/iRedMail/blob/master/functions/packages_freebsd.sh#L54
Hi @xbeaudouin,
According to functions/packages_freebsd.sh, these ports requires flavors:
- mail/spamassassin: need flavors for mysql and postgresql support.
- mail/roundcube: need flavors for openldap, mysql, postgresql. Note: for iRedMail OpenLDAP backend, it requires both openldap and mysql support.
- mail/postfix: need flavors for openldap, mysql, postgresql. Note: for iRedMail OpenLDAP backend, it requires both openldap and mysql support.
- security/amavisd-new: need flavors for openldap, mysql, postgresql. Note: for iRedMail OpenLDAP backend, it requires both openldap and mysql support.
- devel/apr1: need flavors for openldap, mysql, postgresql. Note: for iRedMail OpenLDAP backend, it requires both openldap and mysql support.
- devel/sope: need flavors for openldap, mysql, postgresql. Note: for iRedMail OpenLDAP backend, it requires both openldap and mysql support.
- databases/py-sqlalchemy14: need flavors for mysql, postgresql.
Currently the installation involves compiling Perl / Python / PHP / Rust / Go / LLVM, you can imagine how much time we waste.
Hi, Well excepted if you need some special cyphers on openssl, I don't see any good reason to add this dependency. Postfix, nginx, dovecot can be run on freebsd stock openssl AFAIK. So I think we can remove ssl=openssl in make.conf.
About ports with flavors, I will try to push some of them. Issue will be "dual" flavors which is not supported by the port infrastructure
If dual flavors is impossible, then we still have to install all packages from ports tree, to avoid mixing binary packages and ports. Is such mixing recommended or not?
I see Dovecot has LDAP flavor on by default, and you can choose additional MySQL or PGSQL flavor. Is it possible that we have LDAP flavor on by default too for other ports?
For example, MySQL flavor of mail/postfix supports both LDAP and MySQL, PGSQL flavor of mail/postfix supports both LDAP and PGSQL.
Or, besides standard ldap, mysql, pgsql flavers, can we create ldap-mysql, ldap-pgsql flavor?
I mean, ldap-mysql is just one flavor name, except it enables two compile options instead of one.
- in
FLAVORS=, appendldap-mysqlas a flavor name: https://cgit.freebsd.org/ports/tree/mail/postfix/Makefile?id=d4e949bafdb4e842868267d26a357c9921d3efeb#n25 - Add
ldap_mysql_PKGNAMESUFFIX= -ldap-mysql - and so on ...
the '-' is used to sperate the flavors... I will discuss with other maintainer for that...
I think we can mix both packages and compiled with port ones. There is no problems about that. Also the LDAP can be the exception. Maybe we should do a iredmail ports, that will handle that too.
I think "dual" (or even more) favors is the key. I prefer waiting for you discussion with other maintainers. :)
OpenBSD has multi flavors support and it works well, no need to use ports tree at all for normal users.
I think we can make some "special flavors" eg -mysqlldap -pgsqlldap for such ports.
I will wait for your update. Thank you very much.
Special flavor might be a trick or temporary solution, for example, What if someone needs ldap + mysql + pgsql? I wish FreeBSD ports tree supports multi flavors like OpenBSD in the future. :)
Not sure what happened here but I m not compiling this from ports ever again.
https://github.com/bozhinov/iRedMail-pub/commit/66bb775fc3861396a3d24d78dc65912e80aff102
Turned out MariaDb is not possible as a backend on FreeBSD There is no postfix-mariadb package
P.S. Tested using the latest packages and not the quarterly ones
Got it working 100% with PGSQL via packages https://github.com/bozhinov/iRedMail-pub/commits/master/
Got it working 100% with PGSQL via packages https://github.com/bozhinov/iRedMail-pub/commits/master/
Great news. 👍
Could you please use only one pkg install command to install all packages?
Done! @iredmail I initially cloned the masted branch. at some point \n became \r\n could have been me though. I run on Windows.
@xbeaudouin adding support back for MariaDb does not seem like a lot of work these 3 packages could easily 3 turn into new ones for MariaDb: dovecot-MySQL dovecot-pigeonhole-MySQL postfix-mysql
@bozhinov Nice :) Well did you made a PR ?
@iredmail if @bozhinov made a PR, can you merge it ? Then I will update for mysql/mariadb pkg ?
How about I merge it in a new git branch then we continue in that branch instead of master?