mirror of
https://github.com/opensolutions/ViMbAdmin.git
synced 2026-04-26 00:36:00 +03:00
[GH-ISSUE #11] Feature: Allow setting of global domain aliases #12
Labels
No labels
bug
feature
feature
improvement
improvement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ViMbAdmin-opensolutions#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @szlwzl on GitHub (Mar 5, 2012).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/11
I'd like to be able to set a domain alias so that we don't need to setup a new alias for each individual address.
ANY@example2.com is forwarded to ANY@example.com
I believe that this will require a new table or updates to the db schema and /etc/postfix/mysql/*.cf to reflect which are whole domain aliases and which are just single email aliases.
@barryo commented on GitHub (Mar 6, 2012):
This would indeed be a nice addition.
Currently we support domain aliases of the form:
which will forward all mail to
@example.comto the specified address. What you're asking is a one to one mapping such thatx@example.comwill gotox@example.netfor any value ofx.This could be accomplished programatically but, as you say, Postfix seems to support this via virtual_alias_domains. Have you come across any complete documentation of how this is done via Postfix / MySQL?
Ideally, and preferably, I would like to see this as just another alias entry such as:
as it's not dissimilar to the example at the top of my reply.
If you have a concrete example / how to / documentation of how this works in Postfix please provide references. Otherwise I'll try and put some time aside to dig into it myself.
@szlwzl commented on GitHub (Mar 6, 2012):
That's exactly right - we used allardsoft mail admin before it got too old and it has this feature as you describe.
My understanding is that postfix uses the below config to handle this.
I believe that postfix does a lookup in the virtual_alias_domains then if it can't find it tries:
If this works then the mail is delivered. The problem is that a domain cannot be listed in queries returned by both virtual_mailbox_domains and virtual_alias_domains so would either need to set a flag in the DB that this is a full domain alias or update the queries within the relevant files. I've been experimenting with things like the following in mysql-virtual_domain_forwardings.cf.
And this in mysql_virtual_domains.cf:
query = SELECT domain AS virtual FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1' AND domain NOT IN (select SUBSTRING(address,LOCATE('@',address)+1) as goto from alias where address='*@%s')
I haven't got it working yet but this gives an idea of how I think it would work. I'm considering creating a view in mysql to avoid doing anything too complex with the .cf files. Will have a go and let you know how it goes.
@szlwzl commented on GitHub (Mar 7, 2012):
I've got this working by using *@domain2.com aliasing to *@domain.com and then doing some queries in the mysql/postfix files. Will try and post a howto soon to the wiki.
@szlwzl commented on GitHub (Mar 7, 2012):
Added detail into https://github.com/opensolutions/ViMbAdmin/wiki/Config-Files-for-full-domain-aliasing
@barryo commented on GitHub (Mar 8, 2012):
Great, thanks for that. I'll review (probably next week or the week after) and see if I can make integration into the UI obvious.
@dexterd commented on GitHub (Mar 12, 2012):
Thanks for the guide. One notice - in mysql-virtual_domain_forwardings.cf, 'query=' line, content ends with $ i.e. not all text is visible.
@szlwzl commented on GitHub (Mar 12, 2012):
Doh! That's the important one as well, have updated the page now
@dexterd commented on GitHub (Mar 16, 2012):
Sorry for bothering, similar problem is with 'proxy_read_maps =' line.
Also, 'hosts = 127.0.0.1' option is not present in all .cf files. Is that intended?
@szlwzl commented on GitHub (Mar 16, 2012):
Thanks for that - it should be updated now.
On 16 March 2012 13:03, dexterd
reply@reply.github.com
wrote:
@click commented on GitHub (Mar 16, 2012):
I pulled a few SQL-selects for handling different scenarios from various sources and used it with the original implementation of postfixadmin (with slight modifications), combined with map-handling in main.cf
Not sure how much of this has already been implemented, so I'll just list the queries and their use...
As said before, some of these queries already exists in some way or form in the application/setup, but I hope this helps a bit at least. Can't wait for having this as a full alternative to postfixadmin, with all the bells and whistles implemented :)
For me, the relay-domains (backupmx) query is crucial for using failover-systems etc. at least - most probably already implemented, but worth commenting... :)
@dexterd commented on GitHub (Apr 4, 2012):
Do we need "query = ..." line changes in config files after vimbadmin upgrade(from 2.0.8 -> 2.1.0)? It's been mentioned that database migration is needed ...
@barryo commented on GitHub (Apr 4, 2012):
You only need to update the 'query =' line of the SQL configuration files if you want to use the access restriction. That said, I have just noticed an issue in that we forgot to allow for SMPT. Expect V2.1.1 tomorrow :(
See: https://github.com/opensolutions/ViMbAdmin/wiki/Update-Instructions for details.
PS: The best place for this kind of query is the mailing list.
@nysander commented on GitHub (Jan 23, 2013):
any progress in this topic?
@rodehoed commented on GitHub (Feb 21, 2014):
Dear admin,
Are there any updates about this feature? Most links refered in this post are non existing.
Regards,
Rodehoed
@barryo commented on GitHub (Feb 21, 2014):
No updates but the corrected links above are now:
@barryo commented on GitHub (Feb 21, 2014):
@rodehoed - If this is something you really need and are prepared to sponsor, see commercial support at:
http://www.vimbadmin.net/support.php
@digitalresistor commented on GitHub (Apr 18, 2014):
Since this post only applies to ViMbAdmin V2 and I needed this functionality for a client, I updated the SQL required to be Version 3 compatible.
Please see: https://gist.github.com/bertjwregeer/11055147 for more information, including Dovecot configuration to allow a user to login using either the canonical domain or the alias domain.
Hopefully this helps other people attempting to implement this.