1 (edited by mail2dmitriev 2013-11-22 14:31:14)

Topic: Backup mx - error - user no found

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian 6
- Related log if you're reporting an issue:

Nov 20 22:04:28 mx20 postfix/smtpd[17697]: connect from mail-lb0-f169.google.com[209.85.217.169]
Nov 20 22:04:28 mx20 postfix-policyd: connection from: 127.0.0.1 port: 60806 slots: 0 of 4096 used
Nov 20 22:04:28 mx20 postfix-policyd: rcpt=338, whitelist_sender=update, host=209.85.217.169 (mail-lb0-f169.google.com), from=mail2dmitriev@gmail.com, to=dmitriev@xxxxxx.xx, size=0
Nov 20 22:04:28 mx20 postfix/smtpd[17697]: A844796030: client=mail-lb0-f169.google.com[209.85.217.169]
Nov 20 22:04:28 mx20 postfix/cleanup[17701]: A844796030: message-id=<528CF991.8010309@gmail.com>
Nov 20 22:04:28 mx20 postfix/qmgr[1691]: A844796030: from=<mail2dmitriev@gmail.com>, size=1871, nrcpt=1 (queue active)
Nov 20 22:04:28 mx20 postfix/smtpd[17697]: disconnect from mail-lb0-f169.google.com[209.85.217.169]
Nov 20 22:04:30 mx20 postfix/smtpd[17708]: connect from localhost[127.0.0.1]
Nov 20 22:04:30 mx20 postfix/smtpd[17708]: 49E4E96032: client=localhost[127.0.0.1]
Nov 20 22:04:30 mx20 postfix/cleanup[17701]: 49E4E96032: message-id=<528CF991.8010309@gmail.com>
Nov 20 22:04:30 mx20 postfix/smtpd[17708]: disconnect from localhost[127.0.0.1]
Nov 20 22:04:30 mx20 postfix/qmgr[1691]: 49E4E96032: from=<mail2dmitriev@gmail.com>, size=2394, nrcpt=1 (queue active)
Nov 20 22:04:30 mx20 amavis[1156]: (01156-08) Passed CLEAN, LOCAL [209.85.217.169] [81.88.222.67] <mail2dmitriev@gmail.com> -> <dmitriev@xxxxxx.xx>, Message-ID: <528CF991.8010309@gmail.com>, mail_id: 3h7-Lplx4Ztr, Hits: -100.1, size: 1871, queued_as: 49E4E96032, dkim_id=@gmail.com, 1522 ms
Nov 20 22:04:30 mx20 postfix/smtp[17705]: A844796030: to=<dmitriev@xxxxxx.xx>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.7, delays=0.19/0.01/0/1.5, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=01156-08, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 49E4E96032)
Nov 20 22:04:30 mx20 postfix/qmgr[1691]: A844796030: removed
Nov 20 22:04:30 mx20 postfix/pipe[17709]: 49E4E96032: to=<dmitriev@xxxxxx.xx>, relay=dovecot, delay=0.06, delays=0.01/0.01/0/0.03, dsn=5.1.1, status=bounced (user unknown)
Nov 20 22:04:30 mx20 postfix/cleanup[17701]: 5836996034: message-id=<20131120180430.5836996034@mx20.vpnpro.ru>
Nov 20 22:04:30 mx20 postfix/bounce[17711]: 49E4E96032: sender non-delivery notification: 5836996034
Nov 20 22:04:30 mx20 postfix/qmgr[1691]: 5836996034: from=<>, size=4198, nrcpt=1 (queue active)
Nov 20 22:04:30 mx20 postfix/qmgr[1691]: 49E4E96032: removed
Nov 20 22:04:34 mx20 postfix/smtp[17712]: 5836996034: to=<mail2dmitriev@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.136.26]:25, delay=4.3, delays=0.01/0.01/0.26/4, dsn=2.0.0, status=sent (250 2.0.0 OK 1384970682 s8si18148583eeh.167 - gsmtp)
Nov 20 22:04:34 mx20 postfix/qmgr[1691]: 5836996034: removed
====

Hello, everybody!
I have installed fresh Debian 6 and installed iReadMail and iRedAdminPro. Copied database with VMAIL data from main iRedMail-server and turned on checkbox for Backup MX for every domain. Then shutted down main iReadMail server and tried to send mail from GMAIL.

DNS works fine, so, google finds my backup mx, connects and tries to send email. But postfix says: "status=bounced (user unknown)" and sends google notification: sender non-delivery notification: 5836996034

What do I need to make MX Backup ?
Thank you.

----

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

2 (edited by mail2dmitriev 2013-11-22 03:01:27)

Re: Backup mx - error - user no found

postmap -q 'xxxxxx.xx' mysql:/etc/postfix/mysql/relay_domains.cf
xxxxxx.xx


root@mx20:~# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
allow_percent_hack = no
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 4h
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
maximal_backoff_time = 4000s
maximal_queue_lifetime = 4h
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = yyyyyy.xx
myhostname = mx20.yyyyyy.xx
mynetworks = 127.0.0.0/8
mynetworks_style = host
myorigin = mx20.yyyyyy.xx
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_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
relayhost =
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:10031
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:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
swap_bangpath = no
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /srv/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000

3

Re: Backup mx - error - user no found

Nobody knows what happend? sad

4

Re: Backup mx - error - user no found

Could you please show me output of below commands?

# cd /etc/postfix/mysql/
# for cf in $(ls *cf); do echo ${cf}; postmap -q 'dmitriev@xxxxxx.xx' mysql:./${cf}; done

5 (edited by mail2dmitriev 2013-11-23 01:07:57)

Re: Backup mx - error - user no found

root@mx20:~# cd /etc/postfix/mysql/
root@mx20:/etc/postfix/mysql# for cf in $(ls *cf); do echo ${cf}; postmap -q 'dmitriev@xxxxxx.xx' mysql:./${cf}; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_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_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/xxxxxx.xx/d/m/i/dmitriev-2013.10.29.11.37.40//Maildir/

6

Re: Backup mx - error - user no found

mail2dmitriev wrote:

virtual_mailbox_maps.cf
vmail1/xxxxxx.xx/d/m/i/dmitriev-2013.10.29.11.37.40//Maildir/

This is unexpected output. Could you please paste me file  /etc/postfix/mysql/virtual_mailbox_maps.cf? REMOVE password before posting.

7

Re: Backup mx - error - user no found

user        = vmail
password    = XXXXXXXXXXXXXXXXXXXXXXXXXXX
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir, '/Maildir/') FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND domain.active=1

8

Re: Backup mx - error - user no found

Does it work if you append 'AND domain.backupmx=0' in virtual_mailbox_maps.cf (after 'query =')?

9

Re: Backup mx - error - user no found

No, it is the same error - "user unknown", but output command change:
root@mx20:/etc/postfix/mysql# for cf in $(ls *cf); do echo ${cf}; postmap -q 'dmitriev@xxxxxx.xx' mysql:./${cf}; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_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_mailbox_domains.cf
virtual_mailbox_maps.cf

10

Re: Backup mx - error - user no found

Could you please show me output of below command:

# cd /etc/postfix/mysql/
# for cf in $(ls *cf); do echo ${cf}; postmap -q 'xxxxxx.xx' mysql:./${cf}; done

Replace 'xxxxxx.xx' by the real domain name.
Transport for this relay domain should be 'relay', but i guess your output will be 'dovecot'.

11 (edited by mail2dmitriev 2013-11-24 23:38:46)

Re: Backup mx - error - user no found

root@mx20:~# cd /etc/postfix/mysql/
root@mx20:/etc/postfix/mysql# for cf in $(ls *cf); do echo ${cf}; postmap -q 'xxxxxx.xx' mysql:./${cf}; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
xxxxxx.xx
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
transport_maps_domain.cf
dovecot
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf

12

Re: Backup mx - error - user no found

Does it work if you set domain transport to 'relay'?

13

Re: Backup mx - error - user no found

Dear Zhang, Yes, It works now. Thank you for your help.

14

Re: Backup mx - error - user no found

One more question. For this domen (xxxxxx.xx) I changed transport setting for relay instead of dovecot. And now IredAdmin says: can't "Mark as backup MX" because  "Backup MX doesn't work with custom relay". Then what configuration am I to do to make BX make work. It works now with current configuration, but I guess that the notification "Backup MX doesn't work with custom relay" shows that something is going wrong.

15

Re: Backup mx - error - user no found

Could you show me full content of file '/etc/postfix/mysql/transport_maps_domain.cf'? I believe we didn't check column 'domain.backupmx' in this file. This is the root cause.

16

Re: Backup mx - error - user no found

user        = vmail
password    = xxxxxxxxxxxxxxxxxx
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT transport FROM domain WHERE domain='%s' AND active=1

17

Re: Backup mx - error - user no found

Could you please update 'query =' to below one (append 'AND backupmx=0'), and reset domain transport for this backup mx to 'dovecot' and try again?

query       = SELECT transport FROM domain WHERE domain='%s' AND active=1 AND backupmx=0

18

Re: Backup mx - error - user no found

Hello, Zhang. I'm update this query, return transport to dovecot and mark as backup mx. And - it's work now.

Thank you very much!!!

19

Re: Backup mx - error - user no found

Thanks for your feedback. Will fix this in upcoming release of iRedMail.