4

I installed Getmail to retrieve emails from another email server and Procmail to filter the incoming emails. (I am running Debian/Squeeze.)

The recipe I created has this code:

:0:
* ^[email protected]
Xyz

I thought this will make sure that all incoming emails will be saved in ~/Maildir/Xyz/ as individual files. Instead, it seems to be creating a file called Xyz (not a directory) inside ~/Maildir/ and appending new emails to the same file.

How do I save incoming mails as individual files to a folder, instead of a single file?

Spartanblogger
  • 587
  • 3
  • 9
  • 16

1 Answers1

3

The top level of procmail recipes are reserved for assignment of procmail variables. Add the following to the top of your procmail recipe.

MAILDIR="$HOME/Maildir/"

When defining where the mail should be delivered, you have defined Xyz as a file, not a directory. It should instead read:

:0:
* ^[email protected]
Xyz/

procmail is extremely powerful with many options. I'm always amazed at what it can do.

George M
  • 13,589
  • 4
  • 43
  • 53
  • That worked perfectly! Thank you. (I had set `MAILDIR=$HOME/Maildir/` earlier, but wasn't sure if I should add the forward slash at the of the folder name.) – Spartanblogger Jan 25 '13 at 18:16