Print Page | Close Window

Custom SQL Queries

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=5043
Printed Date: 05 February 2025 at 11:04am


Topic: Custom SQL Queries
Posted By: Desperado
Subject: Custom SQL Queries
Date Posted: 04 February 2005 at 10:38am

All,

I have gotten so far away from the "Sample ASP" pages that I do not even remember what features it has.  I thought that it may be useful to "share" a couple of SQL Queries that I use to help my customers who get huge quantities of quarantined messages.

First, A search span option.  This query can be placed in a CASE statement based on a drop down list of time spans to search for as part of the ListSpam query:

SQL = SQL & "AND (MsgDate >= DATEADD(hour,-8,getdate())) "

This will search the last 8 hours as an example

Another query I use in the "From Address" Sort By option, also part of the ListSpam query:

SQL = "SELECT SUBSTRING(EmailFrom, CHARINDEX('@', EmailFrom) + 1, 100) AS Domain, QuarID, EmailFrom, Subject, MsgDate, MsgID, RejectDesc, RejectDetails, EmailTo, ServerID "
SQL = SQL & "FROM tblQuarantine, tblRejectCodes "

In this case, instead of a single "HREF" in the From title on the ListSpam page, I use 2 hrefs as below:

<th scope="col" bgcolor="silver" nowrap><a href="VirtAdminListSpam.asp?SortBy=EmailFrom">From Addr</a>&nbsp;or&nbsp;<a href="VirtAdminListSpam.asp?SortBy=Domain">From Domain</a></th>
making sure that my SortBy case statement includes the "Domain" Sort"

Once you start ... it is hard to stop!

Regards,

ADDED:  Here is a link to a screen shot of our Spam Filter Administrator Mail Menu:
http://www.desperado.com/images/SF-ScreenShot.jpg - http://www.desperado.com/images/SF-ScreenShot.jpg

 



-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com




Replies:
Posted By: kspare
Date Posted: 04 February 2005 at 11:26am

heh, I know what you mean Dan, since i've gotten your code, i've gone miles and miles with it!

I'll see if I can get some screen shots of mine up.

I've gone as far as domain admins having complete control over editting users, lost passwords. A daily email notification of spam, hourly notification or none at all. Password retrieval, auto logins from the email notification, I actually developed a way to have it integrated into outlook 2000-2003 as a folder. so you just simply click on it and your logged in.

Like Dan says..once you get going it's VERY hard to stop!



Posted By: Desperado
Date Posted: 04 February 2005 at 11:35am

Kevin,

Can you "Expand" on "I actually developed a way to have it integrated into outlook 2000-2003 as a folder. so you just simply click on it and your logged in."?

Dan



-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com



Posted By: kspare
Date Posted: 04 February 2005 at 11:38am

Try this out, it will actually work.

In outlook. Create a new folder called "spam" or whatever you want.

Right click on the folder and click properties.

Go to Homepage Tab

Click show homepage by default for this folder.

paste in this link:

http://www.ksphosting.com/spam/autoauth.asp?username=spamdemo@ksphosting.com&password=demo - http://www.ksphosting.com/spam/autoauth.asp?username=spamdem o@ksphosting.com&password=demo

click ok.

Each time you click on that folder, it will automatically bring up your spam page.

 



Posted By: Desperado
Date Posted: 04 February 2005 at 11:46am

Kevin,

Outlook works and it is very cool ... need to see if there is any way to coerce OE to do the same.

Dan



-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com



Posted By: kspare
Date Posted: 04 February 2005 at 11:55am

from what I could see...OE doesn't support the homepage function.



Posted By: LogSat
Date Posted: 04 February 2005 at 4:47pm
Kevin,

Awesome idea for Outlook! VERY cool, thanks for the tip!



-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: Guests
Date Posted: 04 February 2005 at 5:34pm
kinda cool hey :) I guess it would work with a manual login, but I am trying to simplify the lives of my users as much as I can when it comes to spam.


Posted By: Guests
Date Posted: 04 February 2005 at 6:38pm
What does the autoauth.asp page look like?


Posted By: Desperado
Date Posted: 04 February 2005 at 7:50pm
I do not know what Kevin did but ... All I did was take my original authenticate.asp and stripped all the html out then:

Replaced the request.form entries with request.querystring as:
EmailTo = Request.QueryString("UserName")
Password = Request.QueryString("Password")
Then did all my usual SQL queries and security tests and id all was well, redirected to my menu and if it failed redirected to the original authenticate.asp
 
Does that help?

Regards,


-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com



Posted By: LogSat
Date Posted: 05 February 2005 at 8:10am
Dan,

Two possible problems. If that is really all you modified, then:
1. You should have Request.QueryString("EmailAddress") not "UserName" unless you changed the property in the edit field.
2. The form submits a POST request, not a GET, so the Request.QueryString will not have any information in it.

We modified the authenticate.asp as follows (and will soon update the one on the website). It has code at the top to generalize the Request collection, adapting it so it can read data both if there's a GET or a POST request. The new code is as follows. It will allow users to bookmark the ListSpam.asp page as follows:
ListSpam.asp?EmailAddress=JohnDoe@somewhere.com&Passwo rd=123456


<!--#include file="db_connect.asp"-->   
<%
    if StrComp("POST", Request.ServerVariables("REQUEST_METHOD"), vbTextCompare) = 0 then
      Set RequestCollection = Request.Form
    else
      Set RequestCollection = Request.QueryString
    End if
    If Len(Session("EmailTo")) < 1 Then
        EmailTo = RequestCollection("EmailAddress")

        If Len(EmailTo) < 3 Then
%>
<html>
<head>
    <title>Spam Filter - Login</title>
</head>
<body>
    <form method="post" name="Login">
    <table align="center" border="1" cellpadding="1" cellspacing="1">
        <tr><td align="center" colspan="2"><h2>Please Login</h2></td></tr>
        <tr>
            <td align="right">Email Address:</td>
            <td><input type="text" size="15" name="EmailAddress"></td>
        </tr>
        <tr>
            <td align="right">Password:</td>
            <td><input type="password" size="15" name="Password"></td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                <input type="submit" value="Login">&nbsp;&nbsp;
                <input type="reset" value="Clear">
            </td>
        </tr>
        <tr><td align="center" colspan="2"><a href="Register.asp"> ; ;Register</a></td></tr>
    </table>
    </form>
</body>
</html>
<%
            Response.End
        Else
            'Generate query.
            SQL = "SELECT Password "
            SQL = SQL & "FROM tblLogins "
            SQL = SQL & "WHERE EMail = '" & EmailTo & "'"
            Set rs = con.Execute(SQL)
            Failure = False

            If rs.EOF Then
                Failure = True
            ElseIf IsNull(rs("Password")) Then
                Failure = True
            ElseIf Len(rs("Password")) < 1 Then
                Failure = True
            ElseIf rs("Password") <> RequestCollection("Password") Then
                Failure = True
            End If

            If Failure Then
%>
<html>
<head>
    <title>Spam Filter - Failed Login</title>
</head>
<body>
    <h2 align="center">The password you entered was incorrect!</h2>
    <p align="center"><a href="ListSpam.asp">Try Again</a></p>
</body>
</html>
<%
                Response.End
            Else
                Session("EmailTo") = EmailTo
            End If

        End If

    End If
%>



-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: Desperado
Date Posted: 05 February 2005 at 8:35am

Roberto,

Indeed it is not everything I changed and I have changed the Field name BUT ... I just had set up a "Quickie" independent login script from the normal one just to test out Kevins "Cool" Outlook" inclusion. The unfortunate problem is that nearly all our customers use Outlook Express and that simply won't work unless I just can not find the options.

Our Login script needed to be IDENTICAL to 2 other login we have and it does not require an email address for the login and the rest of the ASP code gets the users email address from our master accounting database based on their login and also retrieves their account status as well as their "Privilege Level"  It also will not let them login if their account is not paid up to date so ... As I had stated before, I am so far away from the originam that I do not even remember what the original was!

Dan. S.



-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com



Posted By: kspare
Date Posted: 05 February 2005 at 11:21am

Here is my code. You'll see I also collect stats on when people automatically login as well.

<!--#include file="db_connect.asp"-->
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1 
Session.Timeout = 30
  EmailTo = Request.QueryString("username")
  Userpass = Request.QueryString("password")
Session("User") = EmailTo
Session("Password") = Userpass
if Request.QueryString("password") = "" then
response.redirect("register.asp")
else


   'Generate query.
   SQL = "SELECT Password, Logins, AutoLastUsed, LastUsed, DomainAdmin, IsAdmin, AutoLogins "
   SQL = SQL & "FROM tblLogins "
   SQL = SQL & "WHERE Email = '" & EmailTo & "'"
   Set rs = con.Execute(SQL)
   Failure = False

   If rs.EOF Then
    Failure = True
   ElseIf IsNull(rs("Password")) Then
    Failure = True
   ElseIf Len(rs("Password")) < 1 Then
    Failure = True
   ElseIf rs("Password") <> userpass Then
    Failure = True
   End If

   If Failure Then
%>
<html>
<head>
 <title>Spam Filter - Failed Login</title>
</head>
<%
On Error Resume Next

SessionGet

SessionImpersonate

ClearSession

Session.Abandon

%>
 <h2>Auto Login Failed Please Login Manually</h2>
 <p><a target="_parent" href="/spam">Try Again</a></p>
  <tr>
               <td align="center">
    &nbsp;</td>
    </tr>
    </body>
</html>
<%
    Response.End
   Else
   
    Logins = rs("Logins") + 1
    SQL = "UPDATE tblLogins "
    SQL = SQL & "SET Logins = '" & Logins & "' "
    SQL = SQL & "WHERE EMail = '" & EmailTo & "'"
    con.Execute SQL

    AutoLogins = rs("AutoLogins") + 1
    SQL = "UPDATE tblLogins "
    SQL = SQL & "SET AutoLogins = '" & AutoLogins & "' "
    SQL = SQL & "WHERE EMail = '" & EmailTo & "'"
    con.Execute SQL

    SQL = "UPDATE tblLogins "
    SQL = SQL & "SET AutoLastUsed = '" & Now() & "' "
    SQL = SQL & "WHERE EMail = '" & EmailTo & "'"
    con.Execute SQL
    SQL = "UPDATE tblLogins "
    SQL = SQL & "SET LastUsed = '" & Now() & "' "
    SQL = SQL & "WHERE EMail = '" & EmailTo & "'"
    con.Execute SQL
    Session("Logins") = Logins
    DomainAdmin = rs("DomainAdmin")
    If DomainAdmin Then
     Session("DoaminAdmin") = DomainAdmin
     Session("IsAdmin") = IsAdmin
     Session("EmailTo") = EmailTo
     Session("SFLoggedOn") = "TRUE"
     response.redirect("/spam")
    Else
     Session("EmailTo") = EmailTo
     Session("SFLoggedOn") = "TRUE"
     response.redirect("/spam")
    End If
   End If
  End If

%>



Posted By: kspare
Date Posted: 05 February 2005 at 11:24am

I also added a notification field for everyone profile in the database. Here are the notification scripts. The script registers you in, then passes you onto the authentication.asp page, which reads the info and then logs you in. Basically this allows me the have multiple methods of logins come to a central location so I don't have to change things in other places. I also have my spam in frames, so our logo sits at the top and never has to change, with only the bottom frame changing. It also allows us to always have the address as http://www.ksphosting.com/spam - www.ksphosting.com/spam  in the address bar, instead of having all the extra asp parameters showing. 

<!--#include file="db_connect.asp"-->
<html>
<body>
Sending Reminders to those with messages in queue and Daily reminders tuned on.<br><br>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
X = 0
 SQL = "SELECT * FROM tbllogins WHERE notification = 2 ORDER BY Email ASC"
 Set rs = con.Execute(SQL)
 IF NOT (rs.eof AND rs.bof) THEN
  rs.MoveFirst
  DO UNTIL rs.eof
   SQL = "SELECT COUNT(*) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" & rs("Email") & "') AND Expire = 0 AND Deliver = 0"
   Set rs2 = con.Execute(SQL)
   IF clng(rs2("MessageCount")) > 0 THEN
    X = X + 1
    SendMessage1 rs("Email"), rs2("MessageCount")
    response.write rs("Email") & " has " & rs2("MessageCount") & " messages in queue... reminder sent.<BR>" & vbcrlf

   END IF
   rs2.close
   set rs2 = nothing
   rs.MoveNext
  LOOP
 END IF
response.write "<BR>" & X & " daily reminder messages sent.<br><br><br>" & vbCRLF
response.write "Sending daily reminders to those with messages, And no accounts.<BR><BR>" & vbCRLF & vbCRLF
X = 0
  SQL = "SELECT DISTINCT EmailTo "
  SQL = SQL & "FROM tblquarantine "
  SQL = SQL & "WHERE Expire = 0 AND Deliver = 0 "
  SQL = SQL & "ORDER BY EmailTo"
  Set rs = con.Execute(SQL)
  If rs.EOF Then
   Response.Write "<h2>No addresses in database!</h2>"
  Else
   rs.movefirst
   While Not rs.EOF
    EmailTo = lcase(rs("EmailTo"))
    OKToMail = True
    SQL2 = "SELECT * FROM tbllogins WHERE Email = '" & EmailTo & "'"
    Set TestRS = con.Execute(SQL2)
    IF not (TestRS.eof AND TestRS.bof) THEN
     IF TestRS("Notification") =< "2" THEN
      OKToMail = False
     END IF
    END IF
    TestRS.close
    Set TestRs = nothing
    IF OKToMail THEN
     SQL = "SELECT COUNT(EmailTo) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" & EmailTo & "')"
     Set MessageCountRS = con.Execute(SQL)
     IF MessageCountRS(0) > 0 THEN
      SendMessage2 EmailTo, MessageCountRS(0)
      X = X + 1
      response.write EmailTo & " has " & MessageCountRS(0) & " messages in queue... reminder sent.<BR>" & vbcrlf
     END IF
    END IF
    rs.MoveNext
   Wend
  END IF
  rs.close
  set rs = nothing
  con.close
  set con = nothing
response.write "<BR>" & X & " daily reminder messages sent to users with no accounts.<br><br><br>" & vbCRLF

SUB SendMessage1(strEmail, lMessageCount)
 Set rs3 = Server.CreateObject("ADODB.Recordset")
 Set rs3.ActiveConnection = con
 rs3.CursorType = 1
 rs3.LockType = 3

SQL = "SELECT Password "
SQL = SQL & "FROM tblLogins "
SQL = SQL & "WHERE (Email = '" & rs("Email") & "')"
Set rs4 = con.Execute(SQL)

 MessageDate = Now
 Message = "From: KSP Spam Administrator <
mailto:support@ksphosting.com - support@ksphosting.com >" & vbCRLF
 Message = Message & "To: " & stremail & vbCRLF
 Message = Message & "Subject: Daily SPAM Notification: You have SPAM!" & vbCRLF
 Message = Message & "Date: " & FormatDateTime(MessageDate, vbLongDate) & " " & FormatDateTime(MessageDate, vbLongTime) & vbCRLF
 Message = Message & "Content-Type: text/html;charset=""ISO-8859-1""" & vbCRLF & vbCRLF
 Message = Message & "<p align=""center""><font face=""Arial""><font color=""#000080"">We have detected </font><font color=""#FF0000"">" & lMessageCount & "</font><font color=""#000080""> suspicious E-Mail(s) for your email account </a></font><font color=""#FF0000"">" & strEmail & "</font></a><font color=""#000080"">.<br>&nbsp;</font></ font></p><p align=""center""><font face=""Arial""><font color=""#000080"">Please click on </font><a href=""
http://www.ksphosting.com/spam/autoauth.asp?username - http://www.ksphosting.com/spam/autoauth.asp?username ="& strEmail &"&password="& rs4("Password") & """><font color=""#000080"">http://www.ksphosting.com/spam</font ></a><font color=""#000080""> to look at the message(s). </font></font></p><p align=""center""><font face=""Arial""><font color=""#000080"">From this menu you may choose to delete all suspicious e-mail(s) or send through to your you mail program.<br>Please note: if you send the message through this individual sender they will be automatically cleared for all future e-mails.<br>&nbsp;</font></font></p ><p align=""center""><font face=""Arial""><font color=""#000080"">What is SPAM? Click here for the answer: </font><a href=""http://computer.howstuffworks.com/spam.htm"">http://computer.howstuffworks.com/spam.htm""><font color=""#000080"">http://www.ksphosting.com/answers/spam& amp; lt;/font></a></font></p>" & vbCRLF
 Message = Message & "." & vbCRLF
 SQL = "SELECT * FROM tblMsgs WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("Msg") = Message
 rs3.Update
 MsgID = rs3("MsgID")
 response.write "MsgID= " & msgID & "<BR>" & vbCRLF
 rs3.Close
 SQL="SELECT * FROM tblQuarantine WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("EMailFrom") = "
mailto:support@ksphosting.com - support@ksphosting.com "
rs3("EMailTo") = strEMail
' rs3("EMailTo") = "
mailto:kevin@pare.ca - kevin@pare.ca "
 rs3("Subject") = "Daily Reminder: You have messages being held in quarantine"
 rs3("MsgID") = MsgID
 rs3("MsgDate") = MessageDate
 rs3("Expire") = 0
 rs3("Deliver") = 1
 rs3("RejectDetails") = ""
 rs3("RejectID") = 0
 rs3("ServerID") = 4
 rs3.Update
 rs3.Close
 Set rs3 = Nothing

END SUB

SUB SendMessage2(strEmail, lMessageCount)
 Set rs3 = Server.CreateObject("ADODB.Recordset")
 Set rs3.ActiveConnection = con
 rs3.CursorType = 1
 rs3.LockType = 3
 MessageDate = Now
 Message = "From: KSP Spam Administrator <
mailto:support@ksphosting.com - support@ksphosting.com >" & vbCRLF
 Message = Message & "To: " & stremail & vbCRLF
 Message = Message & "Subject: Daily SPAM Notification: You have SPAM!" & vbCRLF
 Message = Message & "Date: " & FormatDateTime(MessageDate, vbLongDate) & " " & FormatDateTime(MessageDate, vbLongTime) & vbCRLF
 Message = Message & "Content-Type: text/html;charset=""ISO-8859-1""" & vbCRLF & vbCRLF
 Message = Message & "<p align=""center""><font face=""Arial""><font color=""#000080"">We have detected </font><font color=""#FF0000"">" & lMessageCount & "</font><font color=""#000080""> suspicious E-Mail(s) for your email account </a></font><font color=""#FF0000"">" & strEmail & "</font></a><font color=""#000080"">.<br>&nbsp;</font></ font></p><p align=""center""><font face=""Arial""><font color=""#000080"">Please click on </font><a href=""
http://www.ksphosting.com/spam/register.asp?email - http://www.ksphosting.com/spam/register.asp?email ="& strEmail &"""><font color=""#000080"">http://www.ksphosting.com/spam</font ></a><font color=""#000080""> to look at the message(s). </font></font></p><p align=""center""><font face=""Arial""><font color=""#000080"">From this menu you may choose to delete all suspicious e-mail(s) or send through to your you mail program.<br>Please note: if you send the message through this individual sender they will be automatically cleared for all future e-mails.<br>&nbsp;</font></font></p ><p align=""center""><font face=""Arial""><font color=""#000080"">What is SPAM? Click here for the answer: </font><a href=""http://computer.howstuffworks.com/spam.htm"">http://computer.howstuffworks.com/spam.htm""><font color=""#000080"">http://www.ksphosting.com/answers/spam& amp; lt;/font></a></font></p>" & vbCRLF
 Message = Message & "." & vbCRLF
 SQL = "SELECT * FROM tblMsgs WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("Msg") = Message
 rs3.Update
 MsgID = rs3("MsgID")
 response.write "MsgID= " & msgID & "<BR>" & vbCRLF
 rs3.Close
 SQL="SELECT * FROM tblQuarantine WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("EMailFrom") = "
mailto:support@ksphosting.com - support@ksphosting.com "
rs3("EMailTo") = strEMail
' rs3("EMailTo") = "
mailto:kevin@pare.ca - kevin@pare.ca "
 rs3("Subject") = "Daily Reminder: You have messages being held in quarantine"
 rs3("MsgID") = MsgID
 rs3("MsgDate") = MessageDate
 rs3("Expire") = 0
 rs3("Deliver") = 1
 rs3("RejectDetails") = ""
 rs3("RejectID") = 0
 rs3("ServerID") = 4
 rs3.Update
 rs3.Close
 Set rs3 = Nothing

END SUB


%>
</body>
</html>

 

 



Posted By: kspare
Date Posted: 05 February 2005 at 11:27am

I also modified the register page to work with autoauth, so once you register, you can click the link on the screen and it will automatically log you in.

This also works with the notification email page, everyone in the database will recieve an email, if you have setup an account it delivers the email according to your notfication setting, which is off, hourly and daily.

If you haven't registered, the notification email will include a link to the register page which will automatically fill in your email address for you, requiring you to only enter your full name.

<!--#include file="db_connect.asp"-->
<html>
<body>
Sending Reminders to those with messages in queue and Daily reminders tuned on.<br><br>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
X = 0
 SQL = "SELECT * FROM tbllogins WHERE notification = 2 ORDER BY Email ASC"
 Set rs = con.Execute(SQL)
 IF NOT (rs.eof AND rs.bof) THEN
  rs.MoveFirst
  DO UNTIL rs.eof
   SQL = "SELECT COUNT(*) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" & rs("Email") & "') AND Expire = 0 AND Deliver = 0"
   Set rs2 = con.Execute(SQL)
   IF clng(rs2("MessageCount")) > 0 THEN
    X = X + 1
    SendMessage1 rs("Email"), rs2("MessageCount")
    response.write rs("Email") & " has " & rs2("MessageCount") & " messages in queue... reminder sent.<BR>" & vbcrlf

   END IF
   rs2.close
   set rs2 = nothing
   rs.MoveNext
  LOOP
 END IF
response.write "<BR>" & X & " daily reminder messages sent.<br><br><br>" & vbCRLF
response.write "Sending daily reminders to those with messages, And no accounts.<BR><BR>" & vbCRLF & vbCRLF
X = 0
  SQL = "SELECT DISTINCT EmailTo "
  SQL = SQL & "FROM tblquarantine "
  SQL = SQL & "WHERE Expire = 0 AND Deliver = 0 "
  SQL = SQL & "ORDER BY EmailTo"
  Set rs = con.Execute(SQL)
  If rs.EOF Then
   Response.Write "<h2>No addresses in database!</h2>"
  Else
   rs.movefirst
   While Not rs.EOF
    EmailTo = lcase(rs("EmailTo"))
    OKToMail = True
    SQL2 = "SELECT * FROM tbllogins WHERE Email = '" & EmailTo & "'"
    Set TestRS = con.Execute(SQL2)
    IF not (TestRS.eof AND TestRS.bof) THEN
     IF TestRS("Notification") =< "2" THEN
      OKToMail = False
     END IF
    END IF
    TestRS.close
    Set TestRs = nothing
    IF OKToMail THEN
     SQL = "SELECT COUNT(EmailTo) AS MessageCount FROM tblQuarantine WHERE (EmailTo = '" & EmailTo & "')"
     Set MessageCountRS = con.Execute(SQL)
     IF MessageCountRS(0) > 0 THEN
      SendMessage2 EmailTo, MessageCountRS(0)
      X = X + 1
      response.write EmailTo & " has " & MessageCountRS(0) & " messages in queue... reminder sent.<BR>" & vbcrlf
     END IF
    END IF
    rs.MoveNext
   Wend
  END IF
  rs.close
  set rs = nothing
  con.close
  set con = nothing
response.write "<BR>" & X & " daily reminder messages sent to users with no accounts.<br><br><br>" & vbCRLF

SUB SendMessage1(strEmail, lMessageCount)
 Set rs3 = Server.CreateObject("ADODB.Recordset")
 Set rs3.ActiveConnection = con
 rs3.CursorType = 1
 rs3.LockType = 3

SQL = "SELECT Password "
SQL = SQL & "FROM tblLogins "
SQL = SQL & "WHERE (Email = '" & rs("Email") & "')"
Set rs4 = con.Execute(SQL)

 MessageDate = Now
 Message = "From: KSP Spam Administrator <
mailto:support@ksphosting.com - support@ksphosting.com >" & vbCRLF
 Message = Message & "To: " & stremail & vbCRLF
 Message = Message & "Subject: Daily SPAM Notification: You have SPAM!" & vbCRLF
 Message = Message & "Date: " & FormatDateTime(MessageDate, vbLongDate) & " " & FormatDateTime(MessageDate, vbLongTime) & vbCRLF
 Message = Message & "Content-Type: text/html;charset=""ISO-8859-1""" & vbCRLF & vbCRLF
 Message = Message & "<p align=""center""><font face=""Arial""><font color=""#000080"">We have detected </font><font color=""#FF0000"">" & lMessageCount & "</font><font color=""#000080""> suspicious E-Mail(s) for your email account </a></font><font color=""#FF0000"">" & strEmail & "</font></a><font color=""#000080"">.<br>&nbsp;</font></ font></p><p align=""center""><font face=""Arial""><font color=""#000080"">Please click on </font><a href=""
http://www.ksphosting.com/spam/autoauth.asp?username - http://www.ksphosting.com/spam/autoauth.asp?username ="& strEmail &"&password="& rs4("Password") & """><font color=""#000080"">http://www.ksphosting.com/spam</font ></a><font color=""#000080""> to look at the message(s). </font></font></p><p align=""center""><font face=""Arial""><font color=""#000080"">From this menu you may choose to delete all suspicious e-mail(s) or send through to your you mail program.<br>Please note: if you send the message through this individual sender they will be automatically cleared for all future e-mails.<br>&nbsp;</font></font></p ><p align=""center""><font face=""Arial""><font color=""#000080"">What is SPAM? Click here for the answer: </font><a href=""http://computer.howstuffworks.com/spam.htm"">http://computer.howstuffworks.com/spam.htm""><font color=""#000080"">http://www.ksphosting.com/answers/spam& amp; lt;/font></a></font></p>" & vbCRLF
 Message = Message & "." & vbCRLF
 SQL = "SELECT * FROM tblMsgs WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("Msg") = Message
 rs3.Update
 MsgID = rs3("MsgID")
 response.write "MsgID= " & msgID & "<BR>" & vbCRLF
 rs3.Close
 SQL="SELECT * FROM tblQuarantine WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("EMailFrom") = "
mailto:support@ksphosting.com - support@ksphosting.com "
rs3("EMailTo") = strEMail
' rs3("EMailTo") = "
mailto:kevin@pare.ca - kevin@pare.ca "
 rs3("Subject") = "Daily Reminder: You have messages being held in quarantine"
 rs3("MsgID") = MsgID
 rs3("MsgDate") = MessageDate
 rs3("Expire") = 0
 rs3("Deliver") = 1
 rs3("RejectDetails") = ""
 rs3("RejectID") = 0
 rs3("ServerID") = 4
 rs3.Update
 rs3.Close
 Set rs3 = Nothing

END SUB

SUB SendMessage2(strEmail, lMessageCount)
 Set rs3 = Server.CreateObject("ADODB.Recordset")
 Set rs3.ActiveConnection = con
 rs3.CursorType = 1
 rs3.LockType = 3
 MessageDate = Now
 Message = "From: KSP Spam Administrator <
mailto:support@ksphosting.com - support@ksphosting.com >" & vbCRLF
 Message = Message & "To: " & stremail & vbCRLF
 Message = Message & "Subject: Daily SPAM Notification: You have SPAM!" & vbCRLF
 Message = Message & "Date: " & FormatDateTime(MessageDate, vbLongDate) & " " & FormatDateTime(MessageDate, vbLongTime) & vbCRLF
 Message = Message & "Content-Type: text/html;charset=""ISO-8859-1""" & vbCRLF & vbCRLF
 Message = Message & "<p align=""center""><font face=""Arial""><font color=""#000080"">We have detected </font><font color=""#FF0000"">" & lMessageCount & "</font><font color=""#000080""> suspicious E-Mail(s) for your email account </a></font><font color=""#FF0000"">" & strEmail & "</font></a><font color=""#000080"">.<br>&nbsp;</font></ font></p><p align=""center""><font face=""Arial""><font color=""#000080"">Please click on </font><a href=""
http://www.ksphosting.com/spam/register.asp?email - http://www.ksphosting.com/spam/register.asp?email ="& strEmail &"""><font color=""#000080"">http://www.ksphosting.com/spam</font ></a><font color=""#000080""> to look at the message(s). </font></font></p><p align=""center""><font face=""Arial""><font color=""#000080"">From this menu you may choose to delete all suspicious e-mail(s) or send through to your you mail program.<br>Please note: if you send the message through this individual sender they will be automatically cleared for all future e-mails.<br>&nbsp;</font></font></p ><p align=""center""><font face=""Arial""><font color=""#000080"">What is SPAM? Click here for the answer: </font><a href=""http://computer.howstuffworks.com/spam.htm"">http://computer.howstuffworks.com/spam.htm""><font color=""#000080"">http://www.ksphosting.com/answers/spam& amp; lt;/font></a></font></p>" & vbCRLF
 Message = Message & "." & vbCRLF
 SQL = "SELECT * FROM tblMsgs WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("Msg") = Message
 rs3.Update
 MsgID = rs3("MsgID")
 response.write "MsgID= " & msgID & "<BR>" & vbCRLF
 rs3.Close
 SQL="SELECT * FROM tblQuarantine WHERE 0 = 1"
 rs3.Open(SQL)
 rs3.AddNew
 rs3("EMailFrom") = "
mailto:support@ksphosting.com - support@ksphosting.com "
rs3("EMailTo") = strEMail
' rs3("EMailTo") = "
mailto:kevin@pare.ca - kevin@pare.ca "
 rs3("Subject") = "Daily Reminder: You have messages being held in quarantine"
 rs3("MsgID") = MsgID
 rs3("MsgDate") = MessageDate
 rs3("Expire") = 0
 rs3("Deliver") = 1
 rs3("RejectDetails") = ""
 rs3("RejectID") = 0
 rs3("ServerID") = 4
 rs3.Update
 rs3.Close
 Set rs3 = Nothing

END SUB


%>
</body>
</html>

 



Posted By: kspare
Date Posted: 05 February 2005 at 11:49am

This is my listspam.asp code. I've modified it with the following features:

a Cell mouseover color change for the line your one.

During the mouse over it will show a popup with the reasons why the message was caught.

You can also click anywhere on the line to check the message.

Notice the security I put at the top of every page, so joe blow can't just access the asp code.

<%If Session("User") = "" Then
  Response.Redirect("/spam")
  END IF%>
<!--#include file="db_connect.asp"-->
<script language="JavaScript">
<!--
function refresh()
{
window.location.reload();
}
//-->
</script>
<script LANGUAGE="JavaScript">
<!--
// Confirm Delete
function confirmDeleteSubmit()
{
var agree=confirm("Are you sure you want to DELETE the selected messages?");
if (agree)
 return true ;
else
 return false ;
}
// -->
</script>
<script LANGUAGE="JavaScript">
<!--
// Confirm Send
function confirmSendSubmit()
{
var agree=confirm("Are you sure you want to SEND the selected messages?");
if (agree)
 return true ;
else
 return false ;
}
// -->
</script>

</script>

 

<%
 Response.CacheControl = "no-cache"
 Response.AddHeader "Pragma", "no-cache"
 Response.Expires = -1
 
 Session.Timeout = 30
 EmailTo = Session("EmailTo")

 'Theoretically, this should never happen.
 If Len(EmailTo) < 1 Then
  Session("EmailTo") = Null
  Session.Abandon
  Response.Redirect "ListSpam.asp"
 End If

 LoopCount = 0
 MaxLoop = 500
%>
<%
  'Generate Notification query.
   Email = Session("EmailTo")
   SQL = "SELECT Email, Notification "
   SQL = SQL & "FROM tblLogins "
   SQL = SQL & "WHERE (Email = '" & Email & "') "
   Set rs = con.Execute(SQL)
   Notification = rs("Notification")
   Session("Notification") = Notification
   con.Execute(SQL)

  %>
  <% 
 'update the Notification field for this user
  IF Request.QueryString("notification") = "off" THEN
  SQL = "UPDATE tblLogins SET notification = 0"
  SQL = SQL & "WHERE (Email = '" & Email & "') "
  Set rs = con.Execute(SQL)
  Response.Redirect "ListSpam.asp"
ELSEIF Request.QueryString("notification") = "hourly" THEN
  SQL = "UPDATE tblLogins SET notification = 1"
  SQL = SQL & "WHERE (Email = '" & Email & "') "
  Set rs = con.Execute(SQL)
  Response.Redirect "ListSpam.asp"
ELSEIF Request.QueryString("notification") = "daily" THEN
  SQL = "UPDATE tblLogins SET notification = 2"
  SQL = SQL & "WHERE (Email = '" & Email & "') "
  Set rs = con.Execute(SQL)
  Response.Redirect "ListSpam.asp"
END IF
%>
<html>
<head>
 <title>Spam Filter - Suspected Spam List</title>
 <base target="_parent">
<script language="JavaScript">
<!--
function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs=new Image; d.FP_imgs.src=a; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
// -->
</script>
</head>
<body link="#008000" vlink="#008000" alink="#FF0000" onload="FP_preloadImgs(/*url*/'button44.gif',/*url*/'button4 5.gif',/*url*/'button47.gif',/*url*/'button48.gif',/*url*/'b utton4A.gif',/*url*/'button4B.gif',/*url*/'button4D.gif',/*u rl*/'button4E.gif',/*url*/'button7.gif',/*url*/'button8.gif' ,/*url*/'buttonA.gif',/*url*/'buttonB.gif',/*url*/'buttonD.g if',/*url*/'buttonE.gif')">

<font face="Arial">

<script>
function SelectAll()
{
  void(d=document);
  void(el=d.getElementsByTagName('INPUT'));
  for(i=0;i<el.length;i++)
    void(el.checked=1)
}
</script>

<script>
function DeSelectAll()
{
  void(d=document);
  void(el=d.getElementsByTagName('INPUT'));
  for(i=0;i<el.length;i++)
    void(el.checked=0)
}
</script>

<%
 'Determine if a sort order was chosen.
 Session("sortby") = Request.QueryString("SortBy")
 order_by = Trim(Request.QueryString("SortBy"))

 If order_by = "" Then
  order_by = "DESC-MsgDate"
  Session("SortDir") = "FILO"
 End If

 Select Case order_by
  Case "Subject"
   order_by = "Subject, MsgDate, EmailFrom"
  Case "EmailFrom"
   order_by = "EmailFrom, MsgDate, Subject"
  Case "MsgDate"
   order_By = "MsgDate, EmailFrom, Subject"
  Case "DESC-MsgDate"
   order_By = "MsgDate DESC, EmailFrom, Subject"
 End Select

 'Generate query.
 SQL = "SELECT QuarID, EmailFrom, Subject, MsgDate, MsgID, RejectDesc, RejectDetails "
 SQL = SQL & "FROM tblQuarantine, tblRejectCodes "
 SQL = SQL & "WHERE (EmailTo = '" & EmailTo & "') "
 SQL = SQL & "AND (Deliver <> 1) "
 SQL = SQL & "AND (Expire <> 1) "
 SQL = SQL & "AND (tblQuarantine.RejectID = tblRejectCodes.RejectID) "
 SQL = SQL & "ORDER BY " & order_by
 Set rs = con.Execute(SQL)
 RecordCount = rs.RecordCount
%>
</font>
<div align="center">

  <font face="Arial">

  </tr>

  </font>

  <table width="396">
  <tr>
    <td height="15" style="padding-left: 4px; padding-right: 4px" align="right">
 <p align="right"><font face="Century Gothic"><big>
 <font size="3" color="#000080">Total Quarantined Messages For:</font></big></font></td>

    <td height="15" style="padding-left: 4px; padding-right: 4px">
 </td>

  </tr>
  <tr>

    <td style="padding-left: 4px; padding-right: 4px" width="263" align="right">
 <p><font face="Century Gothic" color="#000080"><strong><%=Server.HTMLEncode(Ema ilTo)%></strong></font></td>

    <td style="padding-left: 4px; padding-right: 4px" width="111" align="left">
 <b><font color="#0099CC" face="Century Gothic"><%=Server.HTMLEncode(RecordCount)%></fon t></b></td>

  </tr>
  <tr>

    <td style="padding-left: 4px; padding-right: 4px" width="263" align="right">
 <font face="Century Gothic" color="#000080"><strong>Times Logged In:</strong></font></td>

    <td style="padding-left: 4px; padding-right: 4px" width="111" align="left">
 <b><font color="#0099CC" face="Century Gothic"><%=Session("Logins")%></font></b&g t;</td>

  </tr>
  <tr>

    <td style="padding-left: 4px; padding-right: 4px" width="263" align="right">
 <p><strong><font face="Century Gothic" color="#000080">
 Maximum Entries Displayed:</font></strong></td>

    <td style="padding-left: 4px; padding-right: 4px" width="111" align="left">
 <b><font color="#0099CC" face="Century Gothic"><%=MaxLoop%></font></b></td& gt;

  <tr>
 </a></a></td>
    <td style="padding-left: 4px; padding-right: 4px" width="263" align="right">
 <p><strong><font face="Century Gothic" color="#000080"><%
IF Session("Notification") = 0 THEN
response.write "<a target=""content"" style=""color: #000080"" href=""listspam.asp?Notification=hourly""><span style=""text-decoration: none"">Notification:</span></a>"  & vbCRLF

ELSEIF Session("Notification") = 1 THEN
response.write "<a target=""content"" style=""color: #000080"" href=""listspam.asp?Notification=daily""><span style=""text-decoration: none"">Notification:</span></a>"  & vbCRLF

ELSEIF Session("Notification") = 2 THEN
response.write "<a target=""content"" style=""color: #000080"" href=""listspam.asp?Notification=off""><span style=""text-decoration: none"">Notification:</span></a>"  & vbCRLF

END IF
 %></font></strong></td>

    <td style="padding-left: 4px; padding-right: 4px" width="111" align="left">
 <b><font color="#0099CC" face="Century Gothic"><%
IF Session("Notification") = 0 THEN
response.write "<a target=""content"" style=""color: #0099CC"" href=""listspam.asp?Notification=hourly""><span style=""text-decoration: none"">Off</span></a>"  & vbCRLF

ELSEIF Session("Notification") = 1 THEN
response.write "<a target=""content"" style=""color: #0099CC"" href=""listspam.asp?Notification=daily""><span style=""text-decoration: none"">Hourly</span></a>"  & vbCRLF

ELSEIF Session("Notification") = 2 THEN
response.write "<a target=""content"" style=""color: #0099CC"" href=""listspam.asp?Notification=off""><span style=""text-decoration: none"">Daily</span></a>"  & vbCRLF

END IF
 %></font></b></td>

  </tr>

  <tr>
    <td style="padding-left: 4px; padding-right: 4px" colspan="2">
 <p align="center">

  </tr>
</table>
 <form action="ResolveSpam.asp" method="post" target="content">
 <font face="Century Gothic" size="2">
 <tbody>
<%
 If rs.EOF Then
%>
   <table border="0" width="475" id="table3">
 <tr>
          <td align="center">
   <a target="content" href="javascript:refresh()">
   <img border="0" id="img5" src="button6.gif" height="20" width="100" alt="Refresh" onmouseover="FP_swapImg(1,0,/*id*/'img5',/*url*/'button7.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img5',/*url*/'button6.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img5',/*url*/'button8.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img5',/*url*/'button7.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Refresh"></a></td>

         

        
              <td align="center">
      <a target="content" href="PasswordChange.asp"><img border="0" id="img6" src="button9.gif" height="20" width="127" alt="Change Password" onmouseover="FP_swapImg(1,0,/*id*/'img6',/*url*/'buttonA.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img6',/*url*/'button9.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img6',/*url*/'buttonB.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img6',/*url*/'buttonA.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1; fp-proportional: 0" fp-title="Change Password"></a></a></td>
                         <td align="center">
        <a target="_parent" href="Logout.asp"><img border="0" id="img7" src="buttonC.gif" height="20" width="100" alt="Log Out" onmouseover="FP_swapImg(1,0,/*id*/'img7',/*url*/'buttonD.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img7',/*url*/'buttonC.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img7',/*url*/'buttonE.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img7',/*url*/'buttonD.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Log Out"></a></a></td>
 </tr>
</table>
  <tr><td align="center" colspan="5"></font><h2>
 <font face="Century Gothic" size="5">No potential spam found!</font></h2>
 <font face="Century Gothic" size="2"></td></tr>

 </tbody>

<%
 Else
%>


</font>


<table border="0" height="1%" id="table2">
 <tr>
  <td>&nbsp;</td>
 </tr>
</table>


<div align="center">
<table border="0" width="475" id="table3">
 <tr>
          <td align="center">
   <a target="content" href="javascript:refresh()">
   <img border="0" id="img5" src="button6.gif" height="20" width="100" alt="Refresh" onmouseover="FP_swapImg(1,0,/*id*/'img5',/*url*/'button7.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img5',/*url*/'button6.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img5',/*url*/'button8.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img5',/*url*/'button7.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Refresh"></a></td>
              <td align="center"><INPUT type=image border="0" onClick="return confirmDeleteSubmit()" name="cmdDelete" value="Delete" id="img4" src="button4C.gif" height="20" width="100" alt="Delete" onmouseover="FP_swapImg(1,0,/*id*/'img4',/*url*/'button4D.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img4',/*url*/'button4C.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img4',/*url*/'button4E.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img4',/*url*/'button4D.gif' )" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #FF0000; fp-font-color-hover: #FF0000; fp-font-color-press: #FF0000; fp-transparent: 1" fp-title="Delete"></td>

          <td align="center">
   <INPUT type=image border="0" onClick="return confirmSendSubmit()" name="cmdSend" value="Send To My Inbox" id="img3" src="button49.gif" height="20" width="134" alt="Send To My Inbox" onmouseover="FP_swapImg(1,0,/*id*/'img3',/*url*/'button4A.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img3',/*url*/'button49.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img3',/*url*/'button4B.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img3',/*url*/'button4A.gif' )" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1; fp-proportional: 0" fp-title="Send To My Inbox"></td>
          <td align="center">
   <img border="0" onclick="SelectAll()" value="Select All" id="img1" src="button46.gif" height="20" width="100" alt="Select All" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Select All" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button47.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button46.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'button48.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button47.gif' )"></td>

          <td align="center">
   <img border="0" onclick="DeSelectAll()" value="De-Select All" id="img2" src="button43.gif" height="20" width="100" alt="De-Select All" onmouseover="FP_swapImg(1,0,/*id*/'img2',/*url*/'button44.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img2',/*url*/'button43.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img2',/*url*/'button45.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img2',/*url*/'button44.gif' )" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="De-Select All"></td>
              <td align="center">
      <a target="content" href="PasswordChange.asp"><img border="0" id="img6" src="button9.gif" height="20" width="127" alt="Change Password" onmouseover="FP_swapImg(1,0,/*id*/'img6',/*url*/'buttonA.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img6',/*url*/'button9.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img6',/*url*/'buttonB.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img6',/*url*/'buttonA.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1; fp-proportional: 0" fp-title="Change Password"></a></a></td>
                         <td align="center">
        <a target="_parent" href="Logout.asp"><img border="0" id="img7" src="buttonC.gif" height="20" width="100" alt="Log Out" onmouseover="FP_swapImg(1,0,/*id*/'img7',/*url*/'buttonD.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img7',/*url*/'buttonC.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img7',/*url*/'buttonE.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img7',/*url*/'buttonD.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Log Out"></a></a></td>
 </tr>
</table>
</div>
</div>

 

 <table border="1" cellpadding="2" cellspacing="0" width="100%">
 <thead align="center" valign="bottom">
  <tr>
   <th scope="col" bgcolor="silver">
   <font color="#000080" face="Century Gothic" size="2">Sel</font></th>
   <th scope="col" bgcolor="silver">
   <font color="#000080" face="Century Gothic" size="2">No.</font></th>
   <th scope="col" bgcolor="silver">
   <a target="content" href="ListSpam.asp?SortBy=EmailFrom">
   <font color="#000080" face="Century Gothic" size="2">From</font></a></th>
   <th scope="col" bgcolor="silver">
   <a target="content" href="ListSpam.asp?SortBy=Subject">
   <font color="#000080" face="Century Gothic" size="2">Subject</font></a></th>
   <% If Session("SortDir") = "FIFO" Then %>
    <th scope="col" bgcolor="silver"><font face="Century Gothic"><a href="ListSpam.asp?SortBy=MsgDate">
    </font>
    <a target="content" href="ListSpam.asp?SortBy=MsgDate">
    <font color="#000080" face="Century Gothic" size="2">Date</font></a><font face="Century Gothic"></a></font></th>
    <% Session("SortDir") = "FILO"
   Else %>
    <th scope="col" bgcolor="silver">
    <a target="content" href="ListSpam.asp?SortBy=MsgDate DESC">
    <font color="#000080" face="Century Gothic" size="2">Date</font></a></th>
    <% Session("SortDir") = "FIFO"
   End If %>
  </tr>
 </thead>
<style>
.classover {background-color: #ff952b;}
</style>
<% Count = 1 %>
<%

  While (Not rs.EOF) AND (LoopCount < MaxLoop)
   LoopCount = LoopCount + 1
   QuarID = rs("QuarID")
   MsgID = rs("MsgID")
%>


<% If Count = 0 Then %>
<tr bgcolor="#c9c9c9" onmouseover="this.className='classover'" onmouseout="this.className=''"  title="Reason:<%=Chr(13)%><%=rs("Rejectdesc")%>& lt;%=Chr(13)%>Details:<%=Chr(13)%><%=rs("Rejectd etails")%>">
<% ELSE %>
<tr bgcolor="white" onmouseover="this.className='classover'" onmouseout="this.className=''"  title="Reason:<%=Chr(13)%><%=rs("Rejectdesc")%>& lt;%=Chr(13)%>Details:<%=Chr(13)%><%=rs("RejectD etails")%>">
<% end if %>

   <td align="center"><font face="Century Gothic"><input type="checkbox" name="<%="chk_" & QuarID%>"></font></td>
<acronym onclick="javascript:if (<%="chk_" & QuarID%>.checked==true){<%="chk_" & QuarID%>.checked=false;} else{<%="chk_" & QuarID%>.checked=true;}"> 
   <%Scount = Scount + 1%>
   <td valign="middle" nowrap align="center">
   <font face="Century Gothic" size="2"><%=Scount%></font></td></ac ronym>
   <td><font face="Century Gothic" size="2">&nbsp;<a href="ResolveSpamv.asp?QuarID=<%=QuarID%>&MsgID=&l t;%=MsgID%>"><font color="#000080">view</font></a><acronym onclick="javascript:if (<%="chk_" & QuarID%>.checked==true){<%="chk_" & QuarID%>.checked=false;} else{<%="chk_" & QuarID%>.checked=true;}"> &nbsp;&nbsp;
    <%=Server.HTMLEncode(rs("EmailFro m"))%>
   </font>
   </td>
   <td><font face="Century Gothic" size="2"><%=Server.HTMLEncode(rs("Subject"))%></ font></td>
   <td><font face="Century Gothic" size="2"><%=rs("MsgDate")%></font></td>
  </tr>


</acronym>

<%
Count = Count + 1
If Count = 2 Then Count = 0 %>
<%
   rs.MoveNext
  Wend
%>
</table>
<font face="Century Gothic">
</table>
 </tbody>
 </table>


</div></td>
    </tr>
  </table>
</left>
  </div>


<div align="center">
<table border="0" width="475" id="table3">
 <tr>
          <td align="center">
   <a target="content" href="javascript:refresh()">
   <img border="0" id="img5" src="button6.gif" height="20" width="100" alt="Refresh" onmouseover="FP_swapImg(1,0,/*id*/'img5',/*url*/'button7.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img5',/*url*/'button6.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img5',/*url*/'button8.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img5',/*url*/'button7.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Refresh"></a></td>
              <td align="center"><INPUT type=image border="0" onClick="return confirmDeleteSubmit()" name="cmdDelete" value="Delete" id="img4" src="button4C.gif" height="20" width="100" alt="Delete" onmouseover="FP_swapImg(1,0,/*id*/'img4',/*url*/'button4D.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img4',/*url*/'button4C.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img4',/*url*/'button4E.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img4',/*url*/'button4D.gif' )" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #FF0000; fp-font-color-hover: #FF0000; fp-font-color-press: #FF0000; fp-transparent: 1" fp-title="Delete"></td>

          <td align="center">
   <INPUT type=image border="0" onClick="return confirmSendSubmit()" name="cmdSend" value="Send To My Inbox" id="img3" src="button49.gif" height="20" width="134" alt="Send To My Inbox" onmouseover="FP_swapImg(1,0,/*id*/'img3',/*url*/'button4A.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img3',/*url*/'button49.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img3',/*url*/'button4B.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img3',/*url*/'button4A.gif' )" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1; fp-proportional: 0" fp-title="Send To My Inbox"></td>
          <td align="center">
   <img border="0" onclick="SelectAll()" value="Select All" id="img1" src="button46.gif" height="20" width="100" alt="Select All" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Select All" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button47.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button46.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'button48.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button47.gif' )"></td>

          <td align="center">
   <img border="0" onclick="DeSelectAll()" value="De-Select All" id="img2" src="button43.gif" height="20" width="100" alt="De-Select All" onmouseover="FP_swapImg(1,0,/*id*/'img2',/*url*/'button44.gi f')" onmouseout="FP_swapImg(0,0,/*id*/'img2',/*url*/'button43.gif ')" onmousedown="FP_swapImg(1,0,/*id*/'img2',/*url*/'button45.gi f')" onmouseup="FP_swapImg(0,0,/*id*/'img2',/*url*/'button44.gif' )" fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="De-Select All"></td>
              <td align="center">
      <a target="content" href="PasswordChange.asp"><img border="0" id="img6" src="button9.gif" height="20" width="127" alt="Change Password" onmouseover="FP_swapImg(1,0,/*id*/'img6',/*url*/'buttonA.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img6',/*url*/'button9.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img6',/*url*/'buttonB.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img6',/*url*/'buttonA.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1; fp-proportional: 0" fp-title="Change Password"></a></a></td>
                         <td align="center">
        <a target="_parent" href="Logout.asp"><img border="0" id="img7" src="buttonC.gif" height="20" width="100" alt="Log Out" onmouseover="FP_swapImg(1,0,/*id*/'img7',/*url*/'buttonD.gif ')" onmouseout="FP_swapImg(0,0,/*id*/'img7',/*url*/'buttonC.gif' )" onmousedown="FP_swapImg(1,0,/*id*/'img7',/*url*/'buttonE.gif ')" onmouseup="FP_swapImg(0,0,/*id*/'img7',/*url*/'buttonD.gif') " fp-style="fp-btn: Embossed Capsule 4; fp-font: Century Gothic; fp-font-style: Bold; fp-font-color-normal: #000080; fp-font-color-hover: #000080; fp-font-color-press: #000080; fp-transparent: 1" fp-title="Log Out"></a></a></td>
 </tr>
</table>
</div>
</div>
 </form>
<%
 End If

 rs.Close
 Set rs = Nothing
 con.Close
 Set con = Nothing
%>
</div>


</font>


</body>
</html>



Posted By: kspare
Date Posted: 05 February 2005 at 11:52am
I must mention that I started this code based on some code dan gave me a year or so ago, so thanks Dan :)


Posted By: Desperado
Date Posted: 05 February 2005 at 12:36pm

Kevin,

What did I say ... something like "Once you start it's hard to stop"?!

I was at work ALL Night working on a PIX Firewall configuration and now ... while I should be going home, I am screwing around trying to figure our why my "favicon" for the SpamFilter manager is intermitant. Why am I doing this?  I think it's an illness!

Dan



-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com



Posted By: kspare
Date Posted: 05 February 2005 at 12:48pm

Oh I know..i've still got more planned for it.h

 

let me know if you need help with the pix. I do cisco in my sleep...literallly. I've woken up and had configs in my head and had to write them down because I solved the problem in my sleep! lol

Pix's....they are a tamable beast! LOL Most hate them. I love them.



Posted By: Desperado
Date Posted: 05 February 2005 at 1:23pm

Kevin,

To be honest, and trying not to "toot my own horn", my nickname here is "Mr. Cisco".  The only reason I was at it all night was because the customer, 2 states away, screwed up installing additional VPN Licenses and managed to blow out the existing keys so I had to walk him through getting SSH access to the device from my IP and I think he was a few fingers short of a full hand.

Back on topic, how much SQL load do you experience gathering your "Notifier" information.  I can imagine a high SQL load if the DB has a million or so records and a lot of users are sighed up.  Or .. no?

Dan



-------------
The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com



Posted By: kspare
Date Posted: 05 February 2005 at 1:25pm
I'm not even sure of the load. But I know it scans 10,000 records in a matter of a second? All the emails go out at 6pm. So I'd say the load is minimal. I also run the delivery asp page right on the webserver.


Posted By: Guests
Date Posted: 10 February 2005 at 9:33am

For those of you that have been playing around with my spamfilter <cough> ric <cough> check back monday. My new version will be online sometime sunday or monday.

Kevin



Posted By: Guests
Date Posted: 10 February 2005 at 3:31pm

you noticed that??? :) 

I thought you were a busy man like I am...

BTW - I love what you've done with it all...



Posted By: kspare
Date Posted: 11 February 2005 at 1:22pm

I am, but I took at the spam for my domain and the demo account has a ton of spam coming from your hotmail account. :)




Print Page | Close Window