Block IPs
Block IPs
Hi, is it possible to block IPs in hMailServer server somewhere (I am not asking about DNS blacklist). Something like a flat list of IPs that should not be allowed to connect to hMailServer (similar to a firewall list).
Why I am asking this question is because I am blocking IPs that I discover in Hmailserver logs but the problem is that my router/firewall has a limit of 16 IPs of its blacklist
Why I am asking this question is because I am blocking IPs that I discover in Hmailserver logs but the problem is that my router/firewall has a limit of 16 IPs of its blacklist
Re: Block IPs
Firewall blacklist
Re: Block IPs
Maybe this is a good starting point
https://www.hmailserver.com/forum/viewt ... 21&t=32829
https://www.hmailserver.com/forum/viewt ... 21&t=32829
Re: Block IPs
Thanks, I followed instructions in the thread you provided, added 5 IPs, letys see
Re: Block IPs
http://hmailserver.com/forum/viewtopic.php?f=9&t=34082
hMailServer Firewall Ban
Ban IPs to windows firewall. Complete with PHP admin/management.
If you care to try it out, wait a few hours before downloading it. I have an update in the works that I hope to upload within 3 hours from now. I finished the update, but I have something running now that needs to end before I can test it out for bugs.
Re: Block IPs
The other guys who have been responding are better at this than I am.
But I ban IPs too but I do it through hMailServer's IP Ranges function. You simply create this list in the set of IP Ranges which prevents the IP Address from processing in hMailServer. In the logs you will see the IP Address connect but then immediately the session will terminate because the IP Address has been banned. A problem with doing it this way is depending on how many IP Addresses you want to ban, your list could be quite lengthy. It could also probably add some processing time to hMailServer. I don't know the internals of hMailServer to say if this would be a performance hit. I have 40 IP Address bans set up in hMailServer. The Windows Firewall method of course though prevents the IP Addresses from ever reaching hMailServer as does your Router Firewall as well. The problem with using Windows Firewall is if you choose to use another Firewall such as McAfee, maybe Kaspersky, Norton, etc. then Windows Firewall is disabled.
You can find the IP Ranges by going to Settings>Advanced>IP Ranges. To make the entry, you specify a beginning and ending IP Range for each entry (if you have a sequential block of IPs then on one IP Range entry is needed). You uncheck (disable) all the Protocols (POP3, IMAP, SMTP) and uncheck all the other specifications disallowing any deliveries, etc. In short uncheck all the check boxes. Set a Priority higher than any other priority for the IP Range.
You should be aware that the IP Address you are blocking might actually be a legitimate IP Address and some hacker is using the IP Address which means you may be potentially blocking legitimate email from reaching hMailServer. This would be the same issue if you were using Wiondows Firewall, your Router Firewall, or any other Firewall as well.
But I ban IPs too but I do it through hMailServer's IP Ranges function. You simply create this list in the set of IP Ranges which prevents the IP Address from processing in hMailServer. In the logs you will see the IP Address connect but then immediately the session will terminate because the IP Address has been banned. A problem with doing it this way is depending on how many IP Addresses you want to ban, your list could be quite lengthy. It could also probably add some processing time to hMailServer. I don't know the internals of hMailServer to say if this would be a performance hit. I have 40 IP Address bans set up in hMailServer. The Windows Firewall method of course though prevents the IP Addresses from ever reaching hMailServer as does your Router Firewall as well. The problem with using Windows Firewall is if you choose to use another Firewall such as McAfee, maybe Kaspersky, Norton, etc. then Windows Firewall is disabled.
You can find the IP Ranges by going to Settings>Advanced>IP Ranges. To make the entry, you specify a beginning and ending IP Range for each entry (if you have a sequential block of IPs then on one IP Range entry is needed). You uncheck (disable) all the Protocols (POP3, IMAP, SMTP) and uncheck all the other specifications disallowing any deliveries, etc. In short uncheck all the check boxes. Set a Priority higher than any other priority for the IP Range.
You should be aware that the IP Address you are blocking might actually be a legitimate IP Address and some hacker is using the IP Address which means you may be potentially blocking legitimate email from reaching hMailServer. This would be the same issue if you were using Wiondows Firewall, your Router Firewall, or any other Firewall as well.
If you think you understand quantum mechanics, you don't understand quantum mechanics.
Re: Block IPs
Hello Palinka, sorry for my late come back
I went through the http://hmailserver.com/forum/viewtopic.php?f=9&t=34082 (half-way)
it is really what I am looking for, I was disappointed when I initially read that it was only compatible with mysql, then I understood that enhancements were done to be compatible with SQL server at
https://github.com/palinkas-jo-reggelt/ ... n/issues/1 ,
my server is sql, big discussions and a lot of efforts, great . Now couple of questions:
- what is the latest version that I should download for SQL server and the latest instructions as well as the nice web site you created ?
- 2nd, I did not figure out how hMailServer will ban email? Based on what info that it will add the ip to the DB?
Thanks in advance
I went through the http://hmailserver.com/forum/viewtopic.php?f=9&t=34082 (half-way)
it is really what I am looking for, I was disappointed when I initially read that it was only compatible with mysql, then I understood that enhancements were done to be compatible with SQL server at
https://github.com/palinkas-jo-reggelt/ ... n/issues/1 ,
my server is sql, big discussions and a lot of efforts, great . Now couple of questions:
- what is the latest version that I should download for SQL server and the latest instructions as well as the nice web site you created ?
- 2nd, I did not figure out how hMailServer will ban email? Based on what info that it will add the ip to the DB?
Thanks in advance
Re: Block IPs
I think it should be good now. I've reached out to the fellow helping me with the mssql queries and I'm waiting to hear back if the last changes are actually final or not. But its either done completely or 99.9% done.eliassal wrote: ↑2020-02-12 16:13Hello Palinka, sorry for my late come back
I went through the http://hmailserver.com/forum/viewtopic.php?f=9&t=34082 (half-way)
it is really what I am looking for, I was disappointed when I initially read that it was only compatible with mysql, then I understood that enhancements were done to be compatible with SQL server at
https://github.com/palinkas-jo-reggelt/ ... n/issues/1 ,
my server is sql, big discussions and a lot of efforts, great . Now couple of questions:
- what is the latest version that I should download for SQL server and the latest instructions as well as the nice web site you created ?
- 2nd, I did not figure out how hMailServer will ban email? Based on what info that it will add the ip to the DB?
Thanks in advance
You should give it a try as it is. The powershell stuff is very complete. If there are any bugs, they're in the PHP, which really won't have any effect on whether your system is actually working or not. If you have any issues, post in the firewall ban thread.
Also, bear in mind that unless a MSSQL-specific issue is very simple, I probably can't help you and you'd have to post an issue on the lcamilo's GitHub page. But the rest of it I'm good with. As with any software, the bugs are 99.9% typos that can be easily fixed if we know about them.
For me, everything is working great and I'm using the same code that's on GitHub except for the eventhandlers stuff, which I haven't (yet) bothered trying to setup on my system.
Re: Block IPs
Don't worry Panilka, I am personally certified SQL server, I worked more than 15 years administring SQL. I did also T-SQL dev long time ago (when I was young ) between 2000-2005. But I still do some t-sql programming im my spare time so I dont forget.
In any case I saw on the github the discussion, you can ask me of course if you have any other issue
In any case I saw on the github the discussion, you can ask me of course if you have any other issue
Re: Block IPs
Yes, I like to try but you did not answer my 2 questions
Re: Block IPs
First - version of firewall ban or version of sql? If you meant the firewall ban, use the latest. If you meant sql, I have no idea. I did not write the queries for mssql. Maybe you should have a look at a few queries if there are differences in syntax between versions.- what is the latest version that I should download for SQL server and the latest instructions as well as the nice web site you created ?
- 2nd, I did not figure out how hMailServer will ban email? Based on what info that it will add the ip to the DB?
Second - The way it works is like this:
1) You set up eventhandlers.vbs to trigger the firewall ban on criteria that you decide. I have some examples for geoip, spamhaus and others.
2) When the firewall ban is called by eventhandlers.vbs, it writes the IP and other information to the database.
3) Task scheduler launches a powershell script that retrieves the latest IPs and creates a firewall rule.
That's the basic concept. The PHP admin allows you to view and modify bans. You can search based on a number of different critera and release an IP (remove firewall rule), make an IP permanently safe from being banned in the future and some other things. Everything that happens with the PHP is manipulating the database. Then, based on flags created by the PHP, the powershell script does things like remove firewall rules, create new rules, etc.
Its grown into something fairly complex. Its working great for me. I'm almost up to 20k banned IPs. I don't really see any practical limit to the number of IPs you can ban. Its chugging along happily day after day.
Re: Block IPs
Here you go. Today's hits. The "FB" column is firewall blocks, counted from the firewall log. None of those ever presented themselves to hmailserver since they were dropped at the firewall.
Re: Block IPs
fantastic. I went again through Instructions section , are those the most up to date to follow? A lot of things to setup wow
Re: Block IPs
Yes. That's the latest, except I haven't changed it for the new functions in eventhandlers.vbs (for choice of mysql or mssql queries). Give it a shot and let me know if you run into errors.
Since you're adept at mssql, you may want to just dump the "choice" functions and go straight with mssql queries.
The worst of the setup is ther vbs side.
Re: Block IPs
OK, I will backup my hmailserver tomorrow and start this endeavor
Re: Block IPs
Palinka, while I started backup to prepare for using this stuff, I noticed that there was already a directory phpwebadmin in hmailserver directory, I was not aware of it. I decided to set it up.
My IIS is version 10.0 running on windows server 2016 (this is where hMailserver runs), I installed php 5.3, phpinfo.php runs fine, followed all instructions at
http://localhost/PHPWebAdmin/
I get
My IIS is version 10.0 running on windows server 2016 (this is where hMailserver runs), I installed php 5.3, phpinfo.php runs fine, followed all instructions at
still when i try to runhmailserver.com/documentation/v5.3/?page=howto_install_phpwebadmin
hmailserver.com/documentation/v5.3/?page=ts_setup_phpwebadmin
hmailserver.com/documentation/latest/index.php?page=howto_dcom_permissions
http://localhost/PHPWebAdmin/
I get
I played with application pools identity, even I tried Administrator credentials which has full privileges on DCOM hmailserver, no way always getting this errorFatal error: Class 'COM' not found in C:\inetpub\wwwroot\PHPWebAdmin\initialize.php on line 13
Re: Block IPs
Try this
Open your loaded PHP.INI, assuming your PHP Path is something like this
C:\Program Files\PHP\php.ini
Lookup this section
"Dynamic Extensions "
Your will see a lot of PHP Extension listed ( if ; stand before, it means its not enabled)
Check the list of Extensions carefully and if you cannot find the php_com_dotnet Extension,
just add it like this
extension=php_com_dotnet
Save the PHP.INI file, close it and just reopen it in Notepad and check if it was really saved.
If you cant save your PHP.INI file because of a permission issue, just click your Windows Start Menue, type in Notepad,
right click it (if it was found) and select "run as Administrator". Now open your PHP.INI file.
After it, Restart Your Microsoft Internet Information Server (IIS) Webserver service and check if PHPWebAdmin works as expected.
Open your loaded PHP.INI, assuming your PHP Path is something like this
C:\Program Files\PHP\php.ini
Lookup this section
"Dynamic Extensions "
Your will see a lot of PHP Extension listed ( if ; stand before, it means its not enabled)
Check the list of Extensions carefully and if you cannot find the php_com_dotnet Extension,
just add it like this
extension=php_com_dotnet
Save the PHP.INI file, close it and just reopen it in Notepad and check if it was really saved.
If you cant save your PHP.INI file because of a permission issue, just click your Windows Start Menue, type in Notepad,
right click it (if it was found) and select "run as Administrator". Now open your PHP.INI file.
After it, Restart Your Microsoft Internet Information Server (IIS) Webserver service and check if PHPWebAdmin works as expected.
Re: Block IPs
I tried the suggestion at
https://serverfault.com/questions/42350 ... on-line-22
but it did not workm i will try yours now
https://serverfault.com/questions/42350 ... on-line-22
but it did not workm i will try yours now
Re: Block IPs
Yeeees it workedm you are the man sirm I was able to access the server
Re: Block IPs
Glad you solved it
Re: Block IPs
Palinka, I downloaded the files (master), there is no sql creation tables. I sa that there are 2 other branches AddSQL support and FixSqlquery, which one I should use between those 3 branches?
IN the setup instructions, you indicate in point
5 "Edit variables in hmsFirewallBan.ps1"
There are no variables in this ps file. I think you mean "Config.ps1"
3rd, all thos Powershell files where they should be copied? in which directory?
Last question, If I understand well, I should run hmsFirewallBan.ps1 at least one in order to create the tables in the database? of course once you confirm from which branch I should get it
IN the setup instructions, you indicate in point
5 "Edit variables in hmsFirewallBan.ps1"
There are no variables in this ps file. I think you mean "Config.ps1"
3rd, all thos Powershell files where they should be copied? in which directory?
Last question, If I understand well, I should run hmsFirewallBan.ps1 at least one in order to create the tables in the database? of course once you confirm from which branch I should get it
Re: Block IPs
As I copied all code in EventHandlers.vbs to my one on the server for the time being only to my hmailserver, I started to see the following error in the log
"ERROR" 5928 "2020-02-14 16:26:54.558" "Script Error: Source: hMailServer COM library - Error: 800403E9 - Description: You do not have access to this property / method. Ensure that hMailServer.Application.Authenticate() is called with proper login credentials. - Line: 186 Column: 4 - Code: (null)"
"ERROR" 5928 "2020-02-14 16:26:54.558" "Script Error: Source: hMailServer COM library - Error: 800403E9 - Description: You do not have access to this property / method. Ensure that hMailServer.Application.Authenticate() is called with proper login credentials. - Line: 186 Column: 4 - Code: (null)"
Re: Block IPs
First, use the current master. Always.eliassal wrote: ↑2020-02-14 17:35Palinka, I downloaded the files (master), there is no sql creation tables. I sa that there are 2 other branches AddSQL support and FixSqlquery, which one I should use between those 3 branches?
IN the setup instructions, you indicate in point
5 "Edit variables in hmsFirewallBan.ps1"
There are no variables in this ps file. I think you mean "Config.ps1"
3rd, all thos Powershell files where they should be copied? in which directory?
Last question, If I understand well, I should run hmsFirewallBan.ps1 at least one in order to create the tables in the database? of course once you confirm from which branch I should get it
Second, I did not update the instructions yet since beginning the conversion to include mssql queries. Config.ps1 is correct for user variables. All of the functions for differentiating mysql/mssql are located in CommonCode.ps1.
Third, place the powershell in any folder you want - so long as the admin user or SYSTEM user that you define in task scheduler has access. All of the powershell files refer to $PSScriptRoot\ for folder locations so it doesn't matter where they go as long as they are together in the same folder. New folders for various things are created relationally like that as well (to keep things tidy so your main folder isn't clogged up with the various txt/csv files needed for running certain functions).
EventHandlers.vbs, of course, is your hmailserver one.
The files in the www folder need to go where your webserver can read and serve them out.
hMailServer's PHP webadmin has nothing to do with my project, although its a very handy thing to have working.
Re: Block IPs
Either you didn't put the correct password in the variables or you're missing a function.eliassal wrote: ↑2020-02-14 17:43As I copied all code in EventHandlers.vbs to my one on the server for the time being only to my hmailserver, I started to see the following error in the log
"ERROR" 5928 "2020-02-14 16:26:54.558" "Script Error: Source: hMailServer COM library - Error: 800403E9 - Description: You do not have access to this property / method. Ensure that hMailServer.Application.Authenticate() is called with proper login credentials. - Line: 186 Column: 4 - Code: (null)"
The fellow helping me with the mssql queries also created an INI file for user variables. That just complicated things, IMO. Add the following to the top of your eventhandlers.vbs:
Code: Select all
Private Const ADMIN = "Administrator"
Private Const PASSWORD = "supersecretpassword"
Private Const EVENTDIR = "C:\Program Files (x86)\hMailServer\Events"
Private Const LOGDIR = "C:\Program Files (x86)\hMailServer\Logs"
Private Const TEMPDIR = "C:\Program Files (x86)\hMailServer\Temp"
Private Const idsTable = "hm_ids"
Private Const DatabaseType = "MSSQL"
When I have time, I'll go through his changes and move them all back into EventHandlers.vbs which is where everything should be all together. I don't see any reason to have multiple files for hmailserver (except VbsJson.vbs, which is quite long).
Re: Block IPs
OK I will run then in a powershell terminal the hmsFirewallBan.ps1 script
Re: Block IPs
but tell me what hmsFirewallBanDBSetup.ps1 does, who is calling it?
Re: Block IPs
shouldnt I run hmsFirewallBanDBSetup.ps1 before schedueling hmsFirewallBan.ps1?
Re: Block IPs
Yes. Otherwise you will have no database into which you place your data. That could also be the root of your vbs error: Error: 800403E9 - Description: You do not have access to this property / method. I was thinking it was an authentication issue, but is probably just no database at all.
Re: Block IPs
Palinka, here is my 1st notes
1- Access to SQL can be done in 2 ways, either Trusted connection or user/password. In my environment, I updated the connection string as follows and it worked fine so the tool should allow to chose 1 of them
2 - I managed to create the tables
3 - in the instructions for the web site, you mention "update cred.php", there is no cred.php, I think you mean config.php. For sql, we have this,
Today using ODBC is very rare for sql generally speaking, sometimes in specific cases.
Anyway, when I try to access the ban web site I get
5 - I agree with you, code should be cleaned somehow especially when talking to Database. In C#, I used Datafactory pattern in the past in order to be able to develop applications that you can plug whatever database, I am not sure if this can be done in vbs, last time I worked with VBS was 2000.
In any case nice efforts and we should continue to improve this tool and make it more robust as attacks are there 24x24 7x7. If any help needed I will be more than happy
1- Access to SQL can be done in 2 ways, either Trusted connection or user/password. In my environment, I updated the connection string as follows and it worked fine so the tool should allow to chose 1 of them
Code: Select all
$ConnectionString = "Server=" + $SQLHost + ";" + "Database=" + $SQLDatabase + ";Trusted_Connection=true"
3 - in the instructions for the web site, you mention "update cred.php", there is no cred.php, I think you mean config.php. For sql, we have this,
Code: Select all
$Database = array (
'dbtype' => 'MSSQL',
'host' => 'SQL\SC2K12',
'username' => 'myuser',
'password' => 'myuser',
'dbname' => 'hmailserver',
'driver' => 'mysql',
'port' => '3306',
'dsn' => 'MariaDB ODBC 3.0 Driver'
);
Anyway, when I try to access the ban web site I get
4 - Errors disappeared in hMailServer but nothing is written to the table [hm_fwban], can you please remind me what are the rules so data can be written to this table?Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:\inetpub\wwwroot\PHPBanAdmin\functions.php:6 Stack trace:
#0 C:\inetpub\wwwroot\PHPBanAdmin\functions.php(6): PDO->__construct('sqlsrv:Server=S...', 'myuser', 'myuser') #1
C:\inetpub\wwwroot\PHPBanAdmin\charthitsperdaycombined.php(2):
include_once('C:\inetpub\wwwr...')
#2 C:\inetpub\wwwroot\PHPBanAdmin\head-g.php(14):
include('C:\inetpub\wwwr...')
#3 C:\inetpub\wwwroot\PHPBanAdmin\index.php(1): include('C:\inetpub\wwwr...')
#4 {main} thrown in C:\inetpub\wwwroot\PHPBanAdmin\functions.php on line 6
5 - I agree with you, code should be cleaned somehow especially when talking to Database. In C#, I used Datafactory pattern in the past in order to be able to develop applications that you can plug whatever database, I am not sure if this can be done in vbs, last time I worked with VBS was 2000.
In any case nice efforts and we should continue to improve this tool and make it more robust as attacks are there 24x24 7x7. If any help needed I will be more than happy
Re: Block IPs
Also if possible, whhile I am waiting my table gets populated, can you please share some records for blocked IPs from [hm_fwban] your so I can test the other functions of the powershell
Re: Block IPs
You need to install the MS-SQL Server Driver for the exact PHP Version you are running
https://docs.microsoft.com/en-us/sql/co ... rver-ver15
Then you need to follow this instructions to enable it in PHP.INI
https://docs.microsoft.com/en-us/sql/co ... rver-ver15
https://docs.microsoft.com/en-us/sql/co ... rver-ver15
Then you need to follow this instructions to enable it in PHP.INI
https://docs.microsoft.com/en-us/sql/co ... rver-ver15
Re: Block IPs
But why the phpwebadmin worked without this driver, it talks to sql as well, no?
Re: Block IPs
No, it uses DCOM to the hMailServer application.
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
Re: Block IPs
OK, but which version of the driver I shlould setup the 5.3 or 7.3?
Yesterday I configured my IIS to use 5.3 in order to make phpwebadmin works
Yesterday I configured my IIS to use 5.3 in order to make phpwebadmin works
Re: Block IPs
VBS scripts seems working fine, I got 1 record in ids table now
Code: Select all
timestamp ipaddress hits country helo
2020-02-15 13:54:14.547 185.36.81.23 1 Republic of Lithuania NULL
Re: Block IPs
According to Release info, you need atleast a PHP 7.x version.
PHP 5.3 isn't supported anymore.
PHP 5.3 isn't supported anymore.
Re: Block IPs
OK, I have already downloaded 7.3
for the record I got, Powershell correctly created the firewall rule but was not able to insert the record in hwban table, after debugging I saw this error in sql, I will investigate, have you seen this?
for the record I got, Powershell correctly created the firewall rule but was not able to insert the record in hwban table, after debugging I saw this error in sql, I will investigate, have you seen this?
Code: Select all
INSERT INTO hm_fwban
(timestamp,ipaddress,ban_reason,country,flag,ptr,rulename)
VALUES (GETDATE(),'185.36.81.23','IDS','Republic of Lithuania',NULL,'No.PTR.Record','185.36.81.23');
Msg 8152, Level 16, State 30, Line 13
String or binary data would be truncated.
The statement has been terminated.
Re: Block IPs
I solved the sql truncation issue, I dont know why the field ipaddres was created with varchar(1)
Re: Block IPs
for the web sit even after setting the driver, I am still getting the same error, here is what i have in my php.config
$Database = array (
'dbtype' => 'mssql',
'host' => 'SQL\SC2K12',
'username' => 'myuserrun',
'password' => 'myuserrun',
'dbname' => 'hmailserver',
'driver' => 'mssql',
'port' => '49207',
'dsn' => ''
);
Re: Block IPs
well I added the foloowing 2 lines in the php.ini
error disappeared but I am getting a blank pageextension=php_sqlsrv_7_ts.dll
extension=php_pdo_sqlsrv_7_ts.dll
Re: Block IPs
how can we debug this? I am not well versed with php
Re: Block IPs
You sure this is right? Shouldn't it be just SC2K12?eliassal wrote: ↑2020-02-15 17:12for the web sit even after setting the driver, I am still getting the same error, here is what i have in my php.config
$Database = array (
'dbtype' => 'mssql',
'host' => 'SQL\SC2K12',
'username' => 'myuserrun',
'password' => 'myuserrun',
'dbname' => 'hmailserver',
'driver' => 'mssql',
'port' => '49207',
'dsn' => ''
);
Try changing that first. Then if that doesn't work try hard-coding the pdo connection statement in functions.php to make sure its not an issue with retrieving the variables.
$pdo = new PDO("sqlsrv:Server=SC2K12,49207;Database=hmailserver, myuserrun, mypassword");
Re: Block IPs
Also, exactly what version of PHP are you running? This definitely seems to be something in your environment.
I'm on 5.6 so I know it works. I haven't tested with PHP 7 yet. That potentially could be an issue, but I think its unlikely.
I'm on 5.6 so I know it works. I haven't tested with PHP 7 yet. That potentially could be an issue, but I think its unlikely.
Re: Block IPs
yes, SQL\SC2K12, it is correct as this is not the default instance. IN sql world, you can have a default instance and as much as other instances, each instance is an independant sql server but running on the same server except that they use dynamic ports and not like th edefault which listens on port 1433. PS scripts abd VBS work well
Re: Block IPs
my hMailsServer is 5.6.6-B2383
Re: Block IPs
I hard coded the connection, same result, blank page. I triggered SQL profiler, the web site is not reaching the sql server
Re: Block IPs
7.0.3. I started debugging with my little knowledge, in fact the site is not reaching rhe Functions.php.
I added this
nothing happens, only blank page
I thought it was because of include in iis, I checked with very simple include files it works except I use quout instead of double quote, I will change your index file to use
I added this
Code: Select all
if( $pdo ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
I thought it was because of include in iis, I checked with very simple include files it works except I use quout instead of double quote, I will change your index file to use
when I dispaly the source of The blank page, I have only thisinclude_once 'dddd'
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>hMailServer Firewall Ban</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="all" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Re: Block IPs
do you want me to revert to version 5.0.3?
Re: Block IPs
There is somthing strange, include files are not gettting executed. I did the fllowing
- Created a.php file
in this file I put
I add an include in index.php can see it in the as follows
I see the output in the browser
nothing was echoed. I put the same thing in a.php, I get the echo correctly
- Created a.php file
in this file I put
Code: Select all
<?php
echo "file <br />";
?>
Code: Select all
include_once 'config.php';
include_once 'functions.php';
include_once 'a.php';
In index I added the following just after after the variable $today<!DOCTYPE html>
<html>
<head>
<title>hMailServer Firewall Ban</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
........
.....
<script src="https://ajax.googleapis.com/ajax/libs/j ... "></script>
file <br />
Code: Select all
$today = date('Y-m-d');
echo $today ;
<!DOCTYPE html>
<html>
<head>
<title>hMailServer Firewall Ban</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="all" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/j ... "></script>
file <br />2020-02-15
Re: Block IPs
what version of PHP you use, in my environment I have
7.0.30
and
5.3.28
In IIS I can switchbetween anyone of them
7.0.30
and
5.3.28
In IIS I can switchbetween anyone of them
Re: Block IPs
include is working because the html from head.php is shown in your source.eliassal wrote: ↑2020-02-15 21:20I thought it was because of include in iis, I checked with very simple include files it works except I use quout instead of double quote, I will change your index file to usewhen I dispaly the source of The blank page, I have only thisinclude_once 'dddd'
Code: Select all
<!DOCTYPE html> <html> <head> <title>hMailServer Firewall Ban</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" media="all" href="stylesheet.css"> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Re: Block IPs
Apache/2.4.26 (Win32)
PHP/5.6.31
I'm reasonably certain there are no non-backward-compatible PHP functions (everything *should* work with PHP 5.3).
I'm almost certain there are no deprecated PHP functions (everything REALLY *should* work with PHP 7).
Re: Block IPs
OK, so I don't know what to do more than this, what do you think?
Re: Block IPs
I'm out of ideas. Are you using the built in sql that comes with hmailserver? Or a standalone sql server?
What happens when you do phpinfo()?
What happens when you do phpinfo()?
Re: Block IPs
No a standalone server. Palinka, I am thinking of creating your phpbam in ASP.Net/C#.
Can you provide me screenshots of the php ban pages, also if possible the rules to follow in the functions in a bullteted list
Can you provide me screenshots of the php ban pages, also if possible the rules to follow in the functions in a bullteted list
Re: Block IPs
Palinka, I checked the php version on one of my desktops, I discovered it was 5.3.28.
I visited the download page at
https://docs.microsoft.com/en-us/sql/co ... rver-ver15
thers is
https://www.microsoft.com/en-us/downloa ... x?id=20098
I visited the download page at
https://docs.microsoft.com/en-us/sql/co ... rver-ver15
thers is
Evene the last 1 is not compatible with PHP version 2.3 as indicated at the urlThe following versions of the drivers for PHP on Windows are available for download:
•Microsoft Drivers 5.8 for PHP for SQL Server
•Microsoft Drivers 5.6 for PHP for SQL Server
•Microsoft Drivers 5.3 for PHP for SQL Server
•Microsoft Drivers 5.2 for PHP for SQL Server
•Microsoft Drivers 4.3 for PHP for SQL Server
•Microsoft Drivers 4.0, 3.2, 3.1, and 3.0 for PHP for SQL Server
https://www.microsoft.com/en-us/downloa ... x?id=20098
So there is no driver for PHP 5.3 !!!!!Supported Operating System
Windows 7, Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2008 Service Pack 2, Windows Vista Service Pack 2
Operating Systems supported in this update:
Ubuntu 15.04, 16.04
RedHat 7
Requires PHP 7 or 5.x. For information about how to download and install the latest stable binaries, visit http://windows.php.net for more detail. Version support for PHP is as follows
•Version 4.0 supports PHP 7.0+ on Windows and Linux
•Version 3.2 supports PHP 5.6, 5.5, and 5.4 on Windows
•Version 3.1 supports PHP 5.5 and 5.4 on Windows
•Version 3.0 supports PHP 5.4 on Windows
Re: Block IPs
Can't you just upgrade php?
Re: Block IPs
I have a demo at http://hmsfirewallbandemo.ddns.net/
Everything works except for actual firewall rule changes. It runs on a database separate from my personal installation, so feel free to do whatever you want with it.
By the way, it runs very slow right now but by the end of the day it will be much faster thanks to a new strategy I'm putting together. Almost done. Big improvement on speed.