The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To: IMAP folders & Maildir filtering

Discussion in 'E-mail Discussions' started by jeroman8, Jul 27, 2006.

  1. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    To filter mail to Maildir accounts IMAP subfolders (!) you need to
    add this to exim conf under central_filter:

    It say already:
    file_transport = address_file

    Put this below:
    directory_transport = address_file

    This is because you are not writing to a file here, you're writing to a folder
    and need the "name" of the new file to be something.

    You can use the cpanel filter interface as usally.
    Under "destination" write your path to the e-mail accounts "new" folder och
    the e-mailaccounts subfolders "new" folder.

    For example:
    Destination: /home/domain44/mail/domain44.com/support_email/.urgent/new/

    support_email = support_email@domain44.com
    .urgent = IMAP folder

    The "/" in the end is important.

    I just tested this after a client wanted to have the server/exim to do the filtering
    and it works perfectly on this cpanel/exim server with maildir.
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Sounds good. I'll have to try it out sometime.
     
  3. WebspaceUK

    WebspaceUK Member

    Joined:
    Jan 3, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK
    I just tried this and this happened..


    And on my IMAP it just showed as a new email in the inbox, not in James. Any idea's why?

    Thanks!
     
  4. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    jeroman8

    Just send a regular mail to the account with the words or whatever you filter
    and "tail -f /var/log/exim_mainlog" to see what it say there.

    Also, I do not have the permission set in the filter, 0660.
    Don't think it matter though.
     
  5. Southpaw018

    Southpaw018 Registered

    Joined:
    Aug 13, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Are you sure the correct line is:
    directory_transport = address_file

    Everywhere I'm looking, it says the line should be
    directory_transport = address_directory


    Please advise. I don't have access to the Exim conf on my server, and I will probably only be able to have my host change it once.
     
  6. Onyx

    Onyx Member

    Joined:
    May 28, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Working Version

    Using all the info above we were able to create a working configuration that handles both local mail from the same server as well as mail from an external location. Some of things we changed may be overkill, but this is the way we got it working:

    Working in three files:

    /etc/exim.conf
    /etc/exim.conf.local
    /etc/exim_outgoing.conf


    In all files, we found and replaced

    Code:
    file_transport = file_directory
    with:

    Code:
    file_transport = file_directory
    directory_transport = address_directory
    With a hint from this thread on the Exim list we added an address_directory transport, right below the address_file thransport:
    Code:
    address_directory:
      debug_print = "T: address_directory for $local_part@$domain"
      driver = appendfile
      envelope_to_add = true
      return_path_add = true
      check_string = ""
      escape_string = ""
      maildir_format
    We'll be stripping down this config to see which parts are essential and which aren't. But filters are triggered properly from both outside and internal email addresses.
     
  7. Onyx

    Onyx Member

    Joined:
    May 28, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Enable Directory Transport - Instructions

    In follow up to my last post in this thread, I have a pretty easy alternative that so far seems to be working. The original changes worked fine but were overwritten with each Exim upgrade.

    By using the Exim Configuration editor located in WHM, we can create permanent additions to the configuration setup quickly and easily.


    1. Go to WHM > Exim Configuration Editor
    2. Switch to Advanced Mode
    3. Scroll down to the editable text box where you will find a "mysystem_aliases" directory. This is in the "DIRECTORS CONFIGURATION" section.
    4. Add the following:
      Code:
      mycentral_filter:
      #!!# filter renamed allow_filter
        driver = redirect
        allow_filter
        no_check_local_user
        file = /etc/vfilters/${domain}
        file_transport = address_file
        directory_transport = address_directory
        pipe_transport = virtual_address_pipe
        reply_transport = address_reply
        retry_use_local_part
        user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
        no_verify
      
    5. Now, scroll down to the text box directly above "RETRY CONFIGURATION". This will probably be empty, and can be used to add custom transports to the end of the "TRANSPORTS CONFIGURATION" section.
    6. Add the following there:
      Code:
      address_directory:
        debug_print = "T: address_directory for $local_part@$domain"
        driver = appendfile
        envelope_to_add = true
        return_path_add = true
        check_string = ""
        escape_string = ""
        maildir_format
    7. All set! Now save the changes and restart Exim by submitting the form. Check for problems starting up just in case.

    We have yet to test these changes to see if they hold up to Exim/CPanel updates. However from my understanding of the Exim Configuration Editor, it should do the trick.
     
Loading...

Share This Page