Hello,
I would like to add signature for each accounts in my zimbra 8.7 using zmmailbox.
I added sign using this: zmmailbox -z -m account@domain.pl csig test "my sign"
This added sign name "test" with text "my sign". Format is traditional text. I need a html version. How to do it ? Please help,
and my second asking.
How to set sign "test" for new messages , answer and forward and set sign "Below included messages" using CLI (not WebUI) ?
thank you for answer
Best regards,
Adam
Add signature using CLI
- Gren Elliot
- Advanced member
- Posts: 183
- Joined: Tue Jun 10, 2014 4:45 am
Re: Add signature using CLI
Just had a quick platy, and this appears to do the trick (creating an HTML signature and a text downgrade)
Code: Select all
zmsoap -z -type account -m user@example.com CreateSignatureRequest/signature @name="globalSignature" content="<html>from me</html>" @type="text/html"
- fs.schmidt
- Outstanding Member
- Posts: 278
- Joined: Sat Sep 13, 2014 3:37 am
- Location: Brazil
- Contact:
Re: Add signature using CLI
Hi Eliot,
Thanks for sharing, it works for me!
Assuming that the user already has a signature and I want to the new one to be set as the default, would know the soap request to do so?
Best regards.
Thanks for sharing, it works for me!
Assuming that the user already has a signature and I want to the new one to be set as the default, would know the soap request to do so?
Best regards.
- Gren Elliot
- Advanced member
- Posts: 183
- Joined: Tue Jun 10, 2014 4:45 am
Re: Add signature using CLI
You can find out the existing IDs of signatures using:
When you add a new signature, you are told the ID as well.
To find out the current default signature, use:
To set it use:
If you need to know the XML used in the SOAP requests (zmsoap syntax can be a bit unintuitive sometimes), use zmsoap's "-vv" option which increases verbosity.
Code: Select all
zmsoap -z -type account -m gren@yak.fatkudu.co.uk GetSignaturesRequest
<GetSignaturesResponse xmlns="urn:zimbraAccount">
<signature name="globalSignature" id="5e61ac1a-8e39-4eae-831b-7cfec07ed7e5">
<content type="text/html"><html>from me</html></content>
</signature>
</GetSignaturesResponse>
To find out the current default signature, use:
Code: Select all
zmsoap -z -type account -m gren@yak.fatkudu.co.uk GetPrefsRequest/pref @name=zimbraPrefDefaultSignatureId
<GetPrefsResponse xmlns="urn:zimbraAccount">
<pref name="zimbraPrefDefaultSignatureId">5e61ac1a-8e39-4eae-831b-7cfec07ed7e5</pref>
</GetPrefsResponse>
Code: Select all
zmsoap -z -type account -m gren@yak.fatkudu.co.uk ModifyPrefsRequest/pref=5e61ac1a-8e39-4eae-831b-7cfec07ed7e5 @name=zimbraPrefDefaultSignatureId
<ModifyPrefsResponse xmlns="urn:zimbraAccount"/>