Lines Matching +full:sub +full:- +full:mailbox
2 * Copyright (c) 1998-2006 Proofpoint, Inc. and its suppliers.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
16 SM_RCSID("@(#)$Id: parseaddr.c,v 8.407 2013-11-22 20:51:56 ca Exp $")
32 ** PARSEADDR -- Parse an address
43 ** of 'berkeley' -- to be transmitted over the arpanet.
46 ** addr -- the address to parse. [i]
47 ** a -- a pointer to the address descriptor buffer.
49 ** flags -- describe detail for parsing. See RF_ definitions
51 ** delim -- the character to terminate the address, passed
53 ** delimptr -- if non-NULL, set to the location of the
55 ** e -- the envelope that will contain this address.
56 ** isrcpt -- true if the address denotes a recipient; false
61 ** `a' is non-NULL).
65 ** e->e_to = addr
98 e->e_to = addr;
100 sm_dprintf("\n--parseaddr(%s)\n", addr);
110 sm_dprintf("parseaddr-->NULL\n");
117 sm_dprintf("parseaddr-->bad address\n");
135 e->e_to = addr = sm_rpool_strdup_x(e->e_rpool, addr);
146 e->e_flags |= EF_SECURE;
158 if (NULL != a->q_user)
162 a->q_user = quote_internal_chars(a->q_user, NULL, &len, e->e_rpool); /* EAI: ok */
166 if (hasctrlchar(a->q_user, isrcpt, true))
169 sm_dprintf("parseaddr-->bad q_user\n");
177 a->q_state = QS_BADADDR;
186 e->e_flags &= ~EF_SECURE;
187 if (QS_IS_BADADDR(a->q_state))
190 (void) hasctrlchar(a->q_paddr, isrcpt, false);
201 if ((a->q_qgrp == NOAQGRP || a->q_qgrp == ENVQGRP) &&
208 r = rscap(RS_QUEUEGROUP, a->q_user, NULL, e, &pvp, pvpbuf,
222 "queue group name %s -> %d",
224 a->q_qgrp = r == NOQGRP ? ENVQGRP : r;
234 char *msg = "Transient parse error -- message queued for future delivery";
236 if (e->e_sendmode == SM_DEFER)
241 if (e->e_message == NULL && e->e_sendmode != SM_DEFER)
242 e->e_message = sm_rpool_strdup_x(e->e_rpool, msg);
243 a->q_state = QS_QUEUEUP;
244 a->q_status = "4.4.3";
253 sm_dprintf("parseaddr-->");
261 ** INVALIDADDR -- check for address containing characters used for macros
264 ** addr -- the address to check.
266 ** delimptr -- if non-NULL: end of address to check, i.e.,
268 ** isrcpt -- true iff the address is for a recipient.
271 ** true -- if the address has characters that are reserved
273 ** false -- otherwise.
305 if (xlen > MAXNAME - 1) /* EAI:ok */
311 b, MAXNAME - 1); /* EAI:ok */
323 usrerr("501 5.1.3 8-bit character in mailbox address \"%s\"",
326 usrerr("501 5.1.7 8-bit character in mailbox address \"%s\"",
336 ** HASCTRLCHAR -- check for address containing meta-characters
338 ** Checks that the address contains no meta-characters, and contains
339 ** no "non-printable" characters unless they are quoted or escaped.
343 ** addr -- the address to check.
344 ** isrcpt -- true if the address is for a recipient; false
346 ** complain -- true if an error should issued if the address
350 ** true -- if the address has any "weird" characters or
351 ** non-printable characters or if a quote is unbalanced.
352 ** false -- otherwise.
373 if (xlen > MAXNAME - 1) /* EAI:ok */
377 (void) shorten_rfc822_string(b, MAXNAME - 1); /* EAI:ok */
379 b, MAXNAME - 1); /* EAI:ok */
386 result = "non-printable character";
398 *--addr = BAD_CHAR_REPLACEMENT;
405 result = "8-bit character";
415 usrerr("501 5.1.3 Syntax error in mailbox address \"%s\" (%s)",
418 usrerr("501 5.1.7 Syntax error in mailbox address \"%s\" (%s)",
425 ** ALLOCADDR -- do local allocations of address on demand.
430 ** a -- the address to reallocate.
431 ** flags -- the copy flag (see RF_ definitions in sendmail.h
433 ** paddr -- the printname of the address.
434 ** e -- envelope
451 sm_dprintf("allocaddr: flags=%x, paddr=%s, ad=%d\n", flags, paddr, bitset(EF_SECURE, e->e_flags));
453 a->q_paddr = paddr;
455 if (a->q_user == NULL)
456 a->q_user = "";
457 if (a->q_host == NULL)
458 a->q_host = "";
460 if (bitset(EF_SECURE, e->e_flags))
461 a->q_flags |= QSECURE;
465 a->q_host = sm_rpool_strdup_x(e->e_rpool, a->q_host);
466 if (a->q_user != a->q_paddr)
467 a->q_user = sm_rpool_strdup_x(e->e_rpool, a->q_user);
470 if (a->q_paddr == NULL)
471 a->q_paddr = sm_rpool_strdup_x(e->e_rpool, a->q_user);
472 a->q_qgrp = NOAQGRP;
476 ** PRESCAN -- Prescan name and make it canonical
489 ** so people type "csvax.eric\@berkeley" -- which screws up the
493 ** addr -- the name to chomp.
494 ** delim -- the delimiter for the address, normally
497 ** pvpbuf -- place to put the saved text -- note that
499 ** pvpbsize -- size of pvpbuf.
500 ** delimptr -- if non-NULL, set to the location of the
502 ** toktab -- if set, a token table to use for parsing.
504 ** ignore -- if true, ignore unbalanced addresses
525 #define MB M|B /* meta-break */
545 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
547 /* sp ! " # $ % & ' ( ) * + , - . / */
562 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
564 /* sp ! " # $ % & ' ( ) * + , - . / */
583 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
585 /* sp ! " # $ % & ' ( ) * + , - . / */
600 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
602 /* sp ! " # $ % & ' ( ) * + , - . / */
621 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
623 /* sp ! " # $ % & ' ( ) * + , - . / */
638 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
640 /* sp ! " # $ % & ' ( ) * + , - . / */
659 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
661 /* sp ! " # $ % & ' ( ) * + , - . / */
676 /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
678 /* sp ! " # $ % & ' ( ) * + , - . / */
692 #define NOCHAR (-1) /* signal nothing in lookahead token */
715 char *saveto = CurEnv->e_to;
733 expand(OperatorChars, obuf, sizeof(obuf) - sizeof(DELIMCHARS),
761 CurEnv->e_to = p;
780 if (q >= &pvpbuf[pvpbsize - 5])
792 --p;
795 CurEnv->e_to = saveto;
803 if ((char) c == (char) -1 && !tTd(82, 101) &&
836 p--;
848 p--;
870 if (q >= &pvpbuf[pvpbsize - 5])
903 cmntcnt--;
930 anglecnt--;
965 if (q >= &pvpbuf[pvpbsize - 5])
991 p--;
999 CurEnv->e_to = saveto;
1009 ** REWRITE -- apply rewrite rules to token vector.
1031 ** pvp -- pointer to token vector. [i]
1032 ** ruleset -- the ruleset to use for rewriting.
1033 ** reclevel -- recursion level (to catch loops).
1034 ** e -- the current envelope.
1035 ** maxatom -- maximum length of buffer (usually MAXATOM)
1099 "%s%-16.16s input:", prefix, rulename);
1104 sm_dprintf("%s%-16.16s input:", prefix, rulename);
1136 sm_dprintf("-----trying rule (line %d):",
1137 rwr->r_line);
1139 sm_dprintf("-----trying rule:");
1140 printav(sm_debug_file(), rwr->r_lhs);
1145 rvp = rwr->r_lhs;
1172 /* end-of-pattern before end-of-address */
1179 /* end-of-input with patterns left */
1187 mlp->match_pattern = rvp;
1188 mlp->match_first = avp;
1193 mlp->match_last = avp++;
1194 cataddr(mlp->match_first, mlp->match_last,
1223 mlp->match_pattern = rvp;
1224 mlp->match_first = avp;
1225 mlp->match_last = avp++;
1231 mlp->match_pattern = rvp;
1232 mlp->match_first = avp;
1233 mlp->match_last = avp - 1;
1243 ** Match against run-time macro.
1251 mlp->match_first = avp;
1266 avp = mlp->match_first;
1288 /* match failed -- back up */
1289 while (--mlp >= mlist)
1291 rvp = mlp->match_pattern;
1293 avp = mlp->match_last + 1;
1307 /* run off the end -- back up again */
1315 mlp->match_last = avp++;
1323 mlp->match_last = avp;
1342 sm_dprintf("----- rule fails\n");
1343 rwr = rwr->r_next;
1349 rvp = rwr->r_rhs;
1352 sm_dprintf("-----rule matches:");
1362 rwr = rwr->r_next;
1383 m = &mlist[rp[1] - '1'];
1393 pp = m->match_first;
1394 while (pp <= m->match_last)
1402 pp = m->match_first;
1403 while (pp <= m->match_last)
1418 sm_syslog(LOG_ERR, e->e_id,
1467 /* prescan pre-printed error */
1478 e->e_rpool, *xpvp);
1578 &pvpbuf[sizeof(pvpbuf)] - replac,
1581 &argvect[MAX_MAP_ARGS - 1])
1602 &pvpbuf[sizeof(pvpbuf)] - replac,
1604 if (arg_rvp < &argvect[MAX_MAP_ARGS - 1])
1607 if (arg_rvp >= &argvect[MAX_MAP_ARGS - 1])
1608 argvect[MAX_MAP_ARGS - 1] = NULL;
1613 trsize = (avp - rvp + 1) * sizeof(*rvp);
1618 map == NULL ? '\0' : map->s_map.map_spacesub,
1660 *avp++ = sm_rpool_strdup_x(e->e_rpool, *xpvp);
1666 rvp = avp - 1;
1684 (int) (avp - npvp) * sizeof(*avp));
1696 "%s%-16.16s returns:", prefix, rulename);
1701 sm_dprintf("%s%-16.16s returns:", prefix, rulename);
1708 ** CALLSUBR -- call subroutines in rewrite vector
1711 ** pvp -- pointer to token vector.
1712 ** reclevel -- the current recursion level.
1713 ** e -- the current envelope.
1769 sm_dprintf("-----skip subr %s (%d)\n",
1772 avp[i - 2] = avp[i];
1773 avp[i - 2] = NULL;
1793 for (; nsubr > 0; nsubr--)
1800 avp[i - 2] = avp[i];
1801 avp[i - 2] = NULL;
1810 MAXATOM - subrindex[nsubr]);
1819 ** MAP_LOOKUP -- do lookup in map
1822 ** smap -- the map to use for the lookup.
1823 ** key -- the key to look up. [x]
1824 ** argvect -- arguments to pass to the map lookup. [x]
1825 ** pstat -- a pointer to an integer in which to store the
1827 ** e -- the current envelope.
1831 ** NULL -- if there was no data for the given key.
1849 map = &smap->s_map;
1851 map->map_mflags |= MF_SECURE; /* default: secure */
1853 if (e->e_sendmode == SM_DEFER &&
1854 bitset(MF_DEFER, map->map_mflags))
1859 smap->s_name, key);
1864 if (!bitset(MF_KEEPQUOTES, map->map_mflags))
1869 sm_dprintf("map_lookup(%s, ", smap->s_name);
1880 replac = (*map->map_class->map_lookup)(map, key, argvect, &status);
1881 if (bitset(MF_SECURE, map->map_mflags))
1882 map->map_mflags &= ~MF_SECURE;
1884 e->e_flags &= ~EF_SECURE;
1889 status, bitset(MF_SECURE, map->map_mflags));
1892 if (status == EX_TEMPFAIL && !bitset(MF_NODEFER, map->map_mflags))
1897 smap->s_name, key, errno);
1898 if (e->e_message == NULL)
1904 smap->s_name,
1906 e->e_message = sm_rpool_strdup_x(e->e_rpool, mbuf);
1909 if (status == EX_TEMPFAIL && map->map_tapp != NULL)
1911 size_t i = strlen(key) + strlen(map->map_tapp) + 1;
1922 (void) sm_strlcpyn(rwbuf, rwbuflen, 2, key, map->map_tapp);
1931 ** INITERRMAILERS -- initialize error and discard mailers
1967 ** BUILDADDR -- build address from token vector.
1970 ** tv -- token vector.
1971 ** a -- pointer to address descriptor to fill.
1973 ** flags -- info regarding whether this is a sender or
1975 ** e -- the current envelope.
2030 a = (ADDRESS *) sm_rpool_malloc_x(e->e_rpool, sizeof(*a));
2035 a->q_flags |= DefaultNotify;
2054 a->q_state = QS_QUEUEUP;
2057 a->q_state = QS_BADADDR;
2058 a->q_mailer = &errormailer;
2063 --maxatom;
2069 --maxatom;
2073 --maxatom;
2077 --maxatom;
2087 cataddr(hostp, tv - 1, hbuf, sizeof(hbuf), '\0', true);
2089 --maxatom;
2094 /* Set up triplet for use by -bv */
2095 a->q_mailer = &errormailer;
2096 a->q_user = sm_rpool_strdup_x(e->e_rpool, ubuf);
2103 a->q_host = sm_rpool_strdup_x(e->e_rpool, hbuf);
2106 a->q_status = sm_rpool_strdup_x(e->e_rpool,
2116 for (ep = ErrorCodes; ep->ec_name != NULL; ep++)
2117 if (SM_STRCASEEQ(ep->ec_name, hbuf))
2119 setstat(ep->ec_code);
2124 a->q_host = NULL;
2150 /* XXX ubuf[off - 1] = ' '; */
2163 if (SM_STRCASEEQ(m->m_name, mname))
2171 a->q_mailer = m;
2176 if (!bitnset(M_LOCALMAILER, m->m_flags))
2181 a->q_host = NULL;
2184 a->q_host = sm_rpool_strdup_x(e->e_rpool, hbuf);
2188 if (bitnset(M_CHECKUDB, m->m_flags) && *p == '@')
2192 --maxatom;
2193 a->q_flags |= QNOTREMOTE;
2199 if (*p == '|' && bitnset(M_CHECKPROG, m->m_flags))
2200 a->q_mailer = m = ProgMailer;
2201 else if (*p == '/' && bitnset(M_CHECKFILE, m->m_flags))
2202 a->q_mailer = m = FileMailer;
2203 else if (*p == ':' && bitnset(M_CHECKINCLUDE, m->m_flags))
2210 a->q_mailer = m = InclMailer;
2211 a->q_user = sm_rpool_strdup_x(e->e_rpool, &ubuf[9]);
2218 p = quote_internal_chars(a->q_host, NULL, &len, NULL);
2220 p = a->q_host;
2222 macdefine(&e->e_macro, A_PERM, 'h', p);
2229 if (m->m_re_rwset > 0)
2230 (void) rewrite(tv, m->m_re_rwset, 0, e, maxatom);
2236 a->q_user = sm_rpool_strdup_x(e->e_rpool, ubuf);
2242 if (a->q_host != NULL && !bitnset(M_HST_UPPER, m->m_flags))
2243 makelower_a(&a->q_host, e->e_rpool);
2244 if (!bitnset(M_USR_UPPER, m->m_flags))
2245 makelower_a(&a->q_user, e->e_rpool);
2256 ** CATADDR -- concatenate pieces of addresses (putting in <LWSP> subs)
2259 ** pvp -- parameter vector to rebuild. [i]
2260 ** evp -- last parameter to include. Can be NULL to
2262 ** buf -- buffer to build the string into.
2263 ** sz -- size of buf.
2264 ** spacesub -- the space separator character;
2267 ** external -- convert to external form?
2278 ** The external format is just an eight-bit clean string (no
2320 sz -= 2;
2329 if (--sz <= 0)
2336 if (--sz <= 0)
2345 ** p[-1] is used because p is advanced (above).
2349 p[-1] = *q++;
2381 ** SAMEADDR -- Determine if two addresses are the same
2383 ** This is not just a straight comparison -- if the mailer doesn't
2387 ** a, b -- pointers to the internal forms to compare.
2390 ** true -- they represent the same mailbox.
2391 ** false -- they don't.
2405 if (a->q_mailer != b->q_mailer)
2413 if (a->q_mailer == &errormailer)
2417 if (strcmp(a->q_user, b->q_user) != 0)
2425 if (a->q_mailer == ProgMailer)
2430 bitset(QGOODUID, ca->q_flags & cb->q_flags) &&
2431 ca->q_uid != cb->q_uid)
2436 if (a->q_host == b->q_host)
2441 if (a->q_host == NULL || b->q_host == NULL)
2446 if (strcmp(a->q_host, b->q_host) != 0)
2452 ** PRINTADDR -- print address (for debugging)
2455 ** a -- the address to print
2456 ** follow -- follow the q_next chain.
2471 /* :'a,.s;^#define \(Q[A-Z]*\) .*; { "\1", \1 },; */
2525 /* find the mailer -- carefully */
2526 m = a->q_mailer;
2530 m->m_mno = -1;
2531 m->m_name = "NULL";
2536 a->q_paddr == NULL ? "<null>" : a->q_paddr,
2537 m->m_mno, m->m_name,
2538 a->q_host == NULL ? "<null>" : a->q_host);
2541 a->q_user,
2542 a->q_ruser == NULL ? "<null>" : a->q_ruser);
2544 switch (a->q_state)
2620 "%d", a->q_state);
2625 (void *)a->q_next, (void *)a->q_alias,
2626 (int) a->q_uid, (int) a->q_gid);
2628 a->q_flags);
2630 for (qfp = AddressFlags; qfp->qf_name != NULL; qfp++)
2632 if (!bitset(qfp->qf_bit, a->q_flags))
2639 qfp->qf_name);
2644 a->q_owner == NULL ? "(none)" : a->q_owner,
2645 a->q_home == NULL ? "(none)" : a->q_home,
2646 a->q_fullname == NULL ? "(none)" : a->q_fullname);
2649 a->q_orcpt == NULL ? "(none)" : a->q_orcpt,
2650 a->q_statmta == NULL ? "(none)" : a->q_statmta,
2651 a->q_status == NULL ? "(none)" : a->q_status);
2654 a->q_finalrcpt == NULL ? "(none)" : a->q_finalrcpt);
2657 a->q_rstatus == NULL ? "(none)" : a->q_rstatus);
2660 a->q_statdate == 0 ? "(none)" : ctime(&a->q_statdate));
2664 a = a->q_next;
2668 ** EMPTYADDR -- return true if this address is empty (``<>'')
2671 ** a -- pointer to the address
2674 ** true -- if this address is "empty" (i.e., no one should
2676 ** false -- if it is a "regular" (read: replyable) address.
2683 return a->q_paddr == NULL || strcmp(a->q_paddr, "<>") == 0 ||
2684 a->q_user == NULL || strcmp(a->q_user, "<>") == 0;
2688 ** REMOTENAME -- return the name relative to the current mailer
2691 ** name -- the name to translate. [i]
2692 ** m -- the mailer that we want to do rewriting relative to.
2693 ** flags -- fine tune operations.
2694 ** pstat -- pointer to status word.
2695 ** e -- the current envelope.
2733 rwset = bitset(RF_HEADERADDR, flags) ? m->m_sh_rwset
2734 : m->m_se_rwset;
2739 rwset = bitset(RF_HEADERADDR, flags) ? m->m_rh_rwset
2740 : m->m_re_rwset;
2748 macdefine(&e->e_macro, A_TEMP, macid("{addr_type}"), addrtype);
2755 if (bitset(RF_CANONICAL, flags) || bitnset(M_NOCOMMENT, m->m_flags))
2773 if (bitset(RF_ADDDOMAIN, flags) && e->e_fromdomain != NULL)
2783 --l;
2788 register char **qxq = e->e_fromdomain;
2792 if (--l <= 0)
2794 *--pxp = NULL;
2809 ** Then run it through any receiving-mailer-specific rulesets.
2843 oldg = macget(&e->e_macro, 'g');
2844 macset(&e->e_macro, 'g', lbuf);
2847 /* need to make sure route-addrs have <angle brackets> */
2853 macset(&e->e_macro, 'g', oldg);
2865 ** MAPLOCALUSER -- run local username through ruleset 5 for final redirection
2868 ** a -- the address to map (but just the user name part).
2869 ** sendq -- the sendq in which to install any replacement
2871 ** aliaslevel -- the alias nesting depth.
2872 ** e -- the envelope.
2903 pvp = prescan(a->q_user, '\0', pvpbuf, sizeof(pvpbuf), NULL, NULL,
2909 a->q_user);
2914 p = quote_internal_chars(a->q_host, NULL, &len, NULL);
2916 p = a->q_host;
2918 macdefine(&e->e_macro, A_PERM, 'h', p);
2919 macdefine(&e->e_macro, A_PERM, 'u', a->q_user);
2920 macdefine(&e->e_macro, A_PERM, 'z', a->q_home);
2922 macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), "e r");
2927 a->q_state = QS_QUEUEUP;
2928 a->q_status = "4.4.3";
2947 a->q_state = QS_DONTSEND;
2951 /* if non-null, mailer destination specified -- has it changed? */
2960 a1->q_flags &= ~Q_COPYFLAGS;
2961 a1->q_flags |= a->q_flags & Q_COPYFLAGS;
2962 a1->q_paddr = sm_rpool_strdup_x(e->e_rpool, a->q_paddr);
2963 a1->q_finalrcpt = a->q_finalrcpt;
2964 a1->q_orcpt = a->q_orcpt;
2967 a->q_state = QS_REPLACED;
2973 a1->q_alias = a;
2974 allocaddr(a1, RF_COPYALL, sm_rpool_strdup_x(e->e_rpool, a->q_paddr), e);
2978 ** DEQUOTE_INIT -- initialize dequote map
2981 ** map -- the internal map structure.
2982 ** args -- arguments.
2996 map->map_mflags |= MF_KEEPQUOTES;
3001 if (*p != '-')
3006 map->map_app = ++p;
3010 map->map_mflags |= MF_DEFER;
3015 map->map_spacesub = *++p;
3023 if (map->map_app != NULL)
3024 map->map_app = newstr(map->map_app);
3029 ** DEQUOTE_MAP -- unquote an address
3032 ** map -- the internal map structure (ignored).
3033 ** name -- the name to dequote.
3034 ** av -- arguments (ignored).
3035 ** statp -- pointer to status out-parameter.
3038 ** NULL -- if there were no quotes, or if the resulting
3040 ** else -- The dequoted buffer.
3060 char spacesub = map->map_spacesub;
3085 if (cmntcnt-- <= 0)
3113 if (anglecnt-- <= 0)
3127 ** RSCHECK -- check string(s) for validity using rewriting sets
3130 ** rwset -- the rewriting set to use.
3131 ** p1 -- the first string to check.
3132 ** p2 -- the second string to check -- may be NULL.
3133 ** e -- the current envelope.
3134 ** flags -- control some behavior, see RSF_ in sendmail.h
3135 ** logl -- logging level.
3136 ** host -- NULL or relay host.
3137 ** logid -- id for sm_syslog.
3138 ** addr -- if not NULL and ruleset returns $#error:
3140 ** addrstr -- if not NULL and ruleset does not return $#:
3144 ** EX_OK -- if the rwset doesn't resolve to $#error
3146 ** else -- the failure status (message printed)
3241 *addrstr = sm_rpool_strdup_x(e->e_rpool, ubuf);
3256 e->e_flags |= EF_DISCARD;
3266 e->e_quarmsg = sm_rpool_strdup_x(e->e_rpool,
3272 e->e_quarmsg = sm_rpool_strdup_x(e->e_rpool,
3275 macdefine(&e->e_macro, A_PERM,
3276 macid("{quarantine}"), e->e_quarmsg);
3285 /* got an error -- process it */
3291 addr->q_mailer = a1.q_mailer;
3292 addr->q_user = a1.q_user;
3293 addr->q_host = a1.q_host;
3369 ** RSCAP -- call rewriting set to return capabilities
3372 ** rwset -- the rewriting set to use.
3373 ** p1 -- the first string to check.
3374 ** p2 -- the second string to check -- may be NULL.
3375 ** e -- the current envelope.
3376 ** pvp -- pointer to token vector.
3377 ** pvpbuf -- buffer space.
3378 ** size -- size of buffer space.
3381 ** EX_UNAVAILABLE -- ruleset doesn't exist.
3382 ** EX_DATAERR -- prescan() failed.
3383 ** EX_OK -- rewrite() was successful.
3384 ** else -- return status from rewrite().