Moin,
anbei meine views: man beachte ich arbeite mit Klartextpasswörtern,…
CREATE VIEW postfix_user AS select concat(egw_accounts.account_lid,’@mvz.ffm’) AS email,substr(egw_accounts.account_pwd,8,char_length(egw_accounts.account_pwd)) AS password,egw_accounts.account_pwd AS pwd,md5(substr(egw_accounts.account_pwd,8,char_length(egw_accounts.account_pwd))) AS pwd_md5,(select egw_addressbook_extra.contact_value from egw_addressbook_extra where ((egw_addressbook_extra.contact_name like ‘quota’) and (egw_addressbook_extra.contact_id like egw_addressbook.contact_id))) AS quota from (egw_accounts join egw_addressbook) where (egw_addressbook.account_id = egw_accounts.account_id);
CREATE VIEW postfix_virtual_domains AS select egw_emailadmin.ea_default_domain AS domain from egw_emailadmin where (egw_emailadmin.ea_active = 1);
Dann noch die Einstellung dafür in der postfix/main.cnf:
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_transport = dovecot
mysql-virtual_mailboxes.cf:
user = postfix
password = X
dbname = egroupware
query = SELECT email FROM postfix_user WHERE email=’%s’
mysql-virtual_domains.cf:
user = postfix
password = X
dbname = egroupware
query = SELECT domain AS virtual FROM postfix_virtual_domains WHERE domain=’%s’
hosts = 127.0.0.1
Dovecot braucht muss auch noch wissen, wie er authentifizieren soll:
password_query = SELECT email AS username, password FROM postfix_user WHERE email = ‘%u’
user_query = SELECT ‘/home/vmail/%d/%n’ AS home, ‘vmail’ AS uid, ‘vmail’ AS gid, CONCAT(’*:storage=’, quota, ‘M’) AS quota_rule FROM postfix_user WHERE email = ‘%u’
Das sind jetzt mal nur ein paar Brotkrumen, keine vollständige Beschreibung und gilt nur für die 1.8, für die 14.1 muss ich die views natürlich anpassen,…
Man kann sich so eine komplette Mailserververwaltung aufbauen, das quotafeld ist z.B. ein selbst definiertes. Ich hatte mir mittels etemplate mal eine eigene Verwaltung für Aliasadressen gebaut, wurde aber nicht genutzt,…
Soweit
Gregor
–