Hey there, finally I started experiments with + separated detail strings in my mail address on a dovecot-perfect-server setup (debian). Goal is to pick up the detail part in custom filters to perform actions with matching emails. But it seems not to work ... I added the custom filters as listed below and sent test mails to the mail address. I expected to find mails with +news in the newsletter-folder and those with +social in the social-folder (both created before). But the mails always get stored in the main mailbox. Code: require ["fileinto", "envelope", "subaddress"]; if envelope :detail "to" "news"{ fileinto "Newsletter"; } if envelope :detail "to" "social"{ fileinto "Social"; }
I'm not familiar with :detail specifically, but I'm guessing you may just need a 'stop; ' in your if blocks to stop further processing.
I added a stop after fileinto, but it still doesn't work. :detail comes with pidgeonhole Code: https://wiki2.dovecot.org/Pigeonhole/Sieve The documentation I found tells, that it must be enabled either for dovecot LDA or LMTP. What is the difference and which one should I choose in a typical howtoforge debian perfect server setup? Furthermore, I am not really familliar with dovecot and sieve configurations, so also this page on dovecot/sieve configuration for pidgeonhole didn't really help me: Code: https://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration (sorry for links in code block, but I wasn't allowed to post direct links in my second forum post )
Ok, I figured it out. I wrote a require statement in my custom filter. This way it was placed in the middle of the .sieve file, below the autogenerated junk rule Sieve doesn't like requires in the middle of the file. I copied the sieve config templates to conf-custom and added "envelope", "subaddress" to the require statement Now I can run custom filters on the detail part of the mail address: mailboxname[+detail]@domain.com as listed in the first post Suggestion to Till, shouldn't be a big change: What about adding these imports to the official config script and add a filter selection "If Detail part of Mail Address is/begins/..."
Aw, I also had to tell postfix to pass the origiginal recipient down to dovecot. adding -a ${original_recipient} to dovecots pipe in postfix master.cf worked it out. My success in the previous post came from a regular mailfilter I added via ispconfig ... To enable my users to manage :detail filters by themselfes, I also made modifications to ISPConfig which are part of my recent pull request: https://git.ispconfig.org/ispconfig/ispconfig3/merge_requests/703