Web Hosting Talk







View Full Version : A little offtopic question probably for programmers...


tomfra
07-13-2003, 01:50 PM
I have a little bit "off-topic" question, but there seem to be many clever people frequenting this dboard so perhaps someone will be able to answer my question...

There is a "special" PHP anti-spam script ( no, it's not Spam Assasin ) installed on one of my domains, this script connects to email account number 1, checks if the email sender has been approved to send you emails and it also does a few other things, then it connects to account 2, account 3 and then again account 1 and so it cycles through all accounts on the server - or a particular domain name to be exact.

It works great but the problem is that if you have more accounts, let's say 50, the script needs some time to cycle through all accounts and for example if you have an email account number 1 and the script is checking account number 30, some spam emails may slip through because you download them through your pop3 email client before they could be checked by the anti-spam script.

Does it make sense so far? I need a solution that will ensure that it will be possible to download only those emails already checked by the anti-spam script.

Now I do not need this solution yet, but it might be necessary when the number of accounts grows. So far the script successfully blocks over 97% of all spam emails so this problem is not a serious one for me, yet...

This is probably a question for programmers I believe. Or if there is a way how to automatically mark all incoming emails as read / seen on the server level ( and instruct the pop3 server ) and mark them as unread / unseen only after they were checked by the anti-spam script or something similar, please let me know.

Any ideas how to solve this puzzle are welcome.

Thanks, I know my question is somewhat offtopic...

Tomas

kevint8
07-13-2003, 04:20 PM
I am not going to ask why you would use a PHP script to handle such a task. I will just assume you have a very good reason and leave it at that.

Now on to your question. One of the thing you could do is read lock the mailboxes while your PHP script is running, that way your POP3 clients won't be able to download any new emails until your PHP script stops running. Just make sure to release your lock at the end of your script execution.

tomfra
07-14-2003, 04:20 PM
Thanks for the suggestion, I will pass this info to the script programmer so that he can take a look at it. Do you know about any web site where I could find more info about how to use these locks so that I could give him as much info as possible?

Thanks again.

Tomas

telnettro
07-15-2003, 05:29 PM
or you could use exim and do it right (and i'm sure other mtas will allow you to fiddle with mails as they're on their way through)

why work so hard to get something to work a weird way when you can do it a more standard way?

tomfra
07-15-2003, 06:20 PM
Originally posted by telnettro
[B]or you could use exim and do it right

Well, I really do have a reason to use this php script, believe me.

Tomas