1

Topic: Bounce Log Issue

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.84
- Linux/BSD distribution name and version: debian 8 jessie
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  mysql
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
====

Hi,

I have issue with bounce log with user unknown.
Log database said it receive with 250 ok. But it bounce with dovecot after postfix.

So log said it receive but it bounce.

Question is how to make it bounce with postfix so log will collect.

Thank you

----

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

2

Re: Bounce Log Issue

You may need to check the SQL query in /etc/dovecot/dovecot-mysql.conf, the query cannot find this user.
It's better turn on debug mode in Dovecot for debugging:
http://www.iredmail.org/docs/debug.dovecot.html

3 (edited by jackavin 2017-03-28 00:12:34)

Re: Bounce Log Issue

I mean the user unknown is correct.
But the log can not track it bounce.

My client see log as it received.
How to make log said bounce.

Because it bounce after amavis. How to make bounce at amavis.

4

Re: Bounce Log Issue

I don't get it.

You said "user unknown is correct", so this user doesn't exist on your server. If so, Postfix should reject the email directly (before it pipes the email to dovecot/amavisd/...).

5 (edited by jackavin 2017-03-28 17:17:15)

Re: Bounce Log Issue

amavis in mysql in said it 250 ok
But when send to dovecot it reject.

Do I miss some config?

6

Re: Bounce Log Issue

Please turn on debug mode in Dovecot for troubleshooting.
FYI: http://www.iredmail.org/docs/debug.dovecot.html

7

Re: Bounce Log Issue

Sorry ZhangHuangbin maybe missunderstood.

1. Email sent with wrong mailbox and reject.
2. Amavis's log said it receive in table msgrcpt with 250 ok.

But it's relay to dovecot and reject.
My issue is how to make amavis log right?
I mean it have to show user unknow.

Thank you

8

Re: Bounce Log Issue

As you can see in /etc/postfix/master.cf, transport 'smtp-amavis', it doesn't use strict restriction rules. e.g. "smtpd_sender_restrictions". And it has "permit_mynetworks" to bypass the user existence check.

If you want to do some restriction with Amavisd, try to update the "smtp-amavis" transport. But i think you're working in the wrong direction, mail should be rejected by Postfix before hitting Amavisd.

9

Re: Bounce Log Issue

How to make it reject in postfix not dovecot.
I just want log it database right for client.

Thank you

10

Re: Bounce Log Issue

If user doesn't exist locally, Postfix will reject it -- with default iRedMail settings.

11

Re: Bounce Log Issue

Mar 30 06:55:00 mx2 postfix/smtpd[28911]: 0B3B48026C: client=mx.mail.com.com[127.0.0.1]
Mar 30 06:55:00 mx2 postfix/cleanup[28068]: 0B3B48026C: message-id=<CAPA2r0H=s6j=hb093z6b9PW=jCtoVf5i=DYaXWuee5ebFLP_vQ@mail.gmail.com>
Mar 30 06:55:00 mx2 postfix/qmgr[944]: 0B3B48026C: from=<SRS0=a8px=3G=ana.co.jp=ml_ex_notice_bkkfrnh+bncBDV5JIUFZ4MRBRMS6HDAKGQEOO5VVXQ@smtp.mailmaster.co.th>, size=173211, nrcpt=1$
Mar 30 06:55:00 mx2 amavis[18771]: (18771-08) Passed CLEAN {RelayedInbound}, [85.25.237.172]:51384 [85.25.237.172] <SRS0=a8px=3G=ana.co.jp=ml_ex_notice_bkkfrnh+bncBDV5JIUFZ4MRBRMS6$
Mar 30 06:55:00 mx2 postfix/smtp[28900]: AC05A80235: to=<prapassorn@abc.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.4, delays=1.1/0/0/0.26, dsn=2.0.0, status=sent (250 2.0.0 fr$
Mar 30 06:55:00 mx2 postfix/pipe[28574]: 0B3B48026C: to=<prapassorn@abc.com>, relay=dovecot, delay=0.04, delays=0.02/0.01/0/0.02, dsn=5.1.1, status=bounced (user unknown)
Mar 30 06:55:00 mx2 postfix/bounce[29224]: 0B3B48026C: sender non-delivery notification: 1565C80235
Mar 30 06:55:00 mx2 postfix/qmgr[944]: 0B3B48026C: removed

OK my miss understood.
the postfix is bounce after amavis so log is wrong how to keep track this.

12

Re: Bounce Log Issue

jackavin wrote:

Mar 30 06:55:00 mx2 postfix/pipe[28574]: 0B3B48026C: to=<prapassorn@abc.com>, relay=dovecot, delay=0.04, delays=0.02/0.01/0/0.02, dsn=5.1.1, status=bounced (user unknown)

Did you modify /etc/dovecot/dovecot-mysql.conf? Show us full content (please remove sql username/password before pasting)

13

Re: Bounce Log Issue

driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=vmail user=vmail password=xxx
# Required by 'doveadm mailbox ...'.
iterate_query = SELECT username AS user FROM mailbox
password_query = SELECT password, allow_nets FROM mailbox WHERE username='%u' AND enable%Ls%Lc=1 AND active=1
user_query = SELECT \
    '%u' AS master_user, \
    CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
    CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
    AND mailbox.domain='%d' \
    AND mailbox.`enable%Ls%Lc`=1 \
    AND mailbox.domain=domain.domain \
    AND domain.backupmx=0 \
    AND domain.active=1 \
    AND mailbox.active=1

14

Re: Bounce Log Issue

Try to query the SQL command used by Dovecot (dovecot-mysql.conf), check which sql column doesn't have correct value.

15

Re: Bounce Log Issue

user unknown is correct.
But how to track log after amavis in MYSQL.
Because if you see this log in amavis is received But it bounce after.
So in database this transaction will be received instead of bounce.

How to make it bounce at postfix so amavis's database will correct.

16

Re: Bounce Log Issue

I'm confused now. Did you modify any Postfix/Dovecot settings after iRedMail installation?

With default settings, if user doesn't exist, Postfix will reject it immediately. So it doesn't go through Amavisd at all. There might be something wrong in your Postfix settings.

17

Re: Bounce Log Issue

If postfix reject it.
Do I amavis's databaase will keep this log?
Or I need to do coding about this stuff.

18

Re: Bounce Log Issue

If postfix rejects it, this email doesn't enter the mail queue, so amavisd won't see this email.

19

Re: Bounce Log Issue

Thank you