1794 |
static void |
static void |
1795 |
builtin_unre (struct mh_machine *mach) |
builtin_unre (struct mh_machine *mach) |
1796 |
{ |
{ |
1797 |
char *start, *p; |
char *p; |
1798 |
|
int rc = munre_subject (strobj_ptr (&mach->arg_str), &p); |
1799 |
for (p = strobj_ptr (&mach->arg_str); *p; p++) |
if (rc == 0 && p != strobj_ptr (&mach->arg_str)) |
|
if (!isspace (*p)) |
|
|
break; |
|
|
|
|
|
start = p; |
|
|
|
|
|
if (strncasecmp (p, "re", 2) == 0) |
|
|
{ |
|
|
if (p[2] == ':') |
|
|
p += 3; |
|
|
else if (p[2] == '[') |
|
|
{ |
|
|
for (p += 3; *p; p++) |
|
|
if (*p == ']' || !isdigit (*p)) |
|
|
break; |
|
|
if (*p == ']' && p[1] == ':') |
|
|
p += 2; |
|
|
else |
|
|
p = start; |
|
|
} |
|
|
else |
|
|
p = start; |
|
|
} |
|
|
|
|
|
if (p != strobj_ptr (&mach->arg_str)) |
|
1800 |
{ |
{ |
|
for (; *p && isspace (*p); p++) |
|
|
; |
|
|
|
|
1801 |
p = strdup (p); |
p = strdup (p); |
1802 |
strobj_free (&mach->arg_str); |
strobj_free (&mach->arg_str); |
1803 |
strobj_create (&mach->arg_str, p); |
strobj_create (&mach->arg_str, p); |
1805 |
} |
} |
1806 |
} |
} |
1807 |
|
|
1808 |
|
static void |
1809 |
|
builtin_isreply (struct mh_machine *mach) |
1810 |
|
{ |
1811 |
|
char *p; |
1812 |
|
int rc; |
1813 |
|
|
1814 |
|
if (strobj_is_null (&mach->arg_str)) |
1815 |
|
{ |
1816 |
|
header_t hdr = NULL; |
1817 |
|
char *value = NULL; |
1818 |
|
message_get_header (mach->message, &hdr); |
1819 |
|
|
1820 |
|
header_aget_value (hdr, MU_HEADER_SUBJECT, &value); |
1821 |
|
rc = munre_subject (value, NULL); |
1822 |
|
free (value); |
1823 |
|
} |
1824 |
|
else |
1825 |
|
rc = munre_subject (strobj_ptr (&mach->arg_str), NULL); |
1826 |
|
|
1827 |
|
mach->arg_num = !rc; |
1828 |
|
} |
1829 |
|
|
1830 |
|
static void |
1831 |
|
builtin_reply_regex (struct mh_machine *mach) |
1832 |
|
{ |
1833 |
|
mh_set_reply_regex (strobj_ptr (&mach->arg_str)); |
1834 |
|
} |
1835 |
|
|
1836 |
int |
int |
1837 |
mh_decode_rcpt_flag (const char *arg) |
mh_decode_rcpt_flag (const char *arg) |
1838 |
{ |
{ |
2039 |
{ "package", builtin_package, mhtype_str, mhtype_none }, |
{ "package", builtin_package, mhtype_str, mhtype_none }, |
2040 |
{ "package_string", builtin_package_string, mhtype_str, mhtype_none }, |
{ "package_string", builtin_package_string, mhtype_str, mhtype_none }, |
2041 |
{ "version", builtin_version, mhtype_str, mhtype_none }, |
{ "version", builtin_version, mhtype_str, mhtype_none }, |
2042 |
|
{ "reply_regex", builtin_reply_regex, mhtype_none, mhtype_str }, |
2043 |
|
{ "isreply", builtin_isreply, mhtype_num, mhtype_str, MHA_OPTARG }, |
2044 |
{ 0 } |
{ 0 } |
2045 |
}; |
}; |
2046 |
|
|