Giter VIP home page Giter VIP logo

Comments (17)

barryo avatar barryo commented on June 3, 2024

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.

szlwzl avatar szlwzl commented on June 3, 2024
[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.

szlwzl avatar szlwzl commented on June 3, 2024

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.

szlwzl avatar szlwzl commented on June 3, 2024

Added detail into https://github.com/opensolutions/ViMbAdmin/wiki/Config-Files-for-full-domain-aliasing

from vimbadmin.

barryo avatar barryo commented on June 3, 2024

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.

dexterd avatar dexterd commented on June 3, 2024

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.

szlwzl avatar szlwzl commented on June 3, 2024

Doh! That's the important one as well, have updated the page now

from vimbadmin.

dexterd avatar dexterd commented on June 3, 2024

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.

szlwzl avatar szlwzl commented on June 3, 2024

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.

click avatar click commented on June 3, 2024

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.

dexterd avatar dexterd commented on June 3, 2024

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.

barryo avatar barryo commented on June 3, 2024

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.

nysander avatar nysander commented on June 3, 2024

any progress in this topic?

from vimbadmin.

rodehoed avatar rodehoed commented on June 3, 2024

Dear admin,

Are there any updates about this feature? Most links refered in this post are non existing.

Regards,
Rodehoed

from vimbadmin.

barryo avatar barryo commented on June 3, 2024

No updates but the corrected links above are now:

from vimbadmin.

barryo avatar barryo commented on June 3, 2024

@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.

digitalresistor avatar digitalresistor commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.