1 (edited by zopaci 2013-08-29 19:19:58)

Topic: Catchall not working.

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

Hello,
I'm trying to configure catch-all for my iRedmail-domain with this: http://www.iredmail.org/wiki/index.php? … /Catch-all

I have added following entry to mysql-database:
Database: vmail
Table: alias
address: @1.domain.com
goto: fullname@domain.com

iRedmail-server was set up behind domain.com and it was fully working.
After that, we added new domain address "1.domain.com" and pointed it to iRedmail-server and catchall-configuration was added.

If I send mail to fullname@domain.com, mail is delivered properly, but if I send mail to fullname@1.domain.com, I cant see any email anywhere and /var/log/mail.log has following error: NOQUEUE: reject: RCPT from [sensored]: 550 5.1.1 <fullname@1.domain.com>: Recipient address rejected: User unknown in virtual alias table; from=<sensored>....

I have commented content_filter-line in main.cf and I have also disabled spamassasin, amavis and clamav.

I need to configure mail so that all sub-domains forward to one catchall-mailbox, but I cannot get even one subdomain to work.
Does anyone have any idea what im doing wrong?

----

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.

*) Did you modify any Postfix config files before?
*) Please show us output of below command to help troubleshoot:

# postconf virtual_alias_maps

*) And show us full content of below files. Please remove/replace password before posting:

- /etc/postfix/mysql/catchall_maps.cf
- /etc/postfix/mysql/domain_alias_catchall_maps.cf

3 (edited by zopaci 2013-08-29 21:47:20)

Re: Catchall not working.

ZhangHuangbin wrote:

*) Did you modify any Postfix config files before?
*) Please show us output of below command to help troubleshoot:

# postconf virtual_alias_maps

*) And show us full content of below files. Please remove/replace password before posting:

- /etc/postfix/mysql/catchall_maps.cf
- /etc/postfix/mysql/domain_alias_catchall_maps.cf

Hello,

I didn't have to modify any postfix-configs.
I don't have these files:
- /etc/postfix/mysql/catchall_maps.cf
- /etc/postfix/mysql/domain_alias_catchall_maps.cf

BUT I managed to make catchall work by adding following mysql-data (command to add alias-data was in the wiki-page I linked, but adding new value to domain-table was not.):

Database: vmail
Table: alias
address: @1.domain.com
goto: fullname@domain.com

Database: vmail
Table: domain
domain: 1.domain.com


Now I have another problem:
If I have multiple sub-domains i.e.:

1.domain.com
2.domain.com
3.domain.com
4.domain.com
5.domain.com
...
9999.domain.com

How can I add a wildcard for subdomains in the MySQL-table (I'm betting I cannot just add @*.domain.com and *.domain.com )?
I don't want to manually add all subdomains to domain- and alias-tables.

4

Re: Catchall not working.

zopaci wrote:

I don't have these files:
- /etc/postfix/mysql/catchall_maps.cf
- /etc/postfix/mysql/domain_alias_catchall_maps.cf

Why you don't have these files? They will be created by iRedMail during installation.

zopaci wrote:

BUT I managed to make catchall work by adding following mysql-data (command to add alias-data was in the wiki-page I linked, but adding new value to domain-table was not.):

Domain must exist first. I updated the wiki page to mention this.

zopaci wrote:

How can I add a wildcard for subdomains in the MySQL-table (I'm betting I cannot just add @*.domain.com and *.domain.com )?
I don't want to manually add all subdomains to domain- and alias-tables.

Then create a shell script to add proper records instead of adding them manually.

Just curious, why do you have to use so many sub-domains?

5 (edited by zopaci 2013-08-29 22:11:37)

Re: Catchall not working.

ZhangHuangbin wrote:
zopaci wrote:

I don't have these files:
- /etc/postfix/mysql/catchall_maps.cf
- /etc/postfix/mysql/domain_alias_catchall_maps.cf

Why you don't have these files? They will be created by iRedMail during installation.

zopaci wrote:

BUT I managed to make catchall work by adding following mysql-data (command to add alias-data was in the wiki-page I linked, but adding new value to domain-table was not.):

Domain must exist first. I updated the wiki page to mention this.

zopaci wrote:

How can I add a wildcard for subdomains in the MySQL-table

Just curious, why do you have so many sub-domains?

Ah, sorry yes I have those files, I just looked from wrong path.

I am making a virtual machine group with multiple virtual machines (one machine for iRedmail) and I have configured all email clients in the vm-group to fetch mail from username@domain.com.

I need to have multiple copies of this vm-group and all of the copies have random hostname (randomsubdomain.domain.com).
I don't want to configure email-clients and iRedmail always for the new copy so I need to configure it so that mail sent to i.e. 4.domain.com goes to vm-group 4 and iredmail of the group4 will forward the mail to username@domain.com and only the clients from vm-group 4 will get the mail.

Then I can send mail to whichever group I want and email-client on the group will automatically get the email and no configuration changes are needed when copying to a new virtual machine group.

I hope you understand what I tried to explain smile

6

Re: Catchall not working.

Honestly, i don't quite understand why you do it this way.
Maybe you can use mail forwarding or something like this to achieve the same goal. Make things easy/simple please if possible.

zopaci wrote:

I am making a virtual machine group with multiple virtual machines (one machine for iRedmail) and I have configured all email clients in the vm-group to fetch mail from username@domain.com.

From the same email address? or username@[SUB_DOMAIN]?

zopaci wrote:

I need to configure it so that mail sent to i.e. 4.domain.com goes to vm-group 4 and iredmail of the group4 will forward the mail to username@domain.com and only the clients from vm-group 4 will get the mail.

Do you send mail to a random username of 4.domain.com? not a hard-coded one? for example, 'root@4.domain.com'. Is it possible to configure it to sent to a hard-coded one?
If it's sent to 'root@4.domain.com' (root user), then you can update /etc/postfix/aliases on server 4.domain.com to forward all emails sent to root user to an email address.

7

Re: Catchall not working.

ZhangHuangbin wrote:

Honestly, i don't quite understand why you do it this way.
Maybe you can use mail forwarding or something like this to achieve the same goal.

Mail forwarding won't work on this and I'm pretty certain that wildcarding all subdomains in iRedmail and catchall is the easiest way to do this.

Back to the problem,
I can't get wildcard work in Mysql and I also tried following:

Modified /etc/postfix/main.cf:
virtual_alias_domains = regexp:/etc/postfix/virtual_alias.regexp

Added /etc/postfix/virtual_alias.regexp:
/@.*\.domain\.com$/ targetuser@domain.com

With the regexp I get following error:
NOQUEUE: reject: RCPT FROM [censored]: 554 5.7.1 <censored>: Relay access denied; from...