Re: Mailing list maintenance.
also if u want to keep this local and not use mailchimp, which I would suggest at least trying as it6 also makes sure a lot more of your mail gets delivered and will tell you how many people actually read the emails etc. There is a library around maybe on riaforge for processing email bounces, there is also a product called bogie bounce which may help you. The problem with automating email bounces is that you need to know all the possible bounce messages, whether they are hard or soft, whether they are delayed messages or just auto responders. On Tue, Aug 23, 2011 at 4:28 AM, matt busche mrbus...@gmail.com wrote: I'm not 100% sure all this code will work w/ CF5, but this is what I use. The JS is thanks to a UDF written by Ray Camden this code pulls all emails from an inbox and searches for anything that I've identified as a bounceback. Then it uses the UDF to find the email and then I add that email address to a list. This also delete out of office emails from the inbox. Hopefully this helps, Matt cfpop server= username= password= action=getAll name=getAllMail cfset DeleteOrder = '' cfoutput cfset Email_List = '' /!--- set a variable to hold the list of all the emails --- cfloop query=getAllMail cfif FROM CONTAINS 'postmaster' OR FROM CONTAINS 'MAILER-DAEMON' OR FROM CONTAINS 'Mail Delivery' OR Body CONTAINS 'Failed' OR Body CONTAINS 'no longer with' OR Body CONTAINS 'Notice' cfset emailList = Body / cfscript function getEmails(str) { var email = (['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name|jobs|travel))); var res = ; var marker = 1; var matches = ; matches = reFindNoCase(email,str,marker,marker); while(matches.len[1] gt 0) { res = listAppend(res,mid(str,matches.pos[1],matches.len[1])); marker = matches.pos[1] + matches.len[1]; matches = reFindNoCase(email,str,marker,marker); } return res; } /cfscript cfloop list=#getEmails(emailList)# index=k cfif NOT ListFind(Email_List,k) cfdump var=#k#br / cfquery datasource=Corporate_Production INSERT INTO InvalidEmails (TextBody) VALUES ('#Trim(k)#') /cfquery cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfset Email_List = ListAppend(Email_List,k) / /cfif /cfloop !--- Delete out of office emails --- cfelseif Body CONTAINS 'Out of Office' OR Subject CONTAINS 'Out of Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Out of the Office' OR Subject CONTAINS 'Out of the Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Reply' OR Subject CONTAINS 'Reply' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Delay' OR Subject CONTAINS 'Delay' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) /cfif /cfloop /cfoutput cfif DeleteOrder NEQ '' cfset Count = 0 / cfloop list=#DeleteOrder# delimiters=, index=i cfpop server= username= password= action=delete messagenumber=#i# name=deleteMail cfset Count = Count + 1 / /cfloop br /cfdump var=#Count# EMAILS FOUND /cfif cfquery DELETE FROM ML_EMAILS WHERE EMAIL IN (SELECT TEXTBODY FROM INVALIDEMAILS) /cfquery cfquery DELETE FROM INVALIDEMAILS /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346957 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Mailing list maintenance.
use www.mailchimp.com it will handle bounces for you automatically as well as lots of other cool stuff. +100 on mailchimp. Its really optimized for this. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346966 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Mailing list maintenance.
use www.mailchimp.com it will handle bounces for you automatically as well as lots of other cool stuff. On Tue, Aug 23, 2011 at 1:47 AM, Dave Long d...@northgoods.com wrote: I have a customer who has a modest opt-in mailing list of approx. 4,000 subscribers that have been added to a MySQL DB via a CF enabled contact form. Since the list pertains to a once-a-year event, he does not utilize the list until a month or two before the event and perhaps once or twice afterwards. As you might guess, over the year long interim, two or three hundred addresses become invalid annually. Now, please don't laugh at the ignorance of my process because I'm here to be educated. In order to prevent accumulation of bad e-mails, I open each individual failure notice, bring up the attached original message, scroll to the bottom to click the Unsubscribe link which activates a delete query for that specific e-mail address, (which also displays an acknowledgement page,) close the page, close the attachment, and finally, delete the notice. (Whew!) Repeating this action several hundred times is a real time waster. Does anyone in this illustrious group have an idea how this house cleaning could be automated with ColdFusion (or otherwise)? One really tough part of the problem is that the failure notices are not a consistent form... various servers use varied formats. BTW, if it matters, I'm using a CF5 server with MySQL 3.51 on a Linux system. Thanks for considering this problem. Dave Long NorthGoods Merchant Services http://www.northgoods.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346949 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Mailing list maintenance.
Yes... Many ways, but the easiest would be to have them bounce into a mailbox of your choosing. You could then use CF to pop the mail and read the information that is needed to identify enough to send the query to the database to delete or do what you need to do. That is just one method, out of many... On Tue, Aug 23, 2011 at 10:47 AM, Dave Long d...@northgoods.com wrote: I have a customer who has a modest opt-in mailing list of approx. 4,000 subscribers that have been added to a MySQL DB via a CF enabled contact form. Since the list pertains to a once-a-year event, he does not utilize the list until a month or two before the event and perhaps once or twice afterwards. As you might guess, over the year long interim, two or three hundred addresses become invalid annually. Now, please don't laugh at the ignorance of my process because I'm here to be educated. In order to prevent accumulation of bad e-mails, I open each individual failure notice, bring up the attached original message, scroll to the bottom to click the Unsubscribe link which activates a delete query for that specific e-mail address, (which also displays an acknowledgement page,) close the page, close the attachment, and finally, delete the notice. (Whew!) Repeating this action several hundred times is a real time waster. Does anyone in this illustrious group have an idea how this house cleaning could be automated with ColdFusion (or otherwise)? One really tough part of the problem is that the failure notices are not a consistent form... various servers use varied formats. BTW, if it matters, I'm using a CF5 server with MySQL 3.51 on a Linux system. Thanks for considering this problem. Dave Long NorthGoods Merchant Services http://www.northgoods.com -- Regards, Andrew Scott WebSite: http://www.andyscott.id.au/ Google+: http://plus.google.com/108193156965451149543 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346950 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Mailing list maintenance.
I'm not 100% sure all this code will work w/ CF5, but this is what I use. The JS is thanks to a UDF written by Ray Camden this code pulls all emails from an inbox and searches for anything that I've identified as a bounceback. Then it uses the UDF to find the email and then I add that email address to a list. This also delete out of office emails from the inbox. Hopefully this helps, Matt cfpop server= username= password= action=getAll name=getAllMail cfset DeleteOrder = '' cfoutput cfset Email_List = '' /!--- set a variable to hold the list of all the emails --- cfloop query=getAllMail cfif FROM CONTAINS 'postmaster' OR FROM CONTAINS 'MAILER-DAEMON' OR FROM CONTAINS 'Mail Delivery' OR Body CONTAINS 'Failed' OR Body CONTAINS 'no longer with' OR Body CONTAINS 'Notice' cfset emailList = Body / cfscript function getEmails(str) { var email = (['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name|jobs|travel))); var res = ; var marker = 1; var matches = ; matches = reFindNoCase(email,str,marker,marker); while(matches.len[1] gt 0) { res = listAppend(res,mid(str,matches.pos[1],matches.len[1])); marker = matches.pos[1] + matches.len[1]; matches = reFindNoCase(email,str,marker,marker); } return res; } /cfscript cfloop list=#getEmails(emailList)# index=k cfif NOT ListFind(Email_List,k) cfdump var=#k#br / cfquery datasource=Corporate_Production INSERT INTO InvalidEmails (TextBody) VALUES ('#Trim(k)#') /cfquery cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfset Email_List = ListAppend(Email_List,k) / /cfif /cfloop !--- Delete out of office emails --- cfelseif Body CONTAINS 'Out of Office' OR Subject CONTAINS 'Out of Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Out of the Office' OR Subject CONTAINS 'Out of the Office' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Reply' OR Subject CONTAINS 'Reply' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) cfelseif Body CONTAINS 'Delay' OR Subject CONTAINS 'Delay' cfset DeleteOrder = ListPrepend(DeleteOrder, MessageNumber) /cfif /cfloop /cfoutput cfif DeleteOrder NEQ '' cfset Count = 0 / cfloop list=#DeleteOrder# delimiters=, index=i cfpop server= username= password= action=delete messagenumber=#i# name=deleteMail cfset Count = Count + 1 / /cfloop br /cfdump var=#Count# EMAILS FOUND /cfif cfquery DELETE FROM ML_EMAILS WHERE EMAIL IN (SELECT TEXTBODY FROM INVALIDEMAILS) /cfquery cfquery DELETE FROM INVALIDEMAILS /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346952 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm