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

Doc Request: smtp forwarding and API V2 #36

Closed
jstockho opened this issue Feb 18, 2015 · 2 comments
Closed

Doc Request: smtp forwarding and API V2 #36

jstockho opened this issue Feb 18, 2015 · 2 comments
Assignees

Comments

@jstockho
Copy link

Let me start by saying I love mailhog. I just found it and got it up and running in no time. Great work! I'd like to take advantage of the feature to forward messages to an SMTP server, but I don't know how to set that up. I didn't see it in the CONFIG.md file. I don't know Go (I'm a Java dev), but I found the following snippet in the config.go file from the Server repo:

flag.StringVar(&cfg.OutgoingSMTPFile, "outgoing-smtp", envconf.FromEnvP("MH_OUTGOING_SMTP", "").(string), "JSON file containing outgoing SMTP servers")

So, I know I need a file with JSON, but what is the expected format?

Also, I noticed that when using the web client I could see the API calls to the server, which is cool, but I noticed that it uses v2. The docs are still for v1. I think I can get most of what I need from the server output, but I was wondering if there were other nuggets of gold I hadn't discovered. For example, the docs don't cover search requests, but I was able to see them when using the search feature in the UI.

If you could update the docs to include the above information, that would be awesome.

Thanks!

@ian-kent
Copy link
Member

Yeah the documentation could be a lot better 😄 I'll hopefully get around to updating it this weekend! I think you've found everything though!

The SMTP auth stuff is very briefly documented here. Summary is - you can configure via the UI and reuse the config later in the same session, but it doesn't get persisted. You can specify a JSON file (so they're always available), but they can't be modified in the UI. Basically, the SMTP AUTH stuff is all a bit hacked in because I wasn't entirely sure about the use case for it!

The JSON file format is based on this, so something along the lines of:

{
    "server name": {
        "name": "server name",
        "host": "...",
        "port": 587,
        "username": "...",
        "password": "...",
        "mechanism": "PLAIN",
    }
}

not sure what logic was behind me requiring server name twice - or if its even used - this is where documenting it would have helped 😉

@jstockho
Copy link
Author

Thanks for getting back to me. I got it working.

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

No branches or pull requests

2 participants