mirror of
https://github.com/anonaddy/anonaddy.git
synced 2026-04-25 06:05:55 +03:00
[GH-ISSUE #49] Self-Hosted | How do I properly add a new domain? #92
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/anonaddy#92
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 @tommyvange on GitHub (Jun 4, 2020).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/49
Hello, my self-hosted anonaddy instance is working great! However, I can't seem to figure out how to add another domain.
I managed to add it into the Anonaddy config and it does show up, but whenever I try to send emails to the alias they bounce with the error:
554 5.7.1 <XXXXXXXXXX@XXXXXXX.XXX>: Relay access deniedI tried to make a new DKIM key and add the domain to the trusted.hosts file, but that didn't seem to change anything.
For the DNS record I made them identical to the original domain with the only exception being that th MX record points to the original domain.
What is the right way to add a second domain to anonaddy (both DNS and config)?
@tommyvange commented on GitHub (Jun 4, 2020):
Update
I added the domain to to the
mydestinationvariable in the postfix config, and the emails are no longer bouncing.However, It is still not working.
Here is the mail.log entry:
I have redacted my gmail username and my anonaddy domains.
Now I am really at a loss, as I don't understand whats wrong.
@willbrowningme commented on GitHub (Jun 9, 2020):
Did you try to just add the domain via the domains page of the app?
@tommyvange commented on GitHub (Jun 9, 2020):
That is not what I mean, I mean add a new global one like 4wrd.cc is in anonaddy.
@willbrowningme commented on GitHub (Jun 12, 2020):
Okay, please try adding the domain to
virtual_mailbox_domainsinstead ofmydestinationin/etc/postfix/main.cfand then also adding it to your.envfile underANONADDY_ALL_DOMAINS@willbrowningme commented on GitHub (Jun 21, 2020):
@tommyvange did you get this issue sorted in the end?
@tommyvange commented on GitHub (Jun 21, 2020):
@willbrowningme - I had surgery, so I haven't been on my PC for a while. I will update when I have tried again :)
@willbrowningme commented on GitHub (Jun 21, 2020):
@tommyvange sorry to hear that, wishing you a speedy recovery.
@slurdge commented on GitHub (Sep 17, 2020):
Hey there, I just added a second domain to my docker install of anonaddy. Some things are working, some other not but there is progress.
Here is what I did:
*.seconddomain.comandseconddomain.comhave MX tomydomain.com.I can verify this in DNSseconddomain.comtovirtual_mailbox_domainswith sed:So far, so good. Emails sent to seconddomain.com are correctly forwarded.
However, the emails sent to a subdomain of seconddomain are not. I guess this is because of the following rule:
In
/etc/postfix/mysql-virtual-alias-domains-and-subdomains.cf:Which lacks the second domain.
I see two solutions:
OR CONCAT(username, '.seconddomain.com' = '%s')is enough but would like to confirm.After that, I would suggest to @crazy-max to update the script that makes the modifications & substitutions (https://github.com/anonaddy/docker/blob/master/rootfs/etc/cont-init.d/03-config.sh) to:
ANONADDY_ALL_DOMAINSvariablevirtual_mailbox_domains(joined by , so "should" be the same thing)What's your thoughts ?
@slurdge commented on GitHub (Sep 17, 2020):
I did the changes manually on my instance, I can confirm that adding the
OR CONCAT(username, '.seconddomain.com') = '%s'andOR CONCAT(additional_usernames.username, '.seconddomain.com) = '%s'works.I have both domains in the frontend, and receiving/forwarding emails both directly and with subdomains work also.
@willbrowningme commented on GitHub (Sep 18, 2020):
@slurdge Yes you're correct, I have done this manually using
OR, it would be good if this could be automated though as you say. I'll post a full example with multiple domains later for reference.@willbrowningme commented on GitHub (Sep 19, 2020):
A full example with two domains - anonaddy.com and anonaddy.me
@slurdge commented on GitHub (Sep 19, 2020):
Thank you! This is exactly what I did.
@crazy-max in pseudo python code here is what the config.sh script should do:
@crazy-max commented on GitHub (Sep 21, 2020):
@slurdge Has been added to the Docker image, thanks for the tips.
mysql-virtual-alias-domains-and-subdomains.cfmysql-recipient-access-domains-and-additional-usernames.cf@slurdge commented on GitHub (Sep 21, 2020):
@crazy-max Nice. I think the example above is correct but a bug has slipped in the commit, I commented on the commit. Let me know what you think.
@slurdge commented on GitHub (Sep 21, 2020):
I was mistaken, no bug to see!
@willbrowningme commented on GitHub (Oct 9, 2020):
@slurdge @crazy-max I'm looking at updating the query for
mysql-recipient-access-domains-and-additional-usernames.cfto enable the catch-all option for additional usernames and custom domains. I've got a couple of options below:I don't particularly like the repeated
NOT EXISTSquery to check if the alias already exists in the database.This query avoids the repeated check for the existance of the alias and seems to be working after a little testing:
What do you think?
@willbrowningme commented on GitHub (Oct 9, 2020):
I've gone with the second one, this is now live and I'll tag a new release shortly.
@slurdge commented on GitHub (Oct 9, 2020):
Sorry I didn't have time to review, but 2nd one is indeed better 😄
@crazy-max commented on GitHub (Oct 9, 2020):
@willbrowningme v0.5.0 docker image available.
@willbrowningme commented on GitHub (Oct 16, 2020):
The query above introduced a bug for the catch-all domains and additional usernames in v0.5.0. I've just released v0.6.0 which fixes the bug but it does have some breaking changes. Please see the release notes about the new stored procedure that replaces the previous two.
@willbrowningme commented on GitHub (Dec 2, 2020):
Closing this issue for now, the self-hosting instructions have details on how to add another global domain.