Discussion:
Kolab 3.4 multi domain patched, email alias lookup fail
Milan Petrovic
2016-11-25 08:40:43 UTC
Permalink
So, I have Kolab 3.4 installed on Ubuntu 3.4 with the multi domain patch.

I already have 4 single, separate domains added. I wanted to add a 5th one
as a separate and a 6th one as its alias domain.

I had first issue while creating users on this account so I had to edit
/usr/share/kolab-webadmin/lib/api/kolab_api_service_form_value.php and
comment out a line:

if (in_array('alias', $conf->get_list('mail_attributes'))) {
if
(!$this->_validate_email_address_in_any_of_my_domains($mail_address)) {
//throw new Exception("Email address '$mail_address'
not in local domain", 693);
}
if (!$this->_validate_crossdomain_alias($mail_address,
$postdata['mail'])) {
throw new Exception("Alias '$mail_address' must be
configured manually for '".$postdata['mail']."'");
}
}

Now I could add users with emails like ***@domain5, ***@domain6, but
cannot also have them have more than one address on both domains at the
same time (I cannot add ***@dom5, ***@dom6, ***@dom5 and ***@dom6 -
if I skip the ***@dom6, user can be created).

Then I had an issue with reception, users couldn’t be found, so I’ve edited
the /etc/postfix/virtual_alias_maps_manual.cf and include this file in
main.cf (in virtual_alias_maps), so it looked like this:

# you can manually set aliases, across domains.
# for example:
#***@test2.de ***@test.de
#@test4.de @test.de
#@pokorra.it ***@test1.de

@domain6 @domain5

server_host = localhost
server_port = 389
version = 3
search_base = dc=%2,dc=%1
scope = sub

domain = ldap:/etc/postfix/ldap/mydestination.cf

bind_dn = uid=kolab-service,ou=Special Users,dc=myprimarydomain,dc=tld
bind_pw = mypass

query_filter = (&(|(mail=%s)(alias=%s))(objectclass=inetorgperson))
result_attribute = mailForwardingAddress

Log showed I was missing a “=“ sign, and emails were not delivered to
either domain5 or domain6, so I’ve changed the alias line to: @domain6 =
@domain5

Now I have emails delivered to domain5 but log shows that emails cannot be
delivered to domain6 ("Recipient address rejected: User unknown in local
recipient table”).


So, how to have the domain alias email addresses in a multi domain setup of
Kolab 3.4?
Milan Petrovic
2016-11-25 11:10:46 UTC
Permalink
I was able to have the email delivered to the ***@domain6 by changing the
alias line in virtual_alias_maps_manual.cf to:

***@domain6 = ***@domain5

If I leave the "=" sign out, the mail log complains that:
fatal: /etc/postfix/virtual_alias_maps_manual.cf, line 1-10: missing '='
after attribute name: "***@domain6 ***@domain5"

But, after adding it, the email is received and shown in inbox but the
account from which I've sent the email to ***@domain6 get (I'm sending
from gmail) gets an automatic reply saying:

Reporting-MTA: dns; myHostName
X-Postfix-Queue-ID: BB400242398
X-Postfix-Sender: rfc822; myGmail
Arrival-Date: Fri, 25 Nov 2016 12:00:35 +0100 (CET)

Final-Recipient: rfc822; =@myPrimaryKolabDomain.com
Original-Recipient: rfc822;=@ myPrimaryKolabDomain.com
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "="


How to fix this?
Post by Milan Petrovic
So, I have Kolab 3.4 installed on Ubuntu 3.4 with the multi domain patch.
I already have 4 single, separate domains added. I wanted to add a 5th one
as a separate and a 6th one as its alias domain.
I had first issue while creating users on this account so I had to edit
/usr/share/kolab-webadmin/lib/api/kolab_api_service_form_value.php and
if (in_array('alias', $conf->get_list('mail_attributes'))) {
if (!$this->_validate_email_address_in_any_of_my_domains($mail_address))
{
//throw new Exception("Email address '$mail_address'
not in local domain", 693);
}
if (!$this->_validate_crossdomain_alias($mail_address,
$postdata['mail'])) {
throw new Exception("Alias '$mail_address' must be
configured manually for '".$postdata['mail']."'");
}
}
cannot also have them have more than one address on both domains at the
Then I had an issue with reception, users couldn’t be found, so I’ve
edited the /etc/postfix/virtual_alias_maps_manual.cf and include this
# you can manually set aliases, across domains.
@domain6 @domain5
server_host = localhost
server_port = 389
version = 3
search_base = dc=%2,dc=%1
scope = sub
domain = ldap:/etc/postfix/ldap/mydestination.cf
bind_dn = uid=kolab-service,ou=Special Users,dc=myprimarydomain,dc=tld
bind_pw = mypass
query_filter = (&(|(mail=%s)(alias=%s))(objectclass=inetorgperson))
result_attribute = mailForwardingAddress
Log showed I was missing a “=“ sign, and emails were not delivered to
@domain5
Now I have emails delivered to domain5 but log shows that emails cannot be
delivered to domain6 ("Recipient address rejected: User unknown in local
recipient table”).
So, how to have the domain alias email addresses in a multi domain setup
of Kolab 3.4?
Andy Kopciuch
2016-11-25 13:05:24 UTC
Permalink
Post by Milan Petrovic
fatal: /etc/postfix/virtual_alias_maps_manual.cf, line 1-10: missing '='
The normal behavior for a file in virutal_alias_maps is to be an indexed file.
I believe if you just specify a path, without a table type ... it just reads
in the contents of the file as is (as part of the configuration).

What you probably want is in main.cf:

virtual_alias_maps = hash:/etc/postfix/virtual,
ldap:/etc/postfix/ldap/virtual_alias_maps.cf,
<other lookup configurations>

Create the file /etc/postfix/virtual

Contents :
@domain6.com @domain5.com

Run this command after modifications :
***@host # /usr/sbin/postmap /etc/postfix/virtual

Which will create/update /etc/postfix/virtual.db


Then run this to reload postfix :
***@host # service postfix reload



Andy
Milan Petrovic
2016-11-25 13:39:56 UTC
Permalink
This has finally fixed it! Emails are delivered to both mailboxes and no
errors sent back to the sender or shown in log.

Seems that separating the alias line into a new file from the configuration
options in virtual_alias_maps_manual.cf what did the trick.

Andy, thanks a lot.

I've been pulling my hair all night in order to fix this. I am really very
grateful. I would have never solved this myself.

Thanks again!
Post by Andy Kopciuch
the
Post by Milan Petrovic
fatal: /etc/postfix/virtual_alias_maps_manual.cf, line 1-10: missing '='
The normal behavior for a file in virutal_alias_maps is to be an indexed file.
I believe if you just specify a path, without a table type ... it just reads
in the contents of the file as is (as part of the configuration).
virtual_alias_maps = hash:/etc/postfix/virtual,
ldap:/etc/postfix/ldap/virtual_alias_maps.cf,
<other lookup configurations>
Create the file /etc/postfix/virtual
@domain6.com @domain5.com
Which will create/update /etc/postfix/virtual.db
Andy
_______________________________________________
users mailing list
https://lists.kolab.org/mailman/listinfo/users
Jan Kowalsky
2016-11-25 21:39:34 UTC
Permalink
Hi Milan
Post by Milan Petrovic
fatal: /etc/postfix/virtual_alias_maps_manual.cf, line 1-10: missing '='
But, after adding it, the email is received and shown in inbox but the
Reporting-MTA: dns; myHostName
X-Postfix-Queue-ID: BB400242398
X-Postfix-Sender: rfc822; myGmail
Arrival-Date: Fri, 25 Nov 2016 12:00:35 +0100 (CET)
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "="
How to fix this?
I'm not shure if I followed your thread carefully enough... But in
relation with alias domains in a multi domain setup it's important to
add an aditionally postfix ldap mapping rule for the domain which will
hold an alias domain.

In the docs: https://docs.kolab.org/howtos/multi-domain.html

"For each parent domain that holds an alias domain name space, you are
required to create a copy of each of the configured mydestination,
local_recipient_maps, virtual_alias_maps and transport_maps lookup
tables, and adjust its settings to match the parent domain name space
and alias domain name spaces."



also here:
https://github.com/jankowa/kolab3scripts/blob/master/kolabEnableMultiDomainAliases.sh

thanks for the tip with the problem "Email address '$mail_address'
not in local domain"

Regaards
Jan

Loading...