Block sender domain using Procmail and squirrelmail

Discussion in 'Server Operation' started by Desp, Jun 11, 2014.

  1. Desp

    Desp Member

    I am trying to setup block_sender plugin from Squirrelmail using procmail, The problem is that when I am trying to add a domain to the list I get:
    [email protected] is already on your block list! Please contact your system administrator if you're not reading this message from your Trash folder!

    Here is what I have done so far in postfix:
    Code:
    mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ 
    In procmail config file I have

    Code:
    INCLUDERC=/usr/share/squirrelmail/plugins/block_sender/sqblock.rc.maildir-flat
    INCLUDERC=/usr/share/squirrelmail/plugins/block_sender/sqblock.rc.mbox-flat
    DROPPRIVS=yes
    :0fw
    | /usr/bin/spamc
    :0
    * ^X-Spam-Status: Yes
    $HOME/spam
    Now I have the block_sender plugin installed and activated. What is missing as I think so far is that $HOME/.procmailrc is missing or not configured as it should be and here where I need help. Any ideas?
     
  2. Desp

    Desp Member

    Now everything should be working and procmail should read global configuration file from /etc/procmailrc

    The problem now found in mail log
    procmail[18885]: Error while writing to "/var/log/procmail.log"
     
  3. Desp

    Desp Member

    Update

    Following this guide here cookbook
    I have created a .procmailrc file for each user.
    The problem is that when .forward file presented the emails get rejected.
    Removing the .forward file making the emails arrive as they should and logging is active withen the Maildir for each user.

    Here is how my .procmailrc look like now:

    Code:
    VERBOSE=yes
    INCLUDERC=/usr/share/squirrelmail/plugins/block_sender/sqblock.rc.maildir-flat
    INCLUDERC=/usr/share/squirrelmail/plugins/block_sender/sqblock.rc.mbox-flat
    
    #Preliminaries
    SHELL=/usr/bin/sh               #Use the Bourne shell (check your path!)
    MAILDIR=${HOME}/Mail            #First check what your mail directory is!
    LOGFILE=${MAILDIR}/procmail.log
    LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
    
    #Whatever recipes you'll use
    #The order of the recipes is significant
    :0
    * ^From: scam@cyberspam\.com
    /dev/null
    
    # Accept all the rest to your default mailbox
    :0:
    ${DEFAULT}
    Now testing the block_sender plugin.
     
    Last edited: Jun 16, 2014

Share This Page