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

Feature Request- Configuration File example #13

Closed
bigjdunham opened this issue Feb 4, 2022 · 6 comments
Closed

Feature Request- Configuration File example #13

bigjdunham opened this issue Feb 4, 2022 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@bigjdunham
Copy link

bigjdunham commented Feb 4, 2022

Since I'm a relative noob to writing config files for docker containers it would be nice to have an example of /etc/mailrise.conf to work from. So I could cut down some different errors of syntax, etc... Thanks for making such a great project!

@YoRyan YoRyan added the documentation Improvements or additions to documentation label Feb 5, 2022
@YoRyan YoRyan self-assigned this Feb 5, 2022
@YoRyan
Copy link
Owner

YoRyan commented Feb 5, 2022

Yes, it's a lot of information to take in at once. Let's see if I can help.

mailrise.conf is based on the Apprise YAML format. It is a hierarchy of multiple concepts:

  1. mailrise.conf has one or more...
  2. Mailrise address, which has exactly one...
  3. Apprise configuration file, which has one or more...
  4. Apprise URL, which can also have some global parameters

You take the Apprise YAML configuration, indent it by a couple of blocks, and stick it under configs.<Mailrise address>. To take an example from the Apprise wiki, which contains three URL's:

urls:
  - xml://localhost
  - json://localhost
  - kodi://user:pass@myserver

becomes:

configs:
  mytestaddress:
    urls:
      - xml://localhost
      - json://localhost
      - kodi://user:pass@myserver

And you can use this endpoint by emailing mytestaddress@mailrise.xyz. (In the Apprise wiki you'll read a lot about "tags" for selecting subsets of URL's, but Mailrise does not support them. Just use multiple addresses.)

Once you have written your configuration file, you'll have to pass it through to the Docker container. With the CLI, you can use the bind mount (-v) option:

docker run -it -p 25:8025 -v /path/to/my/mailrise.conf:/etc/mailrise.conf:ro yoryan/mailrise

Or with Docker Compose you can specify it in YAML:

  mailrise:
    image: yoryan/mailrise
    container_name: mailrise
    restart: unless-stopped
    volumes:
      - ./mailrise.conf:/etc/mailrise.conf:ro

I hope this helps! If it did clarify things for you, I would be happy to add this information to the Readme, to help out everyone else.

@g4m3r7ag
Copy link

I assume you also need a local DNS entry for mailrise.xyz to direct to the host running the container? I didn't see that anywhere in the documentation.

@YoRyan
Copy link
Owner

YoRyan commented Apr 28, 2022

I assume you also need a local DNS entry for mailrise.xyz to direct to the host running the container? I didn't see that anywhere in the documentation.

Nope, you don't need to do anything with DNS. You set Mailrise as your SMTP forwarder, so it receives all (or a portion of if you configure your mail daemon appropriately) your emails and sends Apprise notifications instead of following the normal email routing rules. The @mailrise.xyz address format is just a convention that makes it clear these addresses are not usable on the Internet. But if you look at the configuration format, you'll see that you can use any domain as a Mailrise address.

@g4m3r7ag
Copy link

g4m3r7ag commented May 5, 2022

I'm sorry, I need some more clarification on how to modify the domain. I originally tried

configs.mydomain.com:
  notifications:
    urls:
      - discord://webhookid/webhooktoken/

With the expected recipient address to be notifications@mydomain.com

Then realized that the name cannot include a period, however it says it can include a full email address, which is contradicting because that will contain a period but I tried

configs.notifications@mydomain.com:
  notifications:
    urls:
      - discord://webhookid/webhooktoken/

That also did not work. I don't understand how you can change the domain with the config name and not include a period at the same time? In both of the above instances the container was logging

[2022-05-05 06:08:19] CRITICAL:mailrise.skeleton:Error loading configuration file: 'configs' node not a mapping

@YoRyan
Copy link
Owner

YoRyan commented May 5, 2022

You want the top-level configs key to be a dictionary itself, so your syntax should be:

configs:
  notifications@mydomain.com:
    urls:
      - discord://webhookid/webhooktoken/

If you're not familiar with YAML, you can use an online parser to help you out.

The ability to use a full email address as the key supersedes the prohibition against periods (I suppose that is a little confusing).

@g4m3r7ag
Copy link

g4m3r7ag commented May 5, 2022

Yea that makes sense, I was just trying to follow the documentation literally, which I guess is what I get for trying to configure this as 2AM. Thank you.

image

@YoRyan YoRyan closed this as completed in 15abbde Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants