request=process_request?? (Postfix policy delegation)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

request=process_request?? (Postfix policy delegation)

Manuel Mely-2
Hi,

I'm trying to write a custom policy daemon based on postsize[1]. First,
i'm trying to use postsize with postfix without luck.
Postsize works fine as a script, let me explain, if i do a "telnet
localhost 41414" and send this sequence:

request=smtpd_access_policy
protocol_state=RCPT
protocol_name=SMTP
sender=[hidden email]
recipient=[hidden email]
size=30720000

This works fine, i get a action=value. But if i tell postfix to use the
policy daemon, i get this in /var/log/mail.log in conjunction with a 451
code error

May 20 10:25:42 quebec postfix/smtpd[4498]: warning: premature
end-of-input on 127.0.0.1:41414 while reading input attribute name
May 20 10:25:43 quebec postfix/smtpd[4500]: warning: premature
end-of-input on 127.0.0.1:41414 while reading input attribute name
May 20 10:25:43 quebec postfix/smtpd[4500]: warning: problem talking to
server 127.0.0.1:41414: Success

It seems the script is not reading or have a not wellformed attribute.
This is the main problem.

Trying to solve this, i'm reading postsize code (also some greylist.pl,
postgrey examples and of course SMTPD_POLICY_README) and i noticed that
this other scripts use smtpd_access_policy as function name (for
evaluating policies), also documentation talk about the "request"
attribute and smtpd_access_policy value. My point is to know if is
always request=smtpd_access_policy or can be request=process_request .
Could i see what value for "request" is sending my SMTP server to the
policy daemon?
I'm using process_request as value is because postsize uses Net::Server
perl server engine.






Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: request=process_request?? (Postfix policy delegation)

Wietse Venema
Manuel Mely:
[ Charset ISO-8859-1 unsupported, converting... ]

> Hi,
>
> I'm trying to write a custom policy daemon based on postsize[1]. First,
> i'm trying to use postsize with postfix without luck.
> Postsize works fine as a script, let me explain, if i do a "telnet
> localhost 41414" and send this sequence:
>
> request=smtpd_access_policy
> protocol_state=RCPT
> protocol_name=SMTP
> sender=[hidden email]
> recipient=[hidden email]
> size=30720000
>
> This works fine, i get a action=value. But if i tell postfix to use the
> policy daemon, i get this in /var/log/mail.log in conjunction with a 451
> code error
>
> May 20 10:25:42 quebec postfix/smtpd[4498]: warning: premature
> end-of-input on 127.0.0.1:41414 while reading input attribute name
> May 20 10:25:43 quebec postfix/smtpd[4500]: warning: premature
> end-of-input on 127.0.0.1:41414 while reading input attribute name
> May 20 10:25:43 quebec postfix/smtpd[4500]: warning: problem talking to
> server 127.0.0.1:41414: Success
>
> It seems the script is not reading or have a not wellformed attribute.
> This is the main problem.
>
> Trying to solve this, i'm reading postsize code (also some greylist.pl,
> postgrey examples and of course SMTPD_POLICY_README) and i noticed that
> this other scripts use smtpd_access_policy as function name (for
> evaluating policies), also documentation talk about the "request"
> attribute and smtpd_access_policy value. My point is to know if is
> always request=smtpd_access_policy or can be request=process_request .
> Could i see what value for "request" is sending my SMTP server to the
> policy daemon?
> I'm using process_request as value is because postsize uses Net::Server
> perl server engine.

What is not clear about the text in SMTPD_POLICY_README?

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: request=process_request?? (Postfix policy delegation)

Manuel Mely-2
Wietse Venema wrote:
>
>
> What is not clear about the text in SMTPD_POLICY_README?
>
> Wietse
>  

The "request" attribute is required. In this example the request type is
"smtpd_access_policy".

My point is, does the name of request value must be the name of the
policy evaluating function in the script? For example, greylist.pl have
a function called smtpd_access_policy as request value have.

What does the SMTP server sends as "value" in the "request attribute" to
the policy daemon?
If i debug in postfix, can i see what the SMTP server name=value is
sending to the policy daemon?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: request=process_request?? (Postfix policy delegation)

Wietse Venema
Manuel Mely:

> Wietse Venema wrote:
> >
> >
> > What is not clear about the text in SMTPD_POLICY_README?
> >
> > Wietse
> >  
>
> The "request" attribute is required. In this example the request type is
> "smtpd_access_policy".
>
> My point is, does the name of request value must be the name of the
> policy evaluating function in the script? For example, greylist.pl have
> a function called smtpd_access_policy as request value have.
>
> What does the SMTP server sends as "value" in the "request attribute" to
> the policy daemon?
> If i debug in postfix, can i see what the SMTP server name=value is
> sending to the policy daemon?

At this time, "smtpd_access_policy" is the only request type that
is defined. If you want to maintain compatibility with existing
tools, then do not stray from the path.

The policy protocol can be implemented in any language, so I don't
understand why you are asking a question about a PERL SUBROUTINE
name.

        Wietse


Loading...