Jump to content

Archived

This topic is now archived and is closed to further replies.

Re-JeeP

Check if a mailserver is blacklisted

Recommended Posts

Hi!

I have a problem with a script that i'm creating to se if a mailserver is blacklisted.

[code]<?php
  $file = file_get_contents("http://www.mail-abuse.com/cgi-bin/lookup?ip_address=81.228.8.29");
  print_r($file);
?>[/code]

I get this message
[quote="error mess"]Warning: file_get_contents(http://www.mail-abuse.com/cgi-bin/lookup?ip_address=81.228.8.29) [function.file-get-contents]: failed to open stream: HTTP request failed! in /www/bl/index.php on line 2[/quote]

Have I done something wrong or can't I solve my problem like this?

Thanks!

// Johan

Share this post


Link to post
Share on other sites
"HTTP request failed" most likely means it couldn't load the website. Besides - file_get_contents loads the contents into a string, not an array, so print_r wouldn't work (either use echo or print).

What problem are you trying to solve here? It doesn't take that long to look that info up.

Share this post


Link to post
Share on other sites
I just tried that URL in my web browser and it took awhile to return. It could be a timing issue with PHP timing out while waiting for a response.

Ken

Share this post


Link to post
Share on other sites
Thats possible...

Is there any other way to solve this?

[quote]What problem are you trying to solve here? It doesn't take that long to look that info up.[/quote]
what do you mean?

I wan't to se if a mailserver is blacklisted at mail-abuse.com

Share this post


Link to post
Share on other sites
I understand what you want to do, but don't understand why you need a PHP script to do that. It doesn't take that long to look up an IP address on that site.

Share this post


Link to post
Share on other sites
Ok. I have a site that look up info about a domain.

It checks dns (MX, NS, CNAME) and so on and I wanted a function that checks mailservers in that list.

Share this post


Link to post
Share on other sites
Put a [code]<?php set_time_limit(0); ?>[/code] at the top of your script. This will prevent your script from timing out after 30 seconds.

It worked for me.

BTW, the print_r function works fine with non-array variables.

Ken

Share this post


Link to post
Share on other sites
[quote author=kenrbnsn link=topic=100579.msg397129#msg397129 date=1152896866]
Put a [code]<?php set_time_limit(0); ?>[/code] at the top of your script. This will prevent your script from timing out after 30 seconds.

It worked for me.[/quote]
Dosen't work. My PHP runs in safe-mode!

Share this post


Link to post
Share on other sites
Find another host, one that trusts their users more.

Ken

Share this post


Link to post
Share on other sites
Hehe.... just registerd a new webhotell for a year...

But did the script work for you when you add the time out function?

Share this post


Link to post
Share on other sites
With the time limit set to 0 (infinate) the script worked fine.

Ken

Share this post


Link to post
Share on other sites
[quote author=kenrbnsn link=topic=100579.msg397143#msg397143 date=1152897627]
With the time limit set to 0 (infinate) the script worked fine.

Ken
[/quote]
Hi again!

I tried the script at home but did'nt get it to work all the time.

I clocked it and if it timed out it stopped at about 75 sec.

Same error mess...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.