1

Topic: FreeBSD 10 support

==== Required information ====
- iRedMail version:  0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: FreeBSD 10
- Related log if you're reporting an issue:
====




Hello,
FreeBSD 10 was released today, and the iRedMail installation is broken.
The issue doesn't seem *very* hard to fix, I noticed that the install script mainly fails
because of some hard-coded values and version numbers from the pkgsrc or ports tree,
that were outdated and replaced by newer ones.

I tried fixing it but not sure what I might break,
Dear Zhang, can you please take a look?


Thanks,
Vlad Semenov

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: FreeBSD 10 support

It would be great if you can paste the error log here directly.

FreeBSD 10 was released today, i didn't have time to give it a try yet. Downloading ISO image now.

3

Re: FreeBSD 10 support

I see pkg is default package management tool in FreeBSD 10, i'm not familiar with it yet. I tried to install some binary packages with pkg, obviously we have to continue using ports tree. Let me show you why:

# pkg info dovecot2
dovecot2-2.2.9
...
Options        :
    DOCS           : on
    EXAMPLES       : on
    GSSAPI         : off
    KQUEUE         : on
    LDAP           : off
    LIBWRAP        : off
    LUCENE         : off
    MYSQL          : off
    PGSQL          : off
    SOLR           : off
    SQLITE         : off
    SSL            : on
    VPOPMAIL       : off

# pkg info postfix
postfix-2.10.2,1
...
Options        :
    BDB            : off
    CDB            : off
    DOVECOT        : off
    DOVECOT2       : off
    INST_BASE      : off
    LDAP_SASL      : off
    MYSQL          : off
    NIS            : off
    OPENLDAP       : off
    PCRE           : on
    PGSQL          : off
    SASL2          : off
    SASLKMIT       : off
    SASLKRB5       : off
    SPF            : off
    SQLITE         : off
    TEST           : off
    TLS            : off
    VDA            : off

We need at least one of LDAP/MySQL/PGSQL support in Dovecot and Postfix, and TLS support in Postfix is a must-have option.

Really sad that FreeBSD binary packages is (always) useless for iRedMail. I'm really confused why FreeBSD ports team don't understand this sentence in OpenBSD FAQ:

The end result of the porting effort (ports tree) are ready-to-install binary packages. ... Another advantage is that users rarely need to compile software from source, ...

Another most important feature of OpenBSD ports tree: flavor. http://www.openbsd.org/faq/faq15.html#PortsFlavors

I'm a big OpenBSD fan. smile

4 (edited by Vlad78 2014-01-22 10:56:39)

Re: FreeBSD 10 support

Hi Zhang,
Unfortunately there are some technical and infrastructural issues that prevent me from migrating to OpenBSD, although
I am familiar pretty well with it's architecture. Unfortunately, in this case the web-server runs FreeBSD specific Nginx configuration and iRedMail should be only the mailserver, so migrating entirely to OpenBSD is not an option for me.


The error I got is:

===>  Checking if security/p5-Authen-SASL already installed
===>   Registering installation for p5-Authen-SASL-2.16
Installing p5-Authen-SASL-2.16... done
===>  Cleaning for p5-GSSAPI-0.28
===>  Cleaning for p5-Authen-SASL-2.16
< INFO > Installing port: mail/altermime (2014-01-22 05:11:44) ...
===>  Cleaning for altermime-0.3.11.a1
===>   altermime-0.3.11.a1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by altermime-0.3.11.a1 for building
===>  Extracting for altermime-0.3.11.a1
=> SHA256 Checksum OK for altermime-0.3.11.a1.tar.gz.
===>  Patching for altermime-0.3.11.a1
===>  Applying FreeBSD patches for altermime-0.3.11.a1
===>  Configuring for altermime-0.3.11.a1
===>  Building for altermime-0.3.11.a1
cc -Wall -Werror -g -I. -O2  -c strstack.c
cc -Wall -Werror -g -I. -O2  -c mime_alter.c
mime_alter.c:709:13: error: variable 'newblock' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        } else if (lb[0] == '\n') {
                   ^~~~~~~~~~~~~
mime_alter.c:723:9: note: uninitialized use occurs here
        return newblock;
               ^~~~~~~~
mime_alter.c:709:9: note: remove the 'if' if its condition is always true
        } else if (lb[0] == '\n') {
               ^~~~~~~~~~~~~~~~~~~
mime_alter.c:690:16: note: initialize the variable 'newblock' to silence this warning
        char *newblock;
                      ^
                       = NULL
1 error generated.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/mail/altermime/work/altermime-0.3.11.a1
*** Error code 1

Stop.
make: stopped in /usr/ports/mail/altermime
< ERROR > Port was not success installed, please fix it manually and then re-execute this script.



Now, correct me if I'm wrong but that has nothing to do with the migration to the new pkgng package management.
You said something about getting familiar with it, I'm not sure it's necessary.
FreeBSD users most of the time compile the packages from the ports tree, so the dependencies you showed above are not really related to the issue, imho, it looks more like some packages are not ready to be compiled with LLVM Clang, which
replaced GCC in FreeBSD 10.x.

//
Since you are more familiar with the mail related packages, how important is "altermime" for a normal iRedMail functionality?
I tried commenting stuff out from the "/functions/packages_freebsd.sh" file, but since I end up with fixing more than 7 packages, I guess it's better for you to verify that it's working.
I can submit a patch that makes iRedMail install, however I'm really not sure what is broken along the way.

Regards,
Vlad Semenov

5

Re: FreeBSD 10 support

Looks like AlterMIME cannot be compiled with LLVM Clang, and the development edition of iRedMail disabled it (and archiver/p7zip too). Here's commit log:

Cannot successfully install AlterMIME and p7zip on FreeBSD 10, disable them by default:
* AlterMIME is an optional component, and it's always disabled by default in iRedMail.
* p7zip is an optional component. To enable it, please install it manually, then restart Amavisd service.

Hope it answers your question.

6

Re: FreeBSD 10 support

BTW, OpenLDAP backend is broken on FreeBSD 9/10, so please consider using MySQL or PostgreSQL backend instead.

7 (edited by Vlad78 2014-01-23 07:11:17)

Re: FreeBSD 10 support

Now there is something related to gcc.

=> Attempting to fetch http://heanet.dl.sourceforge.net/projec … .98.tar.gz
clamav-0.98.tar.gz                            100% of   35 MB  681 kBps 00m53s
===> Fetching all distfiles required by clamav-0.98_2 for building
===> Fetching all distfiles required by pkg-1.2.4_1 for building
===>   libcheck-0.9.11 depends on file: /usr/local/sbin/pkg - found
=> check-0.9.11.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://heanet.dl.sourceforge.net/projec … .11.tar.gz
check-0.9.11.tar.gz                           100% of  674 kB  362 kBps 00m02s
===> Fetching all distfiles required by libcheck-0.9.11 for building
===>   gmake-3.82_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gmake-3.82_1 for building
===>  gcc-4.6.4 is only for amd64 i386 ia64 powerpc sparc64, while you are running x86_64.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/gcc
*** Error code 1

Stop.
make: stopped in /usr/ports/security/clamav
< ERROR > Tarballs were not downloaded correctly, please fix it manually and then re-execute iRedMail.sh.


Note :
I am running amd64, so this is definitely a gcc bug.

FreeBSD fbsd.com 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

8

Re: FreeBSD 10 support

Please try the latest development version of iRedMail (not iRedMail-0.8.6):

# hg clone https://bitbucket.org/zhb/iredmail

9 (edited by Vlad78 2014-01-24 04:52:27)

Re: FreeBSD 10 support

Perfect, I must have checked out and older commit before.

With 936623f, the only issue was Apache that fails to start with the following error:

Performing sanity check on apache22 configuration:
Syntax error on line 27 of /usr/local/etc/apache22/Includes/cluebringer.conf:
Invalid command 'AuthMYSQLEnable', perhaps misspelled or defined by a module not included in the server configuration

But that was fine for me since I don't plan using Apache anyway, since Nginx+PHP-FPM is imho a much superior combo.

Does the method you described previously for disabling amavis+clamav+spamassasin will work the same for FreeBSD 10?


Thanks,

10

Re: FreeBSD 10 support

Vlad78 wrote:

Invalid command 'AuthMYSQLEnable', perhaps misspelled or defined by a module not included in the server configuration

I checked ports tree moment ago, port 'www/mod_auth_mysql_another' was removed. That's why we got this error. Will try to fix it later.

Vlad78 wrote:

Does the method you described previously for disabling amavis+clamav+spamassasin will work the same for FreeBSD 10?

Sure.

11

Re: FreeBSD 10 support

===>  Extracting for altermime-0.3.11.a1
=> SHA256 Checksum OK for altermime-0.3.11.a1.tar.gz.
===>  Patching for altermime-0.3.11.a1
===>  Applying FreeBSD patches for altermime-0.3.11.a1
===>  Configuring for altermime-0.3.11.a1
===>  Building for altermime-0.3.11.a1
cc -Wall -Werror -g -I. -O2  -c strstack.c
cc -Wall -Werror -g -I. -O2  -c mime_alter.c
mime_alter.c:709:13: error: variable 'newblock' is used uninitialized whenever
      'if' condition is false [-Werror,-Wsometimes-uninitialized]
        } else if (lb[0] == '\n') {
                   ^~~~~~~~~~~~~
mime_alter.c:723:9: note: uninitialized use occurs here
        return newblock;
               ^~~~~~~~
mime_alter.c:709:9: note: remove the 'if' if its condition is always true
        } else if (lb[0] == '\n') {
               ^~~~~~~~~~~~~~~~~~~
mime_alter.c:690:16: note: initialize the variable 'newblock' to silence this
      warning
        char *newblock;
                      ^
                       = NULL
1 error generated.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/mail/altermime/work/altermime-0.3.11.a1
*** Error code 1

Stop.
make: stopped in /usr/ports/mail/altermime
< ERROR > Port was not success installed, please fix it manually and then re-execute this script.

12

Re: FreeBSD 10 support

Dear all,

I re-packed and uploaded iRedMail-0.8.6 moment ago, it now works on FreeBSD 9 and 10. No interrupt during installation at all, and all 3 backends are working. smile

http://www.iredmail.org/download.html

13 (edited by patum 2014-04-10 23:16:09)

Re: FreeBSD 10 support

I installed iRedMail-0.8.6 (mysql Backend) on FreeBSD 10.0-RELEASE GENERIC  amd64 success.
The entered modified file ./function/packages_freebsd.sh

Post's attachments

packages_freebsd.sh 31.3 kb, 7 downloads since 2014-04-10 

You don't have the permssions to download the attachments of this post.

14

Re: FreeBSD 10 support

Hi patum,

Is is possible for you to show us a diff file instead of the whole modified file?

15

Re: FreeBSD 10 support

patum wrote:

I installed iRedMail-0.8.6 (mysql Backend) on FreeBSD 10.0-RELEASE GENERIC  amd64 success.
The entered modified file ./function/packages_freebsd.sh

Hi! Used that file, installation completes, but with a bit of errors re.

< INFO > Configure Roundcube webmail.
cp: db.inc.php.dist: No such file or directory
cp: main.inc.php.dist: No such file or directory
chown: db.inc.php: No such file or directory
chown: main.inc.php: No such file or directory
chmod: db.inc.php: No such file or directory
chmod: main.inc.php: No such file or directory


Any ideas? :S

Thank you so much for the help! (PS. Used FreeBSD 9.2)

16

Re: FreeBSD 10 support

When iRedMail-0.8.6 was released, FreeBSD ports tree shipped Roundcube 0.9.5. But it's now Roundcube 1.0.0 in ports tree, it has some changes, the major one is merging two config files (db.inc.php, main.inc.php) into one (defaults.inc.php), and custom settings should be stored in config.inc.php (better for upgrading). So due to ports tree change, iRedMail-0.8.6 doesn't work on FreeBSD now.

17

Re: FreeBSD 10 support

ZhangHuangbin wrote:

When iRedMail-0.8.6 was released, FreeBSD ports tree shipped Roundcube 0.9.5. But it's now Roundcube 1.0.0 in ports tree, it has some changes, the major one is merging two config files (db.inc.php, main.inc.php) into one (defaults.inc.php), and custom settings should be stored in config.inc.php (better for upgrading). So due to ports tree change, iRedMail-0.8.6 doesn't work on FreeBSD now.

Got it up and running - I'm a home user, and features I require are only in the PRO version. Very nice work done, but far out of my price league. Will have to move on to something else.