--- /dev/null
+<?php
+
+/**
+ * SquirrelMail List Commands Plugin
+ * Configuration File (config_sample.php, to use, please copy to config.php)
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage listcommands
+ */
+
+
+// Set this to 1 if users should be allowed to add a list of
+// mailing list addresses that don't follow RFC 2369, but when
+// replying to should also show "reply to list" and "post to list"
+// links... set to 0 (zero) otherwise.
+//
+$listcommands_allow_non_rfc_list_management = 0;
+
+
if (!in_array('post', array_keys($links))) {
foreach ($non_rfc_lists as $non_rfc_list) {
- if (preg_match('/(^|,|\s)' . preg_quote($non_rfc_list) . '($|,|\s)/', $recipients)) {
+ if (preg_match('/(^|,|<|\s)' . preg_quote($non_rfc_list) . '($|,|>|\s)/', $recipients)) {
$url = 'src/compose.php?'
. (isset($startMessage)?'startMessage='.$startMessage.'&':'')
. 'send_to=' . str_replace('?','&', $non_rfc_list);
--- /dev/null
+<?php
+
+/**
+ * SquirrelMail List Commands Plugin
+ * options.php
+ *
+ * Shows options page for managing non-RFC-compliant list subscriptions.
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage listcommands
+ */
+
+
+include_once('../../include/init.php');
+include_once(SM_PATH . 'plugins/listcommands/functions.php');
+
+global $listcommands_allow_non_rfc_list_management, $data_dir, $username;
+
+// only allow management of non-RFC lists if admin deems necessary
+//
+@include_once(SM_PATH . 'plugins/listcommands/config.php');
+if (!$listcommands_allow_non_rfc_list_management)
+ return;
+
+
+$lists = get_non_rfc_lists();
+
+
+
+// remove list?
+//
+if (sqGetGlobalVar('deletelist', $deletelist, SQ_FORM)
+ && is_array($deletelist) && !empty($deletelist)) {
+
+ // interface currently does not support multiple deletions at once
+ // but we'll support it here anyway -- the index values of this
+ // array are the only thing we care about and need to be the
+ // index number of the list to be deleted
+ //
+ foreach (array_keys($deletelist) as $index)
+ unset($lists[$index]);
+
+ sort($lists);
+ $temp_lists = array();
+ foreach ($lists as $index => $list_addr)
+ $temp_lists[] = $index . '_' . $list_addr;
+ setPref($data_dir, $username, 'non_rfc_lists', implode(':', $temp_lists));
+
+}
+
+
+
+// add list?
+//
+if (sqGetGlobalVar('addlist', $ignore, SQ_FORM)
+ && sqGetGlobalVar('newlist', $newlist, SQ_FORM)) {
+
+ $lists[] = $newlist;
+
+ sort($lists);
+ $temp_lists = array();
+ foreach ($lists as $index => $list_addr)
+ $temp_lists[] = $index . '_' . $list_addr;
+ setPref($data_dir, $username, 'non_rfc_lists', implode(':', $temp_lists));
+
+}
+
+
+
+displayPageHeader($color, 'None');
+
+$oTemplate->assign('lists', $lists);
+$oTemplate->display('plugins/listcommands/non_rfc_lists.tpl');
+
+
extract($t);
-?><html><body><form method="post" action="">
-<table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
+?><form method="post" action="">
+<div id="optionGroups">
+<table cellspacing="0">
<tr>
- <td colspan="3" align="center" bgcolor="<?php echo $color[0] ?>">
- <b><?php echo _("Options") . " - " . _("Mailing Lists"); ?></b>
+ <td class="header1" colspan="2">
+ <?php echo _("Options") . " - " . _("Mailing Lists"); ?>
</td>
</tr>
<tr>
- <td colspan="3"> </td>
+ <td colspan="2">Manage the (non-RFC-compliant) mailing lists that you are subscribed to for the purpose of providing one-click list replies when responding to list messages. You only need to enter any lists you are subscribed to that do not already comply with RFC 2369.<br /><br />When entering a new list, input the full email address for the address from which list postings are delivered.<br /><br /></td>
</tr>
<tr>
- <td colspan="3">Manage the (non-RFC-compliant) mailing lists that you are subscribed to for the purpose of providing one-click list replies when responding to list messages. You only need to enter any lists you are subscribed to that do not already comply with RFC 2369.<br /><br />When entering a new list, input the full email address for the main list.</td>
- </tr>
- <tr>
- <td colspan="3"> </td>
- </tr>
-</table>
-<table width="80%" align="center" border="0" cellpadding="2" cellspacing="0">
- <tr>
- <td>
+ <td align="right">
<?php echo _("Enter new mailing list"); ?>:
</td>
- <td align="right">
+ <td align="left">
<input type="text" name="newlist" size="30" />
- </td>
- <td>
<input type="submit" name="addlist" value="<? echo _("Add"); ?>" size="30" />
</td>
</tr>
<tr>
- <td colspan="3"> </td>
+ <td colspan="2"> </td>
</tr>
<tr>
- <td valign="top"><? echo _("Existing mailing lists"); ?>:</td>
- <td align="center" colspan="2">
- <table cellpadding="2">
+ <td align="right" valign="top"><? echo _("Existing mailing lists"); ?>:</td>
+ <td align="center">
+ <table border="0" cellpadding="0" cellspacing="0">
<?php
foreach($lists as $index => $list) {
echo '<tr><td>' . $list . '</td><td><input type="submit" name="deletelist[' . $index . ']" value="' . _("Delete") . '" /></td></tr>';
</td>
</tr>
</table>
+</div>
</form>
</body>
</html>