[exim-cvs] Expand $sender_host_dnssec and add vtype_bool

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Exim Git Commits Mailing List
Date:  
À: exim-cvs
Sujet: [exim-cvs] Expand $sender_host_dnssec and add vtype_bool
Gitweb: http://git.exim.org/exim.git/commitdiff/11d7e4fae0bce3557473177ce4b312dd0970cead
Commit:     11d7e4fae0bce3557473177ce4b312dd0970cead
Parent:     5e55c7a9d988e1feac17015d4428b723f6ebe3e1
Author:     Phil Pennock <pdp@???>
AuthorDate: Thu Jun 7 13:08:35 2012 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Thu Jun 7 13:08:35 2012 -0400


    Expand $sender_host_dnssec and add vtype_bool
---
 src/src/expand.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/src/src/expand.c b/src/src/expand.c
index 70bd86f..05361a3 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -351,6 +351,7 @@ enum {
   vtype_ino,            /* value is address of ino_t (not always an int) */
   vtype_uid,            /* value is address of uid_t (not always an int) */
   vtype_gid,            /* value is address of gid_t (not always an int) */
+  vtype_bool,           /* value is address of bool */
   vtype_stringptr,      /* value is address of pointer to string */
   vtype_msgbody,        /* as stringptr, but read when first required */
   vtype_msgbody_end,    /* ditto, the end of the message */
@@ -562,6 +563,7 @@ static var_entry var_table[] = {
   { "sender_helo_name",    vtype_stringptr,   &sender_helo_name },
   { "sender_host_address", vtype_stringptr,   &sender_host_address },
   { "sender_host_authenticated",vtype_stringptr, &sender_host_authenticated },
+  { "sender_host_dnssec",  vtype_bool,        &sender_host_dnssec },
   { "sender_host_name",    vtype_host_lookup, NULL },
   { "sender_host_port",    vtype_int,         &sender_host_port },
   { "sender_ident",        vtype_stringptr,   &sender_ident },
@@ -1522,6 +1524,10 @@ while (last > first)
     sprintf(CS var_buffer, "%ld", (long int)(*(uid_t *)(var_table[middle].value))); /* uid */
     return var_buffer;


+    case vtype_bool:
+    sprintf(CS var_buffer, "%s", *(BOOL *)(var_table[middle].value) ? "yes" : "no"); /* bool */
+    return var_buffer;
+
     case vtype_stringptr:                      /* Pointer to string */
     s = *((uschar **)(var_table[middle].value));
     return (s == NULL)? US"" : s;