From 8bc9274be73f10781fe910a02097d858ad39c718 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 6 Dec 2017 16:07:13 +0100 Subject: realrcptto: extract username from mailbox forwards --- realrcptto.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/realrcptto.c b/realrcptto.c index 34661c7..235ed14 100644 --- a/realrcptto.c +++ b/realrcptto.c @@ -257,6 +257,10 @@ int depth; /* found a single dovecot-rda line. stop lookup */ if (count == 1 && username && found_rda) { + /* special case mailbox forward */ + if (username && !str_diff(username, "$EXT2") + && extension && !str_diffn(extension, "mailbox-", 8)) + username = extension + 8; env_put2("DTUSER", username); return 1; } @@ -272,6 +276,7 @@ char *addr; int depth; { env_unset("DTUSER"); + extension = NULL; return realrcptto_ex(addr, depth); } -- cgit v1.2.3