# 2.0.9: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.1-RELEASE i386  ufs

# listen only on ipv4
listen = *

auth_mechanisms = plain login cram-md5

lda_mailbox_autocreate = yes

base_dir = /var/run/dovecot/

first_valid_gid = 0

last_valid_gid = 1003

login_greeting = ISP Mail Server Ready.

mail_gid = 6

mail_location = maildir:/usr/local/virtual/%d/%n

mail_uid = 1003

passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}

protocols = imap

service auth {
  executable = /usr/local/libexec/dovecot/auth
  unix_listener /var/spool/postfix/private/auth {
    group = mail
    mode = 0660
    user = vmail
  }
  user = root
}

service imap-login {
  inet_listener imap {
    port = 0
  }
}

ssl_cert = </usr/local/etc/postfix/ssl/dovecot/cert.pem
ssl_key = </usr/local/etc/postfix/ssl/dovecot/key.pem

userdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}

protocol imap {
#  mail_plugins = quota imap_quota antispam

mail_plugins = $mail_plugins antispam

}

protocol pop3 {
  mail_plugins = quota
}

protocol lda {
  mail_plugins = $mail_plugins sieve
  postmaster_address = postmaster@mydomain.com
}

plugin {

sieve = /usr/local/etc/sievedir/rob@mydomain.com.sieve
sieve_dir = /usr/local/etc/sievedir/rob@mydomain.com.globalsieve/

sieve_global_path = /usr/local/etc/sievedir/global.sieve
sieve_global_dir = /usr/local/etc/sievedir/globalsieve/

#	antispam_backend = mailtrain
#	antispam_signature = X-DSPAM-Signature
#	antispam_spam = Spam
#	antispam_trash = trash;Trash;Deleted Items;Deleted Messages
#        antispam_mail_tmpdir = /tmp
#        antispam_mail_spam = spam@mydomain.com
#        antispam_mail_notspam = notspam@mydomain.com
#        antispam_mail_sendmail = /usr/sbin/sendmail

  antispam_backend = dspam
  antispam_dspam_args = --source=error;--signature=%%s;--user;%u
  antispam_spam = Spam
  antispam_trash = Trash
  antisapm_unsure = Trash
  antispam_signature = X-DSPAM-Signature


}
