Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17820

is it possible to use Dovecot/Sieve to dynamically create folders?

$
0
0

Hello,

I am running my own Debian-based mailserver using the apparently popular postfix/dovecot combination.

I am basically serving a couple of domains, two of them with a special use for me: My main mail address is mail@mydomain.tld. I use a second domain, dummydomain.tld for "special" (lacking a better word here) cases.

Let's say I want to register to a website called Special Shop. I then register there using the mail address specialshop@dummydomain.tld. This mailbox does not actually exist, anything arriving at my server for @dummydomain.tld gets redirected to mail+catchall@mydomain.tld. I then use Sieve to sort everything containing +catchall into my catchall mail folder.

As you can imagine, my Catchall folder has become quite full. I usually create a new subfolder and a corresponding sieve rule so that future mails for an alias gets sorted into the respective subfolder.

What I'm wondering is if this could be automated. Can I make dovecot or maybe sieve evaluate and parse the original To header and create a new folder for every alias that does not already have a corresponding one? So that the first mail to specialshop@dummydomain.tld, which gets delivered to mail+catchall@mydomain.tld will automatically create a new folder "specialshop" and all subsequent mail will automatically be sorted into this new folder without manual intervention? If so, how would I do this?

I hope I made my usecase clear enough, please ask if there are any questions left. Thanks for your help.

submitted by ickerwx
[link][5 comments]

Viewing all articles
Browse latest Browse all 17820

Trending Articles