aboutsummaryrefslogtreecommitdiff
path: root/src/mail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail.c')
-rw-r--r--src/mail.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mail.c b/src/mail.c
index 3328850..39dfe08 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -685,3 +685,48 @@ notify (struct notification *notification_list,
do_notify (trp, ev, p);
/* FIXME */
}
+
+const char *
+expand_email_admin (struct metadef *def, void *data)
+{
+ size_t size;
+ if (mu_address_to_string (admin_address, NULL, 0, &size) == 0)
+ {
+ size++;
+ def->storage = xmalloc (size);
+ mu_address_to_string (admin_address, def->storage, size, NULL);
+ def->value = def->storage;
+ }
+ else
+ def->value = "";
+ return def->value;
+}
+
+const char *
+expand_email_owner (struct metadef *def, void *data)
+{
+ struct file_triplet *trp = data;
+ mu_address_t addr;
+ const char *errp;
+ size_t size;
+
+ addr = get_recipient (trp->spool->dictionary[project_owner_dict],
+ trp, &errp);
+ if (!addr)
+ {
+ logmsg (LOG_ERR, _("cannot get email of the %s's owner: %s"),
+ trp->project, gettext (errp));
+ def->value = "";
+ }
+ else if (mu_address_to_string (addr, NULL, 0, &size) == 0)
+ {
+ size++;
+ def->storage = xmalloc (size);
+ mu_address_to_string (addr, def->storage, size, NULL);
+ def->value = def->storage;
+ mu_address_destroy (&addr);
+ }
+ else
+ def->value = "";
+ return def->value;
+}

Return to:

Send suggestions and report system problems to the System administrator.