Comments (17)
This would indeed be a nice addition.
Currently we support domain aliases of the form:
@example.com -> [email protected]
which will forward all mail to @example.com
to the specified address. What you're asking is a one to one mapping such that [email protected]
will goto [email protected]
for any value of x
.
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:
@example.com -> @example.net
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.
from vimbadmin.
[email protected] will goto [email protected] for any value of x.
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.
virtual_alias_domains = BLAH
I believe that postfix does a lookup in the virtual_alias_domains then if it can't find it tries:
virtual_mailbox_domains
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.
query = select SUBSTRING(address,LOCATE('@',address)+1) as goto from alias where address='*@%s'
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.
from vimbadmin.
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.
from vimbadmin.
Added detail into https://github.com/opensolutions/ViMbAdmin/wiki/Config-Files-for-full-domain-aliasing
from vimbadmin.
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.
from vimbadmin.
Thanks for the guide. One notice - in mysql-virtual_domain_forwardings.cf, 'query=' line, content ends with $ i.e. not all text is visible.
from vimbadmin.
Doh! That's the important one as well, have updated the page now
from vimbadmin.
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?
from vimbadmin.
Thanks for that - it should be updated now.
On 16 March 2012 13:03, dexterd
[email protected]
wrote:
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?
Reply to this email directly or view it on GitHub:
#11 (comment)
from vimbadmin.
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...
-- handle relay-accepted domains (secondary MX pointers, anyone?)
SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'
-- handle virtual alias domain
SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'
; -- handle catch-all settings of target-domain
SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'
-- handle virtual alias domain mailboxes
SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1'
-- handle virtual aliases
SELECT goto FROM alias WHERE address='%s' AND active = '1'
-- handle virtual domain
SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
-- handle virtual mailbox
SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'
-- handle virtual mailbox limit
SELECT quota FROM mailbox WHERE username='%s' AND active = '1'
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... :)
from vimbadmin.
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 ...
from vimbadmin.
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.
from vimbadmin.
any progress in this topic?
from vimbadmin.
Dear admin,
Are there any updates about this feature? Most links refered in this post are non existing.
Regards,
Rodehoed
from vimbadmin.
No updates but the corrected links above are now:
- https://github.com/opensolutions/ViMbAdmin/wiki/V2---Config-Files-for-full-domain-aliasing
- https://github.com/opensolutions/ViMbAdmin/wiki/V2---Update-Instructions
from vimbadmin.
@rodehoed - If this is something you really need and are prepared to sponsor, see commercial support at:
http://www.vimbadmin.net/support.php
from vimbadmin.
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.
from vimbadmin.
Related Issues (20)
- Batch edit one Goto Adress used in hundred of Aliases Adresses HOT 4
- extends possibilities for plugin HOT 1
- migrating from iRedadmin HOT 1
- Database column `mailbox`.`username` is not unique HOT 1
- typo in: application/controllers/AliasController.php
- Ensure a checkout contains the version number of vimbadmin HOT 3
- Update UPDATING with recent changes needs to be done for 3.x branch HOT 1
- Installation instructions from Wiki doesn't work with recent versions HOT 1
- SmartyCompilerException on PHP 8.1 HOT 1
- Warning fopen() Peer certificate HOT 1
- Number of mailboxes = 1 when there are 150 HOT 3
- vimbtool.php -a mailbox.cli-get-sizes not working HOT 6
- Class "Doctrine\Common\Util\Inflector" not found - when archiving
- vimbtool.php -a mailbox.cli-get-sizes not working with php 8.2 HOT 1
- Deprecated message with PHP 8.2 HOT 3
- error creating mailbox HOT 4
- DB Schema Creation Error using PostgreSQL HOT 1
- Local logging works but records no useful events
- Direct link to latest archive
- PostgreSQL: Initial setup of database leads to an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vimbadmin.