Alias domains not working after upgrade to 3.1dev

Discussion in 'Developers' Forum' started by Th0m, Aug 5, 2020.

  1. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Hey, I found one problem - my testing not matching your case. I'm actually sending with authentication on this test server, and your original report was from external servers, ie. not authenticated. Stay tuned...
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Found the problem now, the mysql-virtual_alias_domains.cf was being used for both virtual_alias_domains and virtual_alias_maps, but those two need results in a different format - the former should return 'hosteddomain.com' for a query of 'aliasdomain.nl', where the latter should return '@hosteddomain.com' with a query of either '[email protected]' or '@aliasdomain.nl'.

    I'll send a fix in MR shortly, but if you want to manually test it, change 'mysql-virtual_alias_domains.cf' to 'mysql-virtual_alias_maps.cf' in virtual_alias_maps:
    Code:
    virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
    
    Then copy mysql-virtual_alias_domains.cf to mysql-virtual_alias_maps.cf (mind owner/permissions), and set the queries as:
    Code:
    # cat /etc/postfix/mysql-virtual_alias_domains.cf | sed -n '/query/,$ p'
    query = SELECT SUBSTRING_INDEX(destination, '@', -1) FROM mail_forwarding
             WHERE source = '@%s' AND type = 'aliasdomain' AND active = 'y' AND server_id = 2
    
    # cat /etc/postfix/mysql-virtual_alias_maps.cf | sed -n '/query/,$ p'
    query = SELECT destination FROM mail_forwarding
             WHERE source = '@%d' AND type = 'aliasdomain' AND active = 'y' AND server_id = 2
    
    Reload postfix and test again.
     
    Th0m, ahrasis and till like this.
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I think this should be server_id = 1 for me... Will test.
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    This works, thanks for your endless effort Jesse, and I'm happy we tackled this before we released 3.2.
    :)
     
    ahrasis likes this.

Share This Page