Call procmail after sieve

George Asenov george.asenov at wpx.net
Thu Sep 1 13:12:03 UTC 2022


Basically I need to achieve the behavior described here:
https://www.concordia.ca/ginacody/aits/support/faq/procmail_and_sieve.html
Could someone explain in details how to ?

On 01-Sep-22 12:54 PM, George Asenov wrote:
> You are right, after configuration now procmail is started and piped the 
> message.
> Unfortunately some loop happen after starting procmail
> =================================================
>   sieve: Started running script 
> `/var/lib/dovecot/sieve_after/procmail.svbin'
>   sieve: Finished running script `ok' 
> (status=/var/lib/dovecot/sieve_after/procmail.svbin, resource usage: no 
> usage recorded)
>   sieve: multi-script: Execute result
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Executing 
> result (status=ok, commit=no)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Starting 
> execution of actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Executing actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Executing pipe 
> action
>   sieve: action pipe: running program: procmail
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Created
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Pass environment: 
> USER=test at uk7.teststring567.tk
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Pass environment: 
> HOME=/home/uk7/homes/test
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Pass environment: 
> HOST=servername.com
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Pass environment: 
> RECIPIENT=test at uk7.teststring567.tk
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Pass environment: 
> ORIG_RECIPIENT=test at uk7.teststring567.tk
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> executing pipe action (status=ok, keep=canceled)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> executing actions (status=ok, keep=none)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> executing result (no commit, status=ok, keep=no)
>   sieve: multi-script: Sequence ended
>   sieve: multi-script: Finishing sequence (status=ok)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Executing 
> result (status=ok, commit=yes)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Starting 
> execution of actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Executing actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> executing actions (status=ok, keep=none)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finalizing actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finalize pipe 
> action (status=ok, action_status=ok, commit_status=ok, pre-commit=yes)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Commit pipe action
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Establishing 
> connection
>   program exec:/var/lib/dovecot/sieve-pipe/procmail: Forked child process
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Connected 
> to program
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Finished 
> streaming payload to program
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Finished 
> input to program
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Disconnected
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Waiting 
> for program to finish after 0 msecs (timeout = 10000 msecs)
>   procmail[152746]: Error while writing to "/var/log/procmail.log"
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Child 
> process ended
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152746): Destroy
>   dovecot[152745]: 
> lda(test at uk7.teststring567.tk)<152745><ZkfLDZJ9EGOpVAIAsVjU+A>: sieve: 
> msgid=<20220901093826.065F32C7 at servername.com>: pipe action: piped 
> message to program `procmail'
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> finalizing actions (status=ok, keep=none)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finishing actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finish pipe action
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> executing result (final, status=ok, keep=no)
>   sieve: multi-script: Sequence finished (status=ok, keep=no)
>   sieve: multi-script: Destroy
>   auth-master: conn unix:/run/dovecot/auth-userdb (pid=152676,uid=0): 
> Disconnected: Connection closed (fd=25)
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152744): Child 
> process ended
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152744): Destroy
>   dovecot[152743]: 
> lda(test at uk7.teststring567.tk)<152743><0nIfDZJ9EGOnVAIAsVjU+A>: sieve: 
> msgid=<20220901093826.065F32C7 at servername.com>: pipe action: piped 
> message to program `procmail'
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> finalizing actions (status=ok, keep=none)
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finishing actions
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finish pipe action
>   sieve: msgid=<20220901093826.065F32C7 at servername.com>: Finished 
> executing result (final, status=ok, keep=no)
>   sieve: multi-script: Sequence finished (status=ok, keep=no)
>   sieve: multi-script: Destroy
>   auth-master: conn unix:/run/dovecot/auth-userdb (pid=152676,uid=0): 
> Disconnected: Connection closed (fd=24)
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152742): Child 
> process ended
>   program exec:/var/lib/dovecot/sieve-pipe/procmail (152742): Destroy
> ############################################
> 
> On 31-Aug-22 10:58 PM, Stephan Bosch wrote:
>>
>>
>> On 31-8-2022 17:20, Christian Mack wrote:
>>> Hello
>>>
>>> You need to activate vnd.dovecot.pipe extention in dovecots sieve.
>> And you need to configure it; i.e. specify where the scripts can be 
>> found.
>>
>>>
>>> Kind regards,
>>> Christian Mack
>>>
>>> Am 31.08.22 um 15:13 schrieb George Asenov:
>>>> Thanks that was the reason for the permissions error. Unfortunately the
>>>> next error comes that isn't explanatory:
>>>>
>>>> ##########################################
>>>>   Starting execution of actions
>>>>   Executing actions
>>>>   Executing pipe action
>>>>   Debug: sieve: action pipe: running program: procmail
>>>>   Error: sieve: action pipe: failed to execute program `procmail':
>>>> vnd.dovecot.pipe extension is unconfigured
>>>>   Finished executing pipe action (status=ok, keep=canceled)
>>>>   Finished executing actions (status=ok, keep=none)
>>>>   Finished executing result (no commit, status=ok, keep=no)
>>>>   Debug: sieve: multi-script: Sequence ended
>>>>   Debug: sieve: multi-script: Finishing sequence (status=ok)
>>>>   Executing result (status=ok, commit=yes)
>>>>   Starting execution of actions
>>>>   Executing actions
>>>>   Finished executing actions (status=ok, keep=none)
>>>>   Finalizing actions
>>>>   Finalize pipe action (status=ok, action_status=ok, commit_status=ok,
>>>> pre-commit=yes)
>>>>   Commit pipe action
>>>>   Error: sieve: failed to pipe message to program `procmail': refer to
>>>> server log for more information. [2022-08-31 13:58:54]
>>>>   Finished finalizing actions (status=failure, keep=none)
>>>>   Finalize implicit keep (failure=yes)
>>>>   Execute implicit keep (failure=yes)
>>>>   Start storing into mailbox INBOX
>>>>   Executing implicit keep action
>>>>   Execute storing into mailbox 'INBOX'
>>>>   Saving to mailbox 'INBOX' successful so far
>>>>   Finished executing implicit keep action (status=ok)
>>>>   Finalize implicit keep action(status=ok, action_status=ok,
>>>> commit_status=ok)
>>>>   Commit implicit keep action
>>>>   Commit storing into mailbox 'INBOX'
>>>>   stored mail into mailbox 'INBOX'
>>>>   Finish implicit keep action
>>>>   Finishing actions
>>>>   Finish pipe action
>>>>   Finished executing result (final, status=failure, keep=no)
>>>>   Debug: sieve: multi-script: Sequence finished (status=failure, 
>>>> keep=no)
>>>>   Debug: sieve: multi-script: Destroy
>>>>   Error: sieve: Execution of script
>>>> /var/lib/dovecot/sieve_after/procmail.sieve failed, but implicit keep
>>>> was successful
>>>> ##########################################
>>>>
>>>> On 31-Aug-22 2:27 PM, Aki Tuomi wrote:
>>>>> You are trying to execute /var/lib/dovecot/sieve-pipe/procmail 
>>>>> though...
>>>>>
>>>>> Aki
>>>>>
>>>>>> On 31/08/2022 14:14 EEST George Asenov <george.asenov at wpx.net> wrote:
>>>>>>
>>>>>>    [root at uk7 ~]# stat /usr/bin/procmail
>>>>>>      File: /usr/bin/procmail
>>>>>> Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (   12/ mail)
>>>>>>
>>>>>> [root at uk7 ~]# stat /usr/bin/
>>>>>>      File: /usr/bin/
>>>>>> Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/ root)
>>>>>>
>>>>>> [root at uk7 ~]# stat /usr
>>>>>>      File: /usr
>>>>>> Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/ root)
>>>>>>
>>>>>> For me it seems that everything with the permissions is ok. Others 
>>>>>> also
>>>>>> can execute it?
>>>>>>
>>>>>> Other suggestions?
>>>>>> Is the config correct?
>>>>>>
>>>>>> I forgot to mention
>>>>>> # dovecot --version
>>>>>> 2.3.16 (7e2e900c1a)
>>>>>> On
>>>>>> # cat /etc/redhat-release
>>>>>> Rocky Linux release 8.6 (Green Obsidian)
>>>>>>
>>>>>> On 31-Aug-22 1:16 PM, Bernd Petrovitsch wrote:
>>>>>>> Hi all!
>>>>>>>
>>>>>>> On 31/08/2022 11:40, George Asenov wrote:
>>>>>>> [...]> Aug 30 15:22:26 uk7 dovecot[112153]:
>>>>>>>> lda(test-uk7.teststring567.tk)<112151><BlNhECIdDmMXtgEAsVjU+A>: 
>>>>>>>> Fatal:
>>>>>>>> execvp(/var/lib/dovecot/sieve-pipe/procmail) failed: Permission 
>>>>>>>> denied
>>>>>>> That looks like a permission problem - no x Bits set on the 
>>>>>>> executable
>>>>>>> and/or directories to it (for the dovecot user)?
>>>>>>>
>>>>>>> Kind regards,
>>>>>>>        Bernd
>>>>>> -- 
>>>>>> Warm regards
>>>>>> George A.
>>>>>> WPXHosting
>>>
>>
> 

-- 
Warm regards
George A.
WPXHosting


More information about the dovecot mailing list