Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- procmail: Unable to treat as directory


StupidScript - 9:30 pm on Mar 24, 2009 (gmt 0)


And the answer is: Don't mess with Procmail

I decided to start over (user-wise) and see what Postfix/Procmail would do, all by themselves.

I deleted all of my user accounts and then reinitialized them using a "clean" etc/skel. i.e. There was no mention of any type of mail directory in the template folder, just the usual shell and basic init settings.

Once that was done, I had a fresh group of near-empty home directories for the users, associated with the appropriate groups and login permissions. I had done nothing to address any mail functions with this set of users.

This differs markedly from the previous setup (and from every other installation I have done over the years), in that I ignored everything having to do with mail when creating the users and their home and mail directories. In my last attempt, I had added a Maildir with child cur, new and tmp directories to /etc/skel so that every new user had those ready to receive mail.

That was the problem. No matter how I set the permissions, Procmail ALWAYS disliked them and treated them as BOGUS and could not figure out how to treat them as directories.

By leaving out all mail directories during account creation, and by adding one modification to the way in which mail was handed off to Procmail by Postfix, I now have a setup where new mail directories are created by Procmail as they are needed and using permissions and ownerships that it recognizes.

So, to sum up:

1) Created new users like this:

useradd -g USERGROUP -m -s /sbin/nologin -b /home -c "User Name" USERNAME

2) Home directories used the contents of the default /etc/skel directory:

.bash_logout, .bash_profile, .bashrc, .gnome2

3) Modified /etc/postfix/main.cf:

WAS: mailbox_command = /usr/bin/procmail -t

NOW: mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir

4) Restarted Postfix

That's it. No more "Unable to treat as directory" or any of the other errors noted above.

For the record, here are the changes I made to config.h before compiling and installing Procmail from source. These mods change the default mail directory to a QMail-style directory and removes individual procmailrc files in favor of one master file:

WAS:
#define DEFmaildir "$HOME"
#define PROCMAILRC "$HOME/.procmailrc"

NOW:
#define DEFmaildir "$HOME/Maildir"
#define PROCMAILRC "/etc/procmailrc"


Thread source:: http://www.webmasterworld.com/linux/3875557.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com