New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

catch unrouted emails only?

Started by markelayan, October 11, 2015, 05:53:14 AM

Previous topic - Next topic

markelayan

hi all, i hope some one can help me in here, my problem i have many unrouted email address and i need to catch it all, but when i use the catch all feature, it catch all the emails going to the domain not only unrouted ones, is there any solutions out there?

thanks
mark

Glenn

You can setup aliases for the ones you don't want going into the catchall mailbox , and deliver the mail to their own mailbox or send them off to another domain.

Jae

I just realized that this problem also happen to my cwp.
But as cwp doesn't create 1 to 1 alias as default when creating user/mailbox, this gonna be problem forever..

I hope, sql alias table for own mailbox will automatically created by cwp, with cwp Pro at least.

Jae

Found solution
first, create mysql map file, in my case i create :

/etc/postfix/mysql-virtual_alias_default_maps.cf

Will contain :
hosts = localhost
user = postfix
password = ************
dbname = postfix
query = SELECT username FROM mailbox WHERE username='%s' AND (active = '1' OR active = '3')


Then edit this file :

/etc/postfix/mail.cf

Find this line :

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/postfix/virtual_regexp


Change to :

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_default_maps.cf, proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/postfix/virtual_regexp

Restart postfix, and and create catch-all alias, will not ignore existing mailbox...

pavsid

Worth mentioning that this rule will get lost if you rebuild postfix.

A better solution is (perhaps) to create aliases/forwarders for the accounts you don't want to be caught.

I.e. we have a catch-all for *@example.com, and accounts for john@example.com and sarah@example.com.

If you create a forwarder for each of john and sarah as follows, then these will take precedence over the catch-all rule and their mails will be delivered to their inbox instead of the catch-all.

john@example.com > john@example.com
sarah@example.com > sarah@example.com

HTH