Announcement

Collapse
No announcement yet.

user procmailrc

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    user procmailrc

    I'm trying to do some mail filtering at the server level.

    What I want this particular rule to do is take any mail with "DenyHosts Report" in the subject and stick it in a subfolder of the inbox named "DenyHosts".
    I've created a .procmailrc in my home directory with the following contents:
    Code:
    LOGDIR=$HOME/.procmail-logs
    LOGFILE=$LOGDIR/log.`date +%y-%m-%d` 
    VERBOSE=YES
    LOGABSTRACT=YES
    DROPPRIVS=yes
    DEFAULT=$HOME/Maildir/
    MAILDIR=$HOME/Maildir/
    
    :0
    * ^Subject: .DenyHosts Report
    $DEFAULT/.DenyHosts/
    This works great in /etc/procmailrc (although the logfile location is set to /var/log/procmail.log in that one), but not in my .procmailrc.

    It sticks all of my emails into a file in my Maildir folder simply named ?, in what appears to be mbox format, instead of Maildir format. I know that it's putting them there because it thinks that the email coming in doesn't match any of my rules, so it puts them wherever I have $DEFAULT set. Why it's putting it all in one file and not in separate files in the inbox like normal, I have no idea. It's also not creating the logfile in the home directory like I want it to. I'm having to go to /var/log/procmail.log to see what's going on with it.

    So the question is then, what is wrong with this .procmailrc?

    #2
    I seem to recall that MAILDIR variable doesn't like a trailing slash (I'm not sure about that, though, and it might not even be relevant to your issue).

    But you might try "MAILDIR=$HOME/Maildir"

    Comment


      #3
      Originally posted by kubicle View Post
      I seem to recall that MAILDIR variable doesn't like a trailing slash...
      It's got the slash in /etc/procmailrc but you never know. I'll give it a try when I get home tonight.

      Comment


        #4
        Originally posted by deadtom View Post
        It's got the slash in /etc/procmailrc but you never know. I'll give it a try when I get home tonight.
        Well, if it works systemwide (in /etc), then I doubt it's the cause (doesn't hurt to try of course, one less thing to troubleshoot).

        Unfortunately I'm not experienced enough with procmail to offer definitive solutions, but there are troubleshooting tips available online, here's one:
        http://partmaps.org/era/mail/procmail-debug.html
        (I'm sure you'll find more with google)

        Comment

        Working...
        X