Add signature using CLI

Post feedback about our hosted demo or your local install. Tell us what you love and/or what you’d like to see added in the future.
madoch
Posts: 1
Joined: Mon Sep 26, 2016 9:17 pm

Add signature using CLI

Postby madoch » Tue Sep 27, 2016 11:41 am

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) ?

Image


thank you for answer

Best regards,
Adam


User avatar
Gren Elliot
Zimbra Employee
Zimbra Employee
Posts: 174
Joined: Tue Jun 10, 2014 4:45 am

Re: Add signature using CLI

Postby Gren Elliot » Tue Sep 27, 2016 2:42 pm

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"
User avatar
fs.schmidt
Posts: 46
Joined: Sat Sep 13, 2014 3:37 am
Location: Brazil
Contact:

Re: Add signature using CLI

Postby fs.schmidt » Thu Sep 07, 2017 12:41 am

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.
User avatar
Gren Elliot
Zimbra Employee
Zimbra Employee
Posts: 174
Joined: Tue Jun 10, 2014 4:45 am

Re: Add signature using CLI

Postby Gren Elliot » Thu Sep 14, 2017 1:14 pm

You can find out the existing IDs of signatures using:

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">&lt;html>from me&lt;/html></content>
  </signature>
</GetSignaturesResponse>

When you add a new signature, you are told the ID as well.

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>

To set it use:

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"/>

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.

Return to “Users”

Who is online

Users browsing this forum: No registered users and 1 guest