Re: [Mutt] Block, autoreplay and purge messages with attachement size large than 1MB

2020-05-27 Thread Mihai Lazarescu

On Wednesday, May 27, 2020 at 16:59:20 -0300, Marcelo Laia wrote:

Please, is there a way for me to configure offlineimap, msmtp 
and mutt to:


1. to check if the message has an attachment

2. to check the attachment size

3. If the attachment is larger than 1MB, send a message with the
following text: "Dear colleague, your message has not been delivered. My
system has detected that it contains attachments larger than 1MB. It wa
blocked! Please upload the attachment in the cloud ( drive, dropbox,
onedrive, etc.) and send me the message again with the link to download
the attachment. Thank you very much! "

4. Purge the message from my local and remote dir

Is there a way to implement this?


You can do it by hand:

- connect mutt directly to your Gmail folder that you want to clean
- sort the messages by size (most size will be due to attachment)
- pipe all messages above a threshold to a script which prepares 
and sends the reply

- delete the messages

Probably this can be automated, at least to some extent.

I prefer to save the attachments on disk, then and delete them 
from the messages. Later on I can still see the name of the 
deleted attachment file in the messages, then I can quickly find 
the detached file using locate.


Best,
Mihai


Re: Block, autoreplay and purge messages with attachement size large than 1MB

2020-05-27 Thread Marcelo Laia
On 27/05/20 at 04:02, José María Mateos wrote:
> Not what you asked specifically, but wouldn't it be easier to do this
> filtering + autoresponse on the server side? Unless you have a particular
> requirement to do this on the client side, of course, in which case ignore
> this message.


You are very welcome!

I asked to do this in the client side because I use Gmail. How I could
do this on the Gmail side? If it is possible, I will love it!

-- 
Marcelo


Re: Block, autoreplay and purge messages with attachement size large than 1MB

2020-05-27 Thread José María Mateos

On Wed, May 27, 2020 at 04:59:20PM -0300, Marcelo Laia wrote:

3. If the attachment is larger than 1MB, send a message with the
following text: "Dear colleague, your message has not been delivered. My
system has detected that it contains attachments larger than 1MB. It was
blocked! Please upload the attachment in the cloud ( drive, dropbox,
onedrive, etc.) and send me the message again with the link to download
the attachment. Thank you very much! "

4. Purge the message from my local and remote dir


Not what you asked specifically, but wouldn't it be easier to do this 
filtering + autoresponse on the server side? Unless you have a 
particular requirement to do this on the client side, of course, in 
which case ignore this message.


Best,

--
José María (Chema) Mateos || https://rinzewind.org


Delete attachement large than a size without delete message

2020-05-27 Thread Marcelo Laia
Hi,

Is there a way to dettach and delete attached file from a message? I
would like to delete all attachments from messages in my mail box large
than 1MB.

Thank you so much!

-- 
Marcelo


Block, autoreplay and purge messages with attachement size large than 1MB

2020-05-27 Thread Marcelo Laia
Hi,

Although I have already pleaded and begged my department colleagues not
to send me messages with attachments larger than 1MB, the unfortunate
ones continue to post messages with attachments over 25GB. These days,
when GMAIL increased the size limit to 50GB, I wanted to die. Today, I
received a message from GMAIL stating that my box is about to run out of
space. It's the end!

Please, is there a way for me to configure offlineimap, msmtp and mutt
to:

1. to check if the message has an attachment

2. to check the attachment size

3. If the attachment is larger than 1MB, send a message with the
following text: "Dear colleague, your message has not been delivered. My
system has detected that it contains attachments larger than 1MB. It was
blocked! Please upload the attachment in the cloud ( drive, dropbox,
onedrive, etc.) and send me the message again with the link to download
the attachment. Thank you very much! "

4. Purge the message from my local and remote dir

Is there a way to implement this?

Thank you so much!

-- 
Marcelo