Forum OpenACS Q&A: Group based mailing list

Collapse
Posted by Malte Sussdorff on
I always wondered if we could not do some magic with the fact that groups are parties. While working on acs-mail-lite tonight I tried to wave the magic wand and voila, here it is:

Give your group an e-mail address (yes, you can do this, they are parties) which is accessible by OpenACS. I did this e.g. by giving out the e-mail address test at www.cognovis.de to the group "test". Furthermore I configured postgres in a way that all email to www.cognovis.de is going to OpenACS service0 user.

Thats it, now every email send to the groups email address is parsed by acs_mail_lite::load_emails, which finds the group_id, gets the list of members and sends out a *single* email to all members (so everyone sees everyone else in the "to" field. I figured if they are all in one group there should not be a big security risk).

This is in HEAD as of now.

Collapse
Posted by Malte Sussdorff on
It also shows up in the mail-tracking, so you can figure out if some has been abusing this. If you want to you could also change the code and require the from_addr to be a member of the group to be perfectly save.

I will probably be using this with our e-mail savy clients who want to send an e-mail to all members of their subsite / community without using bulk-mail or what other things OpenACS offers.

If this becomes of general interest, I could make sure that every group gets and e-mail address with "mailto:groupname@hostname.com"; and probably include it on the .LRN community members page.

Collapse
Posted by Caroline Meeks on
Hi Malte,

Can anyone send email to the group's address and have it delivered or does it check that someone is a group member and/or administrator?

Collapse
Posted by Malte Sussdorff on
As of now the code does not check this. But it is a more or less quick hack for the proof of concept. What you do want to do is get the code out from there and write a callback for incoming_email. Just make sure that the email given for a group does not start with a prefix used by any other installed package.

Or maybe I should just write an additional callback for the incoming email like "incoming_email_matched_party" which could then be used for this.

It would allow each of the package do do what it likes. E.g. dotlrn could define that only administrators can write to the .LRN group while acs_subsite checks if the user is a member of the group (and it is not a .LRN group). And my custom application would deal with it differently.

Which brings me to the question: Can an implementation of a callback stop the further execution of other implementations? E.g. if my callback implementation "aa_malte" has successfully dealt with the e-mail I do not want any other callback implementations to be executed.

Collapse
Posted by Caroline Meeks on
Thanks Malte,

If the incoming email has an attachment will it be sent out to all the group members?

What about making the emails searchable. If you can see the emails in mail tracking then I assume its pretty easy to make them searchable. What about attachements to the emails?

Thanks
Caroline

Collapse
6: E-Mail Forwarding (response to 1)
Posted by Malte Sussdorff on
acs-mail-lite now supports e-mail forwarding. Send an email to something like "malte#openacs.de \@ www.cognovis.de" and the system will forward the email to malte \@ openacs.de while tracking it in the mail tracking. Best of all, hitting the reply button will forward the reply again through the system so you are effectively tracking your whole communication with the user.

Drawback: The E-Mail might be easier classified as SPAM as the reply-to domain does not necessarily match your from_addr domain. On the other hand, the domain where the e-mail originates from is the same as the one in the reply-to.

Collapse
Posted by Malte Sussdorff on
Yikes. Got me :).

All these new and cool e-mail features do not support attachements as of now, or, more precise, I did not test it yet, but i would be surprised if it worked with attachements. If someone can take a look at the incoming e-mails and run them through mime::whatever to get the attachments, that would be awesome, as you could then add the file to the CR as well (parent_id = sender_id or group_id, depending on what you are doing) and have this file linked from teh mail tracking as well.

Searching those e-mails is a piece of cake with mail-tracking. I am sure some search wizards can quickly write an indexer for the acs_mail_log table and store this in mail-tracking (please!).

Collapse
Posted by Don Baccus on
So our TIP process for changing the behavior of core packages simply exists to be ignored?
Collapse
Posted by Caroline Meeks on
Hi Malte,

I'm imagining that the use case for this is you want people to be able to email all members of a group without logging into the site and you want a record of what was sent.

An alternative approach to solving the same use case might be to have an address for starting new threads on forums combined with auto-subscribing group members to the forum.

I think advantages to that approach might be:

1. Built in UI for seeing the messages
2. Threading if you want it, that is if someone replies to the notification its automatically shows up in the forum as a reply
3. Forums already checks that you are a member before posting the message so it helps control spam.
4. More individual control over notifications (batching, opting out etc.)

How do you see your approach or use case as different?

Thanks
Caroline

Collapse
Posted by Malte Sussdorff on
Since when is this change requiring a TIP? It is not changing existing behaviour but adding a new behaviour. Alternatively if it makes you feel more comfortable, I can just do this using callbacks. The question here is though, is adding a callback also considered changing behaviour, because it adds functionality that previously did not exist.
Collapse
Posted by Malte Sussdorff on
Your approachs tries to reach a different goal. My goal was: I have an existing group of users and want to mail to them a simple e-mail. See it more as a replacement for bulk-mail than for something like forums.

Obviously your approach would work, if (as you duely noted):

a) You have an interface that lets you create a forum for a group
b) Have an incoming callback that allows you to mark an e-mail address to go to a forum, therefore changing the notification-xxxx email address, as this is not something a user will easily remember

But it forces you to deal only with users. But a group can consist of parties, which is a CRM use case I have been constantly banging my head against. So, to do this, I would have to either make all parties users (which is difficult to do if the e-mail address belongs to an organization...) or rewrite forums to allow notifications being send out to parties instead. Okay, probably just change notifications to support parties. But this will make your point 3.) invalid.

Simple use case: I have a couple of persons on my site which are in the group "moviegoers". I write them occasionally about new movies I want to go to. Previously I did this by manually selecting them in Outlook (Entourage) and send the E-mail out. Now I can save myself the trouble and just mail to moviegoers at my site.

But, if you could get a) and b) working and prevent "I'm on holiday" messages, I would be more than interested to follow your approach and implement the b) part, as it does have merits for a community toolkit. My main objection to Forum incoming e-mails has been so far the not easily remembered e-mail address and the fact that it did not deal correctly with vacation messages going into infinite loops.

Collapse
Posted by Malte Sussdorff on
To make everyone happy I removed the code from acs-mail-lite and put it into a callback in contacts, if anyone is interested.
Collapse
13: Re: E-Mail Forwarding (response to 6)
Posted by Malte Sussdorff on
E-Mail forwarding as implemented in the callback in contacts now supports forwarding of attachments as well.

Additionally you can specify a subject like "#4123: Test" where 4123 is the object_id. This will be stripped out, but the forwarded message will be logged in mail-tracking for the specified object_id.