aboutsummaryrefslogtreecommitdiff
path: root/src/mail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail.c')
-rw-r--r--src/mail.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/mail.c b/src/mail.c
index 5065306..beb88d4 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -260,8 +260,33 @@ mail_stats ()
}
mu_address_t
+get_uploader_email (struct uploader_info *info, struct file_triplet *trp,
+ const char **errp)
+{
+ mu_address_t addr;
+ mu_address_t rcpt = NULL;
+ int rc;
+
+ rc = mu_address_create (&addr, info->email);
+ if (rc)
+ {
+ *errp = mu_strerror (rc);
+ return NULL;
+ }
+
+ mu_address_set_personal (addr, 1, info->realname);
+
+ /* This hack makes sure that mu_address_to_string (rcpt) will
+ return full email address (with personal part) */
+ mu_address_union (&rcpt, addr);
+ mu_address_destroy (&addr);
+
+ return rcpt;
+}
+
+mu_address_t
get_recipient (struct access_method *method, struct file_triplet *trp,
- char **errp)
+ const char **errp)
{
unsigned nrows, ncols, i;
mu_address_t rcpt = NULL;
@@ -327,7 +352,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
struct notification *ntf)
{
mu_address_t rcpt = NULL;
- char *errp;
+ const char *errp;
switch (ntf->tgt)
{
case notify_admin:
@@ -335,8 +360,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
break;
case notify_user:
- rcpt = get_recipient (trp->spool->access_method[user_data_method],
- trp, &errp);
+ rcpt = get_uploader_email (trp->uploader, trp, &errp);
break;
case notify_owner:
@@ -387,7 +411,6 @@ notify (struct notification *notification_list,
{
struct notification *p;
- fill_project_name (trp);
for (p = notification_list; p; p = p->next)
if (p->ev == ev)
do_notify (trp, ev, p);

Return to:

Send suggestions and report system problems to the System administrator.