Lines Matching defs:addr

15 	struct message_address *first_addr, *last_addr, addr;
23 struct message_address *addr;
25 addr = p_new(ctx->pool, struct message_address, 1);
27 memcpy(addr, &ctx->addr, sizeof(ctx->addr));
28 i_zero(&ctx->addr);
31 ctx->first_addr = addr;
33 ctx->last_addr->next = addr;
34 ctx->last_addr = addr;
98 ctx->addr.mailbox = p_strdup(ctx->pool, str_c(ctx->str));
110 ctx->addr.domain = p_strdup(ctx->pool, str_c(ctx->str));
138 ctx->addr.route = p_strdup(ctx->pool, str_c(ctx->str));
156 ctx->addr.route = "INVALID_ROUTE";
188 name-addr = [display-name] angle-addr
196 ctx->addr.name = p_strdup(ctx->pool, str_c(ctx->str));
197 if (*ctx->addr.name == '\0') {
199 ctx->addr.name = NULL;
204 ctx->addr.domain = "SYNTAX_ERROR";
205 ctx->addr.invalid_syntax = TRUE;
212 /* addr-spec = local-part "@" domain */
223 ctx->addr.invalid_syntax = TRUE;
232 ctx->addr.name = p_strdup(ctx->pool, str_c(ctx->parser.last_comment));
236 read into addr.mailbox) is a mailbox, but if it's followed
242 ctx->addr.mailbox = NULL;
243 ctx->addr.name = p_strdup(ctx->pool, str_c(ctx->str));
246 ctx->addr.domain = "";
248 ctx->addr.invalid_syntax = TRUE;
256 if (ctx->addr.mailbox == NULL) {
257 ctx->addr.mailbox = !ctx->fill_missing ? "" : "MISSING_MAILBOX";
258 ctx->addr.invalid_syntax = TRUE;
260 if (ctx->addr.domain == NULL || ctx->addr.domain[0] == '\0') {
261 ctx->addr.domain = !ctx->fill_missing ? "" : "MISSING_DOMAIN";
262 ctx->addr.invalid_syntax = TRUE;
272 /* mailbox = name-addr / addr-spec */
275 /* nope, should be addr-spec */
278 if (ctx->addr.invalid_syntax && ctx->addr.name == NULL &&
279 ctx->addr.mailbox != NULL && ctx->addr.domain == NULL) {
280 ctx->addr.name = ctx->addr.mailbox;
281 ctx->addr.mailbox = NULL;
286 ctx->addr.invalid_syntax = TRUE;
308 ctx->addr.invalid_syntax = TRUE;
310 ctx->addr.mailbox = p_strdup(ctx->pool, str_c(ctx->str));
340 ctx->addr.invalid_syntax = TRUE;
366 /* address-list = (address *("," address)) / obs-addr-list */
426 (ctx.addr.mailbox != NULL && ctx.addr.domain == NULL)) {
427 ctx.addr.invalid_syntax = TRUE;
439 struct message_address *addr;
446 addr = message_address_parse_real(pool, data, size,
449 return addr;
466 void message_address_write(string_t *str, const struct message_address *addr)
472 if (addr->mailbox == NULL && addr->domain == NULL) {
473 i_assert(addr->next == NULL);
482 while (addr != NULL) {
488 if (addr->domain == NULL) {
492 if (addr->mailbox != NULL && *addr->mailbox != '\0') {
494 if (strstr(addr->mailbox, "=?") != NULL)
498 str_append(str, addr->mailbox);
500 str_append_maybe_escape(str, addr->mailbox, TRUE);
509 i_assert(addr->mailbox == NULL);
524 i_assert(addr->mailbox != NULL);
526 if (addr->name != NULL) {
528 if (strstr(addr->name, "=?") != NULL)
532 str_append(str, addr->name);
534 str_append_maybe_escape(str, addr->name, TRUE);
536 if (addr->route != NULL ||
537 addr->mailbox[0] != '\0' ||
538 addr->domain[0] != '\0') {
539 if (addr->name != NULL && addr->name[0] != '\0')
542 if (addr->route != NULL) {
543 str_append(str, addr->route);
546 if (addr->mailbox[0] == '\0')
549 str_append_maybe_escape(str, addr->mailbox, FALSE);
550 if (addr->domain[0] != '\0') {
552 str_append(str, addr->domain);
558 addr = addr->next;
562 const char *message_address_to_string(const struct message_address *addr)
565 message_address_write(str, addr);
569 const char *message_address_first_to_string(const struct message_address *addr)
573 first_addr = *addr;
579 void message_address_init(struct message_address *addr,
582 i_zero(addr);
583 addr->name = name;
584 addr->mailbox = mailbox;
585 addr->domain = domain;
588 void message_address_init_from_smtp(struct message_address *addr,
591 i_zero(addr);
592 addr->name = name;
593 addr->mailbox = smtp_addr->localpart;
594 addr->domain = smtp_addr->domain;