-/* $Cambridge: exim/src/src/expand.c,v 1.20 2005/04/28 13:29:27 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.25 2005/06/13 13:37:39 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
{ "caller_uid", vtype_uid, &real_uid },
{ "compile_date", vtype_stringptr, &version_date },
{ "compile_number", vtype_stringptr, &version_cnumber },
+ { "csa_status", vtype_stringptr, &csa_status },
#ifdef WITH_OLD_DEMIME
{ "demime_errorlevel", vtype_int, &demime_errorlevel },
{ "demime_reason", vtype_stringptr, &demime_reason },
{ "sender_host_name", vtype_host_lookup, NULL },
{ "sender_host_port", vtype_int, &sender_host_port },
{ "sender_ident", vtype_stringptr, &sender_ident },
+ { "sender_rate", vtype_stringptr, &sender_rate },
+ { "sender_rate_limit", vtype_stringptr, &sender_rate_limit },
+ { "sender_rate_period", vtype_stringptr, &sender_rate_period },
{ "sender_rcvhost", vtype_stringptr, &sender_rcvhost },
{ "sender_verify_failure",vtype_stringptr, &sender_verify_failure },
{ "smtp_active_hostname", vtype_stringptr, &smtp_active_hostname },
if (*ss == NULL && deliver_datafile >= 0) /* Read body when needed */
{
uschar *body;
- int start_offset = SPOOL_DATA_START_OFFSET;
+ off_t start_offset = SPOOL_DATA_START_OFFSET;
int len = message_body_visible;
if (len > message_size) len = message_size;
*ss = body = store_malloc(len+1);
cond_type = chop_match(name, cond_table, sizeof(cond_table)/sizeof(uschar *));
switch(cond_type)
{
- /* def: tests for a non-zero or non-NULL variable, or for an existing
- header */
+ /* def: tests for a non-empty variable, or for the existence of a header. If
+ yield == NULL we are in a skipping state, and don't care about the answer. */
case ECOND_DEF:
if (*s != ':')
(find_header(name, TRUE, NULL, FALSE, NULL) != NULL) == testfor;
}
- /* Test for a variable's having a non-empty value. If yield == NULL we
- are in a skipping state, and don't care about the answer. */
+ /* Test for a variable's having a non-empty value. A non-existent variable
+ causes an expansion failure. */
else
{
string_sprintf("unknown variable \"%s\" after \"def:\"", name);
return NULL;
}
- if (yield != NULL)
- *yield = (value[0] != 0 && Ustrcmp(value, "0") != 0) == testfor;
+ if (yield != NULL) *yield = (value[0] != 0) == testfor;
}
return s;
goto RETURN;
}
+/* The first following string must be braced. */
+
+if (*s++ != '{') goto FAILED_CURLY;
+
/* Expand the first substring. Forced failures are noticed only if we actually
want this string. Set skipping in the call in the fail case (this will always
be the case if we were already skipping). */
-sub1 = expand_string_internal(s+1, TRUE, &s, !yes);
+sub1 = expand_string_internal(s, TRUE, &s, !yes);
if (sub1 == NULL && (yes || !expand_string_forcedfail)) goto FAILED;
expand_string_forcedfail = FALSE;
if (*s++ != '}') goto FAILED_CURLY;
if (*p == 0)
{
- expand_string_message = US"first argument of \"expand\" must not "
- "be empty";
+ expand_string_message = US"first argument of \"extract\" must "
+ "not be empty";
goto EXPAND_FAILED;
}
smode[10] = 0;
s = string_sprintf("mode=%04lo smode=%s inode=%ld device=%ld links=%ld "
- "uid=%ld gid=%ld size=%ld atime=%ld mtime=%ld ctime=%ld",
+ "uid=%ld gid=%ld size=%.30g atime=%ld mtime=%ld ctime=%ld",
(long)(st.st_mode & 077777), smode, (long)st.st_ino,
(long)st.st_dev, (long)st.st_nlink, (long)st.st_uid,
- (long)st.st_gid, (long)st.st_size, (long)st.st_atime,
+ (long)st.st_gid, (double)st.st_size, (long)st.st_atime,
(long)st.st_mtime, (long)st.st_ctime);
yield = string_cat(yield, &size, &ptr, s, Ustrlen(s));
continue;