2015-06-02 23:26:31 -05:00
|
|
|
# SQL: Add per-domain catch-all account
|
2014-11-04 03:48:55 -06:00
|
|
|
|
2017-07-08 22:25:23 -05:00
|
|
|
!!! attention
|
2017-07-06 12:16:46 -05:00
|
|
|
|
|
|
|
* This document is applicable to iRedMail-0.9.7 and later releases.
|
|
|
|
* Here's [doc for iRedMail-0.9.6 and earlier releases](./sql.create.catch-all-20170701.html).
|
|
|
|
|
2014-11-04 03:48:55 -06:00
|
|
|
With default setting, iRedMail will reject emails sent to non-existing mail
|
|
|
|
accounts under hosted mail domains. If you want to accept these emails, you
|
|
|
|
need a domain catch-all account.
|
|
|
|
|
|
|
|
With MySQL/MariaDB or PostgreSQL backend, you can add catch-all account for
|
2017-12-08 21:02:24 -06:00
|
|
|
existing domain `domain.com` in SQL table `vmail.forwardings` like below:
|
2014-11-04 03:48:55 -06:00
|
|
|
|
|
|
|
```sql
|
2015-09-29 08:28:26 -05:00
|
|
|
$ mysql -u root -p
|
2014-11-04 03:48:55 -06:00
|
|
|
sql> USE vmail;
|
2017-07-06 12:16:46 -05:00
|
|
|
sql> INSERT INTO forwardings (address, forwarding, domain, dest_domain)
|
|
|
|
VALUES ('domain.com', 'dest@example.com', 'domain.com', 'example.com');
|
2014-11-04 03:48:55 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
This sql command creates catch-all address for domain `domain.com`, all mails
|
|
|
|
sent to non-existing accounts under `domain.com` will be delivered to
|
|
|
|
`dest@example.com`.
|
|
|
|
|
|
|
|
__NOTE__: With iRedAdmin-Pro, you can manage catch-all account in domain
|
|
|
|
profile directly. Screenshot attached.
|
|
|
|
|
2017-10-28 00:38:13 -05:00
|
|
|
![](./images/iredadmin/domain_profile_catchall.png)
|
2014-11-04 03:48:55 -06:00
|
|
|
|
2015-06-02 23:26:31 -05:00
|
|
|
## See also
|
|
|
|
|
|
|
|
* [Add per-domain catch-all account for OpenLDAP backends](./ldap.add.catch-all.html)
|