Hi all,

I don't know if I can handle any more, and we are not yet half-way thru'! :-)

Howie said:
>Is member address local?
>
>YES: Save mail to local account
>
>NO: Send mail to remote mail server via POST Server
>
>I can see only three ways to accomplish this (and we need to configure this
>to be as efficient as possible)
>
>1 - List processing template verifies whether a domain is local or not and
>sends mail accordingly (so, we would have to perform a query for every
>domain in the membership).
>
>2 - Prefill each member with a flag for local or external
>
>3 - Have the POST Server call a template (say, "IsLocalDomain") for every
>control file
>
>The most efficient way is number 2 but it requires careful coding to
>maintain this flag.  Number 1 and 3 take the same overhead (as far as I can
>see).
>
>Anyway, what are your thoughts?  Should we go for option 1, 2, or three.  Do
>you have a better suggestion than all of these?

We went for option 1 originally as iMS V 1.0 was not as sophisticated then 
as it is now in terms of cfx_iMSmail, etc.  I have attached the original 
code we wrote back then and you can see that we grouped everything by 
domain so a few more lines of code will do a local/external thing for you. 
This bit of code fits into our version of data.cfm as I uploaded to 
Guillermo's forum but is complete in itself as a List server. You can use 
it if you want.

We have moved on a bit since then but I can't send a current version as we 
are in the midst of a major rebuild and I don't think the current one is 
working right now :-)  Something similar to this one is doing the 
production work at the moment.

Talking of production we are in the middle of sending out 63,000 emails 
right now for a client and it has been quite interesting evolving the code 
to handle a dirty database of eddresses and keep the stress off the POST 
server.  Our first attempt was not adequate and the POST server is loaded 
down a bit with a lot of crook domain names, etc. If we get a nice set of 
filters we will share them with you all. Similarly if anyone has some good 
filters we are interested! :-)


<!--- List server include file for data.cfm --->
<!--- copywrite Microset Pty Ltd. This code is not in the public domain --->
<!--- Created by Kym Kovan  27/12/99 --->
<!--- Last Modified:    28/12/99        --->     <!---  By Kym K --->

<!--- this is first version, no digests or anything, just a plain Listserv --->
<!--- file copy added --->
<!--- now table for digesting files --->

<cfset Handled = True>
<cfset PostOK = False>
<!--- get List specs for this List account --->
<cfquery name="getListID" datasource="iMS">
        select  ListID, FromEddress, PostAccess, Path
                from    Lists
                where   AccountNum = #getUser.AccountNum#
</cfquery>
<cfset ThisList = getListID.ListID>
<cfif getListID.RecordCount gt 0 and getListID.PostAccess eq 1>
        <!--- list exists and is open access --->
        <cfset PostOK = True>
<cfelseif getListID.RecordCount gt 0 and getListID.PostAccess eq 2>     <!--- members 
only List so see if sender is one --->
        <cfquery name="getMember" datasource="iMS">
                select  Eddress, Access
                        from    ListMembers
                        where   Eddress = '#smtpfrom#'
                                and     ListID = #ThisList#
                                and Access <> 5
                                and Active = 1
        </cfquery>
        <cfif getMember.RecordCount gt 0 and getMember.Access neq 4>
                <cfset PostOK = True>
        <cfelseif getMember.RecordCount gt 0 and getMember.Access eq 4>
                <!--- put "forward on to moderator" bit here --->
        <cfelse>
                <!--- put "not allowed to post to list" message send bit here --->
        </cfif>
<cfelseif getListID.RecordCount gt 0 and getListID.PostAccess eq 3>     <!--- 
Moderated List --->
        <!--- put "forward on to moderator" bit here --->
<cfelse>
</cfif>
<cfif PostOK>
        <!--- find mail directories --->
        <cfset BaseiMSDir="">
        <CFREGISTRY ACTION="Get"
          BRANCH="HKEY_LOCAL_MACHINE\Software\On-Line Data\inFusionMailServer" 
          ENTRY="BaseDirectory" TYPE="String" Variable="BaseiMSDir">
        <cfset MailPath = "#BaseiMSDir#\Mail\">
        <cfset ListPath = "#MailPath#Lists\#getListID.Path#work\">
        <cfset MailName = Listlast(emailfile, "\")>
        <cfset ListEmail = ListPath & MailName>
        <!--- then put mail file there and save relevant data --->
        <cffile action="COPY" source="#emailfile#" destination="#ListEmail#">
        <cfx_odsmime action="list" file="#emailfile#">
        <cfquery name="SetDig" datasource="iMS">
                insert into     ListDigest
                                                        (ListID, MailName, TimeSent, 
Subject, WhoFrom)
                        values  (#ThisList#, '#ListEmail#', 
#CreateODBCDateTime(ParseDateTime("#odsmime_Date#","POP"))#,
                                                        '#odsmime_Subject#', 
'#odsmime_From#')
        </cfquery>
        <!--- now send the mail --->
        <!--- get domains of members of this List --->
        <cfquery name="getDomains" datasource="iMS">
                select  DomainID
                        from    ListDomains
                        where   ListID = #getListID.ListID#
        </cfquery>
        <!--- loop thru' these domains and get active 'normal' List members for each 
domain and send post to them --->
        <cfset listcntr = 1>
        <cfloop query="getDomains">
                <cfquery name="getMembers" datasource="iMS">
                        select  Eddress
                                from    ListMembers
                                where   DomainID = #getDomains.DomainID#
                                        and     ListID = #getListID.ListID#
                                        and Access = 1
                                        and Active = 1
                </cfquery>
                <cfx_iMSMail kickpost="yes" emailfile="#emailfile#" query="getMembers" 
queryfield="Eddress" smtpfrom="#getListID.ReturnEddress#" DeleteMailFile="no" 
log="yes">
                <cfset listcntr = listcntr+1>
        </cfloop>
</cfif>
--

Yours,

Kym

Reply via email to