Sign DKIM on all domains with keys automatically

IIPoliII

New Member
Jul 21, 2021
1
0
1
20
Hey Guys,
I am testing around Proxmox MGA and it's awesome.
But I hit a wall.

I want to DKIM sign some domains, but without needing to fill the list up.
However when I use "Sign all outgoing mails" it signs it even for domains without DKIM (okay it's logical all is all).
Here is my issue in the case it signs on a domain that doesn't have the DKIM configured, the mail never arrives.

So here is my question.
Can I sign domains only having the key without adding them to the list?

Thanks for your help!
 

aaron

Proxmox Staff Member
Staff member
Jun 3, 2019
2,236
301
88
Can I sign domains only having the key without adding them to the list?
As in, first check if the key is configured in the DNS record for that domain? No. That's what the list is for ;)

I want to DKIM sign some domains, but without needing to fill the list up.
I assume that the list is very long in your case and that's why you don't want to do it?

You could script adding them to the list. Have a look at the API for the DKIM domain list (POST). You can use the integrated pmgsh tool to interact with the API after you logged in via SSH to the PMG.

The API viewer already shows you how to call the command with pmgsh:
Code:
pmgsh create /config/dkim/domains

With the parameters, it would look like this:
Code:
pmgsh create /config/dkim/domains --domain <new domain to be added>
Wrapping this in some for loop and you should be good.

If you want to interact with the API from outside via HTTTP, check out the description for Proxmox VE API. It is also valid for PMG.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!