diff -ruN spamspan/spamspan.js spamspan_new/spamspan.js
--- spamspan/spamspan.js	2009-10-03 19:23:01.000000000 +0100
+++ spamspan_new/spamspan.js	2010-05-14 22:13:03.000000000 +0100
@@ -19,11 +19,19 @@
 // get each span with class spamSpanMainClass
        $("span." + Drupal.settings.spamspan.m, context).each(function (index) {
 // for each such span, set mail to the relevant value, removing spaces
-	    var _mail = ($("span." + Drupal.settings.spamspan.u, this).text() +
-	    	"@" +
-	    	$("span." + Drupal.settings.spamspan.d, this).text())
-	    	.replace(/\s+/g, '')
-	    	.replace(/\[dot\]/g, '.');
+	    var _users   = $("span." + Drupal.settings.spamspan.u, this);
+	    var _domains = $("span." + Drupal.settings.spamspan.d, this);
+	    var _mail = "";
+	    _users.each(function (i) {
+	        if (i <= _domains.length) {
+	            if (i > 0) { _mail += ","; }
+	            _mail += _users.filter(":eq("+i+")").text() +
+	                     "@" +
+	                     _domains.filter(":eq("+i+")").text();
+	        }
+	    });
+	    _mail = _mail.replace(/\s+/g, '')
+	                 .replace(/\[dot\]/g, '.');
 // Find the header text, and remove the round brackets from the start and end
 	    var _headerText = $("span." +  Drupal.settings.spamspan.h, this).text().replace(/^ ?\((.*)\) ?$/, "$1");
 	    // split into individual headers, and return as an array of header=value pairs
diff -ruN spamspan/spamspan.module spamspan_new/spamspan.module
--- spamspan/spamspan.module	2009-10-10 22:34:04.000000000 +0100
+++ spamspan_new/spamspan.module	2010-05-16 22:37:01.000000000 +0100
@@ -126,7 +126,7 @@
  */
 function spamspan_init() {
   // Add the javascript to each page
-  drupal_add_js(drupal_get_path("module", "spamspan") .'/spamspan.compressed.js');
+  drupal_add_js(drupal_get_path("module", "spamspan") .'/spamspan.js');
   // pass necessary variables to the javascript
   drupal_add_js(array(
     'spamspan' => array(
@@ -151,6 +151,16 @@
  *  The span with which to replace the email address
  */
 function _spamspan_callback_mailto($matches) {
+  // $matches[1]: unused: ' or "
+  // $matches[2]: the full mailto: link
+  // $matches[3]: first e-mail address username
+  // $matches[4]: first e-mail address domain name
+  // $matches[5]: optional further full e-mail addresses, separated by commas and possibly spaces
+  // $matches[6]: unused: last full e-mail address if >1 e-mail address
+  // $matches[7]: unused: last e-mail address username if >1 e-mail address
+  // $matches[8]: unused: last e-mail address domain name if >1 e-mail address
+  // $matches[9]: text between <a>...</a> tags
+
   // take the mailto: URL in $matches[2] and split the query string
   // into its component parts, putting them in $headers as
   // [0]=>"header=contents" etc.  We cannot use parse_str because
@@ -158,11 +168,31 @@
   $headers = preg_split('/[&;]/', parse_url($matches[2], PHP_URL_QUERY));
   // if no matches, $headers[0] will be set to '' so $headers must be reset
   if ($headers[0] == '') $headers=array();
-  return _spamspan_output($matches[3], $matches[4], $matches[5], $headers);
+
+  // Create arrays of e-mail usernames and domain names. The first address is
+  // easy: it's in $matches[3] and [4]. The rest we must split up manually from
+  // $matches[5].
+  $usernames = array($matches[3]);
+  $domains = array($matches[4]);
+  if ($matches[5] != '') {
+    $other_addresses = preg_split("/[,\s]*,[,\s]*/", $matches[5]);
+    foreach ($other_addresses as $address) {
+      if ($address != '') {
+        $parts = explode("@", $address);
+        $domains[] = array_pop($parts);
+        $usernames[] = implode("@", $parts);
+      }
+    }
+  }
+
+  // generate HTML
+  return _spamspan_output($usernames, $domains, $matches[9], $headers);
 }
 
 function _spamspan_callback_email($matches) {
-  return _spamspan_output($matches[1], $matches[2], '', '');
+  // $matches[1]: e-mail address username
+  // $matches[2]: e-mail address domain name
+  return _spamspan_output(array($matches[1]), array($matches[2]), '', '');
 }
 
 /**
@@ -171,10 +201,10 @@
  * Replace an email addresses which has been found with the appropriate
  * <span> tags
  *
- * @param $name
- *  The user name
- * @param $domain
- *  The email domain
+ * @param $names
+ *  An array of user name parts of email addresses
+ * @param $domains
+ *  An array of domain parts of email addresses
  * @param $contents
  *  The contents of any <a> tag
  * @param $headers
@@ -182,11 +212,8 @@
  * @return
  *  The span with which to replace the email address
  */
-function _spamspan_output($name, $domain, $contents, $headers) {
+function _spamspan_output($names, $domains, $contents, $headers) {
 
-  // Replace .'s in the address with [dot]
-  $user_name = str_replace(".", " [dot] ", $name);
-  $domain = str_replace(".", " [dot] ", $domain);
   if (variable_get('spamspan_use_graphic', 0)) {
     $image = base_path() . drupal_get_path("module", "spamspan") ."/image.gif";
     $at = '<img alt="at" width="10" src="'. $image .'" />';
@@ -194,10 +221,25 @@
   else {
     $at = variable_get('spamspan_at', ' [at] ');
   }
-  $output = '<span class="spamspan"><span class="'.
-    variable_get('spamspan_userclass', 'u') ."\">$user_name</span>".
-    $at ."<span class=\"".
-    variable_get('spamspan_domainclass', 'd') ."\">$domain</span>";
+  $output = '<span class="spamspan">';
+
+// Add all e-mail addresses
+  foreach ($names as $index=>$name) {
+    if ($index < count($domains)) {
+      // Add a comma separator if appropriate
+      if ($index > 0) { $output .= ","; }
+      // Get the domain to go with this username
+      $domain = $domains[$index];
+      // Replace .'s in the address with [dot]
+      $user_name = str_replace(".", " [dot] ", $name);
+      $domain = str_replace(".", " [dot] ", $domain);
+      // Add the address to the output
+      $output .= '<span class="'.
+        variable_get('spamspan_userclass', 'u') ."\">$user_name</span>".
+        $at ."<span class=\"".
+        variable_get('spamspan_domainclass', 'd') ."\">$domain</span>";
+    }
+  }
 
 // if there are headers, include them as eg (subject: xxx, cc: zzz)
     if (isset ($headers) and $headers) {
@@ -256,8 +298,10 @@
   $mailtopattern = "!<a\s+                            # opening <a and spaces
       (?:(?:\w+\s*=\s*)(?:\w+|\"[^\"]*\"|'[^']*'))*?  # any attributes
       \s*                                             # whitespace
-      href\s*=\s*(['\"])(mailto:"                     # the href attribute
-      . SPAMSPAN_EMAIL .                              # The email address
+      href\s*=\s*(['\"])(mailto:" .                   # the href attribute
+      SPAMSPAN_EMAIL .                                # The first email address
+      "(([,\s]*,[,\s]*" . SPAMSPAN_EMAIL . ")*?)" .   # Optional further comma-
+                                                      # separated addresses
       "(?:\?.*)?)" .                                  # an optional ? followed
                                                       # by a query string
       "\\1                                            # the relevant quote
@@ -276,4 +320,4 @@
   $string = preg_replace_callback($mailtopattern, '_spamspan_callback_mailto', $string);
   // and finally, all bare email addresses
   return preg_replace_callback($emailpattern, '_spamspan_callback_email', $string);
-}
\ No newline at end of file
+}
