Re: mail filter plugin script doesn't effective

2016-03-31 Thread Jerry
On Thu, 31 Mar 2016 20:32:57 +0530, use experience stated:

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

Please stop top-posting. It is really annoying. Also, why are your
posts all double spaced?

Anyway, I found two URLs that might be of interest to you.

http://wiki.dovecot.org/PostLoginScripting

http://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms

Good luck

-- 
Jerry


Re: mail filter plugin script doesn't effective

2016-03-31 Thread use experience
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 
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 
> 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 = >>
>>> ssl_key = >>
>>> userdb {
>>>
>>>   args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
>>>
>>>   driver = static
>>>
>>> }
>>>
>>> protocol imap {
>>>
>>>   mail_plugins = " autocreate"
>>>
>>> }
>>>
>>>
>>
>>
>
>


Re: mail filter plugin script doesn't effective

2016-03-31 Thread Jerry
On Thu, 31 Mar 2016 19:56:04 +0530, use experience stated:

>>   unix_listener auth-userdb {
>>
>> mode = 0777
>>
>>   }

Try adding:

user = vmail
group = vmail

Why are you using mode = 0777? I never use more than 0666. Usually just
0660 and all works well. Try to include the "group" in your definitions.

Restart dovecot and see what happens.


Re: mail filter plugin script doesn't effective

2016-03-31 Thread use experience
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 
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 = >
>> ssl_key = >
>> userdb {
>>
>>   args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
>>
>>   driver = static
>>
>> }
>>
>> protocol imap {
>>
>>   mail_plugins = " autocreate"
>>
>> }
>>
>>
>
>