1

Topic: Only moderators should be able to send mail to alias

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.2
- Linux/BSD distribution name and version: Debian
- 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:
====

Only moderators should be able to send email to the alias, but it delivers email from anybody.

----

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

2

Re: Only moderators should be able to send mail to alias

*) Show me command output:

# grep 'plugins' /opt/iredapd/settings.py

*) Turn on debug mode in iRedAPD, then restart iredapd service. Reference: http://www.iredmail.org/docs/debug.iredapd.html

*) Send one testing email from non-moderator to this alias to reproduce this issue, then paste related log in /var/log/iredapd.log here.

3

Re: Only moderators should be able to send mail to alias

# Enabled plugins.
# - Plugin name is file name which placed under 'plugins/' directory,
plugins = ['sql_alias_access_policy,reject_null_sender,amavisd_wblist']

Debug shows
2015-06-29 22:26:49 INFO Starting iRedAPD (version: 1.6.0, backend: mysql), listening on 127.0.0.1:7777.
2015-06-29 22:26:49 ERROR Error while loading plugin (sql_alias_access_policy,
reject_null_sender,amavisd_wblist): No module named sql_alias_access_policy,
reject_null_sender,amavisd_wblist

4

Re: Only moderators should be able to send mail to alias

2015-06-29 22:38:41 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:41 DEBUG smtp session: recipient=aikido@genseikan.org
2015-06-29 22:38:41 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:41 DEBUG smtp session: queue_id=
2015-06-29 22:38:41 DEBUG smtp session: instance=3ed7.55920f41.ea480.0
2015-06-29 22:38:41 DEBUG smtp session: size=5156
2015-06-29 22:38:41 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:41 DEBUG smtp session: stress=
2015-06-29 22:38:41 DEBUG smtp session: sasl_method=
2015-06-29 22:38:41 DEBUG smtp session: sasl_username=
2015-06-29 22:38:41 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:41 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:41 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:41 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:41 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:41 DEBUG smtp session: encryption_protocol=TLSv1
2015-06-29 22:38:41 DEBUG smtp session: encryption_cipher=AES128-SHA
2015-06-29 22:38:41 DEBUG smtp session: encryption_keysize=128
2015-06-29 22:38:41 INFO [10.1.1.12] RCPT, wells@NETABN.COM -> aikido@genseikan.org, DUNNO
2015-06-29 22:38:41 DEBUG Session ended
2015-06-29 22:38:41 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:41 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:41 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:41 DEBUG smtp session: client_address=10.1.1.12
2015-06-29 22:38:41 DEBUG smtp session: client_name=unknown
2015-06-29 22:38:41 DEBUG smtp session: reverse_client_name=unknown
2015-06-29 22:38:41 DEBUG smtp session: helo_name=exchange.netabn.com
2015-06-29 22:38:41 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:41 DEBUG smtp session: recipient=aikido@genseikan.org
2015-06-29 22:38:41 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:41 DEBUG smtp session: queue_id=
2015-06-29 22:38:41 DEBUG smtp session: instance=3ed7.55920f41.ea480.0
2015-06-29 22:38:41 DEBUG smtp session: size=5156
2015-06-29 22:38:41 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:41 DEBUG smtp session: stress=
2015-06-29 22:38:41 DEBUG smtp session: sasl_method=
2015-06-29 22:38:41 DEBUG smtp session: sasl_username=
2015-06-29 22:38:41 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:41 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:41 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:41 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:41 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:41 DEBUG smtp session: encryption_protocol=TLSv1
2015-06-29 22:38:41 DEBUG smtp session: encryption_cipher=AES128-SHA
2015-06-29 22:38:41 DEBUG smtp session: encryption_keysize=128

2015-06-29 22:38:46 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:46 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:46 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:46 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:46 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:46 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:46 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:46 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:46 DEBUG smtp session: recipient=cjwj@sbcglobal.net
2015-06-29 22:38:46 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:46 DEBUG smtp session: queue_id=
2015-06-29 22:38:46 DEBUG smtp session: instance=3eea.55920f46.46320.0
2015-06-29 22:38:46 DEBUG smtp session: size=0
2015-06-29 22:38:46 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:46 DEBUG smtp session: stress=
2015-06-29 22:38:46 DEBUG smtp session: sasl_method=
2015-06-29 22:38:46 DEBUG smtp session: sasl_username=
2015-06-29 22:38:46 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:46 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:46 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:46 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:46 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:46 DEBUG smtp session: encryption_protocol=
2015-06-29 22:38:46 DEBUG smtp session: encryption_cipher=
2015-06-29 22:38:46 DEBUG smtp session: encryption_keysize=0
2015-06-29 22:38:46 INFO [127.0.0.1] RCPT, wells@NETABN.COM -> cjwj@sbcglobal.net, DUNNO
2015-06-29 22:38:46 DEBUG Session ended
2015-06-29 22:38:47 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:47 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:47 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:47 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:47 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:47 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:47 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:47 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:47 DEBUG smtp session: recipient=csgrenke@gmail.com
2015-06-29 22:38:47 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:47 DEBUG smtp session: queue_id=
2015-06-29 22:38:47 DEBUG smtp session: instance=3eea.55920f47.4fd25.0
2015-06-29 22:38:47 DEBUG smtp session: size=0
2015-06-29 22:38:47 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:47 DEBUG smtp session: stress=
2015-06-29 22:38:47 DEBUG smtp session: sasl_method=
2015-06-29 22:38:47 DEBUG smtp session: sasl_username=
2015-06-29 22:38:47 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:47 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:47 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:47 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:47 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:47 DEBUG smtp session: encryption_protocol=
2015-06-29 22:38:47 DEBUG smtp session: encryption_cipher=
2015-06-29 22:38:47 DEBUG smtp session: encryption_keysize=0
2015-06-29 22:38:47 INFO [127.0.0.1] RCPT, wells@NETABN.COM -> csgrenke@gmail.com, DUNNO
2015-06-29 22:38:47 DEBUG Session ended
2015-06-29 22:38:47 DEBUG Connect from 127.0.0.1, port 39305.
2015-06-29 22:38:47 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:47 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:47 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:47 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:47 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:47 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:47 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:47 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:47 DEBUG smtp session: recipient=dan@rootlike.com
2015-06-29 22:38:47 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:47 DEBUG smtp session: queue_id=
2015-06-29 22:38:47 DEBUG smtp session: instance=3efc.55920f47.7cfc8.0
2015-06-29 22:38:47 DEBUG smtp session: size=0
2015-06-29 22:38:47 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:47 DEBUG smtp session: stress=
2015-06-29 22:38:47 DEBUG smtp session: sasl_method=
2015-06-29 22:38:47 DEBUG smtp session: sasl_username=
2015-06-29 22:38:47 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:47 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:47 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:47 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:47 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:47 DEBUG smtp session: encryption_protocol=
2015-06-29 22:38:47 DEBUG smtp session: encryption_cipher=
2015-06-29 22:38:47 DEBUG smtp session: encryption_keysize=0
2015-06-29 22:38:47 INFO [127.0.0.1] RCPT, wells@NETABN.COM -> dan@rootlike.com, DUNNO
2015-06-29 22:38:47 DEBUG Session ended
2015-06-29 22:38:48 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:48 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:48 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:48 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:48 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:48 DEBUG smtp session: recipient=dbk3539@yahoo.com
2015-06-29 22:38:48 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:48 DEBUG smtp session: queue_id=
2015-06-29 22:38:48 DEBUG smtp session: instance=3efc.55920f48.624b.0
2015-06-29 22:38:48 DEBUG smtp session: size=0
2015-06-29 22:38:48 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:48 DEBUG smtp session: stress=
2015-06-29 22:38:48 DEBUG smtp session: sasl_method=
2015-06-29 22:38:48 DEBUG smtp session: sasl_username=
2015-06-29 22:38:48 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:48 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:48 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:48 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:48 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:48 DEBUG smtp session: encryption_protocol=
2015-06-29 22:38:48 DEBUG smtp session: encryption_cipher=
2015-06-29 22:38:48 DEBUG smtp session: encryption_keysize=0
2015-06-29 22:38:48 INFO [127.0.0.1] RCPT, wells@NETABN.COM -> dbk3539@yahoo.com, DUNNO
2015-06-29 22:38:48 DEBUG Session ended
2015-06-29 22:38:48 DEBUG Connect from 127.0.0.1, port 39313.
2015-06-29 22:38:48 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:48 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:48 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:48 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:48 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:48 DEBUG smtp session: recipient=devinf85@yahoo.com
2015-06-29 22:38:48 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:48 DEBUG smtp session: queue_id=
2015-06-29 22:38:48 DEBUG smtp session: instance=3eff.55920f48.3794e.0
2015-06-29 22:38:48 DEBUG smtp session: size=0
2015-06-29 22:38:48 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:48 DEBUG smtp session: stress=
2015-06-29 22:38:48 DEBUG smtp session: sasl_method=
2015-06-29 22:38:48 DEBUG smtp session: sasl_username=
2015-06-29 22:38:48 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:48 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:48 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:48 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:48 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:48 DEBUG smtp session: encryption_protocol=
2015-06-29 22:38:48 DEBUG smtp session: encryption_cipher=
2015-06-29 22:38:48 DEBUG smtp session: encryption_keysize=0
2015-06-29 22:38:48 INFO [127.0.0.1] RCPT, wells@NETABN.COM -> devinf85@yahoo.com, DUNNO
2015-06-29 22:38:48 DEBUG Session ended
2015-06-29 22:38:48 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:48 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:48 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:48 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:48 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:48 DEBUG smtp session: recipient=dlojk1@gmail.com
2015-06-29 22:38:48 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:48 DEBUG smtp session: queue_id=
2015-06-29 22:38:48 DEBUG smtp session: instance=3eff.55920f48.a9987.0
2015-06-29 22:38:48 DEBUG smtp session: size=0
2015-06-29 22:38:48 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:48 DEBUG smtp session: stress=
2015-06-29 22:38:48 DEBUG smtp session: sasl_method=
2015-06-29 22:38:48 DEBUG smtp session: sasl_username=
2015-06-29 22:38:48 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:48 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:48 DEBUG smtp session: ccert_issuer=
2015-06-29 22:38:48 DEBUG smtp session: ccert_fingerprint=
2015-06-29 22:38:48 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-06-29 22:38:48 DEBUG smtp session: encryption_protocol=
2015-06-29 22:38:48 DEBUG smtp session: encryption_cipher=
2015-06-29 22:38:48 DEBUG smtp session: encryption_keysize=0
2015-06-29 22:38:48 INFO [127.0.0.1] RCPT, wells@NETABN.COM -> dlojk1@gmail.com, DUNNO
2015-06-29 22:38:48 DEBUG Session ended
2015-06-29 22:38:48 DEBUG Connect from 127.0.0.1, port 39321.
2015-06-29 22:38:48 DEBUG smtp session: request=smtpd_access_policy
2015-06-29 22:38:48 DEBUG smtp session: protocol_state=RCPT
2015-06-29 22:38:48 DEBUG smtp session: protocol_name=ESMTP
2015-06-29 22:38:48 DEBUG smtp session: client_address=127.0.0.1
2015-06-29 22:38:48 DEBUG smtp session: client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: reverse_client_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: helo_name=localhost
2015-06-29 22:38:48 DEBUG smtp session: sender=wells@NETABN.COM
2015-06-29 22:38:48 DEBUG smtp session: recipient=eric@cisu.net
2015-06-29 22:38:48 DEBUG smtp session: recipient_count=0
2015-06-29 22:38:48 DEBUG smtp session: queue_id=
2015-06-29 22:38:48 DEBUG smtp session: instance=3f02.55920f48.e0644.0
2015-06-29 22:38:48 DEBUG smtp session: size=0
2015-06-29 22:38:48 DEBUG smtp session: etrn_domain=
2015-06-29 22:38:48 DEBUG smtp session: stress=
2015-06-29 22:38:48 DEBUG smtp session: sasl_method=
2015-06-29 22:38:48 DEBUG smtp session: sasl_username=
2015-06-29 22:38:48 DEBUG smtp session: sasl_sender=
2015-06-29 22:38:48 DEBUG smtp session: ccert_subject=
2015-06-29 22:38:48 D

5

Re: Only moderators should be able to send mail to alias

darth_wells wrote:

plugins = ['sql_alias_access_policy,reject_null_sender,amavisd_wblist']

It should be:

plugins = ['reject_null_sender', 'amavisd_wblist', 'sql_alias_access_policy']

Restart iRedAPD service after you changed 'plugins' setting.