1 (edited by moyorakkhi 2011-11-29 04:23:39)

Topic: Catchall feature not working properly

==== Provide basic information to help troubleshoot and get quick answer ====
- iRedMail version: 0.7.1
- Linux/BSD distribution name and version: CentOS 5.6
- Any related log? Log is helpful for troubleshooting.
====

Hi,

We are using iredmail version 0.7.1 and iredadmin pro (mysql) version 1.3.0. Whenever we enable catchall feature for any domain, all emails for that domain goes to the mentioned catchall email address.

For example:

domain: test.com
mailboxes: test1@test.com, test2@test.com, test3@test.com
CatchAll address: test1@test.com

So when an email sent to test2@test.com or test1@test.com or blahblah@test.com.... all are going to test1@test.com. How can we resolve this issue? Thanks.

----

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

2

Re: Catchall feature not working properly

May i know how you installed iRedMail-0.7.1? Was it the initial release you installed on this server? or upgrade from and old version?

This bug exists in iRedMail-0.6.1 and earlier versions, we already mentioned this bug and provided fix in upgrade tutorial:
http://iredmail.org/wiki/index.php?titl … s_expected

Hope it helps.

3 (edited by moyorakkhi 2011-11-29 13:08:06)

Re: Catchall feature not working properly

Thanks for your help. It was clean installation of 0.7.1 and not upgrade one.

I've checked /etc/postfix/mysql directory and "catchall_maps.cf" & "domain_alias_catchall_maps.cf" are there already. "main.cf" file also has those two files in "virtual_alias_maps". Are we missing anything else?

BTW, mysql database also got those required tables. Well, as it's a clean installation of 0.7.1 it's definitely shipped with these features.

4

Re: Catchall feature not working properly

Found the following message in maillog. Does this has anything related to this?

Nov 28 23:49:54 mail-new postfix/proxymap[28961]: warning: mysql query failed: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
Nov 29 00:01:01 mail-new policyd-cleanup: connecting to mysql database: 127.0.0.1
Nov 29 00:01:01 mail-new policyd-cleanup: connecting to mysql database: 127.0.0.1
Nov 29 00:59:54 mail-new postfix/proxymap[6674]: warning: mysql query failed: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='

5

Re: Catchall feature not working properly

moyorakkhi wrote:

warning: mysql query failed: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='

That's the problem.

Please login to phpMyAdmin, browser database "vmail", check every SQL table, and change column collation from "ascii_general_ci" to "utf8_general_ci" you found.

6

Re: Catchall feature not working properly

Well, i've changed all table collation to utf8_general_ci. That didn't fixed it. Still all emails going to one email address no matter the mailbox exist or not. Also we are having trouble with domain alias. It also not working. postfix returning "550 5.1.1 <USERNAME@DOMAIN.com>: Recipient address rejected: User unknown in virtual mailbox table". We've properly added "domainA.com" into "domainB.com" 's alias. And the mailbox that we are trying to send also exists. We are hosting 350+ domains and recently migrated to the iredmail. Clients are all-over us. Thanks for your help.

7

Re: Catchall feature not working properly

Alias domain error is a known issue in iRedMail-0.7.1, and we fixed it in iRedMail-0.7.2 and later versions. It's mentioned in upgrade tutorial:
http://iredmail.org/wiki/index.php?titl … in_postfix

About catch-all account issue, could you please post output of command "postconf -n" here to help troubleshoot?

It's strongly recommended to upgrade your iRedMail-0.7.1 to the latest version (currently, 0.7.3) by following upgrade tutorials:
http://www.iredmail.org/doc.html#upgrade_tutorial

8 (edited by moyorakkhi 2011-11-30 17:59:54)

Re: Catchall feature not working properly

Alias domain was fixed.

Catch-all still having trouble. We are going to upgrade to newer version of iredmail. Here's the postconf output:

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 = DOMAINNAME.com
myhostname = mail.DOMAIN.com
mynetworks = 127.0.0.0/8, hash:/etc/postfix/pop-before-smtp, 192.168.0.0/24
mynetworks_style = subnet
myorigin = mail.DOMAIN.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:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
sample_directory = /usr/share/doc/postfix-2.5.9/samples
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/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_client_access hash:/etc/postfix/pop-before-smtp, 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, check_policy_service inet:127.0.0.1:7777, 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_restrictions = permit_mynetworks, 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:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
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/domain_alias_maps_alias.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
virtual_gid_maps = static:501
virtual_mailbox_base = /mail
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 = 501
virtual_transport = dovecot
virtual_uid_maps = static:501

9

Re: Catchall feature not working properly

Could you please post all file contents in files listed in virtual_alias_maps? REMOVE MySQL password in these files before posting.

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/domain_alias_maps_alias.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf

10 (edited by moyorakkhi 2011-11-30 19:03:35)

Re: Catchall feature not working properly

Thanks for you help. Here's the files:

/etc/postfix/mysql/virtual_alias_maps.cf:

user        = vmail
password    = xxxxxxxxxxx
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias
.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0
 AND domain.active=1 

/etc/postfix/mysql/domain_alias_maps.cf

user        = vmail
password    = xxxxxxxxx
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
#query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.a
lias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND
 alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active
=1 AND domain.backupmx=0
query       = SELECT mailbox.username as goto FROM mailbox,alias_domain,domain WHERE
 alias_domain.alias_domain='%d' AND mailbox.username=CONCAT('%u', '@', alias_domain.
target_domain) AND alias_domain.target_domain=domain.domain AND mailbox.active=1 AND
 alias_domain.active=1 AND domain.backupmx=0

/etc/postfix/mysql/domain_alias_maps_alias.cf

user        = vmail
password    = xxxxxxxx
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.al
ias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND
alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=
1 AND domain.backupmx=0

/etc/postfix/mysql/catchall_maps.cf

user        = vmail
password    = xxxxxx
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias
.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0

/etc/postfix/mysql/domain_alias_catchall_maps.cf

user        = vmail
password    = xxxxxxx
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.al
ias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target
_domain=domain.domain AND alias.active=1 AND alias_domain.active=1

11

Re: Catchall feature not working properly

Some questions:

- I just found that you have one addition MySQL lookup file which iRedMail doesn't have: "proxy:mysql:/etc/postfix/mysql/domain_alias_maps_alias.cf", what is it used for?

- You comment out iRedMail default SQL query in /etc/postfix/mysql/domain_alias_maps.cf, why not use the default one? And what is the new SQL query used for?

Please use iRedMail default SQL query and remove addition SQL lookup file (domain_alias_maps_alias.cf) you added, then catch-all should work as expected, otherwise we cannot help troubleshoot without default settings.

12

Re: Catchall feature not working properly

We used the all the default settings. But when the domain alias was not working we opied domain_alias_maps.cf over to domain_alias_maps_alias.cf then modified the query in domain_alias_maps.cf to

 "SELECT mailbox.username as goto FROM mailbox,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND mailbox.username=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND mailbox.a
ctive=1 AND alias_domain.active=1 AND domain.backupmx=0" 

.

That's make the domain alias working. Previously both domain ailas and catchall both were not working. I'm making everything default again. I'll revert to you.

13

Re: Catchall feature not working properly

I had a fresh copy of iredmail installed and compared all files in /etc/postfix/mysql. I put all setting same as the default installation both for the files under /etc/postfix/mysql and also in main.cf. But unfortunately domain alias didn't worked and catchall also acting same. All mails going to the catchall address.

14

Re: Catchall feature not working properly

- Did you also compare Postfix settings (output of command "postconf -n")?
- Did you use iRedAdmin-Pro-MySQL old releases on this server before?
- Could you please test below commands on your server to help troubleshoot:

# cd /etc/postfix/mysql/
# for cf in $(ls); do echo "-> ${cf}"; postmap -q 'username@domain.ltd' mysql:./${cf}; done

Please replace "username@domain.ltd" in above command with a real mail address hosted on your server.

15

Re: Catchall feature not working properly

Hi Zhang,

--- Yeah I compared postfix setting everything is same except the "domain_alias_maps_alias.cf" file that we've added when domain alias wasn't working.

--- It was a fresh centos. No installation before. I've also checked with the currently installed version and the new installation. It's same version.

 rpm -qa | grep mysql
mod_auth_mysql-3.0.0-3.2.el5_3
mysql-server-5.0.77-4.el5_6.6
perl-DBD-mysql-4.008-1.el5.rf
php-mysql-5.2.10-1.el5.centos
mysql-5.0.77-4.el5_6.6

---- Here's the output:

-> 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

Thanks for your support.

16

Re: Catchall feature not working properly

Do you think this is the problem. iRedmailpro enters the following "DOMAIN.com user@DOMAIN.com    DOMAIN.com 2011-11-30 05:11:05 0000-00-00 00:00:00 9999-12-31 00:00:00 0". Shouldn't it be "@DOMAIN.com user@DOMAIN.com    DOMAIN.com 2011-11-30 05:11:05 0000-00-00 00:00:00 9999-12-31 00:00:00 0"? Could you please advice through which python file iredmailpro inserting into mysql db. For catchall it's editing the alias table, right?

17

Re: Catchall feature not working properly

moyorakkhi wrote:

---- Here's the output:

-> 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

Thanks for your support.

Did you replace 'username@domain.ltd' in the command with a REAL email address? There should be some addition output.

moyorakkhi wrote:

Do you think this is the problem. iRedmailpro enters the following "DOMAIN.com user@DOMAIN.com    DOMAIN.com 2011-11-30 05:11:05 0000-00-00 00:00:00 9999-12-31 00:00:00 0". Shouldn't it be "@DOMAIN.com user@DOMAIN.com    DOMAIN.com 2011-11-30 05:11:05 0000-00-00 00:00:00 9999-12-31 00:00:00 0"? Could you please advice through which python file iredmailpro inserting into mysql db. For catchall it's editing the alias table, right?

According to the SQL command in catchall_maps.cf, "DOMAIN.com user@DOMAIN.com" is correct:

query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias
.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0

18

Re: Catchall feature not working properly

Sorry Zhang. Here's the output:

-> catchall_maps.cf
-> domain_alias_catchall_maps.cf
-> domain_alias_maps_alias.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
catchall@cutesmilemiami.com
-> transport_maps_domain.cf
-> transport_maps_user.cf
-> virtual_alias_maps.cf
catchall@cutesmilemiami.com
-> virtual_mailbox_domains.cf
-> virtual_mailbox_domains.cf.2011.06.15
-> virtual_mailbox_maps.cf
vmail1/cutesmilemiami.com/c/a/t/catchall-2011.12.03.11.42.55/