1

Topic: although a domain is disabled, why do mails from inside come into it

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: ubuntu-14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): ldap
- Web server (Apache or Nginx):apache
- Manage mail accounts with iRedAdmin-Pro? 2.3.1
- Related log if you're reporting an issue:
====
i am going to migrate a domain into the iredmail server. i opened the domain and their users.
i changed to disable state of domain as the domain configuration is not finish yet.
this domain is still outside.
but i am noticed from my colleague that a customer which on the iredmail server tried to send some mails towards this domain. these mails gone to this disabled directory.whereas these mails should have reached to real server.
i opened a new account on the iredmail now . the same problem did not become.
what can be the problem

----

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

2

Re: although a domain is disabled, why do mails from inside come into it

*) Did you disable domain with iRedAdmin-Pro?
*) Could you please try this:

- add '127.0.0.1' in Postfix parameter 'debug_peer_list =', in /etc/postfix/main.cf.
- Try to send one email to a user inside this disabled domain with 'mail' command:

echo 'test' | mail -s "test" user@domain.com

- Extract all debug log in /var/log/mail.log, paste here.

I think it's related to what attribute/value pairs store in user object, and due to the limit of LDAP query, Postfix cannot query domain account status (which is stored in domain object) while querying mail users.

3

Re: although a domain is disabled, why do mails from inside come into it

1-) yes i disabled the domain using iredadminpro2.3.1

i added the users using create_mail_user_openldap.py

but for example after that i added one another user using iredadminpro  there is no problem for that user.

2-) i added debugpeer in main.cf
i executed concerning command for test mail
here is the mail.log the mail dropped iredmail directory
Oct 17 18:22:57 mail postfix/pickup[49089]: E785412E1BA0: uid=0 from=<root@mail.ihlas.com.tr>
Oct 17 18:22:57 mail postfix/cleanup[49096]: E785412E1BA0: info: header Subject: test mail from local; from=<root@mail.ihlas.com.tr>
Oct 17 18:22:57 mail postfix/cleanup[49096]: E785412E1BA0: message-id=<20151017152257.E785412E1BA0@mail.ihlas.com.tr>
Oct 17 18:22:57 mail postfix/qmgr[49088]: E785412E1BA0: from=<root@mail.ihlas.com.tr>, size=352, nrcpt=1 (queue active)
Oct 17 18:22:57 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 220 [127.0.0.1] ESMTP amavisd-new service ready
Oct 17 18:22:57 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: EHLO mail.ihlas.com.tr
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-[127.0.0.1]
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-VRFY
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-PIPELINING
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-SIZE
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-ENHANCEDSTATUSCODES
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-8BITMIME
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250-DSN
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250 XFORWARD NAME ADDR PORT PROTO HELO IDENT SOURCE
Oct 17 18:22:57 mail postfix/smtp[49284]: server features: 0x149f8f size 0
Oct 17 18:22:57 mail postfix/smtp[49284]: Using ESMTP PIPELINING, TCP send buffer size is 2626560, PIPELINING buffer size is 4096
Oct 17 18:22:57 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 17 18:22:57 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: XFORWARD SOURCE=LOCAL
Oct 17 18:22:57 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: MAIL FROM:<root@mail.ihlas.com.tr> SIZE=352
Oct 17 18:22:57 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: RCPT TO:<testmail@iea.com.tr>
Oct 17 18:22:57 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: DATA
Oct 17 18:22:57 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 17 18:22:57 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250 2.5.0 Ok XFORWARD
Oct 17 18:22:57 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 17 18:22:58 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250 2.1.0 Sender <root@mail.ihlas.com.tr> OK
Oct 17 18:22:58 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 17 18:22:58 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250 2.1.5 Recipient <testmail@iea.com.tr> OK
Oct 17 18:22:58 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=240 enable_deadline=0
Oct 17 18:22:58 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 354 End data with <CR><LF>.<CR><LF>
Oct 17 18:22:58 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=600 enable_deadline=0
Oct 17 18:22:58 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: .
Oct 17 18:22:58 mail postfix/smtp[49284]: > 127.0.0.1[127.0.0.1]:10024: QUIT
Oct 17 18:22:58 mail postfix/smtp[49284]: smtp_stream_setup: maxtime=1200 enable_deadline=0
Oct 17 18:22:58 mail postfix/smtpd[49108]: connect from localhost[127.0.0.1]
Oct 17 18:22:58 mail postfix/smtpd[49108]: smtp_stream_setup: maxtime=300 enable_deadline=0
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> START Client host RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=permit_mynetworks
Oct 17 18:22:58 mail postfix/smtpd[49108]: permit_mynetworks: localhost 127.0.0.1
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_hostname: localhost ~? 127.0.0.0/8
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_list_match: permit_mynetworks: no match
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=permit_mynetworks status=1
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> END Client host RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 220 mail.ihlas.com.tr ESMTP Postfix (Ubuntu)
Oct 17 18:22:58 mail postfix/smtpd[49108]: xsasl_dovecot_server_create: SASL service=smtp, realm=(null)
Oct 17 18:22:58 mail postfix/smtpd[49108]: name_mask: noanonymous
Oct 17 18:22:58 mail postfix/smtpd[49108]: xsasl_dovecot_server_mech_filter: keep mechanism: PLAIN
Oct 17 18:22:58 mail postfix/smtpd[49108]: xsasl_dovecot_server_mech_filter: keep mechanism: LOGIN
Oct 17 18:22:58 mail postfix/smtpd[49108]: watchdog_pat: 0x7f1a7b6def50
Oct 17 18:22:58 mail postfix/smtpd[49108]: < localhost[127.0.0.1]: EHLO mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_list_match: localhost: no match
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_list_match: 127.0.0.1: no match
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-PIPELINING
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-SIZE 85728640
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-ETRN
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-AUTH PLAIN LOGIN
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-AUTH=PLAIN LOGIN
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-ENHANCEDSTATUSCODES
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250-8BITMIME
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250 DSN
Oct 17 18:22:58 mail postfix/smtpd[49108]: watchdog_pat: 0x7f1a7b6def50
Oct 17 18:22:58 mail postfix/smtpd[49108]: < localhost[127.0.0.1]: MAIL FROM:<root@mail.ihlas.com.tr> BODY=7BIT
Oct 17 18:22:58 mail postfix/smtpd[49108]: extract_addr: input: <root@mail.ihlas.com.tr>
Oct 17 18:22:58 mail postfix/smtpd[49108]: smtpd_check_addr: addr=root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr request = rewrite
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr rule = local
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr address = root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 0
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: address
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: address
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: (list terminator)
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: rewrite_clnt: local: root@mail.ihlas.com.tr -> root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr request = resolve
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr sender =
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr address = root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 0
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: transport
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: transport
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: local
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: nexthop
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: nexthop
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: recipient
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: recipient
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 256
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: (list terminator)
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: resolve_clnt: `' -> `root@mail.ihlas.com.tr' -> transp=`local' host=`mail.ihlas.com.tr' rcpt=`root@mail.ihlas.com.tr' flags= class=local
Oct 17 18:22:58 mail postfix/smtpd[49108]: ctable_locate: install entry key root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: extract_addr: in: <root@mail.ihlas.com.tr>, result: root@mail.ihlas.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: smtpd_check_rewrite: trying: permit_inet_interfaces
Oct 17 18:22:58 mail postfix/smtpd[49108]: permit_inet_interfaces: localhost 127.0.0.1
Oct 17 18:22:58 mail postfix/smtpd[49108]: fsspace: .: block size 4096, blocks free 185516788
Oct 17 18:22:58 mail postfix/smtpd[49108]: smtpd_check_queue: blocks 4096 avail 185516788 min_free 0 msg_size_limit 85728640
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250 2.1.0 Ok
Oct 17 18:22:58 mail postfix/smtpd[49108]: watchdog_pat: 0x7f1a7b6def50
Oct 17 18:22:58 mail postfix/smtpd[49108]: < localhost[127.0.0.1]: RCPT TO:<testmail@iea.com.tr>
Oct 17 18:22:58 mail postfix/smtpd[49108]: extract_addr: input: <testmail@iea.com.tr>
Oct 17 18:22:58 mail postfix/smtpd[49108]: smtpd_check_addr: addr=testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr request = rewrite
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr rule = local
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr address = testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 0
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: address
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: address
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: (list terminator)
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: rewrite_clnt: local: testmail@iea.com.tr -> testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr request = resolve
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr sender =
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr address = testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 0
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: transport
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: transport
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: dovecot
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: nexthop
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: nexthop
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: recipient
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: recipient
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: flags
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 4096
Oct 17 18:22:58 mail postfix/smtpd[49108]: private/rewrite socket: wanted attribute: (list terminator)
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: resolve_clnt: `' -> `testmail@iea.com.tr' -> transp=`dovecot' host=`iea.com.tr' rcpt=`testmail@iea.com.tr' flags= class=default
Oct 17 18:22:58 mail postfix/smtpd[49108]: ctable_locate: install entry key testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: extract_addr: in: <testmail@iea.com.tr>, result: testmail@iea.com.tr
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> START Recipient address RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=permit_mynetworks
Oct 17 18:22:58 mail postfix/smtpd[49108]: permit_mynetworks: localhost 127.0.0.1
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_hostname: localhost ~? 127.0.0.0/8
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_list_match: permit_mynetworks: no match
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=permit_mynetworks status=1
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> END Recipient address RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> START Recipient address RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=permit_mynetworks
Oct 17 18:22:58 mail postfix/smtpd[49108]: permit_mynetworks: localhost 127.0.0.1
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_hostname: localhost ~? 127.0.0.0/8
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8
Oct 17 18:22:58 mail postfix/smtpd[49108]: match_list_match: permit_mynetworks: no match
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=permit_mynetworks status=1
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> END Recipient address RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: before input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapping enable_milters
Oct 17 18:22:58 mail postfix/smtpd[49108]: after input_transp_cleanup: cleanup flags = none
Oct 17 18:22:58 mail postfix/smtpd[49108]: connect to subsystem public/cleanup
Oct 17 18:22:58 mail postfix/smtpd[49108]: public/cleanup socket: wanted attribute: queue_id
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: queue_id
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 2EF2212E1B9C
Oct 17 18:22:58 mail postfix/smtpd[49108]: public/cleanup socket: wanted attribute: (list terminator)
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: send attr flags = 128
Oct 17 18:22:58 mail postfix/smtpd[49108]: 2EF2212E1B9C: client=localhost[127.0.0.1]
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250 2.1.5 Ok
Oct 17 18:22:58 mail postfix/smtpd[49108]: watchdog_pat: 0x7f1a7b6def50
Oct 17 18:22:58 mail postfix/smtpd[49108]: < localhost[127.0.0.1]: DATA
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> START Data command RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=reject_unauth_pipelining
Oct 17 18:22:58 mail postfix/smtpd[49108]: reject_unauth_pipelining: DATA
Oct 17 18:22:58 mail postfix/smtpd[49108]: generic_checks: name=reject_unauth_pipelining status=0
Oct 17 18:22:58 mail postfix/smtpd[49108]: >>> END Data command RESTRICTIONS <<<
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 354 End data with <CR><LF>.<CR><LF>
Oct 17 18:22:58 mail postfix/cleanup[49293]: 2EF2212E1B9C: message-id=<20151017152257.E785412E1BA0@mail.ihlas.com.tr>
Oct 17 18:22:58 mail postfix/smtpd[49108]: public/cleanup socket: wanted attribute: status
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: status
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: 0
Oct 17 18:22:58 mail postfix/smtpd[49108]: public/cleanup socket: wanted attribute: reason
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: reason
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute value: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: public/cleanup socket: wanted attribute: (list terminator)
Oct 17 18:22:58 mail postfix/smtpd[49108]: input attribute name: (end)
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 250 2.0.0 Ok: queued as 2EF2212E1B9C
Oct 17 18:22:58 mail postfix/smtpd[49108]: watchdog_pat: 0x7f1a7b6def50
Oct 17 18:22:58 mail postfix/smtpd[49108]: < localhost[127.0.0.1]: QUIT
Oct 17 18:22:58 mail postfix/qmgr[49088]: 2EF2212E1B9C: from=<root@mail.ihlas.com.tr>, size=818, nrcpt=1 (queue active)
Oct 17 18:22:58 mail postfix/smtpd[49108]: > localhost[127.0.0.1]: 221 2.0.0 Bye
Oct 17 18:22:58 mail postfix/smtpd[49108]: disconnect from localhost[127.0.0.1]
Oct 17 18:22:58 mail amavis[48573]: (48573-05) Passed CLEAN {RelayedInternal}, MYUSERS <root@mail.ihlas.com.tr> -> <testmail@iea.com.tr>, Message-ID: <20151017152257.E785412E1BA0@mail.ihlas.com.tr>, mail_id: RKoCWsDKdcMr, Hits: -0.001, size: 352, queued_as: 2EF2212E1B9C, 248 ms
Oct 17 18:22:58 mail postfix/smtp[49284]: < 127.0.0.1[127.0.0.1]:10024: 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 2EF2212E1B9C

4

Re: although a domain is disabled, why do mails from inside come into it

yavuz.maslak wrote:

1-) yes i disabled the domain using iredadminpro2.3.1
i added the users using create_mail_user_openldap.py
but for example after that i added one another user using iredadminpro  there is no problem for that user.

this is interesting. I will try to reproduce this issue on my testing machine and come back with a fix.

5

Re: although a domain is disabled, why do mails from inside come into it

Ok i am waiting for the solution.

meanwhile i did to enable and disable the domain. the problem is not solved.

But I selected all users and then  i disabled the  all users.

again i sent a mail for test. This time the mail reached concerning users directory on the real server.  the problem is solved.

but there is a bug.

ZhangHuangbin wrote:
yavuz.maslak wrote:

1-) yes i disabled the domain using iredadminpro2.3.1
i added the users using create_mail_user_openldap.py
but for example after that i added one another user using iredadminpro  there is no problem for that user.

this is interesting. I will try to reproduce this issue on my testing machine and come back with a fix.

6

Re: although a domain is disabled, why do mails from inside come into it

I cannot reproduce this issue.

I created a mail domain and 2 mail users -- one created with iRedMail installer (postmaster@), the other created with create_mail_user_OpenLDAP.py.

*) I compared the LDIF data of those 2 users, no big difference except one has 'preferredLanguage' attribute, but it doesn't impact mail delivery at all.

*) I disabled mail domain with iRedAdmin-Pro, then send email to both accounts, both failed and i got a non-delivery notification.

If you disable mail domain, when mail arrives, Postfix will query this domain first (with 'virtual_mailbox_domains =' lookup). So, when you disabled mail domain, what's the output of below commands?

# cd /etc/postfix/ldap/
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'your_domain.com' ldap:./${cf}; done
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'user1@your_domain.com' ldap:./${cf}; done
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'user2@your_domain.com' ldap:./${cf}; done

Please replace 'your_domain.com' and 'userX@your_domain.com' with the real mail domain name and email addresses.

7

Re: although a domain is disabled, why do mails from inside come into it

Ok  I am going to test this situation tonight .

But how can i check this domain is disable or enable on command line interface now?
when i check on the iredadminpro the domain is disable.
I moved about 10 domains so far ( about 1000 accounts ) first there was a problem for this domain.

8

Re: although a domain is disabled, why do mails from inside come into it

yavuz.maslak wrote:

But how can i check this domain is disable or enable on command line interface now?

Please try the commands in my last reply, when you query a disabled mail domain, it returns nothing. but for a enabled domain, it will return correct mail domain name and transport name. Note: querying mail user under disabled mail domain still returns valid data.

# cd /etc/postfix/ldap/
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'your_domain.com' ldap:./${cf}; done
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'user1@your_domain.com' ldap:./${cf}; done
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'user2@your_domain.com' ldap:./${cf}; done

9

Re: although a domain is disabled, why do mails from inside come into it

according to iredadminpro on the server,  iea.com.tr is disabled now.

root@mail:/etc/postfix/ldap#  for cf in $(ls *.cf); do echo ${cf}; postmap -q 'iea.com.tr' ldap:./${cf}; done
catchall_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_group_maps.cf
virtual_group_members_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf

10

Re: although a domain is disabled, why do mails from inside come into it

The postmap output is correct. If a domain is enabled, 'virtual_mailbox_domains.cf' will return its domain name.

11

Re: although a domain is disabled, why do mails from inside come into it

if i check as user , the return is below

root@mail:/etc/postfix/ldap# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'itutar@iea.com.tr' ldap:./${cf}; done
catchall_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
itutar@iea.com.tr
transport_maps_domain.cf
transport_maps_user.cf
dovecot
virtual_alias_maps.cf
virtual_group_maps.cf
virtual_group_members_maps.cf
itutar@iea.com.tr
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf

ZhangHuangbin wrote:

The postmap output is correct. If a domain is enabled, 'virtual_mailbox_domains.cf' will return its domain name.

12 (edited by yavuz.maslak 2015-10-20 03:49:49)

Re: although a domain is disabled, why do mails from inside come into it

likewise, While, the domain is disabled and relay settings for the domain is smtp:[realsmtpserverip]:25 , Relay without verifying local recipients is checked as the attachment and the problem user is enable, if i send a mail to this problem user from another mail address on the same domain the mail go local directory.

if i set relay settings for the user or set disabled for the user  the mail goes the real server.



ZhangHuangbin wrote:

The postmap output is correct. If a domain is enabled, 'virtual_mailbox_domains.cf' will return its domain name.

Post's attachments

Screen Shot 2015-10-19 at 22.47.45.png
Screen Shot 2015-10-19 at 22.47.45.png 38.59 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

13

Re: although a domain is disabled, why do mails from inside come into it

hello Zhang

This issue does not become for everydomain. the program has a problem with iea.com.tr domain name.
I deleted this domain and its directory (under the vmail1 ) and added it again.
I disabled the domain on iredadminpro but status of the accounts are enabled.
when i send a mail from a mail address at the server towards test@iea.com.tr, unfortunately  the mail goes its directory on the iredmail server.



yavuz.maslak wrote:

likewise, While, the domain is disabled and relay settings for the domain is smtp:[realsmtpserverip]:25 and the problem user is enable, if i send a mail to this problem user from another mail address on the same domain the mail go local directory.

if i set relay settings for the user or set disabled for the user  the mail goes the real server.



ZhangHuangbin wrote:

The postmap output is correct. If a domain is enabled, 'virtual_mailbox_domains.cf' will return its domain name.

14

Re: although a domain is disabled, why do mails from inside come into it

I added a new domain as test called abc.com.tr  ( it is the same 8 characters except dots. )

I added the same user itutar@abc.com.tr using python create_mail_user_OpenLDAP.py abc.com.tr.csv .

I disabled the domain on iredadminpro.

when i send a mail from a mail address on the iredmail server the mail goes local directory unfortunately.

But if i add a new user on the iredadminpro and try to send it a mail over the same mail server, then the mail reaches the right server outside.

There is a bug regarding to the script. 

yavuz.maslak wrote:

hello Zhang

This issue does not become for everydomain. the program has a problem with iea.com.tr domain name.
I deleted this domain and its directory (under the vmail1 ) and added it again.
I disabled the domain on iredadminpro but status of the accounts are enabled.
when i send a mail from a mail address at the server towards test@iea.com.tr, unfortunately  the mail goes its directory on the iredmail server.



yavuz.maslak wrote:

likewise, While, the domain is disabled and relay settings for the domain is smtp:[realsmtpserverip]:25 and the problem user is enable, if i send a mail to this problem user from another mail address on the same domain the mail go local directory.

if i set relay settings for the user or set disabled for the user  the mail goes the real server.



ZhangHuangbin wrote:

The postmap output is correct. If a domain is enabled, 'virtual_mailbox_domains.cf' will return its domain name.

15

Re: although a domain is disabled, why do mails from inside come into it

The problem is i cannot reproduce this issue.

Could you please do me a favor, export LDIF data of both mail users? let's compare the ldif data.

16

Re: although a domain is disabled, why do mails from inside come into it

Ok ldif on the iredadminpro for itutar@abc.com.tr  as below

dn: mail=itutar@abc.com.tr,ou=Users,domainName=abc.com.tr,o=domains,dc=ihlas,dc=local
accountStatus: active
amavisLocal: TRUE
cn: test22
enabledService: internal
enabledService: doveadm
enabledService: lib-storage
enabledService: indexer-worker
enabledService: mail
enabledService: dsync
enabledService: smtp
enabledService: smtpsecured
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: deliver
enabledService: lda
enabledService: lmtp
enabledService: recipientbcc
enabledService: senderbcc
enabledService: managesieve
enabledService: managesievesecured
enabledService: sieve
enabledService: sievesecured
enabledService: forward
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook
homeDirectory: /var/vmail/vmail1/abc.com.tr/itutar-2015.10.20.08.51.21/
mail: itutar@abc.com.tr
mailMessageStore: vmail1/abc.com.tr/itutar-2015.10.20.08.51.21/
mailQuota: 1073741824
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
preferredLanguage: en_US
shadowLastChange: 0
sn: itutar
storageBaseDirectory: /var/vmail
uid: itutar
userPassword: {SSHA}PASS==

ZhangHuangbin wrote:

The problem is i cannot reproduce this issue.

Could you please do me a favor, export LDIF data of both mail users? let's compare the ldif data.

17

Re: although a domain is disabled, why do mails from inside come into it

Please post both users. otherwise we cannot compare.

18 (edited by yavuz.maslak 2015-10-21 02:17:50)

Re: although a domain is disabled, why do mails from inside come into it

Ok

Users1(iunlu@abc.com.tr) has problem  and user2 is normal (yavuzmaslak@abc.com.tr)
dn: mail=iunlu@abc.com.tr,ou=Users,domainName=abc.com.tr,o=domains,dc=ihlas,dc=local
accountStatus: active
amavisLocal: TRUE
cn:: xLBsaGFuIMOcbmzDvA==
enabledService: internal
enabledService: doveadm
enabledService: lib-storage
enabledService: indexer-worker
enabledService: dsync
enabledService: mail
enabledService: smtp
enabledService: smtpsecured
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: deliver
enabledService: lda
enabledService: forward
enabledService: senderbcc
enabledService: recipientbcc
enabledService: managesieve
enabledService: managesievesecured
enabledService: sieve
enabledService: sievesecured
enabledService: lmtp
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook
homeDirectory: /var/vmail/vmail1/abc.com.tr/iunlu-2015.10.20.08.39.51/
mail: iunlu@abc.com.tr
mailMessageStore: vmail1/abc.com.tr/iunlu-2015.10.20.08.39.51/
mailQuota: 524288000
mtaTransport: dovecot
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
shadowLastChange: 0
sn: iunlu
storageBaseDirectory: /var/vmail
uid: iunlu
userPassword: {SSHA}PASS

second user ldif;
dn: mail=yavuzmaslak@abc.com.tr,ou=Users,domainName=abc.com.tr,o=domains,dc=ihlas,dc=local
accountStatus: active
amavisLocal: TRUE
cn: test
enabledService: internal
enabledService: doveadm
enabledService: lib-storage
enabledService: indexer-worker
enabledService: mail
enabledService: dsync
enabledService: smtp
enabledService: smtpsecured
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: deliver
enabledService: lda
enabledService: lmtp
enabledService: recipientbcc
enabledService: senderbcc
enabledService: managesieve
enabledService: managesievesecured
enabledService: sieve
enabledService: sievesecured
enabledService: forward
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook
homeDirectory: /var/vmail/vmail1/abc.com.tr/yavuzmaslak-2015.10.20.20.42.15/
mail: yavuzmaslak@abc.com.tr
mailMessageStore: vmail1/abc.com.tr/yavuzmaslak-2015.10.20.20.42.15/
mailQuota: 1073741824
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
preferredLanguage: en_US
shadowLastChange: 0
sn: yavuzmaslak
storageBaseDirectory: /var/vmail
uid: yavuzmaslak
userPassword: {SSHA}PASS

As far as I can see, the different is that iunlu@abc.com.tr with problemli also has "mtaTransport: dovecot"
Other user has not it. For this domain, I added iunlu... by create_mail_user_OpenLDAP.py. But I added the second user by iredadminpro.

ZhangHuangbin wrote:

Please post both users. otherwise we cannot compare.

19

Re: although a domain is disabled, why do mails from inside come into it

Oh, found the problem.

iRedMail configures Postfix to query per-user transport first, then per-domain transport. If user doesn't have per-user transport, and domain is disabled, Postfix cannot get a transport.

Fixed create_mail_user_OpenLDAP.py, it won't set a per-user transport now.
https://bitbucket.org/zhb/iredmail/comm … f5007fa1ef

Thanks very much for the feedback and tests.

20

Re: although a domain is disabled, why do mails from inside come into it

Hello zhang

i think the problem is  solved.
I left mtaTransport empty instead of 'dovecot' in the create_mail_user_OpenLDAP.py. This script adds 'dovecot' on user's relay setting and this suppresses domain relay settings. this situation causes problem if domain is inactive.

And I readded concerning users ( because the domain is not active yet ) this time  it is enough setting of relay configuration on the domain.

yavuz.maslak wrote:

Ok

Users1(iunlu@abc.com.tr) has problem  and user2 is normal (yavuzmaslak@abc.com.tr)
dn: mail=iunlu@abc.com.tr,ou=Users,domainName=abc.com.tr,o=domains,dc=ihlas,dc=local
accountStatus: active
amavisLocal: TRUE
cn:: xLBsaGFuIMOcbmzDvA==
enabledService: internal
enabledService: doveadm
enabledService: lib-storage
enabledService: indexer-worker
enabledService: dsync
enabledService: mail
enabledService: smtp
enabledService: smtpsecured
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: deliver
enabledService: lda
enabledService: forward
enabledService: senderbcc
enabledService: recipientbcc
enabledService: managesieve
enabledService: managesievesecured
enabledService: sieve
enabledService: sievesecured
enabledService: lmtp
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook
homeDirectory: /var/vmail/vmail1/abc.com.tr/iunlu-2015.10.20.08.39.51/
mail: iunlu@abc.com.tr
mailMessageStore: vmail1/abc.com.tr/iunlu-2015.10.20.08.39.51/
mailQuota: 524288000
mtaTransport: dovecot
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
shadowLastChange: 0
sn: iunlu
storageBaseDirectory: /var/vmail
uid: iunlu
userPassword: {SSHA}PASS

second user ldif;
dn: mail=yavuzmaslak@abc.com.tr,ou=Users,domainName=abc.com.tr,o=domains,dc=ihlas,dc=local
accountStatus: active
amavisLocal: TRUE
cn: test
enabledService: internal
enabledService: doveadm
enabledService: lib-storage
enabledService: indexer-worker
enabledService: mail
enabledService: dsync
enabledService: smtp
enabledService: smtpsecured
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: deliver
enabledService: lda
enabledService: lmtp
enabledService: recipientbcc
enabledService: senderbcc
enabledService: managesieve
enabledService: managesievesecured
enabledService: sieve
enabledService: sievesecured
enabledService: forward
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook
homeDirectory: /var/vmail/vmail1/abc.com.tr/yavuzmaslak-2015.10.20.20.42.15/
mail: yavuzmaslak@abc.com.tr
mailMessageStore: vmail1/abc.com.tr/yavuzmaslak-2015.10.20.20.42.15/
mailQuota: 1073741824
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
preferredLanguage: en_US
shadowLastChange: 0
sn: yavuzmaslak
storageBaseDirectory: /var/vmail
uid: yavuzmaslak
userPassword: {SSHA}PASS

As far as I can see, the different is that iunlu@abc.com.tr with problemli also has "mtaTransport: dovecot"
Other user has not it. For this domain, I added iunlu... by create_mail_user_OpenLDAP.py. But I added the second user by iredadminpro.

ZhangHuangbin wrote:

Please post both users. otherwise we cannot compare.