Current time: 11-23-2024, 11:13 AM Hello There, Guest! (LoginRegister)


Post Reply 
Domain alias mail forward ?
Author Message
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #3
RE: Domain alias mail forward ?
OK I now checked that... I could not find a option in the nice clicky gui ;-)

So handwork:

1. Add mysql user
Quote:> mysql -u root -p mysql

mysql> GRANT SELECT ON ispcp.* to 'ispcp_postfix'@'localhost' identified by 'mypass';
mysql> FLUSH PRIVILEGES;
mysql> quit;

2. Install Postfic mysql package
Quote:apt-get install postfix-mysql


3. Create Postfix mysql map
Create /etc/postfix/domainalias.mysql with the following content:
NOTE: Replace NORMAL_DOMAIN and ALIAS_DOMAIN (f.e. domain1.com and domain1_alias.com)
Quote:user=ispcp_postfix
password=mypass
dbname=ispcp
query = SELECT concat(mail_users.mail_acc,'@', domain.domain_name) as forw_addr FROM mail_users inner join domain on mail_users.domain_id = domain.domain_id WHERE concat(mail_users.mail_acc,'@', 'ALIAS_DOMAIN') = '%s' and domain.domain_name='NORMAL_DOMAIN' and (mail_type='normal_mail' or mail_type='normal_forward');
hosts = 127.0.0.1


4. Alter postfix main.cf
Alter the line virtual_alias_maps of /etc/postfix/main.cf that it looks like:
Quote:virtual_alias_maps = hash:/etc/postfix/ispcp/aliases, mysql:/etc/postfix/domainalias.mysql

5. postfix reload
Quote:> postfix reload


There is another possibility with an hash-file containing @domain1_alias.com @domain1.com. But this solution would accept mails for users the don't exist in @domain1.com an bounce them later... Thats not nice!
(This post was last modified: 11-14-2007 05:19 AM by rbtux.)
11-14-2007 05:16 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Domain alias mail forward ? - GaRCieLD - 11-14-2007, 02:26 AM
RE: Domain alias mail forward ? - rbtux - 11-14-2007, 02:56 AM
RE: Domain alias mail forward ? - rbtux - 11-14-2007 05:16 AM
RE: Domain alias mail forward ? - GaRCieLD - 11-14-2007, 05:30 AM
RE: Domain alias mail forward ? - GaRCieLD - 11-14-2007, 06:06 AM
RE: Domain alias mail forward ? - rbtux - 11-14-2007, 06:08 AM
RE: Domain alias mail forward ? - jmeyerdo - 02-14-2008, 03:39 AM
RE: Domain alias mail forward ? - rbtux - 02-14-2008, 03:47 AM
RE: Domain alias mail forward ? - jmeyerdo - 02-14-2008, 04:21 AM
RE: Domain alias mail forward ? - jmeyerdo - 02-15-2008, 03:41 AM
RE: Domain alias mail forward ? - aseques - 10-05-2009, 10:32 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)