Anonymous email posting via Mailhandler
albertc - March 30, 2007 - 10:18
| Project: | Mailhandler |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
As far as I know, the Mailhandler module does only accept mail postings from addresses that have been previously registered in the Drupal site.
However, I'd like to accept anonymous submissions, too. Is this possible and how can it be set up? Ideally, messages received from unregistered senders should remain 'unpublished' until they are reviewed by the site admin.
Thanks in advance for any assistance
--
Albert

#1
see http://drupal.org/node/226786
#2
That link is partially useful, but I instead was expecting to be able to set up anon/unknown mails to be owned by a default/proxy/daemon user account.
I don't want many new registrations, I want my current email aliases, and those of my groupmates to just be accepted into a grab-bag account ownership.
I tried over-riding the node owner via my commands ... but that's a bit of a problem.
#3
Well, I didn't wanna, but I went ahead and hacked out what I need to get what appears to be working here ...
in mailhandler_authenticat, I added
<?php} else {
$node->uid = 0;
$node->name = 'anonymous';
$node->title = $node->title . ' (from ' . $fromaddress . ')'; // use the name supplied in email headers
}
if (!$from_user) {
// failed authentication. we will still try to submit anonymously.
$node->uid = 0;
$node->name = $fromname; // use the name supplied in email headers
}
*/
<
?>
and commented out
<?php/*
if (!$from_user) {
// failed authentication. we will still try to submit anonymously.
$node->uid = 0;
$node->name = $fromname; // use the name supplied in email headers
}
*/
</
?>
and
<?php//mailhandler_switch_user($node->uid);
</
?>
... and it appears to be working now ... I didn't invest much time here, but it seems to have gotten me what I was looking to do.
#4
There is a hook_mailhandler where you can make changes like this before the node/comment is saved. I don't intend native support for this "proxy" user feature
#5
Sweet ... I'll have to explore that a little further. Thanks for the heads up!
#6
Ah, that is so much better. Really nice to get in there without hacking. Thanks for creating the hook!
Also, while I was in there, I realizedthat I just had to give the anonymous user access to create the node type (duh!) I wanted in order to have the external email cascade into Drupal as an anonymous user ... not exactly what I wanted, but definately workable.
#7
Automatically closed -- issue fixed for two weeks with no activity.