[Dovecot] deliver: select destination folder

Dominik Werder dwerder at gmx.net
Sun Oct 2 13:00:16 EEST 2005


Hello,

I wanted a commandline switch within deliver to select the destination  
folder within an IMAP account, so I added the -f switch, heres the diff,  
the implementation is only "proof of concept"  hehe, I didnt checked if  
theres any security riscs in doing this. Could we add something like this  
to dovecot?


diff deliver.c.orig deliver.c
342c342
<       const char *destination, *mail;
---
>       const char *destination, *mail, *folder;
355a356
>       folder = NULL;
364a366,373
>               } else if (strcmp(argv[i], "-f") == 0) {
>                       /* destination folder */
>                       i++;
>                       if (i == argc) {
>                               i_fatal_status(EX_USAGE,
>                                              "Missing folder argument");
>                       }
>                       folder = argv[i];
378a388,391
>       if (folder == NULL) {
>               folder = "INBOX";
>       }
>
449c462
<       if (save_mail(storage, "INBOX", input) < 0)
---
>       if (save_mail(storage, folder, input) < 0)


bye!
Dominik


More information about the dovecot mailing list