Results 1 to 8 of 8

Thread: Zimbra and procmail

  1. #1
    Join Date
    Feb 2010
    Posts
    7
    Rep Power
    5

    Default Zimbra and procmail

    Hi All,

    Have any one been able to setup zimbra with procmail? Procmail as the filter for zimbra I mean. If yes, how was that achieved? Please help.

  2. #2
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default

    Got it to work yesterday for 1 email adres, dunno how it scales up.

    I adapted the piping instructions I found here:
    Configuring Postfix to work with piped scripts - Zimbra :: Wiki

    So, these cut-and-paste instructions work for me:
    Code:
    su - zimbra							// Make sure you're the 'zimbra' user
    mkdir /opt/zimbra/procmail                            // this will hold the filter file and the logfile
    cat /opt/zimbra/postfix/conf/main.cf               // check out what transports you have now, adapt the next command for your result
    	proxy:ldap:/opt/zimbra/conf/ldap-transport.cf
    zmlocalconfig -e transport_maps=' hash:/opt/zimbra/postfix/conf/transport,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf'		// add a postfix transport
    vi /opt/zimbra/postfix/conf/transport
    	# Pipe transports for RT queues
    	# YOU HAVE TO ADD THE PIPES TO /opt/zimbra/postfix/conf/master.cf if you want them to work!!!
    	test@yourdomain.com     procmail-pipe                    // fill-in the correct email address
    postmap /opt/zimbra/postfix/conf/transport			// update the transport db
    vi /opt/zimbra/postfix/conf/master.cf.in			// define the pipe
    	procmail-pipe         unix    -       n               n               -               -       pipe
        flags= user=zimbra argv=/usr/bin/procmail /opt/zimbra/procmail/procmailrc			
    This is the header of my procmail file (/opt/zimbra/procmail/procmailrc)
    	SHELL = /bin/sh
    	PATH=$HOME/bin:/usr/bin:/bin:.
    	MAILDIR=/opt/zimbra/procmail/  # You better make sure it exists
    	DEFAULT=$MAILDIR
    	LOGFILE=.procmaillog
    	LOCKFILE=.procmaillock
    	VERBOSE=no
    
    Turning VERBOSE to yes will enable logging.
    Everything after // is comment.
    Remove beginning tabs, make sure NO line starts with a space or tab. They are only here for clarity.
    Good luck !

  3. #3
    Join Date
    Oct 2011
    Location
    Kathmandu, Nepal
    Posts
    4
    Rep Power
    4

    Unhappy Procmail integration not working

    Hi FrederikD,

    I tried your solution, but it does not seem to work for me. I might be wrong with my configurations. My configurations are as below:

    The configured transport in /opt/zimbra/postfix/conf/main.cf is:
    Code:
    transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf
    In /opt/zimbra/postfix/conf/transport:
    Code:
    admin@iras-aks.com	procmail-pipe
    In /opt/zimbra/postfix/conf/master.cf:
    Code:
    procmail-pipe	unix	-	n	n	-	-	pipe
        flags= user=zimbra argv=/usr/bin/procmail /opt/zimbra/procmail/procmailrc
    I executed:
    Code:
    zmlocalconfig -e transport_maps=' hash:/opt/zimbra/postfix/conf/transport,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf'
    The content of the /opt/zimbra/procmail/procmailrc file are as below:
    Code:
    SHELL = /bin/sh
    PATH=$HOME/bin:/usr/bin:/bin:.
    DEFAULT=$MAILDIR
    LOGFILE=.procmaillog
    LOCKFILE=.procmaillock
    VERBOSE=yes
    
    :0
    * From:.*admin.*
    * To:.*roshan.*
    * ! ^Content-Type:.*text/plain.*
    {
            :0B
    		        * ^(Content-(Type|Disposition):.*|[     ]*(file)?)name=("[^"]*|[^]*)\..*
    				        /dev/null
    }
    I just want to block mail attachments from admin user to the user named roshan. The attachment blocking is not working.

  4. #4
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default

    Hi aks

    Unfortunately did my Zimbra proposal never got approved officially which is why my test-setup is not available anymore.

    Nevertheless, can you confirm there was no /opt/zimbra/procmail/.procmaillog file created?
    If not you might try changing the owner and group of /opt/zimbra/procmail/procmailrc to 'zimbra'

    Frederik

  5. #5
    Join Date
    Oct 2011
    Location
    Kathmandu, Nepal
    Posts
    4
    Rep Power
    4

    Default

    Quote Originally Posted by FrederikD View Post
    Hi aks

    Unfortunately did my Zimbra proposal never got approved officially which is why my test-setup is not available anymore.

    Nevertheless, can you confirm there was no /opt/zimbra/procmail/.procmaillog file created?
    If not you might try changing the owner and group of /opt/zimbra/procmail/procmailrc to 'zimbra'

    Frederik
    Hi FrederikD,
    I could not see the file /opt/zimbra/procmail/.procmaillog file, so it's not created. The /opt/zimbra/procmail/procmailrc file is already chown-ed to zimbra:zimbra. The permission on the file is -rw-r-----. Do I need to change anything?

    Thanks.

  6. #6
    Join Date
    Oct 2011
    Location
    Kathmandu, Nepal
    Posts
    4
    Rep Power
    4

    Default

    Also that in the transport file, admin@iras-aks.com is mentioned, and it is not a system account, rather it is an account created by zimbra. Can this be the source of the problem? I was not clear about test@yourdomain.com directive in your instructions. Should I replace it with root@iras-aks.com or with zimbra@iras-aks.com

    Note: iras-aks.com is the test domain that i've configured zimbra for.

  7. #7
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default

    Yes, I believe I created a new email adres and used that one.

    But what I could not find was a way for procmail to re-inject the mail into zimbra.
    I only used that email account to filter and then forward to another email account.

    Come to think of it, I don't think I ever got any logging out either. Forgive me, this is coming back to me in pieces

    So I would try creating 2 new email accounts, 1 for procmail and 1 for procmail to send the mail to, and add a forward at the end of your procmailrc:
    Code:
    :0
        ! root@iras-aks.com
    (if that is the email account you wish to read your mail in)

  8. #8
    Join Date
    Oct 2011
    Location
    Kathmandu, Nepal
    Posts
    4
    Rep Power
    4

    Thumbs up [SOLVED] Procmail Integration

    Hi FrederikD,
    I repeated all of the steps, and finally made it to work. I'm not sure of what went wrong in the previous attempt. Now that I've jotted down the configuration at How to use Procmail with ZCS.

    Thanks for you help.

Similar Threads

  1. Replies: 0
    Last Post: 12-09-2010, 03:33 PM
  2. Zimbra and procmail
    By bibo in forum Administrators
    Replies: 0
    Last Post: 11-29-2007, 05:55 AM
  3. Procmail advanced filtering in zimbra
    By genesis in forum Administrators
    Replies: 0
    Last Post: 10-08-2007, 07:19 AM
  4. UW IMAP + Procmail to Zimbra
    By kherron in forum Migration
    Replies: 1
    Last Post: 10-01-2007, 10:47 AM
  5. Zimbra and Procmail
    By andreychek in forum Administrators
    Replies: 9
    Last Post: 01-27-2007, 11:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •