Change recipient_delimiter in postfix

NethServer Version: 8
Module: Mail

Hi all,

the Mail module has the nice property that a recipient delimiter + is configured in postfix, which allows for a user user@domain.com to receive also emails in the form user+sometext@domain.com. This is nice. However, there are some webservices out there that do not accept E-Mail addresses with a +-sign in it. Hence, I wanted to change the recipient delimiter to +_, which would not only allow user+sometext@domain.com, but also user_sometext@domain.com as alternative E-Mail Adresses.
According to the documentation here GitHub - NethServer/ns8-mail: NS8 Mail module with SMTP, IMAP, Spam/Virus filter I executed

runagent -m mail1 podman exec -ti postfix vi /etc/postfix/main.cf.d/myoverride.cf

and entered recipient_delimiter = +_, and saved the file. Then I executed

runagent -m mail1 systemctl --user reload postfix

and checked that the settings have been accepted with

runagent -m mail1 podman exec -ti postfix postconf -n | grep delimiter

This command outputs as expected:

postconf: warning: /etc/postfix/main.cf, line 143: overriding earlier entry: recipient_delimiter=+
recipient_delimiter = +_

However, mails to the address user_sometext@domain.com do get rejected with 550 5.1.1 : Recipient address rejected: undeliverable address: lookup failed.

When I set recipient_delimiter = +_ on a postfix instance installed on plain Debian (no NS8), it is working as expected.
Why is it failing in Nethserver? Any hints how to fix it?

By the way: I was not able to find the equivalent of /var/log/mail.log on NS8, so I am pretty much stuck with debugging.
In the cluster admin interface, when I view logs of the application mail1, it is empty and not showing anything, not even after mail tranafer failed with the error measage above.

@stephdl @davidep does one of you have an idea here?
It seems like some configuration in nethserver is blocking the recipient_delimiter option in postfix in an unexpected way, but I have no idea what it is and how I can written around it…
Thank you!

For debug purpose

journalctl -e -t postfix

journalctl -f _UID=$(id -u mail1)

Go to the log page of the cluster admin and sort by tag or module ID

For sure no log no help

I’ve never tried changing the delimiter settings. Using more than one delimiter seems possible in general with Postfix, but keep in mind that our setup uses Dovecot as the LMTP delivery agent. Dovecot has a similar parameter, which you can customize as well. You can find more details here: All Settings | Dovecot CE.

I’m not sure if this warning means the customization is ignored, but if it is, that could be a problem. You might want to experiment by manually editing the main.cf file to remove the warning and then reloading the Postfix configuration directly from the container using:

postfix reload
3 Likes

You’d look at the Logs page in cluster-admin.

As alternative, the system journal has latest entries too, as Steph’s pointed out.

On Rocky Linux there is also the default /var/log/maillog file containing similar log entries. I don’t know if Debian is pre-configured with file-based syslog.

Thank you, that was a good hint. After I add the setting recipient_delimiter = +_ to dovecot as well, it is working! :slight_smile: Problem solved.

Also, logs from the mail system are accessible via journalctl as Steph pointed out. However, in the cluster admin page under logs, I do not manage do find any logs from the mail app. How can I debug that?

1 Like

Please see System logs — NS8 documentation

Choose the Mail instance and click Search button. Adjust Start/End date and query as wanted.

1 Like