XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum -> PHP Filters in Windows 2003

Reply to this topicStart new topicStart Poll

> PHP Filters in Windows 2003
jstuckle
Posted: Jul 19 2006, 07:05 PM
Quote Post


Newbie
*

Group: Members
Posts: 13
Member No.: 2118
Joined: 25-June 06



I've got two problems which may or may not be related.

First of all, I'm trying to get a test filter written in PHP to run. This basic filter just takes the input arguments and writes them to a file (works fine by itself).

The server is Windows 2003 with two IP addresses. The primary IP is used for our live site, and the secondary one for testing. We have the primary domain MX record pointing to the primary IP and a test subdomain MX record pointing to the secondary IP. these work fine.

My first attempt was in filters.pre-data.tab to only process the secondary IP address and domain:

"*" "*@test.[DOMAIN]" "*" "[IPADDRESS]/32" "testfilter.tab"

testfilter.tab has:

"c:/php/php.exe" "[MAILROOT]/filters/helofilter.php" "@@FILE"

This setup calls the filter but with return code -121 (can't execute). I also tried it with no parameters in testfilter.tab, to no avail. I even tried with "c:\php\php.exe" and "c:\\php\\php.exe" to no avail. "Any idea what I'm doing wrong here?

Figuring it might be a problem with the way I was using the pre-data filter, I tried the following in filters.in.tab:

"*" "*@test.[DOMAIN]" "0.0.0.0/0" "0.0.0.0/0" "testfilter.tab"

The filter wasn't even being called (nothing in the filters log file). So I changed this to:

"*" "*" "0.0.0.0/0" "0.0.0.0/0" "testfilter.tab"

And the filter still wasn't being called.

Now I'm totally confused. From what I can tell in the docs, my entries are correct (tabs between entries, etc.). And testfilter.tab is in [MAILROOT]/filters (and seems to be called in the firs case, anyway).

Maybe these two are related and maybe they aren't. But I'd really like to get this going!

TIA for any help anyone can provide.

Jerry
PM
Top
hschneider
Posted: Jul 20 2006, 07:55 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



> "[MAILROOT]/filters/helofilter.php"

Replace "[MAILROOT]" with a valid path.


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
jstuckle
Posted: Jul 20 2006, 12:54 PM
Quote Post


Newbie
*

Group: Members
Posts: 13
Member No.: 2118
Joined: 25-June 06



It is a valid path. I just don't list some of these things in a public forum.

And even if it weren't a valid path, I should still be able to execute PHP. I'd just get an error from PHP itself. As it is, I'm getting -121 trying to execute php.exe.
PM
Top
hschneider
Posted: Jul 20 2006, 01:45 PM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Use \ instead of / ...


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
jstuckle
Posted: Jul 20 2006, 10:49 PM
Quote Post


Newbie
*

Group: Members
Posts: 13
Member No.: 2118
Joined: 25-June 06



Thanks for the suggestion, but like I said in the first post, I've tried both single and double backslashes in it.

The whole thing has me very perplexed!
PM
Top
hschneider
Posted: Jul 21 2006, 06:25 AM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Pls double check all paths and also if real tabs are used inside all .tab files.


--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
jstuckle
Posted: Jul 21 2006, 12:37 PM
Quote Post


Newbie
*

Group: Members
Posts: 13
Member No.: 2118
Joined: 25-June 06



Believe me - I have checked everything twice, long before I posted here. I do have tab characters in my .TAB files and the path to my PHP.EXE is correct.

I may be new to xmail - but I am not a newbie. And I still think it's something I've done wrong, but everything looks OK.

And I'm getting desparate enough to compile the source and start debugging...
PM
Top
hschneider
Posted: Jul 21 2006, 02:02 PM
Quote Post


No - I'm not an answering script ...
Group Icon

Group: Admin
Posts: 6631
Member No.: 195
Joined: 19-June 02



Gotit!

"c:\php\php.exe [MAILROOT]\filters\helofilter.php" "@@FILE"



--------------------
Bye,
Harald


-- Download XMail Queue Manager 1.46 NOW: XMail Server Tools
-- Cross platform remote queue management!
-- Message analyzing on the fly!
-- Builtin diagnostics knowledge base!
-- Manages multiple mail queues!

Sponsored by
CD-Produktion und DVD-Produktion and Homestaging Saarland - Immobilien schneller verkaufen in der Region Saarland, Rheinland-Pfalz und Luxembourg
PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Scripting Corner | Next Newest »

Reply to this topicStart new topicStart Poll