1 (edited by bysamahmadli 2021-07-26 18:44:50)

Topic: accesspolicy moderatorsonly not working

I use free version iredmail 1.4.0 installed with iredmail script on centos 7 and using mariadb with nginx.
I have alias all which all users in members list. Now I want give restriction for only some 4-5 users who can send email to this alias. And after reading iredmail documentation I understand that i must give resctriction membersonly in accesspolicy and must add  this 4-5 users to member list for this alias. But after doing that the users who in the same domain with our mail domain still can send emails to this alias. Please, help me with this problem.

----

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

2

Re: accesspolicy moderatorsonly not working

Please turn on debug mode in iRedAPD and reproduce the issue again, extract full related log lines from iRedAPD log file and paste here for troubleshooting.
FYI: https://docs.iredmail.org/debug.iredapd.html

3

Re: accesspolicy moderatorsonly not working

ZhangHuangbin wrote:

Please turn on debug mode in iRedAPD and reproduce the issue again, extract full related log lines from iRedAPD log file and paste here for troubleshooting.
FYI: https://docs.iredmail.org/debug.iredapd.html

I do this after your reply but this is not something like error which can be debugged. Can you said please now how I can find the problem after openning debug. There is nothing about this in log file. And I think that the function is not working. Because there is nothing to do in configs. I've just set  accesspolicy of alias@mydomain.com (forexample) to moderators only. Then I've added some users to moderators and the documentation says that nobody expect this moderators cannot send the mail to my alias@mydomain.com. Users with other domain name can't send after this but the users in mydomain.com still can send email to this alias. It works like i set accesspolicy=domain. But I set accesspolicy=moderatorsonly.

4 (edited by bysamahmadli 2021-07-27 15:22:09)

Re: accesspolicy moderatorsonly not working

Here is all I need and I've done for this which has written in official site.

Access policy
Access restriction requires iRedAPD plugin sql_alias_access_policy, please make sure it's enabled in iRedAPD config file /opt/iredapd/settings.py.

You can restrict which senders are allowed to send email to this mail alias account by adding proper policy name in SQL column alias.accesspolicy. For example:

sql> UPDATE alias SET accesspolicy='domain' WHERE address='alias@mydomain.com';
Available access policies:

Access Policy Name    Comment
public    no restrictions
domain    all users under same domain are allowed to send email to this mail alias account.
subdomain    all users under same domain and all sub-domains are allowed to send email to this mail alias account.
membersonly    only members of this mail alias account are allowd.
moderatorsonly    only moderators of this mail alias account are allowed.
membersandmoderatorsonly    only members and moderators of this mail alias account are allowed.

How to assign a moderator
Moderators are email addresses stored in SQL table moderators. With iRedAPD-1.4.5 and later releases, it's ok to use *@domain.com as (one of) moderator for all users under mail domain 'domain.com'.

To assign user someone@gmail.com and someone@outlook.com as moderator of mail alias alias@mydomain.com:

sql> INSERT INTO moderators (address, moderator, domain, dest_domain)
                    VALUES ('alias@mydomain.com', 'someone@gmail.com', 'mydomain.com', 'gmail.com');

sql> INSERT INTO moderators (address, moderator, domain, dest_domain)
                    VALUES ('alias@mydomain.com', 'someone@outlook.com', 'mydomain.com', 'outlook.com');

https://docs.iredmail.org/sql.create.mail.alias.html