1

Topic: iRedAPD not working as expected

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): iRedAdmin-Pro-LDAP-1.7.2
- Linux/BSD distribution name and version: CentOS 5.8
- Any related log? Log is helpful for troubleshooting.
====

Hi Zhang,

I was just testing iRedAPD to start working on user lever white/Blacklist functionality, but I think its not working. I also tried following :
http://iredmail.org/wiki/index.php?titl … D/OpenLDAP
tutorial but still did not get success.

Upon checking log shows these entries:
#cat /var/log/iredapd-rr.log
2012-05-17 15:49:52 INFO Starting iredapd (v1.3.7, pid: 4933), listening on 127.0.0.1:7778.
2012-05-17 15:55:16 INFO [127.0.0.1] sender@mydomain.com -> blacklist_user@otherdomain.com, DUNNO

#cat /var/log/iredapd.log
2012-05-17 13:28:50 INFO Starting iredapd (v1.3.7, ldap). Enabled plugin(s): ldap_maillist_access_policy, block_amavisd_blacklisted_senders. Listening on 127.0.0.1:7777.
2012-05-17 13:39:53 INFO [127.0.0.1] sender@mydomain.com -> blacklist_user@otherdomain.com, DUNNO

Can you guide me further where I am missing something?

----

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

2

Re: iRedAPD not working as expected

one more finding was if I put "Reject mails from below senders" E-mail ID in box then server rejects E-mail from stated Email ID. I think its just an issue of "Reject mails sent to below recipients" section where server is not rejecting emails when user try to send email to blacklisted E-mail ID.

3

Re: iRedAPD not working as expected

Could you please clearly explain what result you expect? and what you set in per-user white/blacklist with iRedAdmin-Pro?

4

Re: iRedAPD not working as expected

Hi Zhang,

I want specific users do not send emails on some E-mail addresses. So I added one E-mail ID in "Reject mails sent to below recipients" in one of the user's White/Blacklist settings. But when that user is sending an email to email ID which is in Reject List, it is not blocking, E-mails are going out.

If I add an email ID in "Reject mails from below senders" list and when email comes to the server from outside server is blocking that E-mail and sending response as ...  Recipient address rejected: Blacklisted (state 13).

so mainly sending is not being blocked by the server if internal user try to send E-mail, this is the main issue.

5

Re: iRedAPD not working as expected

- Please paste output of command "postconf -n".
- Please set "log_level = debug" in /opt/iredapd/etc/iredapd-rr.ini, restart iredapd-rr, send an email to blocked reciipient for testing, and paste related log in /var/log/iredapd-rr.log.

6

Re: iRedAPD not working as expected

Hi Zhang,

Here is postconf -n

------------------------------------------------------------------------------------------------------------------------
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = mydomain.com
myhostname = mail.mydomain.com
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
myorigin = mail.mydomain.com
newaliases_path = /usr/bin/newaliases.postfix
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = /usr/share/doc/postfix-2.5.9/README_FILES
recipient_bcc_maps = proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:ldap:/etc/postfix/ldap/relay_domains.cf
sample_directory = /usr/share/doc/postfix-2.5.9/samples
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_user.cf
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:7777, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
smtpd_sender_restrictions = check_policy_service inet:127.0.0.1:7778, permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/pki/tls/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/pki/tls/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/pki/tls/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:ldap:/etc/postfix/ldap/transport_maps_user.cf, proxy:ldap:/etc/postfix/ldap/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap/virtual_alias_maps.cf, proxy:ldap:/etc/postfix/ldap/virtual_group_maps.cf, proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf, proxy:ldap:/etc/postfix/ldap/catchall_maps.cf
virtual_gid_maps = static:501
virtual_mailbox_base = /mnt/glusterfs
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_maps.cf
virtual_minimum_uid = 501
virtual_transport = dovecot
virtual_uid_maps = static:501
------------------------------------------------------------------------------------------------------------------------

Debug Logs for iredapd-rr.log

------------------------------------------------------------------------------------------------------------------------
2012-05-18 09:01:10 DEBUG Forking first child.
2012-05-18 09:01:10 DEBUG Creating new session
2012-05-18 09:01:10 DEBUG Forking second child.
2012-05-18 09:01:10 DEBUG Setting umask
2012-05-18 09:01:10 DEBUG Changing working directory to "/"
2012-05-18 09:01:10 DEBUG Redirecting file descriptors
2012-05-18 09:04:20 DEBUG Connect from 127.0.0.1, port 50671.
2012-05-18 09:04:20 DEBUG smtp session: request=smtpd_access_policy
2012-05-18 09:04:20 DEBUG smtp session: protocol_state=RCPT
2012-05-18 09:04:20 DEBUG smtp session: protocol_name=ESMTP
2012-05-18 09:04:20 DEBUG smtp session: client_address=XXX.XX.XX.X
2012-05-18 09:04:20 DEBUG smtp session: client_name=unknown
2012-05-18 09:04:20 DEBUG smtp session: reverse_client_name=my.domain.com
2012-05-18 09:04:20 DEBUG smtp session: helo_name=[X.X.1.X]
2012-05-18 09:04:20 DEBUG smtp session: sender=sys-admin@mydomain.com
2012-05-18 09:04:20 DEBUG smtp session: recipient=ketan@ketan.com
2012-05-18 09:04:20 DEBUG smtp session: recipient_count=0
2012-05-18 09:04:20 DEBUG smtp session: queue_id=
2012-05-18 09:04:20 DEBUG smtp session: instance=1b54.4fb60284.c160a.0
2012-05-18 09:04:20 DEBUG smtp session: size=386
2012-05-18 09:04:20 DEBUG smtp session: etrn_domain=
2012-05-18 09:04:20 DEBUG smtp session: stress=
2012-05-18 09:04:20 DEBUG smtp session: sasl_method=PLAIN
2012-05-18 09:04:20 DEBUG smtp session: sasl_username=sys-admin@mydomain.com
2012-05-18 09:04:20 DEBUG smtp session: sasl_sender=
2012-05-18 09:04:20 DEBUG smtp session: ccert_subject=
2012-05-18 09:04:20 DEBUG smtp session: ccert_issuer=
2012-05-18 09:04:20 DEBUG smtp session: ccert_fingerprint=
2012-05-18 09:04:20 DEBUG smtp session: encryption_protocol=TLSv1
2012-05-18 09:04:20 DEBUG smtp session: encryption_cipher=DHE-RSA-AES256-SHA
2012-05-18 09:04:20 DEBUG smtp session: encryption_keysize=256
2012-05-18 09:04:20 DEBUG LDAP connection initialied success.
2012-05-18 09:04:20 DEBUG LDAP bind success.
2012-05-18 09:04:20 DEBUG Error: No option 'bypass_mynetworks' in section: 'general'. Use default action instead: DUNNO
2012-05-18 09:04:20 INFO [XXX.XX.XX.X] sys-admin@mydomain.com -> ketan@ketan.com, DUNNO
2012-05-18 09:04:20 DEBUG Connection closed
------------------------------------------------------------------------------------------------------------------------

I think this relates to the problem I might be having..

2012-05-18 09:04:20 DEBUG Error: No option 'bypass_mynetworks' in section: 'general'. Use default action instead: DUNNO

7

Re: iRedAPD not working as expected

Hi Zhang,

I added bypass_mynetworks = no in /opt/iredapd/etc/iredapd-rr.ini and restarted iredapd-rr but now the log shows:

2012-05-18 09:48:09 INFO Starting iredapd (v1.3.7, pid: 3825), listening on 127.0.0.1:7778.
2012-05-18 09:48:09 DEBUG Forking first child.
2012-05-18 09:48:09 DEBUG Creating new session
2012-05-18 09:48:09 DEBUG Forking second child.
2012-05-18 09:48:09 DEBUG Setting umask
2012-05-18 09:48:09 DEBUG Changing working directory to "/"
2012-05-18 09:48:09 DEBUG Redirecting file descriptors
2012-05-18 09:48:23 DEBUG Connect from 127.0.0.1, port 49873.
2012-05-18 09:48:23 DEBUG smtp session: request=smtpd_access_policy
2012-05-18 09:48:23 DEBUG smtp session: protocol_state=RCPT
2012-05-18 09:48:23 DEBUG smtp session: protocol_name=ESMTP
2012-05-18 09:48:23 DEBUG smtp session: client_address=xxx.xxx.xxx.xxx
2012-05-18 09:48:23 DEBUG smtp session: client_name=unknown
2012-05-18 09:48:23 DEBUG smtp session: reverse_client_name=mail.mydomain.com
2012-05-18 09:48:23 DEBUG smtp session: helo_name=[172.16.1.13]
2012-05-18 09:48:23 DEBUG smtp session: sender=sys-admin@mydomain.com
2012-05-18 09:48:23 DEBUG smtp session: recipient=ketan@ketan.com
2012-05-18 09:48:23 DEBUG smtp session: recipient_count=0
2012-05-18 09:48:23 DEBUG smtp session: queue_id=
2012-05-18 09:48:23 DEBUG smtp session: instance=ef4.4fb60cd7.71b49.0
2012-05-18 09:48:23 DEBUG smtp session: size=392
2012-05-18 09:48:23 DEBUG smtp session: etrn_domain=
2012-05-18 09:48:23 DEBUG smtp session: stress=
2012-05-18 09:48:23 DEBUG smtp session: sasl_method=PLAIN
2012-05-18 09:48:23 DEBUG smtp session: sasl_username=sys-admin@mydomain.com
2012-05-18 09:48:23 DEBUG smtp session: sasl_sender=
2012-05-18 09:48:23 DEBUG smtp session: ccert_subject=
2012-05-18 09:48:23 DEBUG smtp session: ccert_issuer=
2012-05-18 09:48:23 DEBUG smtp session: ccert_fingerprint=
2012-05-18 09:48:23 DEBUG smtp session: encryption_protocol=TLSv1
2012-05-18 09:48:23 DEBUG smtp session: encryption_cipher=DHE-RSA-AES256-SHA
2012-05-18 09:48:23 DEBUG smtp session: encryption_keysize=256
2012-05-18 09:48:23 DEBUG LDAP connection initialied success.
2012-05-18 09:48:23 DEBUG LDAP bind success.
2012-05-18 09:48:23 DEBUG __get_sender_dn_ldif (sender): sys-admin@mydomain.com
2012-05-18 09:48:23 DEBUG __get_sender_dn_ldif: Quering LDAP
2012-05-18 09:48:23 DEBUG __get_sender_dn_ldif (result): [('mail=sys-admin@mydomain.com,ou=Users,domainName=mydomain.com,o=domains,dc=mydomains,dc=com', {'         memberOfGroup': ['everyone@mydomain.com'], 'uid': ['sys-admin'], 'mailQuota': ['0'], 'objectClass': ['inetOrgPerson', 'mailUser', 'shadowAccount', 'am         avisAccount'], 'userPassword': ['{SSHA}6Fj4Z7ekaB5VR37iTbvwImll4bFi2u/lFxXKBQ=='], 'homeDirectory': ['/mnt/glusterfs/vmail1/mydomain.com/s/y/s/sys-adm         in-2012.05.16.19.27.14/'], 'accountStatus': ['active'], 'mailBlacklistRecipient': ['ketan@ketan.com'], 'amavisLocal': ['TRUE'], 'sn': ['sys-adm         in'], 'storageBaseDirectory': ['/mnt/glusterfs'], 'mail': ['sys-admin@mydomain.com'], 'shadowLastChange': ['0'], 'mailMessageStore': ['vmail1/ayudame.         in/s/y/s/sys-admin-2012.05.16.19.27.14/'], 'enabledService': ['mail', 'deliver', 'lda', 'smtp', 'smtpsecured', 'pop3', 'pop3secured', 'imap', 'imaps         ecured', 'managesieve', 'managesievesecured', 'sieve', 'sievesecured', 'forward', 'senderbcc', 'recipientbcc', 'internal', 'shadowaddress', 'display         edInGlobalAddressBook'], 'cn': ['System Administrator']})]
2012-05-18 09:48:23 INFO Error: plugin ldap_maillist_access_policy.py not exist.
2012-05-18 09:48:23 INFO Error: plugin block_amavisd_blacklisted_senders.py not exist.
2012-05-18 09:48:23 DEBUG Final action: None.
2012-05-18 09:48:23 INFO [xxx.xxx.xxx.xxx] sys-admin@mydomain.com -> ketan@ketan.com, DUNNO
2012-05-18 09:48:23 DEBUG Connection closed

8

Re: iRedAPD not working as expected

Hi Zhang,

I sorted out finally after copying ldap_maillist_access_policy.py & block_amavisd_blacklisted_senders.py from src directory. Its working fine now. I think you need to take care in future versions like for pro version its directly configured or something like that.

anyways.. .thanks