[Serdev] Can the function is_to_local be added to the domain
module
Klaus Darilion
klaus.mailinglists at pernau.at
Tue May 25 15:11:07 UTC 2004
There is a function to check for to-tags: has_totag()
I do it this way:
if (is_from_local() ) {
#authenticate local user
route(8);
} else {
# request from non local user? is only allowed if loose routing is used
and to tag is present
if ( is_present_hf("Route") && has_totag() ) {
xlog("L_INFO", "%is [%Tf]: %rm %fu -> %ru: relaying allowed because
route header is present\n");
} else {
sl_send_reply("403", "we don't support relaying");
xlog("L_ERR", "%is [%Tf]: %rm %fu -> %ru: 403 relaying not allowed
->break\n");
break;
};
};
klaus
Zeus Ng wrote:
> I guess x-lite use the Route header whereas WM does not. So, x-lite
> in-dialog will not use loose_route().
>
> Anyway, my relay checking is now written as follow and seems to be working
> fine.
>
> # loose-route processing
>
> if (loose_route()) {
>
> xlog("L_NOTICE", "Loose route detected\n");
> if (!t_relay()) {
>
> sl_reply_error();
> };
>
> xlog("L_NOTICE", "%rm: Message forwarded to destination\n");
> break;
> };
>
>
>
> /* Prevent using our proxy as a relay */
> if (!(is_from_local() || is_uri_host_local()) &&
> !search("^To:(.*);tag=(.*)$")) {
> xlog("L_ERR", "reject: RCPT from %is: 403 %ct: Relay access denied;
> from=<%fu> to=<%tu> method=%rm uri=<%ru>\n");
> sl_send_reply("404", "Relay access not allowed here");
> break;
> };
>
>
> Zeus
>
>
>
>>-----Original Message-----
>>From: Klaus Darilion [mailto:klaus.mailinglists at pernau.at]
>>Sent: Wednesday, 26 May 2004 12:11 AM
>>To: Zeus Ng
>>Cc: 'Juha Heinanen'; serdev at lists.iptel.org
>>Subject: Re: [Serdev] Can the function is_to_local be added
>>to the domain module
>>
>>
>>Note: in-dialog requests are not always caught by the
>>loose_route block,
>>e.g. in-dialog requests of Windows Messenger (which is a
>>strict router)
>>are processed by the loose_route block whereas xlite's in-dialog
>>requests passes by.
>>
>>Why? I don't know. :-(
>>
>>Klaus
>>
>
>
>
More information about the Serdev
mailing list