Page 2 of 2

Posted: 2007-11-27 14:33
by ^DooM^
I don't like ASSP ;)

While it is a great application and does exactly what it is designed to do I don't like using mail proxy services that sit between my mail server and the outside world. I have been waiting for SpamAssassin integration so I can scan email files without having anything sat between the net and my mailserver.

Besides that ASSP has like a myriad of options that I couldn't be bothered to go through. I like simple things like greylisting. 1 tick box and your up and running :D

Posted: 2007-11-27 19:28
by Kaan1983
Thanks for confusing me :)

Can we build a comunity part on this or another website where we can share greylisting and blacklisting kind of informations? Cause I am going to ask for your greylisting white list entries now :D

Posted: 2007-11-27 20:04
by ^DooM^

Posted: 2007-11-28 11:29
by Kaan1983
:) Yep I made a post there

Posted: 2008-02-11 21:56
by tnt2k03
I got this error while using the greylist.php, "Incorrect integer value: '' for column 'whiteid' at row 1". It gave me the list and when I submit some of the ip to the white list that is the error I got. Anyone has any idea? Thanks for helping.

Best Regards,

TNT

Posted: 2008-02-12 03:00
by ^DooM^
What version of hmail are you using?

Posted: 2008-02-12 15:16
by tnt2k03
Hi Doom,

Thank you for quick reply. I am using hmailserver ver. 4.4.1 B273. Thanks again for helping.

TNT

Posted: 2008-02-12 15:17
by ^DooM^
Are you using the builtin MySQL server or do you have an external one?

Posted: 2008-02-12 17:37
by tnt2k03
Hi again,

I am using an external mysql database. Thanks.

TNT

Posted: 2008-02-12 19:30
by ^DooM^
Ok I am guessing you are running MySQL 5 in strict mode?

If that is the case then the SQL line I am using will probably throw an error.

I don't have an SQL5 version to test with so this is off the top of my head.

on line 524 change this line from

Code: Select all

$pQuery = mysql_query("INSERT INTO `hm_greylisting_whiteaddresses` VALUES('','{$strIPAddress}','{$strDescription}')") or die(mysql_error());
to

Code: Select all

$pQuery = mysql_query("INSERT INTO `hm_greylisting_whiteaddresses` (whiteid, whiteipaddress, whiteipdescription) VALUES (NULL, '{$strIPAddress}', '{$strDescription}')") or die(mysql_error());
The above code should be one single line and not wrapped as shown on the forum.

Let me know if this works.

Cheers!

Posted: 2008-02-12 20:09
by tnt2k03
Hi Doom,

It worked great. Thank you so much for helping.

Sincerely,

TNT

Posted: 2008-02-12 20:46
by ^DooM^
You are welcome. Please be aware though that whitelist entries that are placed directly into the database will not show up until the hMail service is restarted. Unfortunately this is a limitation with placing values directly into the database instead of using the COM API.

Re: Greylisting View Currently Delayed

Posted: 2008-09-12 12:01
by FiShBuRn
Hi Doom,

Thanks for this excelent script helped me a lot!

Regards

Re: Greylisting View Currently Delayed

Posted: 2008-09-12 12:45
by ^DooM^
You're welcome.

I'm hoping to get some free time soon to update this script to allow users to login to check their own greylisting entries that can be integrated into a web portal or similar. I'll post it up here as and when i get it done :)

Re: Greylisting View Currently Delayed

Posted: 2009-10-27 21:42
by joksi

Code: Select all

   $com = new COM("hMailServer.Application");

	$com->Connect();
	$com->Authenticate("Administrator", "PASSWORD");
	$com->Reinitialize();
Will update the greylisting whitelist with no need to manually reboot the server. :)

Re: Greylisting View Currently Delayed

Posted: 2009-10-27 21:48
by ^DooM^
Yes but I didn't want to use the COM API at all ;)

Re: Greylisting View Currently Delayed

Posted: 2009-10-27 22:02
by martin
Todo : Figure out how to refresh hMail's Whitelist Cache. (Still not done as needs COM access)
In 5.4, the white list won't be cached.

Re: Greylisting View Currently Delayed

Posted: 2009-10-27 22:05
by ^DooM^
Sweet. Is there to be any whitelist improvements in 5.4? Per user whitelists perhaps?

Re: Greylisting View Currently Delayed

Posted: 2009-10-27 22:20
by martin
Nope, nothing such planned.

Re: Greylisting View Currently Delayed

Posted: 2009-11-03 11:27
by FiShBuRn
^Doom^, in the last stable version of hmail the "IP Address's" are showed as "0.0.0.0" can you tell me what i need to change to fix it?

Regards

Re: Greylisting View Currently Delayed

Posted: 2009-11-03 11:42
by ^DooM^
As far as I am aware no changes have been made to how IP's are stored. Can you post a row from the database for m so I can compare with what's expected. (I assume it has been working fine with previous versions?)

Re: Greylisting View Currently Delayed

Posted: 2009-11-03 11:57
by joksi
Yes there is a change in the database, 'glipaddress' is now named 'glipaddress1'.
Just do a search for 'glipaddress' and replace with 'glipaddress1' in the file and everything will work again.

I noticed this and solved this a couple of days ago, after not using your script for awhile and now running newer hmail installation.

Re: Greylisting View Currently Delayed

Posted: 2009-11-03 11:59
by ^DooM^
Ahh probably to help with IPV6 addition at a later date. Thanks for the heads up joksi

Re: Greylisting View Currently Delayed

Posted: 2009-11-03 12:31
by FiShBuRn
^DooM^ wrote:As far as I am aware no changes have been made to how IP's are stored. Can you post a row from the database for m so I can compare with what's expected. (I assume it has been working fine with previous versions?)
Yes, it has been working only with 5.3 this appears, i will change the value that joksi suggested.

Regards

Edit: it worked :D

Re: Greylisting View Currently Delayed

Posted: 2010-02-17 15:39
by xrkolovos
i get this warings...

Code: Select all

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Inetpub\wwwroot\PHPWebAdmin\greylist\greylist.php on line 218

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in C:\Inetpub\wwwroot\PHPWebAdmin\greylist\greylist.php on line 219

Re: Greylisting View Currently Delayed

Posted: 2010-02-17 15:43
by ^DooM^
what version of MySQL are you running?

Re: Greylisting View Currently Delayed

Posted: 2010-02-18 10:23
by xrkolovos
Mysql 5.1

Re: Greylisting View Currently Delayed

Posted: 2010-02-18 10:52
by ^DooM^
That current section of code just counts how many unique ip's there are in the database. I can only assume some syntax from MySQL4 to 5 has changed when using DISTINCT.

Aside those warnings does the script work?

Re: Greylisting View Currently Delayed

Posted: 2010-02-18 11:23
by xrkolovos
yes it works fine as i see.
It just doesn't count Total number of unique IP's i think. Because of this.


if you want to check it send a pm and i will show you the page to test it.

Re: Greylisting View Currently Delayed

Posted: 2010-02-18 12:08
by ^DooM^
Well i can't see anything wrong with the syntax and i don't have an SQL5 server to test on currently.

You could try altering line 217 from this

Code: Select all

$pQuery = mysql_query("SELECT COUNT(DISTINCT glipaddress) AS numrows FROM `hm_greylisting_triplets`");
to this

Code: Select all

$pQuery = mysql_query("SELECT COUNT(DISTINCT glipaddress) AS 'numrows' FROM `hm_greylisting_triplets`");
However I don't see why this small change would make any difference.

That count doesn't really do anything to be totally honest, you could just remove line 217, 218, 219 and 228 if that change does not work.

Re: Greylisting View Currently Delayed

Posted: 2010-02-18 12:47
by xrkolovos
i checked the table hm_greylisting_triplets and there is no field glipaddress.

that's all the fields

hm_greylisting_triplets.glid,
hm_greylisting_triplets.glcreatetime,
hm_greylisting_triplets.glblockendtime,
hm_greylisting_triplets.gldeletetime,
hm_greylisting_triplets.glipaddress1,
hm_greylisting_triplets.glsenderaddress,
hm_greylisting_triplets.glrecipientaddress,
hm_greylisting_triplets.glblockedcount,
hm_greylisting_triplets.glpassedcount,
hm_greylisting_triplets.glipaddress2

Re: Greylisting View Currently Delayed

Posted: 2010-02-18 14:38
by ^DooM^
joksi wrote:Yes there is a change in the database, 'glipaddress' is now named 'glipaddress1'.
Just do a search for 'glipaddress' and replace with 'glipaddress1' in the file and everything will work again.

I noticed this and solved this a couple of days ago, after not using your script for awhile and now running newer hmail installation.

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 00:34
by XucruT
So first I want to know if, using this script, when I put a register to the whitelist, does the message automaticaly will be delivered ?

I thik greylisting is a nice job, but I´m having a lot of claims with the users for emails not delivered in time. What I want to do is a script that, when the message arrives, the server send an e-mail to the sender asking that he confirms the send maybe typing a confirmation number and if its correct, the message is delivered and then the sender automaticaly goes to the whitelist.

Can you show me the way to do this ?

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 00:47
by ^DooM^
You can't do that with this script neither with greylisting. What you want is called challenge response anti spam. This type of anti spam is a royal pain and causes excess un-needed bandwidth usage. There maybe a script to do it somewhere, i can't recall one off the top of my head though.

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 00:59
by XucruT
I agree that chalenge antispam cause an un-needed bandwidth usage, but I beleave too that the sender must being able to prove yours authenticity.

And second option that I´m thinking about is give to my users a way to see what messages (not only the senders eg) are in greylist and can choose deliver it... It´s less complicated ?

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 01:09
by ^DooM^
The problem with challenge/response is automated mailers that send out things like receipts, newsletters, welcome messages, forum verification links etc are never delivered because C/R sends the email back to the sender which 90% of the time is a no-reply account which is never checked, so your users lose out in the end. It's a lame solution to the spam problem in my opinion.

Greylisting is automatic, my script will show you what's delayed waiting for a second try from the sending mail server. Currently it's not very user configurable, i am waiting for a new hmail update that will allow greylist whitelist entries to be added without the cache needing to be re-populated. Also there is a request to add user added whitelist entries too that once added i will be able to update my script to allow users to login check/change/add entries.

Neither of these two solutions are what you are asking for though. Basically you want some kind of delayed queue and if user wants email then they can choose to have it delivered. That seems like a lot of work for the end user. I suggest just enabling greylisting and see how you go. From my own statistics it has stopped around 95% of incoming spam. See this link for my figures http://damnation.org.uk/glist/

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 01:26
by XucruT
I´m already using Greylisting for 3 months and I receive calls daily with users saying "Somebody send me an e-mail has 1 hour and its not arrives to me"............ And I´m crazying...

I don´t know there but here some e-mails don´t arrives never again... E-mails that I saw in the database and was in greylist but I think that the server don´t try to send again or send very quickly again an the hmail blocks again... I lowered the time to defer delivey atemps to 1 minute to feel how will work however If the user could to liberate the message in greylist will give more years of life...

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 01:31
by ^DooM^
The actual email is not stored. hMail delays the email before it is even sent with a 451 delayed code.

http://www.hmailserver.com/forum/viewto ... 20&t=13682

The script above may help some, whenever a user emails someone their mail address is automatically whitelisted. so when they reply it comes through without delay.

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 01:42
by XucruT
Whats the diference between disable greylisting and automaticaly put incoming senders in the whitelist ?

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 01:52
by mattg
With recipients from local senders being added to the whitelist, when they reply they won't be greylisted. (what the script does)

Greylisting affects ALL incoming mail

Re: Greylisting View Currently Delayed

Posted: 2010-05-26 02:27
by Bill48105
Hi XucruT,
I have similar complaints from users. With my current mail server I just disable greylisting for them & they beg me to turn it back on after they get tons of spam & suddenly they stop complaining so much. hehe (Too bad hMail doesn't have per-user option to disable greylisting but it does allow per domain at least)

Would it be helpful to just whitelist IP's of 'important' senders mail servers then no worries about delays from them? If you trust that server why not add them to whitelist and you get less grief. Take some time to build up whitelist but eventually you'll have good set of common senders you trust.

Btw, so the 'bypass' options in hMail don't help any? You'd think many people use SPF these days & more so have MX/A record although spammers could too so perhaps that allows some more spam but at least maybe it helps cut down on annoying delays.
Bill

Re: Greylisting View Currently Delayed

Posted: 2010-06-28 03:16
by gfbaggio
I am fairly new to php and would like to know how to modify your script to add not the IP address but the sender email to the whitelist.

By the way your script rocks.

Thanks

Re: Greylisting View Currently Delayed

Posted: 2010-06-28 10:32
by ^DooM^
This should do what you need.

I have briefly tested it and it does add the data to the whitelist table. Let me know if you come across any oddities.

Cheers
greylisteml.zip
Greylist script that adds email addresses to global whitelist instead of whitelisting server IP.
(5.23 KiB) Downloaded 453 times

Re: Greylisting View Currently Delayed

Posted: 2010-06-29 01:57
by gfbaggio
This work very good, it adds the information to the database, but it does not appear in the hmailserver administrator.
I even tried to stop and restart the mailserver but nothing.

Any help.

Thanks

Re: Greylisting View Currently Delayed

Posted: 2010-06-29 09:36
by ^DooM^
This is the same issue as the old script. hMail will not currently pick up changes to the database unless you restart the service or use the COM API to force a refresh. I believe this functionality will be changing in 5.4 where whitelist details are always pulled from the database instead of being cached in memory. 5.4 is hopefully just a few weeks away so until then just restart the service from Start -> Administrative tools -> Services -> hmailserver

Re: Greylisting View Currently Delayed

Posted: 2012-12-02 20:57
by FiShBuRn
hey ^DooM^ thanks once again for this script. Now i have one problem, just upgraded to php 5.4.9 and i get this error "PHP Fatal error: Cannot re-assign auto-global variable _POST".

Do you think that is possible to fix this?

Regards

Re: Greylisting View Currently Delayed

Posted: 2012-12-02 23:45
by ^DooM^
Give this version a try and let me know. I believe I fixed the issue.
greylistv09.a.zip
(5.31 KiB) Downloaded 422 times

Re: Greylisting View Currently Delayed

Posted: 2012-12-03 00:07
by FiShBuRn
wow fast :) yeap, its fixed! thanks again!!!!

regards