1

Topic: Cluebringer to iRedAPD documentation and setting fix

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: Debian 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:
====

Hello Zhang!

I followed this document to migrate from Cluebringer to iRedAPD:

http://www.iredmail.org/docs/cluebringe … edapd.html

The section "Enable iRedAPD in Postfix" might contain a problem:

smtpd_recipient_restrictions =
    ...
    check_policy_service inet:127.0.0.1:7777
    permit_mynetworks
    permit_sasl_authenticated
    ...

iRedAPD policy is checked first, then allowed networks and (at least in my case) sasl_authenticated users.

In my case this caused a problem as internal servers are using the iRedMail server as relay to send notifications.
They have a standard configuration and use username@hostname as sender address. This address might be "wrong" according to iRedAPD rules and these emails get rejected.

Fix:

I rearranged the order of the rules so that local networks and authenticated users skip iRedAPD check:

smtpd_recipient_restrictions =
    ...
    permit_mynetworks
    permit_sasl_authenticated
    check_policy_service inet:127.0.0.1:7777
    ...


Now the email server works perfectly.

Please consider updating the documentation or add a hint that the order of the checks might be a problem for "some users". I don't know if the order from the documentation is wrong or if it causes just a problem in my case. I guess there is no "wrong" or "right" setting here wink
Permitting mynetworks and authenticated users seems to me be the "correcter" setting.

What do you think?

Best regards,

Bernhard

----

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

2

Re: Cluebringer to iRedAPD documentation and setting fix

The order of restriction rules is correct. You need to add IP addresses/networks in Postfix "mynetworks=" to iRedAPD too, like this:

# File: /opt/iredapd/settings.py

MYNETWORKS = ['xx.xx.xx.xx', 'xx.xx.xx.0/24', ...]

If you place iRedAPD after "permit_mynetworks", all emails sent with Roundcube (hosted on localhost) will not go through iRedAPD at all, then outbound throttling and other features implemented in iRedAPD will not be triggered.

3

Re: Cluebringer to iRedAPD documentation and setting fix

UPDATE:

I updated tutorial to mention 'MYNETWORKS =' setting moment ago, this way it will be clearer.

Thanks very much for your feedback. smile

4

Re: Cluebringer to iRedAPD documentation and setting fix

I restored the original order and added MYNETWORKS setting to iRedAPD configuration.
This works as expected. Thank you!

In main.cf from postfix I added a big comment that changes to "mynetworks" have to be done as well in /opt/iredapd/settings.py

5

Re: Cluebringer to iRedAPD documentation and setting fix

broth wrote:

In main.cf from postfix I added a big comment that changes to "mynetworks" have to be done as well in /opt/iredapd/settings.py

Good idea. i updated main.cf template file with similar comment too:
https://bitbucket.org/zhb/iredmail/comm … aa059e29c0