73 #define STR vstring_str
97 if ((domain = strrchr(
STR(addr),
'@')) == 0)
99 name_len = domain -
STR(addr);
101 domain_len = strlen(domain);
111 msg_info(
"%s: %s map lookup problem -- "
112 "message not accepted, try again later",
125 for (masqp = masq_domains->
argv; (masq = *masqp) != 0; masqp++) {
126 for (truncate = 1; *masq ==
'!'; masq++)
127 truncate = !truncate;
129 masq_len = strlen(masq);
132 if (masq_len == domain_len) {
133 if (strcmp(masq, domain) == 0)
135 }
else if (masq_len < domain_len) {
136 parent = domain + domain_len - masq_len;
137 if (parent[-1] ==
'.' && strcmp(masq, parent) == 0) {
140 msg_info(
"masquerade: %s -> %s", domain, masq);
149 return (did_rewrite);
166 return (did_rewrite);
182 return (did_rewrite);
197 int main(
int argc,
char **argv)
204 msg_fatal(
"usage: %s exceptions masquerade_list address", argv[0]);
212 if (strchr(argv[3],
'@') == 0)
213 msg_fatal(
"address must be in user@domain form");
#define MATCH_FLAG_RETURN
ARGV * argv_free(ARGV *argvp)
#define tok822_scan(cp, ptr)
int main(int argc, char **argv)
VSTRING * unquote_822_local(VSTRING *dst, const char *mbox)
VSTRING * vstring_truncate(VSTRING *vp, ssize_t len)
STRING_LIST * cleanup_masq_exceptions
VSTRING * vstring_strcpy(VSTRING *vp, const char *src)
TOK822 * tok822_free_tree(TOK822 *)
#define casefold(dst, src)
#define string_list_init(o, f, p)
#define string_list_match
int cleanup_masquerade_external(CLEANUP_STATE *state, VSTRING *addr, ARGV *masq_domains)
VSTREAM * vstream_printf(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
VSTRING * tok822_externalize(VSTRING *, TOK822 *, int)
int cleanup_masquerade_internal(CLEANUP_STATE *state, VSTRING *addr, ARGV *masq_domains)
NORETURN msg_fatal(const char *fmt,...)
int cleanup_masquerade_tree(CLEANUP_STATE *state, TOK822 *tree, ARGV *masq_domains)
int vstream_fflush(VSTREAM *stream)
char * mystrndup(const char *str, ssize_t len)
char * var_masq_exceptions
ARGV * argv_split(const char *, const char *)
#define quote_822_local(dst, src)
VSTRING * vstring_free(VSTRING *vp)
#define VAR_MASQ_EXCEPTIONS
#define CLEANUP_STAT_WRITE
VSTRING * vstring_strcat(VSTRING *vp, const char *src)
void msg_info(const char *fmt,...)