mail filter plugin script doesn't effective

use experience useexperience at gmail.com
Thu Mar 31 15:02:57 UTC 2016


Thanks Jerry,

BTW, I have tried modifying as follows, but still I script doesn't
effective.

Also I gave full permission for script execution.

unix_listener auth-userdb {

    group = vmail

    mode = 0666

    user = vmail

  }


service santhosh-filter-out {

  executable = script /usr/local/bin/mail-filter-out.sh

  unix_listener santhosh-filter-out {

    group = vmail

    mode = 0666

    user = vmail

  }

  user = dovecot

}

service santhosh-filter {

  executable = script /usr/local/bin/mail-filter.sh

  unix_listener santhosh-filter {

    group = vmail

    mode = 0666

    user = vmail

  }

}

On Thu, Mar 31, 2016 at 8:00 PM, use experience <useexperience at gmail.com>
wrote:

> Hello Team,
>
> I am using script to create a database (Testing, so that I can use it for
> further my feature)
>
> service santhosh-filter {
>
>   executable = script /usr/local/bin/mail-filter.sh
>
>   unix_listener santhosh-filter {
>
>     mode = 0777
>
>     user = vmail
>
>   }
>
> }
>
>
> mail-filter.sh contains
>
>
> mysql -uroot -proot -e "create database temp5;"
>> exec "$@"
>
>
> Please help me.
>
> On Thu, Mar 31, 2016 at 7:56 PM, use experience <useexperience at gmail.com>
> wrote:
>
>> output of *dovecot --version*:
>> Dovecot version : 2.2.9
>> -----
>> output of *doveconf -n:*
>>
>> auth_debug = yes
>>>
>>> auth_mechanisms = plain login
>>>
>>> auth_verbose = yes
>>>
>>> disable_plaintext_auth = no
>>>
>>> mail_debug = yes
>>>
>>> mail_location =
>>> maildir:/var/mail/vhosts/%d/%n:LAYOUT=fs:DIRNAME=dovecot_maildir
>>>
>>> mail_plugins = " mail_log notify mail_filter"
>>>
>>> mail_privileged_group = mail
>>>
>>> namespace inbox {
>>>
>>>   inbox = yes
>>>
>>>   location =
>>>
>>>   mailbox Drafts {
>>>
>>>     auto = subscribe
>>>
>>>     special_use = \Drafts
>>>
>>>   }
>>>
>>>   mailbox Junk {
>>>
>>>     special_use = \Junk
>>>
>>>   }
>>>
>>>   mailbox Sent {
>>>
>>>     auto = subscribe
>>>
>>>     special_use = \Sent
>>>
>>>   }
>>>
>>>   mailbox "Sent Messages" {
>>>
>>>     auto = no
>>>
>>>     special_use = \Sent
>>>
>>>   }
>>>
>>>   mailbox Spam {
>>>
>>>     auto = create
>>>
>>>     special_use = \Junk
>>>
>>>   }
>>>
>>>   mailbox Trash {
>>>
>>>     auto = no
>>>
>>>     special_use = \Trash
>>>
>>>   }
>>>
>>>   mailbox virtual/All {
>>>
>>>     auto = no
>>>
>>>     special_use = \All
>>>
>>>   }
>>>
>>>   prefix =
>>>
>>> }
>>>
>>> passdb {
>>>
>>>   args = /etc/dovecot/dovecot-sql.conf.ext
>>>
>>>   driver = sql
>>>
>>> }
>>>
>>> plugin {
>>>
>>>   autocreate = Trash
>>>
>>>   autocreate2 = Spam
>>>
>>>   mail_filter = santhosh-filter %u
>>>
>>>   mail_log_events = delete undelete expunge copy mailbox_delete
>>> mailbox_rename flag_change save mailbox_create
>>>
>>>   mail_log_fields = uid box msgid size flags vsize from subject
>>>
>>> }
>>>
>>> protocols = " imap lmtp pop3"
>>>
>>> service auth-worker {
>>>
>>>   user = vmail
>>>
>>> }
>>>
>>> service auth {
>>>
>>>   unix_listener /var/spool/postfix/private/auth {
>>>
>>>     group = postfix
>>>
>>>     mode = 0777
>>>
>>>     user = postfix
>>>
>>>   }
>>>
>>>   unix_listener auth-userdb {
>>>
>>>     mode = 0777
>>>
>>>   }
>>>
>>>   user = dovecot
>>>
>>> }
>>>
>>> service imap-login {
>>>
>>>   executable = imap-login -R rawlogs
>>>
>>> }
>>>
>>> service imap-postlogin {
>>>
>>>   executable = script-login /usr/local/bin/postlogin.sh
>>> /etc/dovecot/script/echo.sh
>>>
>>>   user = vmail
>>>
>>> }
>>>
>>> service imap {
>>>
>>>   executable = imap imap-postlogin
>>>
>>> }
>>>
>>> service lmtp {
>>>
>>>   unix_listener /var/spool/postfix/private/dovecot-lmtp {
>>>
>>>     group = postfix
>>>
>>>     mode = 0600
>>>
>>>     user = postfix
>>>
>>>   }
>>>
>>> }
>>>
>>> service santhosh-filter-out {
>>>
>>>   executable = script /usr/local/bin/mail-filter-out.sh
>>>
>>>   unix_listener santhosh-filter-out {
>>>
>>>     mode = 0777
>>>
>>>     user = vmail
>>>
>>>   }
>>>
>>>   user = dovecot
>>>
>>> }
>>>
>>> service santhosh-filter {
>>>
>>>   executable = script /usr/local/bin/mail-filter.sh
>>>
>>>   unix_listener santhosh-filter {
>>>
>>>     mode = 0777
>>>
>>>     user = vmail
>>>
>>>   }
>>>
>>> }
>>>
>>> ssl_cert = </etc/dovecot/dovecot.pem
>>>
>>> ssl_key = </etc/dovecot/private/dovecot.pem
>>>
>>> userdb {
>>>
>>>   args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
>>>
>>>   driver = static
>>>
>>> }
>>>
>>> protocol imap {
>>>
>>>   mail_plugins = " autocreate"
>>>
>>> }
>>>
>>>
>>
>>
>
>


More information about the dovecot mailing list