Hello Team,
I am facing the same issue as detailed below, please help to the solution to resolve the issue.
I have a problem with iredmail maillist restriction. After migrating to a new server with latest OS and iredmail services, all configurations are working fine except maillist restriction. If i set mail list to only moderator can send, it doesnt work as anybody can send to that group. I have enabled ldap_malist_policy_access in iredpad/settings plugins as: plugins = ["reject_null_sender", "wblist_rdns", "greylisting", "throttle", "amavisd_wblist", "ldap_maillist_access_policy"]
and also connect from postfix as:
# Recipient restrictions
smtpd_recipient_restrictions =
reject_unknown_sender_domain
reject_non_fqdn_sender
reject_unknown_recipient_domain
reject_non_fqdn_recipient
reject_unlisted_recipient
check_policy_service inet:10.1.2.100:7777
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
# check_policy_service inet:127.0.0.1:12340
# END-OF-MESSAGE restrictions
smtpd_end_of_data_restrictions =
check_policy_service inet:10.1.2.100:7777
The maillist ldif are as follows:-
dn: mail=mtest@demo.egov.go.tz,ou=Groups,domainName=demo.egov.go.tz,o=domains,dc=gov,dc=go,dc=tz
accessPolicy: allowedOnly
accountStatus: active
cn: moderator testing
enabledService: mail
enabledService: deliver
listAllowedUser: test1.demo@demo.egov.go.tz
mail: mtest@demo.egov.go.tz
objectClass: mailList
The logs in iredapd is set in debug mode and below are the logs showing when a user (non moderator) test3.demo@demo.egov.go.tz sent an email to a group mtest@demo.egov.go.tz but it get delivered to its members.
Jan 20 15:33:36 imap journal: iredapd [policy] sender=test3.demo@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [policy] recipient=mtest@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [policy] sasl_username=test3.demo@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd Sender: test3.demo@demo.egov.go.tz, SASL username: test3.demo@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [+] Getting LDIF data of account: mtest@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd search base dn: o=domains,dc=gov,dc=go,dc=tz#012search scope: SUBTREE #012search filter: (&(!(domainStatus=disabled))(|(mail=mtest@demo.egov.go.tz)(shadowAddress=mtest@demo.egov.go.tz))(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))#012search attributes: ['objectClass', 'accountStatus', 'listAllowedUser', 'accessPolicy', 'enabledService']
Jan 20 15:33:36 imap journal: iredapd [LDAP] query target domain of given alias domain: demo.egov.go.tz#012[LDAP] query filter: (&(objectClass=mailDomain)(accountStatus=active)(domainAliasName=demo.egov.go.tz))
Jan 20 15:33:36 imap journal: iredapd [LDAP] query target domain of given alias domain: demo.egov.go.tz#012[LDAP] query filter: (&(objectClass=mailDomain)(accountStatus=active)(domainAliasName=demo.egov.go.tz))
Jan 20 15:33:36 imap journal: iredapd Possible policy senders: ['test3.demo@demo.egov.go.tz', '@demo.egov.go.tz', '@.', '@.demo.egov.go.tz', '@.egov.go.tz', '@.go.tz', '@.tz', '10.1.2.55', '10.1.2.*', '10.1.*.55']
Jan 20 15:33:36 imap journal: iredapd Possible policy recipients: ['mtest@demo.egov.go.tz', '@demo.egov.go.tz', '@.', '@.demo.egov.go.tz', '@.egov.go.tz', '@.go.tz', '@.tz']
Jan 20 15:33:36 imap journal: iredapd [SQL] Query local addresses: #012SELECT id, email#012 FROM users#012 WHERE email IN ('test3.demo@demo.egov.go.tz', '@demo.egov.go.tz', '@.', '@.demo.egov.go.tz', '@.egov.go.tz', '@.go.tz', '@.tz', '10.1.2.55', '10.1.2.*', '10.1.*.55')#012 ORDER BY priority DESC
Jan 20 15:33:36 imap journal: iredapd [SQL] Query external addresses: #012SELECT id, email#012 FROM mailaddr#012 WHERE email IN ('mtest@demo.egov.go.tz', '@demo.egov.go.tz', '@.', '@.demo.egov.go.tz', '@.egov.go.tz', '@.go.tz', '@.tz')#012 ORDER BY priority DESC
Jan 20 15:33:36 imap journal: iredapd [SQL] Query local addresses: #012SELECT id, email#012 FROM users#012 WHERE email IN ('mtest@demo.egov.go.tz', '@demo.egov.go.tz', '@.', '@.demo.egov.go.tz', '@.egov.go.tz', '@.go.tz', '@.tz')#012 ORDER BY priority DESC
Jan 20 15:33:36 imap journal: iredapd [SQL] Query external addresses: #012SELECT id, email#012 FROM mailaddr#012 WHERE email IN ('test3.demo@demo.egov.go.tz', '@demo.egov.go.tz', '@.', '@.demo.egov.go.tz', '@.egov.go.tz', '@.go.tz', '@.tz', '10.1.2.55', '10.1.2.*', '10.1.*.55')#012 ORDER BY priority DESC
Jan 20 15:33:36 imap journal: iredapd [10.1.2.55] RCPT, test3.demo@demo.egov.go.tz => mtest@demo.egov.go.tz, OK [sasl_username=test3.demo@demo.egov.go.tz, sender=test3.demo@demo.egov.go.tz, client_name=unknown, reverse_client_name=unknown, helo=10.1.2.54, encryption_protocol=TLSv1.2, encryption_cipher=ECDHE-RSA-AES256-GCM-SHA384, server_port=, process_time=0.0156s]
Jan 20 15:33:36 imap journal: iredapd [SQL] Insert into smtp_sessions: #012 INSERT INTO smtp_sessions (#012 time, time_num,#012 action, reason, instance,#012 client_address, client_name, reverse_client_name, helo_name,#012 encryption_protocol, encryption_cipher,#012 server_address, server_port,#012 sender, sender_domain,#012 sasl_username, sasl_domain,#012 recipient, recipient_domain)#012 VALUES (#012 '2021-01-20 12:33:36', 1611146016,#012 'OK', '', '12ba4.60082320.2f034.0',#012 '10.1.2.55', 'unknown', 'unknown', '10.1.2.54',#012 'TLSv1.2', 'ECDHE-RSA-AES256-GCM-SHA384',#012 '', '',#012 'test3.demo@demo.egov.go.tz', 'demo.egov.go.tz',#012 'test3.demo@demo.egov.go.tz', 'demo.egov.go.tz',#012 'mtest@demo.egov.go.tz', 'demo.egov.go.tz')
Jan 20 15:33:36 imap journal: iredapd [policy] sender=test3.demo@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [policy] recipient=mtest@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [policy] sasl_username=test3.demo@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [10.1.2.55] END-OF-MESSAGE, test3.demo@demo.egov.go.tz => mtest@demo.egov.go.tz, DUNNO [recipient_count=1, size=2374, process_time=0.0020s]
Jan 20 15:33:36 imap journal: iredapd [SQL] Insert into smtp_sessions: #012 INSERT INTO smtp_sessions (#012 time, time_num,#012 action, reason, instance,#012 client_address, client_name, reverse_client_name, helo_name,#012 encryption_protocol, encryption_cipher,#012 server_address, server_port,#012 sender, sender_domain,#012 sasl_username, sasl_domain,#012 recipient, recipient_domain)#012 VALUES (#012 '2021-01-20 12:33:36', 1611146016,#012 'DUNNO', '', '12ba4.60082320.2f034.0',#012 '10.1.2.55', 'unknown', 'unknown', '10.1.2.54',#012 'TLSv1.2', 'ECDHE-RSA-AES256-GCM-SHA384',#012 '', '',#012 'test3.demo@demo.egov.go.tz', 'demo.egov.go.tz',#012 'test3.demo@demo.egov.go.tz', 'demo.egov.go.tz',#012 'mtest@demo.egov.go.tz', 'demo.egov.go.tz')
Jan 20 15:33:36 imap journal: iredapd [policy] sender=test3.demo@demo.egov.go.tz
Jan 20 15:33:36 imap journal: iredapd [10.1.2.54] RCPT, test3.demo@demo.egov.go.tz -> arch2@gmsarch.gov.go.tz, OK [sasl_username=, sender=test3.demo@demo.egov.go.tz, client_name=unknown, reverse_client_name=unknown, helo=imap-ngoro.eganet.go.tz, encryption_protocol=TLSv1.2, encryption_cipher=ECDHE-RSA-AES256-GCM-SHA384, server_port=25, process_time=0.0195s]
Jan 20 15:33:36 imap journal: iredapd [10.1.2.54] END-OF-MESSAGE, test3.demo@demo.egov.go.tz -> arch2@gmsarch.gov.go.tz, DUNNO [recipient_count=1, size=4020, process_time=0.0106s]
Jan 20 15:33:36 imap journal: iredapd [10.1.2.54] RCPT, test3.demo@demo.egov.go.tz -> ramadhani.mdachi@ega.go.tz, OK [sasl_username=, sender=test3.demo@demo.egov.go.tz, client_name=unknown, reverse_client_name=unknown, helo=imap-ngoro.eganet.go.tz, encryption_protocol=TLSv1.2, encryption_cipher=ECDHE-RSA-AES256-GCM-SHA384, server_port=25, process_time=0.0190s]
Jan 20 15:33:36 imap journal: iredapd [10.1.2.54] END-OF-MESSAGE, test3.demo@demo.egov.go.tz -> ramadhani.mdachi@ega.go.tz, DUNNO [recipient_count=1, size=4026, process_time=0.0101s]
Output of postconf smtpd_recipient_restrictions
postconf smtpd_recipient_restrictions
smtpd_recipient_restrictions = reject_unknown_sender_domain reject_non_fqdn_sender reject_unknown_recipient_domain reject_non_fqdn_recipient reject_unlisted_recipient check_policy_service inet:10.1.2.54:7777 permit_mynetworks permit_sasl_authenticated reject_unauth_destination
postconf smtpd_end_of_data_restrictions
smtpd_end_of_data_restrictions = check_policy_service inet:10.1.2.54:7777