Mercurial > dovecot > core-2.2
changeset 3660:f2d65601097c HEAD
Added -m parameter to store mail to non-INBOX mailbox without Sieve
scripting.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 16 Oct 2005 17:48:25 +0300 |
parents | 7a04c13af9bc |
children | a745511d591e |
files | src/deliver/deliver.c |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/deliver/deliver.c Sun Oct 16 17:35:12 2005 +0300 +++ b/src/deliver/deliver.c Sun Oct 16 17:48:25 2005 +0300 @@ -343,6 +343,7 @@ int main(int argc, char *argv[]) { const char *auth_socket = DEFAULT_AUTH_SOCKET_PATH; + const char *mailbox = "INBOX"; const char *destination, *mail; const struct var_expand_table *table; enum mail_storage_flags flags; @@ -378,6 +379,14 @@ "Missing auth socket path argument"); } auth_socket = argv[i]; + } else if (strcmp(argv[i], "-m") == 0) { + /* destination mailbox */ + i++; + if (i == argc) { + i_fatal_status(EX_USAGE, + "Missing mailbox argument"); + } + mailbox = argv[i]; } else { i_fatal_status(EX_USAGE, "Unknown argument: %s", argv[1]); @@ -454,7 +463,7 @@ net_set_nonblock(0, TRUE); input = i_stream_create_file(0, default_pool, 8192, FALSE); - if (save_mail(storage, "INBOX", input) < 0) + if (save_mail(storage, mailbox, input) < 0) return EX_TEMPFAIL; i_stream_unref(input);