-/* $Cambridge: exim/src/src/deliver.c,v 1.45 2007/08/22 14:20:28 ph10 Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.46 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
RDO_REWRITE,
NULL, /* No :include: restriction (not used in filter) */
NULL, /* No sieve vacation directory (not sieve!) */
+ NULL, /* No sieve enotify mailto owner (not sieve!) */
NULL, /* No sieve user address (not sieve!) */
NULL, /* No sieve subaddress (not sieve!) */
&ugid, /* uid/gid data */
-/* $Cambridge: exim/src/src/filtertest.c,v 1.10 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/filtertest.c,v 1.11 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
else
{
yield = (filter_type == FILTER_SIEVE)?
- sieve_interpret(filebuf, RDO_REWRITE, NULL, NULL, NULL, &generated, &error)
+ sieve_interpret(filebuf, RDO_REWRITE, NULL, NULL, NULL, NULL, &generated, &error)
:
filter_interpret(filebuf, RDO_REWRITE, &generated, &error);
}
-/* $Cambridge: exim/src/src/functions.h,v 1.42 2008/06/04 13:28:23 michael Exp $ */
+/* $Cambridge: exim/src/src/functions.h,v 1.43 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
extern int recv_line(int, uschar *, int);
#endif
extern int rda_interpret(redirect_block *, int, uschar *, uschar *,
- uschar *, uschar *, ugid_block *, address_item **, uschar **,
- error_block **, int *, uschar *);
+ uschar *, uschar *, uschar *, ugid_block *, address_item **,
+ uschar **, error_block **, int *, uschar *);
extern int rda_is_filter(const uschar *);
extern BOOL readconf_depends(driver_instance *, uschar *);
extern void readconf_driver_init(uschar *, driver_instance **,
extern void sha1_mid(sha1 *, const uschar *);
extern void sha1_start(sha1 *);
extern int sieve_interpret(uschar *, int, uschar *, uschar *, uschar *,
- address_item **, uschar **);
+ uschar *, address_item **, uschar **);
extern void sigalrm_handler(int);
extern BOOL smtp_buffered(void);
extern void smtp_closedown(uschar *);
-/* $Cambridge: exim/src/src/rda.c,v 1.14 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/rda.c,v 1.15 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
options the options bits
include_directory restrain to this directory
sieve_vacation_directory passed to sieve_interpret
+ sieve_enotify_mailto_owner passed to sieve_interpret
sieve_useraddress passed to sieve_interpret
sieve_subaddress passed to sieve_interpret
generated where to hang generated addresses
static int
rda_extract(redirect_block *rdata, int options, uschar *include_directory,
- uschar *sieve_vacation_directory, uschar *sieve_useraddress,
- uschar *sieve_subaddress, address_item **generated, uschar **error,
- error_block **eblockp, int *filtertype)
+ uschar *sieve_vacation_directory, uschar *sieve_enotify_mailto_owner,
+ uschar *sieve_useraddress, uschar *sieve_subaddress,
+ address_item **generated, uschar **error, error_block **eblockp,
+ int *filtertype)
{
uschar *data;
return FF_ERROR;
}
frc = sieve_interpret(data, options, sieve_vacation_directory,
- sieve_useraddress, sieve_subaddress, generated, error);
+ sieve_enotify_mailto_owner, sieve_useraddress, sieve_subaddress,
+ generated, error);
}
expand_forbid = old_expand_forbid;
options options to pass to the extraction functions,
plus ENOTDIR and EACCES handling bits
include_directory restrain :include: to this directory
- sieve_vacation_directory directory passed to sieve_interpret()
+ sieve_vacation_directory directory passed to sieve_interpret
+ sieve_enotify_mailto_owner passed to sieve_interpret
sieve_useraddress passed to sieve_interpret
sieve_subaddress passed to sieve_interpret
ugid uid/gid to run under - if NULL, no change
int
rda_interpret(redirect_block *rdata, int options, uschar *include_directory,
- uschar *sieve_vacation_directory, uschar *sieve_useraddress,
- uschar *sieve_subaddress, ugid_block *ugid, address_item **generated,
- uschar **error, error_block **eblockp, int *filtertype, uschar *rname)
+ uschar *sieve_vacation_directory, uschar *sieve_enotify_mailto_owner,
+ uschar *sieve_useraddress, uschar *sieve_subaddress, ugid_block *ugid,
+ address_item **generated, uschar **error, error_block **eblockp,
+ int *filtertype, uschar *rname)
{
int fd, rc, pfd[2];
int yield, status;
Ustrstr(data, ":include:") == NULL)) /* and there's no :include: */
{
return rda_extract(rdata, options, include_directory,
- sieve_vacation_directory, sieve_useraddress, sieve_subaddress,
- generated, error, eblockp, filtertype);
+ sieve_vacation_directory, sieve_enotify_mailto_owner, sieve_useraddress,
+ sieve_subaddress, generated, error, eblockp, filtertype);
}
/* We need to run the processing code in a sub-process. However, if we can
/* Now do the business */
yield = rda_extract(rdata, options, include_directory,
- sieve_vacation_directory, sieve_useraddress, sieve_subaddress, generated,
- error, eblockp, filtertype);
+ sieve_vacation_directory, sieve_enotify_mailto_owner, sieve_useraddress,
+ sieve_subaddress, generated, error, eblockp, filtertype);
/* Pass back whether it was a filter, and the return code and any overall
error text via the pipe. */
-/* $Cambridge: exim/src/src/routers/queryprogram.c,v 1.10 2007/01/08 10:50:20 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/queryprogram.c,v 1.11 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
RDO_REWRITE, /* rewrite generated addresses */
NULL, /* :include: directory not relevant */
NULL, /* sieve vacation directory not relevant */
+ NULL, /* sieve enotify mailto owner not relevant */
NULL, /* sieve useraddress not relevant */
NULL, /* sieve subaddress not relevant */
&ugid, /* uid/gid (but not set) */
-/* $Cambridge: exim/src/src/routers/redirect.c,v 1.20 2007/01/08 10:50:20 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/redirect.c,v 1.21 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
(void *)offsetof(redirect_router_options_block, sieve_useraddress) },
{ "sieve_vacation_directory", opt_stringptr,
(void *)offsetof(redirect_router_options_block, sieve_vacation_directory) },
+ { "sieve_enotify_mailto_owner", opt_stringptr,
+ (void *)offsetof(redirect_router_options_block, sieve_enotify_mailto_owner) },
{ "skip_syntax_errors", opt_bool,
(void *)offsetof(redirect_router_options_block, skip_syntax_errors) },
#ifdef EXPERIMENTAL_SRS
NULL, /* sieve_subaddress */
NULL, /* sieve_useraddress */
NULL, /* sieve_vacation_directory */
+ NULL, /* sieve_enotify_mailto_owner */
NULL, /* syntax_errors_text */
NULL, /* syntax_errors_to */
NULL, /* qualify_domain */
}
frc = rda_interpret(&redirect, options, ob->include_directory,
- ob->sieve_vacation_directory, ob->sieve_useraddress, ob->sieve_subaddress,
- &ugid, &generated, &(addr->message), ob->skip_syntax_errors? &eblock : NULL,
- &filtertype, string_sprintf("%s router (recipient is %s)", rblock->name,
- addr->address));
+ ob->sieve_vacation_directory, ob->sieve_enotify_mailto_owner,
+ ob->sieve_useraddress, ob->sieve_subaddress, &ugid, &generated,
+ &(addr->message), ob->skip_syntax_errors? &eblock : NULL, &filtertype,
+ string_sprintf("%s router (recipient is %s)", rblock->name, addr->address));
qualify_domain_recipient = save_qualify_domain_recipient;
-/* $Cambridge: exim/src/src/routers/redirect.h,v 1.9 2007/01/08 10:50:20 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/redirect.h,v 1.10 2008/12/18 13:13:54 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *sieve_subaddress;
uschar *sieve_useraddress;
uschar *sieve_vacation_directory;
+ uschar *sieve_enotify_mailto_owner;
uschar *syntax_errors_text;
uschar *syntax_errors_to;
uschar *qualify_domain;
-/* $Cambridge: exim/src/src/sieve.c,v 1.35 2008/11/18 11:10:43 michael Exp $ */
+/* $Cambridge: exim/src/src/sieve.c,v 1.36 2008/12/18 13:13:53 michael Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
int require_enotify;
struct Notification *notified;
#endif
+ uschar *enotify_mailto_owner;
#ifdef SUBADDRESS
int require_subaddress;
#endif
else if (eq_octet(check,&str_envelope_auth,0)) filter->require_envelope_auth=1;
#endif
#ifdef ENOTIFY
- else if (eq_octet(check,&str_enotify,0)) filter->require_enotify=1;
+ else if (eq_octet(check,&str_enotify,0))
+ {
+ if (filter->enotify_mailto_owner == NULL)
+ {
+ filter->errmsg=CUS "enotify disabled";
+ return -1;
+ }
+ filter->require_enotify=1;
+ }
#endif
#ifdef SUBADDRESS
else if (eq_octet(check,&str_subaddress,0)) filter->require_subaddress=1;
filter points to the entire file, read into store as a single string
options controls whether various special things are allowed, and requests
special actions (not currently used)
- sieve_vacation_directory where to store vacation "once" files
+ vacation_directory where to store vacation "once" files
+ enotify_mailto_owner owner of mailto notifications
useraddress string expression for :user part of address
subaddress string expression for :subaddress part of address
generated where to hang newly-generated addresses
int
sieve_interpret(uschar *filter, int options, uschar *vacation_directory,
- uschar *useraddress, uschar *subaddress, address_item **generated, uschar **error)
+ uschar *enotify_mailto_owner, uschar *useraddress, uschar *subaddress,
+ address_item **generated, uschar **error)
{
struct Sieve sieve;
int r;
}
}
+if (enotify_mailto_owner == NULL)
+ sieve.enotify_mailto_owner = NULL;
+else
+ {
+ sieve.enotify_mailto_owner=expand_string(enotify_mailto_owner);
+ if (sieve.enotify_mailto_owner == NULL)
+ {
+ *error = string_sprintf("failed to expand \"%s\" "
+ "(sieve_enotify_mailto_owner): %s", enotify_mailto_owner,
+ expand_string_message);
+ return FF_ERROR;
+ }
+ }
+
sieve.useraddress = useraddress == NULL ? CUS "$local_part_prefix$local_part$local_part_suffix" : useraddress;
sieve.subaddress = subaddress;