WebFaction
Community site: login faq

The procmailex documentation contains a really helpful trick for procmail beginners.

If you are fairly new to procmail and plan to experiment a little bit it often helps to have a safety net of some sort. Inserting the following two recipes above all other recipes will make sure that of all arriving mail always the last 32 messages will be preserved. In order for it to work as intended, you have to create a directory named `backup' in $MAILDIR prior to inserting these two recipes.

:0 c backup

:0 ic | cd backup && rm -f dummy ls -t msg.* | sed -e 1,32d

It didn't work for me. The WebFaction mail servers have a different directory structure. (maildir)

asked 02 May, 15:28

robin's gravatar image

robin
362
accept rate: 50%


The WebFaction support desk created this for me:

First I created a folder called backup (referred to in recipes as .backup/).

Then add these at the top of Filtering: Advanced.

SHELL=/bin/bash

# BACKUP LAST 32 MESSAGES

:0 c .backup/

:0 ic | find .backup/{cur,new} -type f | xargs ls -t | sed -e 1,32d | xargs rm

# END BACKUP LAST 32 MESSAGES

permanent link

answered 02 May, 15:35

robin's gravatar image

robin
362
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×255
×17

question asked: 02 May, 15:28

question was seen: 321 times

last updated: 02 May, 15:35

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM