]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: When generating envelope to From_-line, don't append a second @owndomain if...
authorTimo Sirainen <tss@iki.fi>
Wed, 14 Jul 2010 12:52:47 +0000 (13:52 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 14 Jul 2010 12:52:47 +0000 (13:52 +0100)
src/lib-storage/index/mbox/mbox-save.c

index 9911ec4bb26b29aa1e1b1fbff7617761418966d7..9aa98044cd9d3169d8bd5c9e57224edda7cff497 100644 (file)
@@ -121,8 +121,11 @@ static int write_from_line(struct mbox_save_context *ctx, time_t received_date,
                        struct mail_storage *storage =
                                &ctx->mbox->storage->storage;
 
-                       from_envelope = t_strconcat(storage->user->username,
-                                                   "@", my_hostdomain(), NULL);
+                       from_envelope =
+                               strchr(storage->user->username, '@') != NULL ?
+                               storage->user->username :
+                               t_strconcat(storage->user->username,
+                                           "@", my_hostdomain(), NULL);
                }
 
                /* save in local timezone, no matter what it was given with */