Coder Social home page Coder Social logo

Comments (6)

hibas123 avatar hibas123 commented on August 23, 2024 1

With the following query, you could just write "null" in the source_username field:

query = SELECT concat(destination_username, '@', destination_domain) as destinations FROM aliases WHERE source_username ='%u' and source_domain ='%d' and enabled = true UNION ALL SELECT concat(destination_username, '@', destination_domain) as destinations FROM aliases WHERE source_username = 'null' and source_domain ='%d' and enabled = true AND not exists (SELECT id FROM aliases WHERE source_username ='%u' and source_domain ='%d' and enabled = true);

But keep in mind that this way no user named null should exist.

This way you dont event need the source_username field to be null.

Hopes this helps you.
Fabian

from mailman.

 avatar commented on August 23, 2024 1

@phiilu
I can confirm that the query of @hibas123 works as expected. Also, the identical query is given in the Questions and Answers section in Thomas Leister's official guide.

from mailman.

phiilu avatar phiilu commented on August 23, 2024

@soulsymphonies Thank you for using my GUI :)

I would suggest to go with @hibas123 solution (Thank you for helping out!). If the provided query is working I will add it to the docs, otherwise I want to collect more feedback before doing anything.

from mailman.

phiilu avatar phiilu commented on August 23, 2024

Thank you @lonkey!

I added a link to the guide, unfortunately this guide is only available in german. Maybe Thomas will also add it to the english version in the future.

from mailman.

soulsymphonies avatar soulsymphonies commented on August 23, 2024

thank you ever so much for all your efforts, sorry for the late reply, lot's of things happened in my life that I had to address.

I think this solution covers it. Thanks again.

from mailman.

T0biii avatar T0biii commented on August 23, 2024

i edited @hibas123 query to:
query = SELECT concat(destination_username, '@', destination_domain) as destinations FROM aliases WHERE source_username ='%u' and source_domain ='%d' and enabled = true UNION ALL SELECT concat(destination_username, '@', destination_domain) as destinations FROM aliases WHERE source_username = '*' and source_domain ='%d' and enabled = true AND not exists (SELECT id FROM aliases WHERE source_username ='%u' and source_domain ='%d' and enabled = true);

so you could just write "*" in the source_username field instant of "null"

from mailman.

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.