-/* $Cambridge: exim/src/src/expand.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.7 2004/11/18 11:17:33 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
vtype_reply, /* value not used; get reply from headers */
vtype_pid, /* value not used; result is pid */
vtype_host_lookup, /* value not used; get host name */
- vtype_load_avg /* value not used; result is int from os_getloadavg */
+ vtype_load_avg, /* value not used; result is int from os_getloadavg */
+ vtype_pspace, /* partition space; value is T/F for spool/log */
+ vtype_pinodes /* partition inodes; value is T/F for spool/log */
};
/* This table must be kept in alphabetical order. */
{ "local_user_gid", vtype_gid, &local_user_gid },
{ "local_user_uid", vtype_uid, &local_user_uid },
{ "localhost_number", vtype_int, &host_number },
+ { "log_inodes", vtype_pinodes, (void *)FALSE },
+ { "log_space", vtype_pspace, (void *)FALSE },
{ "mailstore_basename", vtype_stringptr, &mailstore_basename },
{ "message_age", vtype_int, &message_age },
{ "message_body", vtype_msgbody, &message_body },
{ "received_for", vtype_stringptr, &received_for },
{ "received_protocol", vtype_stringptr, &received_protocol },
{ "recipient_data", vtype_stringptr, &recipient_data },
+ { "recipient_verify_failure",vtype_stringptr,&recipient_verify_failure },
{ "recipients", vtype_recipients, NULL },
{ "recipients_count", vtype_int, &recipients_count },
{ "reply_address", vtype_reply, NULL },
{ "runrc", vtype_int, &runrc },
{ "self_hostname", vtype_stringptr, &self_hostname },
{ "sender_address", vtype_stringptr, &sender_address },
+ { "sender_address_data", vtype_stringptr, &sender_address_data },
{ "sender_address_domain", vtype_domain, &sender_address },
{ "sender_address_local_part", vtype_localpart, &sender_address },
{ "sender_data", vtype_stringptr, &sender_data },
{ "sender_host_port", vtype_int, &sender_host_port },
{ "sender_ident", vtype_stringptr, &sender_ident },
{ "sender_rcvhost", vtype_stringptr, &sender_rcvhost },
+ { "sender_verify_failure",vtype_stringptr, &sender_verify_failure },
{ "smtp_command_argument", vtype_stringptr, &smtp_command_argument },
{ "sn0", vtype_filter_int, &filter_sn[0] },
{ "sn1", vtype_filter_int, &filter_sn[1] },
{ "sn8", vtype_filter_int, &filter_sn[8] },
{ "sn9", vtype_filter_int, &filter_sn[9] },
{ "spool_directory", vtype_stringptr, &spool_directory },
+ { "spool_inodes", vtype_pinodes, (void *)TRUE },
+ { "spool_space", vtype_pspace, (void *)TRUE },
{ "thisaddress", vtype_stringptr, &filter_thisaddress },
{ "tls_certificate_verified", vtype_int, &tls_certificate_verified },
{ "tls_cipher", vtype_stringptr, &tls_cipher },
s[ptr] = 0; /* string_cat() leaves room */
}
return s;
+
+ case vtype_pspace:
+ {
+ int inodes;
+ sprintf(CS var_buffer, "%d",
+ receive_statvfs((BOOL)(var_table[middle].value), &inodes));
+ }
+ return var_buffer;
+
+ case vtype_pinodes:
+ {
+ int inodes;
+ (void) receive_statvfs((BOOL)(var_table[middle].value), &inodes);
+ sprintf(CS var_buffer, "%d", inodes);
+ }
+ return var_buffer;
}
}
uschar *sub1, *sub2;
/* If there are no following strings, we substitute the contents of $value for
-lookups and for extractions in the success case. In the fail case, nothing is
-substituted. In the case of "if", lack of following strings is an error. */
+lookups and for extractions in the success case. For the ${if item, the string
+"true" is substituted. In the fail case, nothing is substituted for all three
+items. */
while (isspace(*s)) s++;
if (*s == '}')
{
- if (type[0] == 'i') goto FAILED_CURLY;
- if (yes && lookup_value != NULL)
- *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, lookup_value,
- Ustrlen(lookup_value));
- lookup_value = save_lookup;
+ if (type[0] == 'i')
+ {
+ if (yes) *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, US"true", 4);
+ }
+ else
+ {
+ if (yes && lookup_value != NULL)
+ *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, lookup_value,
+ Ustrlen(lookup_value));
+ lookup_value = save_lookup;
+ }
s++;
goto RETURN;
}
/* Convert to masked textual format and add to output. */
yield = string_cat(yield, &size, &ptr, buffer,
- host_nmtoa(count, binary, mask, buffer));
+ host_nmtoa(count, binary, mask, buffer, '.'));
continue;
}
case EOP_RFC2047:
{
- uschar buffer[1024];
+ uschar buffer[2048];
uschar *string = parse_quote_2047(sub, Ustrlen(sub), headers_charset,
buffer, sizeof(buffer));
yield = string_cat(yield, &size, &ptr, string, Ustrlen(string));