Re: [exim] Exim4 & QueryProgram

Etusivu
Poista viesti
Vastaa
Lähettäjä: Nigel Wade
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Exim4 & QueryProgram
Marco wrote:
> Nigel Wade ha scritto:
>
>> Marco wrote:
>>
>>> Hi all,
>>> I have created in my exim4.conf.template a new router with this
>>> characteristics:
>>> maildir_overquota2:
>>> driver = queryprogram
>>> command = /usr/local/sbin/checkQuota $local_part $domain
>>> command_user = mail
>>> command_group = mail
>>>
>>> This is my script (/usr/local/sbin/checkQuota)
>>> #!/bin/bash
>>> echo PASS
>>>
>>> When I test exim with:
>>> exim4 -oMr spam-scanned -d -bt root@???
>>> is ok!
>>>
>>> But when I try with:
>>> exim4 -bh IP I have this error:
>>>
>>> calling maildir_overquota2 router
>>> >>> maildir_overquota2 router: defer for root@???
>>> >>> message: maildir_overquota2 router: command returned non-zero
>>> code 127
>>> >>> ----------- end verify ------------
>>> >>> accept: condition test deferred
>>> 451 Temporary local problem - please try later
>>> LOG: H=localhost () [127.0.0.1] F=<user1@???> temporarily
>>> rejected RCPT root@???: maildir_overquota2 router: command
>>> returned non-zero code 127
>>>
>>> Could you help me?
>>>
>>> Thanks
>>> Marco
>>>
>>
>> The debugging output should tell you a whole lot more than you've
>> shown us above.
>>
>> Firstly, in the situation where it doesn't fail with non-zero return
>> code 127, is the router being run at all? The -oMr spam-scanned might
>> mean another router is accepting the address before the
>> maildir_overquota2 router is called.
>>
>>
>> In the second case, where it fails, who actually ran the script (it
>> should have been user mail, group mail, but what does the debugging
>> output show?). Does that user have permission to execute
>> /usr/local/bin/checkQuota?
>
>
>
> Hi Nigel,
> In first case the debugging output is: (with exim4 -oMr spam-scanned -d
> -bt root@???)
> --------> maildir_overquota2 router <--------
> local_part=root domain=domain.it
> calling maildir_overquota2 router
> maildir_overquota2 router called for root@???: domain = domain.it
> uid=8 gid=8 current_directory=/
> direct command:
> argv[0] = /usr/local/sbin/checkQuota
> argv[1] = $local_part
> argv[2] = $domain
> direct command after expansion:
> argv[0] = /usr/local/sbin/checkQuota
> argv[1] = root
> argv[2] = domain.it
> command wrote: PASS
> maildir_overquota2 router passed for root@???


Ok, here the values of $local_part and $domain above (root and domain.it) are
substited in the command as expected...

>
> end exim proceed with another router.
>
> In second case the debugging output is: (with exim4 -bh IP)
> --------> maildir_overquota2 router <--------
> local_part=root domain=domain.it
> calling maildir_overquota2 router
> maildir_overquota2 router called for root@???: domain = domain.it
> uid=8 gid=8 current_directory=/
> direct command:
> argv[0] = /usr/local/sbin/checkQuota
> argv[1] = $local_part
> argv[2] = $domain
> direct command after expansion:
> argv[0] = /usr/local/sbin/checkQuota
> argv[1] = koron
> argv[2] = koron.it
> maildir_overquota2 router: defer for root@???


... but here they are not. In this command they have been substituted as koron
and koron.it, despite the debug output stating they are root and domain.it, as
above.

Do those values have any significance?

> message: maildir_overquota2 router: command returned non-zero code 127


What does your script really do? If all it does is to output the string PASS,
why would the arguments passed to it make any difference? The 127 normally
indicates a "command not found" or "permission denied" type of error.

> ----------- end verify ------------
> accept: condition test deferred
> SMTP>> 451 Temporary local problem - please try later
> 451 Temporary local problem - please try later
> LOG: MAIN REJECT
> H=localhost (name) [IP] F=<user1@???> temporarily rejected RCPT
> root@???: maildir_overquota2 router: command returned non-zero
> code 127
> and exim stop.
>
> Permission of checkQuota script:
> ls -lah /usr/local/sbin/
> -rwxrwxrwx root:mail checkQuota


That looks ok.


-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@???
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555