Virtual Users And Domains With Postfix, Courier And MySQL [+ procmail ?]

Discussion in 'HOWTO-Related Questions' started by immobilia, Jun 13, 2006.

  1. immobilia

    immobilia New Member

    Virtual Users And Domains With Postfix, Courier And MySQL + Add Mailfiltering

    Hello, i'have succefully try your excelent tutorial : Virtual Users And Domains With Postfix, Courier And MySQL

    Now, i need configure spam level for each users, how to ? :confused:
    SA-learning seems use procmail, but Postfix use VDA to delivered mail.

    Need i to add a delivered (procmail) agent in /etc/postfix/master.cf ? as
    #procmail unix - n n - - pipe flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
    But what is the correct syntax ?

    How to use procmail why Virtual mysql users ? :confused:

    Question : When we use transport of one domain to maildrop, we can't use users forwardings ? :confused:

    Another question, how to create a Maildir/ file named "MyDir" instead of ".MyDir", it's a restriction of Courier server or other ? :confused:

    And when i add Add Mailfiltering to the Falko howto Postfix Guide
    I think i don't use correctly the filter while i creating me a file .spam, doesn't it create me Maidir ?

    In fact with this filter, if Maildir doesn't exist, maildrop create just one file as we are Not Maildir/ mail files.
    Must be add verification and if necessary create Maildir/ file whith maildirmake.
     
    Last edited: Jun 13, 2006
  2. falko

    falko Super Moderator ISPConfig Developer

  3. immobilia

    immobilia New Member

    I think i have read all post in this forum

    Yes falko, i think i have look the totality of forum

    Add Mailfiltering to the Falko howto Postfix Guide
    http://www.howtoforge.com/postfix_mailfilter

    Virtual Users And Domains With Postfix, Courier And MySQL
    http://www.howtoforge.com/virtual_postfix_mysql_quota_courier

    and more...

    My old problem (resolve) is when i use mailfiltering (with transport of my domain to maildrop), i thinked lost the advantage of forwardings table.
    Example :
    When i send mail to [email protected], transport look priority on forwardings, and maildrop try to delivered mail to user : all who doesn't exist.
    Jun 14 09:23:48 server1 postfix/pipe[32741]: 895FC3C002B: to=<[email protected]>, relay=maildrop, delay=0, status=deferred (temporary failure. Command output: /usr/local/maildrop/bin/maildrop: Invalid user specified. )

    But i think it was "receive_override_options = no_address_mappings" that kill alias.
    Now i'have comment :
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    I have not yet retry with this options ON.

    But my error is in maildrop when delivering message
    The message is dump in a mbox file instead of a maildir.
    I need create Folder first from my Imap client for it's work. This is obligatory ?


    Somebody can indicate me a mail serveur able to manage :
    virtual users (mysql, ldap, ...) ,
    optionnaly quota per user ,
    virtuals domains ,
    SMTP + imap + pop ,
    antivirus (free) ,
    antispam (free and definition file peer user) ,
    mailfiltering
    +
    a webmail (multilanguage including FR) + (declaration mail spam for learning) + (vacation) + (administration of mail filters)
    optionally a back office to adminstrate virtual users and virtual domains

    Or help me to use Virtual Users And Domains With Postfix, Courier And MySQL with another MDA (Procmail...) without transport.

    http://www.oav.net/vda/VIRTUAL_README.txt
    The agent does not support user+foo address extensions, aliases or .forward files (use the virtual table instead), and therefore doesn't support file or program aliases. This choice was made to simplify and streamline the code (it allowed me to dispense with 70% of local's code - mostly the bits that are a security headache) - if you need this functionality, this agent isn't for you.

    What the best file format ? mbox or maildir?
     
    Last edited: Jun 14, 2006
  4. falko

    falko Super Moderator ISPConfig Developer

    What's in your maildroprc?


    I prefer Maildir because it stores one email message per file instead of all email messages in one file.
     
  5. immobilia

    immobilia New Member

    /etc/maildroprc :
    Code:
    # Global maildrop filter file
    
    # Uncomment this line to make maildrop default to ~/Maildir for
    # delivery- this is where courier-imap (amongst others) will look.
    #DEFAULT="$HOME/Maildir"
    
    LOGNAME=tolower("$LOGNAME")
    EXTENSION="$1"
    RECIPIENT=tolower("$2")
    USER="$3"
    HOST="$4"
    SENDER="$5"
    DEFAULT="/home/vmail/$HOST/$USER/."
    
    if ( "$EXTENSION" ne "" )
    {
      DELIMITER="+"
    }
    
    if (!$SENDER)
    {
      SENDER = "<>"
    }
    
    #
    # Autocreate maildir, if not existant
    #
    
    `test -e /home/vmail/$HOST`
    if ( $RETURNCODE != 0 )
    {
      `mkdir /home/vmail/$HOST`
    }
    
    `test -e /home/vmail/$HOST/$USER`
    if ( $RETURNCODE != 0 )
    {
      `/usr/local/maildrop/bin/maildirmake /home/vmail/$HOST/$USER`
      `chmod -R 0700 /home/vmail/$HOST`
    }
    
    #
    # Check that user has his own maildrop include,
    # if not available, check if $DEFAULT is set
    # (newer maildrop get's that from the DB and updates
    # it) and deliver or fail temporarily if not available
    #
    
    `test -f /home/vmail/.mailfilters/$LOGNAME`
    if ( $RETURNCODE == 0 )
    {
      include "/home/vmail/.mailfilters/$LOGNAME"
    }
    else
    {
      if ( "$DEFAULT" ne "" )
      {
        to "$DEFAULT"
      }
      else
      {
        EXITCODE=75
        exit
      }
    }
    
    In fact my reel question must be:
    Can user connect to her mailbox before i create his maildir (manualy or automatically when user received first mail) ?
     
  6. falko

    falko Super Moderator ISPConfig Developer

    No, Maildir must exist before you connect to it.
     

Share This Page