<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

	<channel>
		<title>robfelty WordPress plugin forum &#187; Topic: introduction - I am working on linking mailman with buddypress forums</title>
		<link>http://forum.robfelty.com/</link>
		<description>robfelty WordPress plugin forum &#187; Topic: introduction - I am working on linking mailman with buddypress forums</description>
		<language>en</language>
		<pubDate>Wed, 08 Feb 2012 09:35:35 +0000</pubDate>

					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-3023</link>
				<pubDate>Tue, 30 Mar 2010 13:26:49 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">3023@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Thanks Rob.
&#60;/p&#62;</description>
			</item>
					<item>
				<title>robfelty on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-3021</link>
				<pubDate>Mon, 29 Mar 2010 19:52:59 +0000</pubDate>
				<dc:creator>robfelty</dc:creator>
				<guid isPermaLink="false">3021@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;I put those changes into trunk.
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-3019</link>
				<pubDate>Mon, 29 Mar 2010 00:40:48 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">3019@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Revised patch - sorry for pasting direct code, but pastebin's not online at the moment.  Features are as above: smtp fix, and adding a way for a plugin filter to block a post completely. Additionally, this fixes the handling of :end, which isn't handled well for HTML posts currently.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;Index: postie-functions.php
===================================================================
--- postie-functions.php	(revision 220496)
+++ postie-functions.php	(working copy)
@@ -173,12 +173,21 @@
       &#38;#39;post_status&#38;#39; =&#38;gt; $post_status
   );
   $details = apply_filters(&#38;#39;postie_post&#38;#39;, $details);
-  DisplayEmailPost($details);
-  PostToDB($details,$isReply, $post_to_db,
-      $custom_image_field);
-  if ($confirmation_email)
-    MailToRecipients($mimeDecodedEmail, false,
-        array($postAuthorDetails[&#38;#39;email&#38;#39;]), false, false);
+	if ( empty( $details ) ) {
+		// It is possible that the filter has removed the post, in which case, it should not be posted.
+		// And if we created a placeholder post (because this was not a reply to an existing post),
+		// then it should be removed
+		if ( !$is_reply ) {
+			wp_delete_post($post_id);
+		}
+	} else {
+		DisplayEmailPost( $details );
+		PostToDB( $details,$isReply, $post_to_db, $custom_image_field );
+		if ($confirmation_email) {
+			MailToRecipients( $mimeDecodedEmail, false,
+					array($postAuthorDetails[&#38;#39;email&#38;#39;]), false, false );
+		}
+	}
 }
 /** FUNCTIONS **/

@@ -902,10 +911,11 @@

 function checkSMTP($mimeDecodedEmail, $smtpservers) {

-if ( empty( $smtpservers ) ) return true;
-
+  if ( empty( $smtpservers ) ) return true;
   foreach ( (array) $mimeDecodedEmail-&#38;gt;headers[&#38;#39;received&#38;#39;] as $received ) {
-		if ( in_array( strtolower($received), $smtpservers ) ) return true;
+		foreach ($smtpservers as $smtp) {
+			if ( stristr( $received, $smtp ) !== false ) return true;
+		}
 	}
   return false;
 }
@@ -954,20 +964,12 @@
 * @param string
 * @param filter
 */
-function EndFilter( &#38;amp;$content,$filter) {
-$arrcontent = explode(&#38;quot;\n&#38;quot;, $content);
-$i = 0;
-for ($i = 0; $i&#38;lt;=count($arrcontent); $i++) {
-  $line = $arrcontent[$i];
-  $nextline = $arrcontent[$i+1];
-      if (preg_match(&#38;quot;/^$filter/&#38;quot;,trim($line))) {
-          //print(&#38;quot;&#38;lt;p&#38;gt;Found in $line&#38;quot;);
-          break;
-      }
-  $strcontent .= $line .&#38;quot;\n&#38;quot;;
+function EndFilter( &#38;amp;$content, $end ) {
+	$pos = strpos( $content, $end );
+  if ( $pos === false )
+      return $content;
+	return $content = substr($content, 0, $pos);
 }
-  $content = $strcontent;
-}

 //filter content for new lines
 function FilterNewLines ( $content, $convertNewLines=false ) {&#60;/code&#62;&#60;/pre&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2972</link>
				<pubDate>Mon, 22 Mar 2010 13:32:39 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2972@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Sorry, I let a small problem through with the smtp filter. &#60;a href='http://wordpress.pastebin.ca/1849602'&#62;This patch fixes it&#60;/a&#62;, as well as adding in a new feature: if a postie filter returns false, then the email is not turned into a wordpress post: this provides a way for the filter to suppress an email.
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2948</link>
				<pubDate>Wed, 17 Mar 2010 13:55:56 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2948@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Ah, ok, I'll just back away from that one slowly then!
&#60;/p&#62;</description>
			</item>
					<item>
				<title>robfelty on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2947</link>
				<pubDate>Wed, 17 Mar 2010 12:04:44 +0000</pubDate>
				<dc:creator>robfelty</dc:creator>
				<guid isPermaLink="false">2947@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Andrew,&#60;/p&#62;
&#60;p&#62;Thanks for that. However, I think that someone had requested this awhile ago, to use this:&#60;br /&#62;
&#60;a href=&#34;http://htmlpurifier.org/&#34; rel=&#34;nofollow&#34;&#62;http://htmlpurifier.org/&#60;/a&#62;
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2944</link>
				<pubDate>Tue, 16 Mar 2010 23:55:54 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2944@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Thanks for that, Rob, that's great.&#60;br /&#62;
I saw that &#34;html purify&#34; was top of the TODO list in postie-functions: this patch should do it: &#60;a href=&#34;http://wordpress.pastebin.ca/1843301&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.pastebin.ca/1843301&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Andrew
&#60;/p&#62;</description>
			</item>
					<item>
				<title>robfelty on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2941</link>
				<pubDate>Tue, 16 Mar 2010 11:53:42 +0000</pubDate>
				<dc:creator>robfelty</dc:creator>
				<guid isPermaLink="false">2941@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Andrew,&#60;/p&#62;
&#60;p&#62;I have committed your changes into HEAD now. I also fixed the cron updating, which you had noted was not working. Thanks so much for your help. I apologize for the ugly code. Quite a few people had their hands on postie before me, and it also was dormant for a couple years. I have slowly been working on bringing it back up to wordpress standards. &#60;/p&#62;
&#60;p&#62;The reason I started hacking postie in the first place was to use it with mailman lists for a friend. I had it working fairly well, but he never ended up really using it. &#60;/p&#62;
&#60;p&#62;Rob
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2938</link>
				<pubDate>Mon, 15 Mar 2010 08:05:23 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2938@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;&#60;a href='http://wordpress.pastebin.ca/1841258'&#62;revised patch here&#60;/a&#62;, with nested serialized arrays, as discusssed.&#60;/p&#62;
&#60;p&#62;I'm still testing: it seems stable so far...
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2935</link>
				<pubDate>Sun, 14 Mar 2010 14:10:25 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2935@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;OK, I'll have a go at this, and get back to you tomorrow, all being well.&#60;/p&#62;
&#60;p&#62;Re &#60;code&#62;GetConfig/GetDBConfig&#60;/code&#62; - as the only place the old config is used, is in the activation routine, I moved the relevant code into &#60;code&#62;function activate_postie()&#60;/code&#62; in &#60;code&#62;postie.php&#60;/code&#62;. But I'll reverse those particular changes, so that you &#38;amp; all postie users can be confident that their old settings will be carried over securely.&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Andrew
&#60;/p&#62;</description>
			</item>
					<item>
				<title>robfelty on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2934</link>
				<pubDate>Sun, 14 Mar 2010 11:45:43 +0000</pubDate>
				<dc:creator>robfelty</dc:creator>
				<guid isPermaLink="false">2934@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;I had a chance to look over the patch a little bit. It looks good for the most part. The main thing that I would change is to undo any changes you made to the GetConfig (and GetDBConfig) functions. Under the new settings scheme, I don't use that function any more, except to convert the old-style settings into the new style. So it needs to be left untouched in order to smoothly transition from old style to new style settings.&#60;/p&#62;
&#60;p&#62;If you can get nested serialized arrays to work, that would be great. &#60;/p&#62;
&#60;p&#62;Rob
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2933</link>
				<pubDate>Sun, 14 Mar 2010 11:24:38 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2933@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Hi Rob,&#60;br /&#62;
&#60;code&#62;register_setting&#60;/code&#62; will do all the serialisation for you.&#60;/p&#62;
&#60;p&#62;The good news is that I really didn't need to touch much of your options code to get all that working, with serialised options - I just adjusted the place where &#60;code&#62;register_setting&#60;/code&#62; was called, and tweaked a couple of other things. Most of my patch is concerned with tidying up the handling of default options, and stripping out the old database-handling of the old-format options.&#60;/p&#62;
&#60;p&#62;I think we can get serialised arrays to work. If we can, would you prefer to stick with those? They all get turned into arrays at processing-time anyway. They'd just get turned into &#60;code&#62;\n&#60;/code&#62;-delimited strings for processing in the &#60;code&#62;textarea&#60;/code&#62; on the options screen.&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Andrew
&#60;/p&#62;</description>
			</item>
					<item>
				<title>robfelty on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2932</link>
				<pubDate>Sun, 14 Mar 2010 10:57:32 +0000</pubDate>
				<dc:creator>robfelty</dc:creator>
				<guid isPermaLink="false">2932@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Andrew,&#60;/p&#62;
&#60;p&#62;I was switching these to strings because I could not get nested serialized arrays to work. I haven't gotten a chance to look at your patch yet. I was moving towards storing all postie settings in one serialized array, so that there would only be one database lookup necessary. Is that the way register_settings works too?
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2931</link>
				<pubDate>Sun, 14 Mar 2010 01:17:22 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2931@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;&#60;a href='http://wordpress.pastebin.ca/1838810'&#62;patch updated&#60;/a&#62; here.&#60;/p&#62;
&#60;p&#62;About the options that were previously stored as arrays (e.g. smtp or sig_patterns_list), is it better to store those as arrays, or as strings with array elements joined with a \n separator?  From the code, it looks like you're switching to the latter - have I got that right?&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Andrew
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2926</link>
				<pubDate>Fri, 12 Mar 2010 15:14:01 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2926@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;&#60;em&#62;register_setting&#60;/em&#62; allows you to use the WP backend to do these useful tasks:&#60;br /&#62;
database updates, some validation and sanitisation, and handling the _nonce_ fields for security.&#60;/p&#62;
&#60;p&#62;EDIT2: Whereas I add &#60;code&#62;settings_fields(&#38;#39;postie-settings&#38;#39;)&#60;/code&#62; into the main options form, to generate the _nonce_fields for security. &#60;/p&#62;
&#60;p&#62;I did have some difficulty the first time I tried to get &#60;em&#62;register_setting&#60;/em&#62; to work, and had to try a few different combinations.&#60;/p&#62;
&#60;p&#62;The key is that (as you can see in my patch) you need to run the &#60;em&#62;register_setting&#60;/em&#62; call from a function that is hooked into &#60;em&#62;admin_init&#60;/em&#62;. So, in the main body of &#60;em&#62;postie.php&#60;/em&#62; I add:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if (is_admin()) {
  add_action(&#38;#39;admin_init&#38;#39;,&#38;#39;postie_admin_settings&#38;#39;);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and in &#60;em&#62;postie-functions.php&#60;/em&#62;, I add:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function postie_admin_settings() {
  register_setting(&#38;#39;postie-settings&#38;#39;,&#38;#39;postie-settings&#38;#39;,&#38;#39;postie_validate_settings&#38;#39;);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;where the last argument is a validation function.&#60;br /&#62;
Then all of the handling of &#60;em&#62;$_POST&#60;/em&#62; variables can be removed from the options form, and options can be submitted/retrieved just using &#60;em&#62;get_option('postie-settings')&#60;/em&#62; and &#60;em&#62;update_option('postie_settings,$options);&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;NB that in all three cases, &#60;em&#62;register_setting, get_option&#60;/em&#62; and &#60;em&#62;update_option&#60;/em&#62;, it's singular not plural (e.g. 'option' not 'option&#60;strong&#62;s&#60;/strong&#62;') - that catches me out every time!&#60;/p&#62;
&#60;p&#62;But in the case of &#60;code&#62;settings_fields&#60;/code&#62;, it's plural &#34;settings&#34; (and &#34;fields&#34;), not singular &#34;setting&#34;!&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Andrew
&#60;/p&#62;</description>
			</item>
					<item>
				<title>robfelty on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2925</link>
				<pubDate>Fri, 12 Mar 2010 13:01:20 +0000</pubDate>
				<dc:creator>robfelty</dc:creator>
				<guid isPermaLink="false">2925@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Andrew,&#60;/p&#62;
&#60;p&#62;Thanks for the changes. I will look at them soon. I have been working on updating the settings mechanisms. I couldn't get &#60;code&#62;register_settings()&#60;/code&#62; to work, but I am using &#60;code&#62;settings_fields&#60;/code&#62;. What is the difference really?&#60;/p&#62;
&#60;p&#62;Rob
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2922</link>
				<pubDate>Thu, 11 Mar 2010 04:32:35 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2922@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;I've taken a pass at rationalising the options handling, and getting it all working with register_settings and the like, leaving all the database updating to wordpress.&#60;/p&#62;
&#60;p&#62;&#60;a href='http://wordpress.pastebin.ca/1833538'&#62;Here's my diff file&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It touches quite a lot of code - sorry about that. But it does knock the options handling into shape. It strips out all the old database-options handling, apart from the bit that's run at plugin activation, that imports settings from the old database-options. All that's now in the activation call within postie.php.&#60;/p&#62;
&#60;p&#62;I hope this is useful. Feedback very welcome. I don't have legacy postie configs to test it against, but will happily fix any bugs arising from my changes.
&#60;/p&#62;</description>
			</item>
					<item>
				<title>andrew_s1 on "introduction - I am working on linking mailman with buddypress forums"</title>
				<link>http://forum.robfelty.com/topic/introduction-i-am-working-on-linking-mailman-with-buddypress-forums#post-2919</link>
				<pubDate>Wed, 10 Mar 2010 06:45:53 +0000</pubDate>
				<dc:creator>andrew_s1</dc:creator>
				<guid isPermaLink="false">2919@http://forum.robfelty.com/</guid>
				<description>&#60;p&#62;Thank you Rob - good work on taking postie forward.&#60;/p&#62;
&#60;p&#62;I'm working on a plugin to link mailman to buddypress.&#60;br /&#62;
&#60;a href='http://andrewsinlondon.wordpress.com/'&#62;I've written some thoughts on the process&#60;/a&#62;.&#60;br /&#62;
I think Postie will do the email-&#38;gt; wordpress job I need, with minor mods. It's a very impressive plugin.&#60;/p&#62;
&#60;p&#62;I'm wrestling with the HEAD revision of postie in the SVN now - it wasn't possible to change settings on a clean install, so I've done some patching to fix that. [edit - just tried another clean install, and it worked fine, as long as I commented out postie-functions.php line 5 - Suhosin does not like that ini_set]&#60;/p&#62;
&#60;p&#62;Anyway, just wanted to check in, let you know what I'm working on.
&#60;/p&#62;</description>
			</item>
		
	</channel>

</rss>
