Group Listserve v0.7

Release Notes

This plugin adds to the default group discussion email notifications to simulate a listserve, allowing users to create and comment on topics via email.

    * Send new topics and comments to existing topics in a group via email
    * Group members are kept up to date via email notification

Required Settings:
    * A user needs to join the group (that they want to receive Listserve type notifications from) and then set the checkbox labelled "ListServ" to ON for the group in the menu Settings>Group notifications screen
    * Personal notifications of users own content should be set to ON for both the Email checkbox (to enable the receipt of join requests) and the "ListServe" checkbox (to enable the receipt of Listserve content)
    * Any topic created IN ELGG needs to be OPEN and PUBLIC (Email created topics are set to this automatically) for them to receive Listserve notification functionality (there is no condition set on the groups in which the topic is posted).

Wish List
    * User notifications - alerting users to the status of their mail out
    * Clean messages, at the moment HTML messages are not being stripped, this will be resolved in the next release.
    * Settings page for admin to set mail credentials

  • I'm not sure I've not tested the plugin you link to. This plug allows topic comments to be emailed to group members with the topic name as the subject and the group name as the email. As long a the mail server is set up to all unknown emails to pass the cron will pickup replies to that email address and add them as topic comments. Users can create new topics from email mailing groups based on email addresses with new subject lines.



  • ok, I see the difference

  • Hello Dan,

    This plugin is just what our book club is looking for, to replace but duplicate the functionality of YahooGroups.  Couple of questions

    1. The titles of the emails are "New discussion post" which almost screams spam.  In which file can we change that automatically generated email title?

    2. What's this about a cron job?  Do we need to do anything more than enable the cron job plugin??  If so, detailed instructions would be very welcome.

    Again, thanks for this great plugin. We look forward to hearing the fix!


  • There is a readme in the package which you should open with any text file reader, notepad, preview, etc. In it there are detailed instructions on how to get the plugin working. It sounds like you have not set up the plugin correctly. Apologies, the plugin is in its infancy and is a little rough round the edges.

  • Hi Dan,

    Fantastic plugin idea... just what I need, but I have a problem, the messages that get sent out come from "the post name" which is my hosting companies server, and I can not see a way of changing this as I do not understand why it is happening... I have a normal email address in the main settings in the Admin area, should I look somewherere else?  Your help would be much appreciated...

  • Have you checked the readme for instructions?

    The plugin has not been tested with any other email hosts than our own, which we have full control over. Is the domain that elgg is installed upon the same domain as your email address?

    The plugin will send out from the domain it is installed on, if this a virtual shared server there may be issues.

    Dan M

  • Hi Dan, Yes, I am on a virtual shared server :(  is there a fix do you think?

  • There probably is but there is no more development on this plugin scheduled in the near future! Please feel free to give it a go!

    Else a dedicated space is needed. Bug noted.

  • Hi Dan, My hosting service say  "The address is the server hostname, unless a "from" email address is specified in the email headers, the email will be sent from your account using the server's hostname rather than your chosen email address. I recommend you check the settings in your script to see where you can modify the from email address on any email messages sent out.

    Where can I insert an address for the to override the one?

  • Thanks Dhrup, that might help me if I was less of a numpty with php etc... could you expand a little please... I take it you refer to this section in the mail.php file in Listserve plugin file?

    * Gets the email address for a POP3 Header
    * @params String $header    POP3 Header
    * @return bool
    function get_email_from_header($header) {
        if(array_key_exists('From',$header)) {
            if(preg_match("/^<(.*@.*)>$/",$header['From'],$matches)) {
                return $matches[1];
            } elseif(preg_match("/(.*)<(.*@.*)>$/",$header['From'],$matches)) {
                return $matches[2];
            } elseif(preg_match("/^(.*@.*)$/",$header['From'],$matches)) {
                print "Without less and greater than";
                return $matches[1];
        } else {
            return false;

    Alas, this is all too baffling for me and I can not understand what to do exactly :(

  • that wrong file;)
    need this code
    mail( ... , "-f..." );

  • Dhrup... many thanks, really helpful.... NOT!

  • lolz..;-)  stop being so "numpty" just locate the php call to mali (.. etc, etc...)  and add the skeleton code above with yoor own sender's id. you need t dnd this code -- mail($to, $subject, $message, $headers, $flags ); or something similar.

    toldya u r lookinig at wrong code -- read this within the PlugIn -->

        $headers = "From: $from_email{$header_eol}"
            . "Content-Type: text/plain; charset=UTF-8; format=flowed{$header_eol}"
              . "MIME-Version: 1.0{$header_eol}"
              . "Content-Transfer-Encoding: 8bit{$header_eol}";

          if (is_callable('mb_encode_mimeheader')) {
            $subject = mb_encode_mimeheader("Re: [{$SUBJECT_TITLE}]","UTF-8", "B");

        // Format message
          $message = strip_tags($message); // Strip tags from message
          $message = preg_replace("/(\r\n|\r)/", "\n", $message); // Convert to unix line endings in body
          $message = preg_replace("/^From/", ">From", $message); // Change lines starting with From to >From

        return mail($to->email, $subject, wordwrap($message), $headers);

  • Somehow, I missed the answer to this >> 1. The titles of the emails are "New discussion post" which almost screams spam.  In which file can we change that automatically generated email title?

    The plugin is otherwise working fine.

  • And sorry for the delay in follow up.  I was sick with the flu and offline.

  • @tlcoles, sorry for the delay in the response, from what I remember, the email subject was generated automatically by ELGG & we had issues with customising this our selves.

    Unfortunately I don't have the time to sort out a work around at the moment as I'm busy with a new job but I'd suggest modifying the start.php file, adding the below line within the if statement just before line 95, hopefully this will help.

    <code>if ('New discussion post' == $SUBJECT_TITLE) $SUBJECT_TITLE = 'Title of your choice'</code>

    I hope this helps, hopefully I'll have some free time & will be able to have a proper look at this in the next few weeks.

  • @Dan or anyone,

    I insatlled the Plugin in /mod, however, I got the following error message after installation:

    Fatal error: require_once() [" >function.require]: Failed opening required 'Net/Socket.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/o/p/o/ware/html/platform/mod/listserve/lib/Net/POP3.php on line 38

    When I looked for Net/Socket.php file on the server, the file was there. Please help.


  • Very useful! I will test it later. Thanks!

  • Fatal error: require_once() [" >function.require]: Failed opening required 'Net/Socket.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/o/p/o/ware/html/platform/mod/listserve/lib/Net/POP3.php on line 38   (Solved)


    For those who might receive the above error message when using Elgg 1.6.1, when trying to activate this plugin,  I resolved the problem, by going first removing the plugin folder from the server, then I went into mod/listserve/lib/Net/POP3.php on line 38, on my local computer; there you will find require_once('Net/Socket.php'); on that line. I removed the Net/ from the bracket and uploaded the plugin to the server. Voila, the error message disappeared, and the plugin was activated and functioning.

  • Hi Vantel, I did not get that error I use 1.6.1... it all worked smoothly, but I still can not get the from address to match my domain (it goes from my server address)... perhaps removing that "Net" bit will help me? I guess I'll try it... thanks.

  • Hi Dan, hi all,

    Firstly, thanks a lot for posting this module.  I am sure it must have taken a lot of effort.  I don't know if anyone is using it yet but I thought that I would share some experiences.  Unlike probably a chunk of this community I am being paid to write code for an Elgg-based system so (with Dan's blessing) maybe I can help get some more tweaks/fixes done to this module (providing it fits in with what we are doing in our project).

    Anyway, I have only been working this this module for half a day so my understanding is still rudamentary (and I am new to Elgg), so please correct me if I am wrong, but here are some things I found along the way

    1)  topic.php (function add_topic) seems to have a bug in it.  The message (the body of the email) never gets added to the group post.  The consequence of this is that new topics have a subject, but no body.  The fix to this is to add this code at line 47 (or around there)

    $grouptopic->description = $message;

    2) This module seems to support plain text emails just fine, but does not seem to like multi-part (i don't know about html only, maybe they are fine too).  multi-part emails end up as posts that have a lot of spurious header-type information in them.  we have a community of Outlook users so i am going to have to try to figure out how to address that.

    3) I don't have a clear idea of the usage pattern of this module yet.  If i email into the system and it creates a new topic, another user should get sent an email with the message in. if they reply to that email then it should posted as a comment.  i don't know if this is how it works for everyone else, we are working off a customized version of Elgg, but it does not seem to for us.  the notification email sent by the system would need to have the group name in the email address.  ours does not currently, but maybe that is our problem! :-)

    4)  This could be my lack of understand of PHP config, but I had to tweak the code to get this module working.  In mail.php the call to handle_messages (line 167) threw an exception because $tags was not set.  I was not sure how the tags there related to the tags potentially stored in the $message_info.  I was not too worried about tagging today, so I just set a $tags variable to blank and it allows me to proceed.  The same is true if the call to add_topic (where $message_info['tags'] is not a valid array entry)

    5)  The module might be improved somewhat by some handling of outlier cases.  At the moment if the email cannot be processed it gets deleted anyway.  This might be necessary with a pop3 mailbox, but it might be hard to troubleshoot issues in a production system like this.

    6)  I had to debug the code to find out what format the subject line had to be in.  As far as I can make out the subject line needs to end in [my topic name goes here] (including the brackets).  I imagine the brackets are to delimit the text so that "RE:" (or whatever) does not get in the way.  

    Thanks again,


  • hi there,

    has anyone managed to get this module working successfully yet?  it seems like the fact that the framework does not pass through the actual comment being posted there are some workarounds with globals that (for me at least) are causing some issues.  one thing i am interested in - if a comment is added by the non-group/topic owner do correct emails get sent out?




Founder and techinical creative at Believe Collective


  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 3
  • Updated: 2014-11-17
  • Downloads: 1105
  • Recommendations: 0