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

/apple URL does not work #5

Closed
joshms123 opened this issue Aug 30, 2022 · 21 comments
Closed

/apple URL does not work #5

joshms123 opened this issue Aug 30, 2022 · 21 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@joshms123
Copy link

Hello,
When navigating to /apple or /dns-zone, the application just returns 404 not found; however when navigating to mobile config (with email filled in) it downloads the profile.

@williamdes
Copy link
Member

Hi @joshms123
Indeed, I did not release this yet
I will try to release it today

@williamdes williamdes self-assigned this Aug 30, 2022
@williamdes williamdes added the documentation Improvements or additions to documentation label Aug 30, 2022
@williamdes
Copy link
Member

I deployed this on an edge version:

docker pull ghcr.io/wdes/mail-autodiscover-autoconfig/mail-autodiscover-autoconfig:edge

@joshms123
Copy link
Author

Hello, I don't seem to have access to that package. Thank you for the help so far.

@williamdes
Copy link
Member

williamdes commented Sep 1, 2022

I don't seem to have access to that package

You need to use

# docker login ghcr.io
username: joshms123
password: githubPasswordOrUserToken

I deployed this on my server and I have a minor UI improvement to do before releasing the final version

@joshms123
Copy link
Author

I did login and it just displayed access denied. When I navigate to the packages page, it does show the deployment but when I navigate to said deployment it says 0 packages.

@williamdes
Copy link
Member

I did login and it just displayed access denied.

Do you mean at the login stage ?
I did create a token at https://github.com/settings/tokens with read:packages and used it as a password

@williamdes
Copy link
Member

Oops: it's docker login ghcr.io

@joshms123
Copy link
Author

Yes; I've also tested by pulling another public GHCR package and that worked.

@williamdes
Copy link
Member

Here is part of my production docker-compose

    mail-autodiscover-autoconfig:
        #image: wdes/mail-autodiscover-autoconfig:latest
        image: ghcr.io/wdes/mail-autodiscover-autoconfig/mail-autodiscover-autoconfig:edge
        mem_limit: 120M
        mem_reservation: 50M
        restart: on-failure:40
        network_mode: host
        environment:
            ROCKET_PROFILE: production
            ROCKET_ADDRESS: "2a10:4646:xxx::xxx"
            ROCKET_PORT: "80"
            ROCKET_LOG_LEVEL: normal
            APPLE_MAIL_UUID: ccf622ec-1905-4c60-xxx-4fa1455cbee4
            APPLE_PROFILE_UUID: 1ceeceea-bc41-4131-xxx-f8b13e429cb3
            CUSTOM_DOMAINS: xxx.xxx
            IMAP_HOSTNAME: imap.xxx.xxx.xxx
            POP_HOSTNAME: pop.xxx.xxx.xxx
            SMTP_HOSTNAME: smtp.xxx.xxx.xxx

How is yours ?

@joshms123
Copy link
Author

joshms123 commented Sep 1, 2022

services:
  mail-acd:
    image: ghcr.io/wdes/mail-autodiscover-autoconfig/mail-autodiscover-autoconfig:edge

@williamdes
Copy link
Member

Okay I got it, it was private..
Sorry for the mistake
Let me know how the Apple page works out

@joshms123
Copy link
Author

That now all works. However, seems I've ran into another issue. Even though in the env my IMAP_HOSTNAME is set to a custom server, it seems to default back to imap.domain.tld (only tested in the config-v1.1.xml so far). Would you like me to move this to a new issue?

@williamdes
Copy link
Member

Did you add it to CUSTOM_DOMAINS by mistake ?

@joshms123
Copy link
Author

joshms123 commented Sep 1, 2022

My config is as follows:

      CUSTOM_DOMAINS: domain.tld
      IMAP_HOSTNAME: mail.provider.tld
      POP_HOSTNAME: mail.provider.tld
      SMTP_HOSTNAME: mail.provider.tld

However, it seems to come back with imap.domain.tld instead of mail.provider.tld. Also just read through the output of apple xml config and it has the same issue.

@williamdes
Copy link
Member

williamdes commented Sep 1, 2022

Hmm, what are your front end domains?

This may be related to #3

This is how it currently works:

  • CUSTOM_DOMAINS is for you to have nothing to configure and it will use imap, smtp, pop sub domains of the domain(s) you put in CUSTOM_DOMAINS
  • all other domains will all have IMAP_HOSTNAME, SMTP_HOSTNAME, POP_HOSTNAME values returned

The domain from where you access the server will make all the magic. It's very important that you get the configuration right

How did you configure all this?
Normally you should have a server running
A DNS record domain.tld pointing to the server
Another one (provider.tld) also pointing to the server or CNAMEing the other domain

@joshms123
Copy link
Author

Hello,
In my custom domains, I have my website domain (domain.tld) that is the domain of e-mail addresses (E.G: [email protected]).
In my imap, smtp and pop vars I have the domain of my email provider (mail.mymailcheap.com).
It seems to just return as you said (imap,pop,smtp).domain.tld where as I'd need it to return the provider addresses while using the [email protected].
Hope this makes sense.

@williamdes
Copy link
Member

Hello, In my custom domains, I have my website domain (domain.tld) that is the domain of e-mail addresses (E.G: [email protected]). In my imap, smtp and pop vars I have the domain of my email provider (mail.mymailcheap.com). It seems to just return as you said (imap,pop,smtp).domain.tld where as I'd need it to return the provider addresses while using the [email protected]. Hope this makes sense.

Hello

If I understand this correctly your domain must not be in CUSTOM_DOMAINS because it has to have IMAP_HOSTNAME and other ENVs applied. Remove it and try once more, it should work better ;)

I think I will implement a config file soon, it's not easy for people to understand how I currently made this work

If I would make a configuration to explain the setup file it would look like

[*]
imap = $IMAP_HOSTNAME
smtp = $SMTP_HOSTNAME
pop = $POP_HOSTNAME

# For each CUSTOM_DOMAINS as $CUSTOM_DOMAIN
[$CUSTOM_DOMAIN]
imap = imap.$CUSTOM_DOMAIN
smtp = smtp.$CUSTOM_DOMAIN
pop = pop.$CUSTOM_DOMAIN

This is what this code does: https://github.com/wdes/mail-autodiscover-autoconfig/blob/main/src/util.rs#L12-L40

So your autoconfig and autodiscover DNS fields should point to the server that hosts this node.
And then all requests done with softwares will end up in https://autoconfig.domain.tld and then the service will detect that it needs to apply ENVs or the imap,pop,smtp.domain.tld syntaxes based on if it is present in CUSTOM_DOMAINS

Off topic: What do you think about this config file structure ?

@joshms123
Copy link
Author

Hello,
That makes perfect sense; having that documented would definitely help. So what would I put in place? I tried just removing it from my compose, but it panics because that var isn't set. I have replaced it with a placeholder and that does seem to work, but it might be worth documenting what to put in place (or just having the software use an empty default if that is not set).

@williamdes
Copy link
Member

Hello, That makes perfect sense; having that documented would definitely help. So what would I put in place? I tried just removing it from my compose, but it panics because that var isn't set. I have replaced it with a placeholder and that does seem to work, but it might be worth documenting what to put in place (or just having the software use an empty default if that is not set).

I had tried to document that with a comment on my example ENV but it really needs to be changed and have a real configuration file that does not need paragraphs to be understood ^^

You can put an empty string it should define the ENV
Anyway, I will patch the code to be more tolerent when the CUSTOM_DOMAINS ENV does not exist so it does not panic.

@williamdes williamdes added the bug Something isn't working label Sep 1, 2022
@williamdes
Copy link
Member

williamdes commented Sep 4, 2022

All the changes discussed above are pushed, built and ready on the edge version.
Let me know how it works for you, and then I may proceed to a release

@williamdes williamdes changed the title URLs don't work /apple URL does not work Sep 4, 2022
@williamdes
Copy link
Member

I just published v1.5.0 🎉
Let me know if there is more to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants