1

Topic: Testing 1.8.4 on FreeBSD 15.1, Python 3.12, PostGreSQL 18

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.8.4 PGSQL
- Deployed with iRedMail Easy or the downloadable installer? Installer (Github code)
- Linux/BSD distribution name and version: FreeBSD 15.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- 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.
====

Hi Zhang,

This is not a support ticket. I'm sharing some testing notes after validating iRedMail 1.8.4 on FreeBSD 15.1-RELEASE, which was released recently.

I've been running iRedMail on FreeBSD since 2019, on a personal mail server, and perform periodic rebuild and migration exercises to keep my documentation current and validate the upgrade path.
The actual server is running quite old versions.
This test was performed entirely in a disposable VM environment using a fresh install of FreeBSD 15.1 and iRedMail 1.8.4.

Overall, the installation was successful, but I encountered a few issues related mainly to platform version drift since FreeBSD 15.1 has newer package baselines than the currently supported FreeBSD release. The fixes were straightforward and may be worth considering for inclusion before declaring FreeBSD 15.1 officially supported.

Python Package Flavour

The installer currently uses Python 3.11 package names while FreeBSD 15.1 repositories now provide Python 3.12 packages by default.

# ./functions/packages_freebsd.sh

# replace
export PY3_VER='3.11'
export PY_FLAVOR='py311'
# with
export PY3_VER='3.12'
export PY_FLAVOR='py312'

Without this change the installer attempts to install packages which no longer exist in the repository, for example:

py311-sqlalchemy14
py311-passlib
py311-psycopg2
py311-requests
...

After changing the flavour to py312, package installation proceeds normally.

PostgreSQL Baseline

The installer currently uses PostgreSQL 17. FreeBSD 15.1 repositories now provide PostgreSQL 18 as the default baseline.

# ./conf/postgresql

# replace
export PGSQL_VERSION='17'
# with
export PGSQL_VERSION='18'

This avoids package version conflicts later in the installation process.

Random Password Generation

I (we) ran into an issue previously encountered on FreeBSD several years ago.
Check Topic 21040 from 2025-Nov, under: Random Password Generator. We came across that also back in 2020. So it is still linguering and bites me every time.

During installation PostgreSQL would eventually report:

FATAL: canceling authentication due to timeout

The root cause is the random password generation method used on FreeBSD.

# ./conf/global

# replace
export RANDOM_STRING='eval </dev/urandom LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 32'
# with
export RANDOM_STRING='openssl rand -base64 24'

This method has worked reliably in my testing and avoids the FreeBSD-specific issues that can occur with the existing command.

The generated passwords were correctly written to:

./config

and PostgreSQL setup completed successfully afterwards.

SpamAssassin Dependency (re2c)

The installer completed package installation but later failed when compiling SpamAssassin rules.

Error:
Can't exec "re2c": No such file or directory

This occurred during:

Compiling SpamAssassin rulesets (sa-compile)

Suggested update in:

# ./functions/packages_freebsd.sh

# replace
ALL_PKGS="${ALL_PKGS} spamassassin"
# with
ALL_PKGS="${ALL_PKGS} re2c spamassassin"

After installing re2c, the SpamAssassin compilation step completed successfully.

Optional Changes

These are not required for successful installation but may be useful depending on deployment preferences. I do make these changes manually post-installation.

PostgreSQL Login Class

# /etc/rc.conf.local

# add
postgresql_login_class="postgres"

PHP-FPM Logging

# /usr/local/etc/php-fpm.conf

# Default: notice; reduce noise
log_level = warning

SOGo Not Installed
If SOGo is not selected, remove it from the backup list:

# /var/vmail/backup/backup_pgsql.sh

# if sogo not installed
# replace
export DATABASES='vmail roundcubemail amavisd iredadmin sogo iredapd'
# with
export DATABASES='vmail roundcubemail amavisd iredadmin iredapd'

PostFix server/domain

# /usr/local/etc/postfix/main.cf

# hostname
# server level
myhostname = server.domain.local
# domain level
myorigin = domain.local
# domain level (reuse, avoids issues)
mydomain = $myorigin
Summary

After applying the following changes:

  • Python flavor: py311 -> py312

  • PostgreSQL: 17 -> 18

  • Random password generation -> openssl rand

  • Add re2c dependency


iRedMail 1.8.4 installed successfully on a fresh FreeBSD 15.1 VM.

Hopefully these notes help accelerate validation of FreeBSD 15.1 support and potentially reduce the work required for an upcoming release.

As always, thank you for continuing to support FreeBSD as a deployment platform for iRedMail.

Regards

----

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

2

Re: Testing 1.8.4 on FreeBSD 15.1, Python 3.12, PostGreSQL 18

Addendum: Additional SpamAssassin Findings on FreeBSD 15.1

While continuing the FreeBSD 15.1 testing, I spent some time looking more closely at the SpamAssassin-related issues mentioned in my previous post.

After further investigation, I believe there are actually several separate issues involved.

1. re2c Is Not a Missing Dependency

In my original testing, SpamAssassin failed with:

Can't exec "re2c": No such file or directory

This initially suggested that re2c should be added to the FreeBSD package list inside iRedMail.

After further testing, I no longer believe this is necessary.

The current FreeBSD package dependency tree already includes re2c:

# pkg info -d spamassassin

spamassassin-4.0.2_3:
  re2c-4.5.1
  ...

So the package system already handles this dependency.

Please disregard my earlier suggestion to explicitly add re2c to the FreeBSD package list.

At this point I believe the observed re2c message was likely a side effect of another SpamAssassin-related problem encountered earlier in the installation process.

2. Razor Configuration Appears Inconsistent with the Current Package Options

During installation, spamassassin --lint failed with:

failed to parse line in
/usr/local/etc/mail/spamassassin/local.cf

razor_config /usr/local/etc/mail/spamassassin/razor.conf

Looking further, the generated SpamAssassin configuration originates from an iRedMail sample file.

The sample still contains Razor-related configuration and even references a very old project URL in the header.

However, the FreeBSD 15.1 package is currently built with:

# pkg info spamassassin

Options:
  RAZOR : off
  PYZOR : off

At the same time, iRedMail generates (from a sample):

razor_config /usr/local/etc/mail/spamassassin/razor.conf

and creates: /usr/local/etc/mail/spamassassin/razor.conf

debuglevel = 0

Commenting the razor_config line allows`spamassassin --lint` to progress further.

This may indicate that the SpamAssassin sample configuration in iRedMail is carrying historical assumptions that no longer match current FreeBSD package defaults.

3. ENV and Perl Taint Mode

The other issue is more interesting and I would appreciate some historical context.

During installation `sa-update`

fails with:

Insecure $ENV{ENV} while running with -T switch

The system environment contains:

ENV=/root/.shrc

Running manually:

sa-update

produces the error.

Running manually:

env -u ENV sa-update

does not.

The same observation applies to:

spamassassin --lint

and related SpamAssassin utilities.

A workaround appears to be:

env -u ENV sa-update
env -u ENV sa-compile

However, I am intentionally not proposing this as the correct fix.

My concern is that this behavior may have been introduced intentionally for a reason that is no longer obvious from the current code.

I wonder what are the historical context regarding:

  • why the current approach exists,

  • whether this is expected behaviour,

  • whether it is specific to newer Perl versions,

  • or whether it should be addressed elsewhere.

and understand whether this is:

  • FreeBSD-specific

  • SpamAssassin-specific

  • Perl-specific, or

  • an expected limitation

Current Position

After a bit more testing, my updated view is:

Confirmed FreeBSD 15.1 Changes

  • Python 3.12 package flavour update

  • PostgreSQL 18 baseline update

  • Random password generation using openssl

SpamAssassin Findings

re2c:
    No longer considered an issue.

Razor:
    Configuration appears inconsistent with
    current FreeBSD package options.

ENV / perl -T:
    Workaround identified,
    root cause still under investigation.

Hopefully these additional notes help narrow the remaining FreeBSD 15.1 issues. I would be particularly interested in any background on the Perl taint-mode behavior and whether it is expected by design.