Skip to main content

One Email Signature for the Whole Company in Zimbra, Filled from the Directory

Zimbra keeps signatures in each mailbox, so a company signature usually means a template sent around by email, pasted by each user, and out of date by the next promotion or new phone number. MSH Zimbra Rules adds the signature on the server instead, as the message passes through. One template holds the layout, and the directory fills in each sender's own details. This article sets it up for a whole domain in about fifteen minutes and checks it with a message and a reply between two colleagues.

What you get​

Every message a user sends ends with the company signature, with their own photo, name, job title, company, phone numbers, email and office address:

A message from James Carter to Aisha Okafor in the Classic Zimbra web client, ending with his signature: his photo, James Carter, VP of Customer Experience, Example Software, his phone and mobile numbers, his email address and 200 West Lake Street, Suite 1400, 60606 Chicago

  • Nobody types a signature. Users write their message and click Send. The signature is added on the server, so it is the same in the Zimbra web client, Outlook, Thunderbird and on a phone.
  • The details come from the directory. A new job title or phone number in Zimbra shows up in the signature after the next directory sync, without touching the template.
  • Empty fields disappear. A user without a mobile number gets Phone: alone, not Mobile: with nothing after it.
  • The photo travels with the message. It is attached as an inline image, so the recipient sees it without loading anything from the internet.

What you will build​

PartWhereSetting
Directory syncSettings > Directory ServiceThe users' attributes and photos, synced from Zimbra's LDAP
TemplateContent > TemplatesMade with the Signature wizard, named Company signature
Signature ruleRules > Signature RulesCondition: Message sender in the domain chicago.lan

Before you start​

  • MSH Zimbra Rules 1.4 or later, installed on the Zimbra server, see the installation guide.
  • The directory service configured, see Directory service. Bind with Zimbra's own LDAP account uid=zimbra,cn=admins,cn=zimbra: a restricted account cannot read the photos.
  • The users' details filled in Zimbra: job title, company, phone numbers and address, in the Zimbra administration console or with zmprov. The signature can only show what the directory has.
  • Photos, optional. Users can set their own with the Profile Image zimlet, see Set Your Profile Photo in the Classic Zimbra Web Client.

Step 1 - Sync the directory and check a user​

Log in to the administrator panel at https://<host>:9010, open Settings > Directory Service and click Sync. The directory syncs on its own at 00:00 and 12:00 too. A manual sync brings in the details and photos changed since then, which matters before a test.

Then open Domains, double-click your domain and find a user. The column Used in templates shows what the signature will print for them: the directory value, or the value the user set in Change User Info.

The Directory Service page with the connection to mail.chicago.lan, and the Save Settings, Test Connection and Sync buttons
Step 1 of 4

Click Sync to bring in the latest details and photos from Zimbra.

Step 2 - Build the template with the signature wizard​

Open Content > Templates, click Add Template... and choose Signature wizard.... Name the template Company signature.

The wizard fills every field with its variable, such as {firstName}, {jobTitle} or {mobileNumber}, see Variables. Leave them as they are: they are replaced with each sender's own values when the message is sent. Uncheck a field to leave it out, or type fixed text instead of a variable, for example the company name if the directory does not have it.

Change Photo from {photo} to {photo:80}. {photo} keeps the size of the photo in the directory, often 120 pixels or more, which is large next to the text. {photo:80} makes it 80 pixels wide, see Photo.

On the Design tab choose the font, its size and the two colors: the primary color for the name and the links, the secondary one for the job title. Click Save.

The Templates page with the Add Template menu button
Step 1 of 10

In Content > Templates, open Add Template....

The wizard puts each line in an {#if} block, so a line whose values are all empty is left out, and a line with one of two values shows only that one. Text next to Wizard holds the plain-text version, for mail clients that do not show Html.

Step 3 - Create the signature rule​

Open Rules > Signature Rules and click Add Rule.... On the General tab, name the rule Company signature and leave Active ticked.

On the Signature tab click Choose..., select the template Company signature and click Select.

On the Conditions tab click Add, choose Sender > Sender, then In Domain, and select your domain. Click OK and Save. The rule now adds the signature to every message sent by a user of the domain, to colleagues and to the outside world alike. With more than one domain, add one condition per domain and choose Any condition is met.

The Dashboard of the administrator panel, with Rules in the navigation
Step 1 of 14

Open Rules in the navigation.

Why not All messages?

All messages would match mail that comes in from outside too, and the rule would try to sign it with the details of a sender who is not in the directory: the variables would come out empty. In Domain limits the rule to your own users.

Step 4 - Test it with a message and a reply​

Log in to the Zimbra web client as one user, here James Carter, and send a message to a colleague, here Aisha Okafor. Write no signature. Log in as the colleague: the message ends with James's signature. Reply to it, again without a signature, and look at the reply as James.

A new message from James Carter to aisha.okafor@chicago.lan, Northwind onboarding call, ending with Thanks, James and no signature
Step 1 of 4

Write a message without a signature and click Send.

The same template gave each of them their own details: Aisha's signature has her job title, her phone numbers and her Austin office, James's his Chicago one.

The reply in the Classic web client: Hi James, Wednesday at 2 pm works for me, Aisha, then her signature with her photo and details, then the quoted message from James with his signature

In a reply, the signature goes above the quoted message, where a reader expects it, see Positioning. The quoted message keeps the signature it had, so a long thread collects one signature per message.

Let users correct their own details​

Phone numbers change more often than the directory is updated. With the Change User Info zimlet, users open their name menu in the Zimbra web client and correct their own phone and mobile numbers. New messages use the new values within a minute, while the GAL keeps the directory value, see Change User Info. Which details users may change is set on the User attributes page.

If the signature is not what you expect​

  • No signature at all. The sender is not in the domain of the condition, or the rule is inactive. The Rules tester shows which rules a message matches.
  • The signature has empty lines or missing details. The directory has no value for them. Check Used in templates on the user's page under Domains, and run a sync after changing details in Zimbra.
  • An old photo, or no photo. The photo is read at the directory sync, so a photo changed in the web client shows after the next sync, see Profile Image.
  • A paper clip next to every message. The photo is attached as an inline image, and some mail clients show a paper clip for it. That is how the recipient gets the photo without loading it from the internet, see Templates.
  • A signed or encrypted message has no signature. Signature rules leave such messages untouched, since a change would break the digital signature, see Signature rules.
  • Users still add their own signature. Then messages end with two. Ask users to clear the signature in Preferences > Signatures of the web client and in their other mail clients.

Want to try it on your own server? Start a free trial.