5ce2084ada06ade9f44fc2914c34658e9a842dc1Timo Sirainen/* group: ... ; will be stored like:
a24665de9d5c773115a5918e60ed587aafe67d5cTimo Sirainen {name = NULL, NULL, "group", NULL}, ..., {NULL, NULL, NULL, NULL}
a1973d0f171b027f9a7c642bc1c2134293731e1cTimo Sirainen /* display-name */
a1973d0f171b027f9a7c642bc1c2134293731e1cTimo Sirainen /* route string contains the @ prefix */
a1973d0f171b027f9a7c642bc1c2134293731e1cTimo Sirainen /* local-part */
a1973d0f171b027f9a7c642bc1c2134293731e1cTimo Sirainen /* there were errors when parsing this address */
f40e6ef5190f68c2fd0e94c0b001bdf7d160236aTimo Sirainen/* Parse message addresses from given data. If fill_missing is TRUE, missing
f40e6ef5190f68c2fd0e94c0b001bdf7d160236aTimo Sirainen mailbox and domain are set to MISSING_MAILBOX and MISSING_DOMAIN strings.
f86c599ead3602dc2d63a473cc13c1119978f538Timo Sirainen Otherwise they're set to "".
f86c599ead3602dc2d63a473cc13c1119978f538Timo Sirainen Note that giving an empty string will return NULL since there are no
f86c599ead3602dc2d63a473cc13c1119978f538Timo Sirainen addresses. */
5ce2084ada06ade9f44fc2914c34658e9a842dc1Timo Sirainenmessage_address_parse(pool_t pool, const unsigned char *data, size_t size,
f40e6ef5190f68c2fd0e94c0b001bdf7d160236aTimo Sirainen unsigned int max_addresses, bool fill_missing);
15581297511b658a29c707c6031a258bab7bf1a5Stephan Bosch/* Parse RFC 5322 "path" (Return-Path header) from given data. Returns -1 if
15581297511b658a29c707c6031a258bab7bf1a5Stephan Bosch the path is invalid and 0 otherwise.
15581297511b658a29c707c6031a258bab7bf1a5Stephan Boschint message_address_parse_path(pool_t pool, const unsigned char *data,
15581297511b658a29c707c6031a258bab7bf1a5Stephan Bosch size_t size, struct message_address **addr_r);
cc77c1cfe8d072765f793474f49fecd897525466Stephan Boschvoid message_address_init(struct message_address *addr,
cc77c1cfe8d072765f793474f49fecd897525466Stephan Bosch const char *name, const char *mailbox, const char *domain)
cc77c1cfe8d072765f793474f49fecd897525466Stephan Boschvoid message_address_init_from_smtp(struct message_address *addr,
cc77c1cfe8d072765f793474f49fecd897525466Stephan Bosch const char *name, const struct smtp_address *smtp_addr)
5ce2084ada06ade9f44fc2914c34658e9a842dc1Timo Sirainenvoid message_address_write(string_t *str, const struct message_address *addr);
fbad2d10747ac76a29b3a9dcfb4e7e67236ab872Stephan Boschconst char *message_address_to_string(const struct message_address *addr);
fbad2d10747ac76a29b3a9dcfb4e7e67236ab872Stephan Boschconst char *message_address_first_to_string(const struct message_address *addr);
c10706d231f0690e934affdf18daa9b9a41814c6Timo Sirainen/* Returns TRUE if header is known to be an address */