If you want to do that on Dovecot's side, look for sieve and vnd.dovecot.filter.
See https://doc.dovecot.org/configuration_manual/sieve/plugins/extprograms/ and 
corresponding RFC for details.

Doing that directly in Dovecot might not be the most effective way but depends 
on your needs... Anyway, it would require a bit of scripting, basically you 
need to parse the message for MIME structure, find the "attachment" part, 
remove it, reassemble and return.

Depending on your stack, you may take a look at the more effective place to do 
the filtering (as John Stoffel mentioned) -- e. g. many antivirus/antispam 
filters have the ability to filter out attachments... But if that's primarily 
for a single user or there's no way to plug it in prior Dovecot, it could fit 
perfectly.


Tomas

On Sat, Jun 03, 2023 at 10:07:20AM +0200, Oliver Glas wrote:
>    Hello,
> 
>    I am looking for a way to remove attachments, based on a condition.
>    Like attachments starting with "TimeReport" shall be removed, and then the
>    mail should
>    be delivered, with all other attachments.
> 
>    I did so far not find a solution to remove attachments.
>    Do I need a plugin / extension  ? If so, how to implement and use that ?
> 
>    Greetings, Oliver Glas

> _______________________________________________
> dovecot mailing list -- dovecot@dovecot.org
> To unsubscribe send an email to dovecot-le...@dovecot.org

_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to