I’m adding a DKIM (the domain already exists) with the API call:

const response = await fetch(`${process.env.MAILCOW_API_HOST}/api/v1/add/dkim`, {
	method: 'post',
	headers: {
		"Content-Type":"application/json",
		"X-API-Key": process.env.MAILCOW_API_KEY
	},
	body: JSON.stringify({
		"dkim_selector": "dkim",
		domain,
		"key_size": "2048"
	})
});

const result = await response.json();
console.log('addDKIM', { domain }, result);

I get the result:

{ type: 'success', msg: 'Task completed' }

But when I try to get the key with an API call, or if I try to look for it in web UI, I get nothing, it’s not there.

Logs don’t reveal a lot at INFO level:

# docker logs mailcowdockerized-dockerapi-mailcow-1
INFO:     172.22.1.9:36214 - "GET /host/stats HTTP/1.1" 200 OK
INFO:     172.22.1.9:36234 - "GET /host/stats HTTP/1.1" 200 OK
INFO:     172.22.1.9:33606 - "GET /host/stats HTTP/1.1" 200 OK

I haven’t debugged further, I’m sure I could find the reason If I search more…

But seems like something’s wrong. It should not return success if the key is not created.

  • My API call was wrong. 😒

Please open such issues on Github.

  • ile likes this.

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

My API call was wrong. 😒

No one is typing