Permalink
Browse files

Added an option to allow any email address to post.

  • Loading branch information...
1 parent 64a29f0 commit 90596f5b1437930e7dcfbc292c96dcf6b7d454da @danwolfgang danwolfgang committed Jun 11, 2011
Showing with 22 additions and 0 deletions.
  1. +5 −0 README.md
  2. +2 −0 plugins/PostOffice/config.yaml
  3. +7 −0 plugins/PostOffice/lib/PostOffice.pm
  4. +8 −0 plugins/PostOffice/lib/PostOffice/CMS.pm
View
@@ -99,6 +99,11 @@ users send new entries to.
* Email Addresses Allowed to Post: Movable Type will post messages received
from these email addresses. Separate multiple addresses with a comma.
+* Allow Any Email: This option will simply publish any email received in the
+ destination inbox. Users are not authenticated in any way, making posting
+ completely anonymous. The Default Author is assigned entry ownership in this
+ case.
+
* Default Author: This is the "default" author, the person to whom entries are
assigned if no other valid author exists. Email addresses specified in the
above field will be attributed to this author if they are not valid Authors.
@@ -38,6 +38,8 @@ settings:
Default: 1
allowed_emails:
Default: email@yourdomain.com
+ allow_any_email:
+ Default: 0
post_assets:
Default: 0
post_status:
@@ -495,6 +495,13 @@ sub process_messages {
next;
}
my $from = lc $addr->address;
+
+ # If any email address is allowed to post then just set the current
+ # $from to be a key in the $addresses hash.
+ if ($cfg->{allow_any_email}) {
+ $addresses->{$from} = 1;
+ }
+
unless ($addresses->{$from}) {
print STDERR "[PostOffice] Unknown author address for message "
. $msg->{'message-id'}
@@ -209,6 +209,14 @@ sub config_template {
</mtapp:setting>
<mtapp:setting
+ id="allow_any_email"
+ label="<__trans phrase="Allow Any Email Address to Post">"
+ show_hint="1"
+ hint="<__trans phrase="Checking this box will allow anybody to post to this blog. Note that this basically allows for unauthenticated, anonymous posting.">">
+ <input type="checkbox" name="allow_any_email" <mt:if name="allow_any_email">checked="checked"</mt:if> id="allow_any_email" class="cb" value="1" />
+</mtapp:setting>
+
+<mtapp:setting
id="default_author"
label="<__trans phrase="Default Author">"
show_hint="1"

0 comments on commit 90596f5

Please sign in to comment.