I’m trying to figure out how to send PGP encrypted and signed emails when creating a ticket / article via the Zammad API.
In my setup, the default agent setting for outgoing emails is configured to “PGP signed + encrypted.” When I create an email via the UI, those options are automatically checked and everything works as expected — the outgoing message is signed and encrypted.
However, when I create a ticket (and article) via the API on behalf of an agent, the message is sent successfully, but it’s neither encrypted nor signed.
I’ve looked through the API documentation, but I couldn’t find any parameter or option that would allow enabling encryption or signing for the article when it’s created.
Is there a way to enable PGP encryption and signing when creating tickets or articles via the API?
If not, is there perhaps a workaround (e.g., setting specific headers, using a different endpoint, or mimicking the UI behavior somehow)?
That was actually the first thing I tried as well. After replicating the PUT request that the UI sends, i added something like this to the article payload:
In theory, this looks fine — the ticket even shows the encryption checkmark. However, the email isn’t actually delivered; after 1–2 minutes, the ticket shows this error:
Delivery failed: Unable to send email to 'x@x.de': Can't use Channel::Driver::Smtp: #<NoMethodError: undefined method `[]' for nil:NilClass>
So I don’t think this hacky approach is the right way. I’m currently digging through the repo to see if there’s a proper API input for these PGP settings — but it’s a lot of code to navigate when you’re new to it. If I find something before anyone else does, I’ll share it here — and of course, I’d be happy for any hints in the meantime!