Sign DKIM on all domains with keys automatically

IIPoliII

Member
Jul 21, 2021
4
0
6
22
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!
 
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.
 
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 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.
Thanks for your reply, I tried this solution however it can't work for me as the scripts that directadmin uses aren't available when you disable dkim.

Is there not a way to check if the dkim is present in the domain before sending the mail and if not it doesn't sign it and if yes it signs it?
 

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 yours easily in our online shop.

Buy now!