Hi everyone,

I've searched the group here and found a few threads relating to the CFSMTP 
tag/plugin. I really thought this would be pretty simple, create an app 
that receives email and parses the subject/body. So I set up a testing 
server on the internal network and am trying to get a working 'prototype' 
system that I can refine/expound on. Basically I need to the get the CFSMPT 
system working and then I can flesh out the rest of the application.

I can start the server. No issue. I can telnet from another machine to the 
server and manually send an email to the cf application. The openBD app 
accepts the mail with no error. This is where my problem is... I have a few 
logging queries in each of the functions, but nothing gets logged. Further 
I have the filter functions set up such that the test email I'm initiating 
manually through telnet should be rejected (without the proper domain).

Here is the code I'm using.

Starting the CFSMTP server:

<cfset temp = smtpstart(name='ddmgSMTP', cfcmail='modules.model.ddmgSMTP', 
cfcfilter='modules.model.ddmgSMTPFilter', ip='10.0.0.1', port='25')>

Again, this starts the CFSMTP server without issue or error.

My "cfcmail" (ddmgSMTP) has the following function:

<cffunction name="onMailAccept" access="public" returntype="any">
    <cfargument name="mail" required="true">

    <cfquery name="logit" datasource="#myDsn#">
     INSERT INTO email_test_log ( description )
     VALUES ( 'Data received!' )
    </cfquery>
</cffunction>

My "cfcfilter" (ddmgSMTPFilter) has the following two functions:

<cffunction name="onMailFrom" access="public" returntype="boolean">
     <cfargument name="email" required="true">
     <cfargument name="ip" required="true">

     <cfquery name="logit" datasource="#myDsn#">
         INSERT INTO email_test_log ( description )
         VALUES ( 'onMailFrom triggered with: email="#arguments.email#", 
ip="#arguments.ip#"' )
     </cfquery>

     <cfreturn false />
</cffunction>


<cffunction name="onMailTo" access="public" returntype="boolean">
     <cfargument name="email" required="true">
     <cfargument name="ip" required="true">

     <cfquery name="logit" datasource="#myDsn#">
         INSERT INTO email_test_log ( description )
         VALUES ( 'onMailTo triggered with: email="#arguments.email#", 
ip="#arguments.ip#"' )
     </cfquery>

     <cfset validDomains = "domain.com,ddmg.net" />

     <cfset mailToDomain = listGetAt(arguments.email, 2, "@") />

     <cfif listFind(validDomains, mailToDomain)>
         <cfreturn true />
     </cfif>
     <cfreturn false />
</cffunction>

So the way I was expecting things to work was that when I telnet in to the 
CFSMTP the system would fire the "onMailFrom" function in the filter cfc 
after I send the "MAIL FROM:" command, which in this case would create an 
entry in the database. Then the "onMailTo" function in the filter cfc would 
trigger after I send the "RCPT TO:" command, which should create an entry 
in the database. Also, if I've specified an email address that doesn't end 
with either "ddmg.net" or "domain.com" - I'm expecting the CFSMTP server to 
terminate the connection. 

Then I'm expecting the "onMailAccept" function in the cfcmail to trigger 
after sending "DATA" with proper termination, which (again) should add an 
entry to the database.

I get no errors, no database entries, and when I poll the "smtpStatus()" it 
indicates that 1 connection happened and 1 email processed.

Can anyone spot something I'm doing wrong here (probably something 
simple/stupid) or maybe point me to the proper/which log files to see if 
there is anything in the logs that may indicate that something went wrong 
or wasn't right?? Any help will be greatly appreciated!

Thanks,
Alan

-- 
-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Open 
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to