Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch-All does not work #4

Open
GitNorb opened this issue Dec 18, 2022 · 1 comment
Open

Catch-All does not work #4

GitNorb opened this issue Dec 18, 2022 · 1 comment

Comments

@GitNorb
Copy link

GitNorb commented Dec 18, 2022

Hello,
thank you for your work, this has taken a lot of work off my hands.

I had problems with the Catch-All alias. In the original version there is the alias table. A null for the source_username stands for "Forward all mails that cannot be mapped to destination". This does not work or me. Maybe this should not work for security reasons. But if it should work is here what I changed:

The schema for the alias table is located at roles/mariadb/files/schema.sql and has

CREATE TABLE `aliases` (
...
    `source_username` varchar(64) NOT NULL,
...
);

The fix is to allow the source_username to be NULL

There is also a query in roles/postfix/templates/sql/aliases.jq:

select concat(destination_username, '@', destination_domain) as destinations from aliases where source_username = '%u' and source_domain = '%d' and enabled = true;

I used the original query

SELECT DISTINCT concat(destination_username, '@', destination_domain) AS destinations FROM aliases
        WHERE (source_username = '%u' OR source_username IS NULL) AND source_domain = '%d'
        AND enabled = true
        AND NOT EXISTS (SELECT id FROM accounts WHERE username = '%u' and domain = '%d');

After this changes, Catch-All Support works for me, but the mailserver is not in production use. So maybe this fix creates some side effects.

Please check the fix and if this is good, it can be adopted.

If it's not good, or makes a security hole possible, feel free to tell me why.

@mainfield
Copy link

Later reply, but maybe it helps others in the future:
The ansible script seems to be based on the ENGLISH version (debian stretch) of Thomas Leister's guide, while @GitNorb seems to refer to a query that was introduced in the GERMAN version (debian buster).

Thomas has a changelog (compared to the stretch version) in the buster version, where he explicitly mentions the enablement of Catch-All.

@mubn doesn't seem to react on the latest pull requests, but maybe it might be a good idea to fork this repo and update it according to the German version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants