#include "mail-autoexpunge.h"
#include "mail-namespace.h"
#include "mail-deliver.h"
+#include "message-address.h"
#include "main.h"
#include "client.h"
#include "commands.h"
return str_c(str);
}
-static void rcpt_address_parse(struct client *client, const char *address,
- const char **username_r, const char **detail_r)
-{
- const char *p, *domain;
-
- *username_r = address;
- *detail_r = "";
-
- if (*client->unexpanded_lda_set->recipient_delimiter == '\0')
- return;
-
- domain = strchr(address, '@');
- p = strstr(address, client->unexpanded_lda_set->recipient_delimiter);
- if (p != NULL && (domain == NULL || p < domain)) {
- /* user+detail@domain */
- *username_r = t_strdup_until(*username_r, p);
- if (domain == NULL)
- *detail_r = p+1;
- else {
- *detail_r = t_strdup_until(p+1, domain);
- *username_r = t_strconcat(*username_r, domain, NULL);
- }
- }
-}
-
static void lmtp_address_translate(struct client *client, const char **address)
{
const char *transpos = client->lmtp_set->lmtp_address_translate;
return 0;
}
}
- rcpt_address_parse(client, address, &username, &detail);
+ message_detail_address_parse(client->unexpanded_lda_set->recipient_delimiter,
+ address, &username, &detail);
client_state_set(client, "RCPT TO", address);