Re: Remove attachments

2023-06-04 Thread Tomas Habarta via dovecot
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


attachments storage sub folders

2023-06-04 Thread cor--- via dovecot
Hi all, we're using a separate attachment storage. Is there a way to control 
the subfolders that are created for each attachment? Currently the path is 
/XX/YY/XXYY. In practice this means almost every single 
attachment gets its own 2 subfolders XX/YY. I'm seeing users with 5000 
attachments and almost 10.000 folders. 

Normally this wouldn't be that big of a deal but we're using ZFS storage with 
metadata special device and this is causing a huge amount of additional folder 
metadata. It would already be helpful if we could just have a single 
XX/XX subfolder per user.  Is that possible?

Thanks,

Cor


dovecot 2.3.20
mail_attachment_dir = /data/attachments/%{userdb:folder}
mail_attachment_fs = posix
mail_attachment_hash = %{sha256:160}
mail_attachment_min_size = 128k
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org