1

Topic: Catchall not working with aliases

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): 0.7.3 Mysql (pro 1.3)
- Linux/BSD distribution name and version: CentOS 5.6
- Any related log? Log is helpful for troubleshooting.
====

Hello,

We are having trouble with catchall feature. Any aliases that were in place would get sent to the catchall. For instance, xyz@example.com is an alias of abc@example.com. When we put the catchall in place if we sent to abc@example.com it went through fine but if we sent to xyz@example.com it was sent to the catchall@example.com.

Thanks in advance.

----

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

2

Re: Catchall not working with aliases

Please show us output of below commands to help troubleshoot. Replace 'abc@example.com' and 'xyz@example.com' below with real email addresses before executing.

# cd /etc/postfix/mysql/
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'abc@example.com' mysql:./${cf}; done
# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'xyz@example.com' mysql:./${cf}; done
# postconf -n

3

Re: Catchall not working with aliases

Thanks for the response Zhang.

Here goes the outputs:


The mailbox:

[root@mail-new mysql]# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'odelavega@mvisolutions.com' mysql:./${cf}; done
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
odelavega@mvisolutions.com
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/mvisolutions.com/odelavega

The Alias mailbox:

[root@mail-new mysql]# for cf in $(ls *.cf); do echo ${cf}; postmap -q 'tito@mvisolutions.com' mysql:./${cf}; done
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
tito@mvisolutions.com
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
odelavega@mvisolutions.com
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/mvisolutions.com/tito

Postconf:

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
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 = 26214400
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = mvisolutions.com
myhostname = mail1-new.mvisolutions.com
mynetworks = 127.0.0.0/8, hash:/etc/postfix/pop-before-smtp, 192.168.0.0/24
mynetworks_style = subnet
myorigin = mail-new.mvisolutions.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_bind_address = 66.165.162.157
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
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

4

Re: Catchall not working with aliases

moyorakkhi wrote:

xyz@example.com is an alias of abc@example.com

I'm wondering how you add this kind of alias.

With iRedMail default settings, if you have a mailbox "abc@example.com", then create an alias domain "alias.com", alias mailbox "abc@alias.com" will be available automatically.

You mentions "xyz@" is an alias of "abc@", ideally, it should work as expected. May i know how you create this kind of alias? Is it just a typo error?

Here's my test on local server:

- Original domain: example.com, user: abc@example.com
- Alias domain: alias.com, alias address: abc@alias.com

Output of commands mentioned in my previous post:

# for i in $(ls *cf); do echo $i; postmap -q 'abc@example.com' mysql:./$i; 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
abc@example.com

transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
abc@example.com
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
vmail1/example.com/a/b/c/abc-2012.07.31.23.18.04//Maildir/


# for i in $(ls *cf); do echo $i; postmap -q 'abc@alias.com' mysql:./$i; done
catchall_maps.cf
domain_alias_catchall_maps.cf
domain_alias_maps.cf
abc@example.com

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

Send an email to both abc@example.com and abc@alias.com, i can receive both testing emails in abc@'s mailbox.

5

Re: Catchall not working with aliases

I found the difference.

Your Postfix parameter:

moyorakkhi wrote:

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

iRedMail default setting:

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

You have addtion lookup map: proxy:mysql:/etc/postfix/mysql/domain_alias_maps_alias.cf. What's it?

If you find all lookup files used in iRedMail below, please make sure you have correct mysql queries in these lookup files on your server.
https://bitbucket.org/zhb/iredmail/src/ … tfix/mysql

6

Re: Catchall not working with aliases

Also, you're running iRedMail-0.7.3 and iRedAdmin-Pro-MySQL-1.3.0, please upgrade both to the latest versions: iRedMail-0.8.1, iRedAdmin-Pro-MySQL-1.4.0.

If you don't have download link of the latest version of iRedAdmin-Pro-MySQL, please send an email to "support _at_ iredmail.org", we will send you one as soon as possible.

7

Re: Catchall not working with aliases

Thanks a lot Zhang. We shall upgrade iredmail and will replace all the lookup files with the default one. Shall get back to you after doing this.