sent_confirmation/0040755000000000000000000000000010022457007013276 5ustar rootrootsent_confirmation/setup.php0100644000000000000000000000441710022456676015165 0ustar rootroot * This program is licensed under GPL. See COPYING for details * */ function squirrelmail_plugin_init_sent_confirmation() { global $squirrelmail_plugin_hooks; $squirrelmail_plugin_hooks['compose_send']['sent_confirmation'] = 'sent_conf_message_sent'; $squirrelmail_plugin_hooks['generic_header']['sent_confirmation'] = 'sent_conf_check_is_sent'; // This was causing PHP warnings when replying so don't use // it for now - it wasn't really necessary, just to be extra // extra safe anyway (turn off sent flag) // Update: it does provide an erroneous "message sent" notification // when SMTP errors occur, so instead, the sent_conf_status is reset // in the check_is_sent_do function whenever the sent_conf screen // isn't being shown - seems to work fine // $squirrelmail_plugin_hooks['compose_bottom']['sent_confirmation'] = 'sent_conf_compose_bottom'; $squirrelmail_plugin_hooks['options_display_inside']['sent_confirmation'] = 'sent_conf_show_options'; $squirrelmail_plugin_hooks['options_display_save']['sent_confirmation'] = 'sent_conf_save_options'; } // Version information // function sent_confirmation_version() { return '1.6'; } if (!defined('SM_PATH')) define('SM_PATH', '../'); // This is the text that appears on the option page // function sent_conf_show_options() { include_once(SM_PATH . 'plugins/sent_confirmation/options.php'); sent_conf_options(); } // Here we save the user's sent_confirmation preferences // function sent_conf_save_options() { include_once(SM_PATH . 'plugins/sent_confirmation/options.php'); sent_conf_options_save(); } // set flag indicating message was sent function sent_conf_message_sent() { include_once(SM_PATH . 'plugins/sent_confirmation/functions.php'); sent_conf_message_sent_do(); } // // function sent_conf_check_is_sent() { include_once(SM_PATH . 'plugins/sent_confirmation/functions.php'); sent_conf_check_is_sent_do(); } // // function sent_conf_compose_bottom() { include_once(SM_PATH . 'plugins/sent_confirmation/functions.php'); sent_conf_compose_bottom_do(); } ?> sent_confirmation/functions.php0100644000000000000000000013003010022456725016017 0ustar rootroot * This program is licensed under GPL. See COPYING for details * */ global $sent_confirmation_debug; $sent_confirmation_debug = 0; // include compatibility plugin // if (defined('SM_PATH')) include_once(SM_PATH . 'plugins/compatibility/functions.php'); else if (file_exists('../plugins/compatibility/functions.php')) include_once('../plugins/compatibility/functions.php'); else if (file_exists('./plugins/compatibility/functions.php')) include_once('./plugins/compatibility/functions.php'); // Very simple place to indicate that the message was sent // function sent_conf_message_sent_do() { // if saving as a draft, this plugin should be ignored // global $draft; if ($draft) return; // first, check if the restrict_senders plugin // is installed and if so, it needs to run first // global $plugins; if (in_array('restrict_senders', $plugins)) { global $restrict_senders_finished, $sent_confirmation_was_delayed; if (!$restrict_senders_finished) { $sent_confirmation_was_delayed = 1; return; } } global $sent_confirmation_debug, $sent_conf_message_sent_status, $sent_conf_include_recip_addr, $send_to, $send_to_cc, $send_to_bcc, $sent_conf_show_only_first_recip_addr, $sent_conf_enable, $sent_conf_allow_user_override, $data_dir, $username, $sent_conf_include_cc, $sent_conf_include_bcc, $sent_conf_message_style, $sent_conf_show_headers, $mailbox, $passed_id, $action, $sort, $sent_conf_orig_reply_msg, $username, $imapServerAddress, $key, $imapPort, $sent_conf_orig_subject, $sent_conf_orig_sender, $sent_conf_enable_orig_msg_options, $lastTargetMailbox, $sent_conf_mbox_list; compatibility_sqextractGlobalVar('lastTargetMailbox'); if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/sent_confirmation/config.php'); else include_once ('../plugins/sent_confirmation/config.php'); $sent_conf_enable = ($sent_conf_message_style == 'off' ? 0 : 1); // get all our config set up // if ($sent_conf_allow_user_override) { $sent_conf_enable = getPref($data_dir, $username, 'sent_conf_enable', $sent_conf_enable); $sent_conf_message_style = getPref($data_dir, $username, 'sent_conf_style', $sent_conf_message_style); $sent_conf_include_recip_addr = getPref($data_dir, $username, 'sent_conf_incl_recip', $sent_conf_include_recip_addr); $sent_conf_show_only_first_recip_addr = getPref($data_dir, $username, 'sent_conf_show_only_first_recip_addr', $sent_conf_show_only_first_recip_addr); $sent_conf_include_cc = getPref($data_dir, $username, 'sent_conf_include_cc', $sent_conf_include_cc); $sent_conf_include_bcc = getPref($data_dir, $username, 'sent_conf_include_bcc', $sent_conf_include_bcc); $sent_conf_show_headers = getPref($data_dir, $username, 'sent_conf_show_headers', $sent_conf_show_headers); $sent_conf_enable_orig_msg_options = getPref($data_dir, $username, 'sent_conf_enable_orig_msg_options', $sent_conf_enable_orig_msg_options); } // if not enabled, just quit // if (!$sent_conf_enable) return; // build information to be passed to display function below // $sent_conf_message_sent_status = 'sent'; if ($sent_conf_include_recip_addr) { if ($sent_conf_show_only_first_recip_addr) { preg_match('/\s*([\'"].*?[\'"]){0,1}(.*?)([,;]|$)/', trim($send_to), $matches); if (isset($matches[2])) { if (isset($matches[1])) $sent_conf_message_sent_status = $matches[1] . $matches[2] . ($sent_conf_message_style < 3 ? ', et al' : ''); else $sent_conf_message_sent_status = $matches[2] . ($sent_conf_message_style < 3 ? ', et al' : ''); } // failsafe // else $sent_conf_message_sent_status = $send_to; } else { if ($sent_conf_show_headers) //$sent_conf_message_sent_status = 'To: '; $sent_conf_message_sent_status = ''; else $sent_conf_message_sent_status = ''; $sent_conf_message_sent_status .= $send_to; $send_to_cc = trim($send_to_cc); $send_to_bcc = trim($send_to_bcc); if ($sent_conf_include_cc && !empty($send_to_cc)) { if ($sent_conf_show_headers) $sent_conf_message_sent_status .= ', Cc: ' . $send_to_cc; else $sent_conf_message_sent_status .= ', ' . $send_to_cc; } if ($sent_conf_include_bcc && !empty($send_to_bcc)) { if ($sent_conf_show_headers) $sent_conf_message_sent_status .= ', Bcc: ' . $send_to_bcc; else $sent_conf_message_sent_status .= ', ' . $send_to_bcc; } } } // get reply info for deletion, move, back-to options // $sent_conf_orig_reply_msg = ''; $sent_conf_orig_subject = ''; $sent_conf_orig_sender = ''; $sent_conf_mbox_list = ''; if ($sent_conf_message_style > 2 && $sent_conf_enable_orig_msg_options && (strpos($action, 'reply') !== FALSE || strpos($action, 'forward') !== FALSE)) { $sent_conf_orig_reply_msg = $mailbox . '|' . $passed_id . '|' . $sort; $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); $header = $message->rfc822_header; $sent_conf_orig_subject = decodeHeader($header->subject,false,true); $orig_from = (is_array($header->from)) ? $header->from[0] : $header->from; if (is_object($orig_from)) { $sent_conf_orig_sender = $orig_from->getAddress(); } else { $sent_conf_orig_sender = ''; } $sent_conf_mbox_list = sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox))); } compatibility_sqsession_register($sent_conf_orig_sender, 'sent_conf_orig_sender'); compatibility_sqsession_register($sent_conf_orig_subject, 'sent_conf_orig_subject'); compatibility_sqsession_register($sent_conf_orig_reply_msg, 'sent_conf_orig_reply_msg'); compatibility_sqsession_register($sent_conf_mbox_list, 'sent_conf_mbox_list'); compatibility_sqsession_register($sent_conf_message_sent_status, 'sent_conf_message_sent_status'); if ($sent_confirmation_debug == 1) { echo "just before sending
";
      print_r($_SESSION);
      echo "
"; exit; } } // Determine if there was a message just sent, if so, display message // function sent_conf_check_is_sent_do() { // get global variable for versions of PHP < 4.1 // if (!compatibility_check_php_version(4,1)) { global $HTTP_SERVER_VARS; $_SERVER = $HTTP_SERVER_VARS; } // strange, but on replies, the session doesn't seem // to be getting started before output is being sent // so we force it here // // if (stristr($_SERVER['SCRIPT_NAME'], 'compose.php')) // compatibility_sqsession_is_active(); // Nope, doesn't do the trick; seems that even though the // session is started, it throughs up errors... whatever! // this is called in the generic header, so we // only want to do this when we are on the right_main // page (unless "compose in new window" is on, in // which case we want to do it in the compose page, // or we are on the compose page and we have "mail_sent", // meaning that a draft was just resumed and sent) // global $compose_new_win, $mail_sent; if (($compose_new_win && !stristr($_SERVER['SCRIPT_NAME'], 'compose.php')) || (!$compose_new_win && !stristr($_SERVER['SCRIPT_NAME'], 'right_main.php') && !($mail_sent && stristr($_SERVER['SCRIPT_NAME'], 'compose.php')))) { /* // make sure sent flag is off // Note: this clears flag when most any page is loaded; whereas the only problem it is meant to solve is when SMTP errors occur upon sending, the next time this plugin runs, it displays the sent confirmation, even though the message DID NOT get sent due to the SMTP errors. This is an architectural compromise. It could be solved by adding a new hook just after the message was sent in the SM core, but for now, I'll assume that most SM installations actually have working SMTP or sendmail servers. sent_conf_compose_bottom_do(); */ return; } global $sent_conf_message_sent_status, $color, $sent_confirmation_debug, $sent_conf_message_style, $sent_conf_include_recip_addr, $sent_conf_allow_user_override, $data_dir, $username, $sent_conf_enable, $sent_conf_show_headers, $sent_conf_orig_reply_msg, $pp_noPageHeader, $sent_conf_orig_subject, $sent_conf_orig_sender, $pp_forceTopURL, $sent_conf_enable_orig_msg_options, $compose_new_win, $sent_conf_mbox_list, $blockedAddresses, $mailbox, $plugins; compatibility_sqextractGlobalVar('sent_conf_message_sent_status'); compatibility_sqextractGlobalVar('sent_conf_orig_reply_msg'); compatibility_sqextractGlobalVar('sent_conf_orig_subject'); compatibility_sqextractGlobalVar('sent_conf_orig_sender'); compatibility_sqextractGlobalVar('sent_conf_mbox_list'); compatibility_sqextractGlobalVar('blockedAddresses'); if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/sent_confirmation/config.php'); else include_once ('../plugins/sent_confirmation/config.php'); $sent_conf_enable = ($sent_conf_message_style == 'off' ? 0 : 1); if ($sent_conf_allow_user_override) { $sent_conf_enable = getPref($data_dir, $username, 'sent_conf_enable', $sent_conf_enable); $sent_conf_message_style = getPref($data_dir, $username, 'sent_conf_style', $sent_conf_message_style); $sent_conf_include_recip_addr = getPref($data_dir, $username, 'sent_conf_incl_recip', $sent_conf_include_recip_addr); $sent_conf_show_headers = getPref($data_dir, $username, 'sent_conf_show_headers', $sent_conf_show_headers); $sent_conf_enable_orig_msg_options = getPref($data_dir, $username, 'sent_conf_enable_orig_msg_options', $sent_conf_enable_orig_msg_options); } if ($sent_confirmation_debug == 2) { echo "session...
";
      print_r($_SESSION);
      echo "
"; } // if not enabled, just quit // if (!$sent_conf_enable) return; // if we should be showing a notification, then do it // if (isset($sent_conf_message_sent_status) && !empty($sent_conf_message_sent_status) && $sent_conf_message_sent_status != 'not_sent' && $sent_conf_message_style != 'off') { // if using preview pane plugin and it hasn't run // first, go run it now // if (in_array('preview_pane', $plugins)) { if (!(isset($pp_forceTopURL) && !empty($pp_forceTopURL))) { if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/preview_pane/functions.php'); else include_once ('../plugins/preview_pane/functions.php'); preview_pane_check_frames_do(); } // if preview_pane is redirecting us, don't do anything here // if ($pp_forceTopURL == "yes") return; } else $pp_noPageHeader = FALSE; // a little trickery to get the page header // printed out... the problem is that this // function is called in a hook that is part // of displayPageHeader(), so we need to avoid // an endless recursion loop here // if ($sent_conf_message_style > 2) { global $color, $sent_conf_count; if (!$sent_conf_count) { $sent_conf_count = 1; if (!empty($mailbox)) ($pp_noPageHeader ? pp_displayPageHeader($color, $mailbox) : displayPageHeader($color, $mailbox)); else ($pp_noPageHeader ? pp_displayPageHeader($color, 'None') : displayPageHeader($color, 'None')); } else { return; } } echo '
'; bindtextdomain('sent_confirmation', SM_PATH . 'plugins/sent_confirmation/locale'); textdomain('sent_confirmation'); //------------------------------------------------------------- // STYLE 1 //------------------------------------------------------------- if ($sent_conf_message_style == 1) { if ($sent_conf_include_recip_addr) { $addresses = sc_parseEmailAddresses($sent_conf_message_sent_status); $output = ''; $firstTime = TRUE; foreach ($addresses as $addressAndNick) { $address = trim($addressAndNick[0]); if (!empty($address)) { if (!$firstTime) $output .= ', '; $firstTime = FALSE; $output .= $address; } } echo '' . _("Message Sent To: ") . $output; // if any disallowed addresses from the // restrict senders plugin, display them // if ($blockedAddresses) { echo '
BLOCKED ADDRESSES: '; $first = 1; foreach ($blockedAddresses as $badAddr) { if (!$first) echo ', '; $first = 0; echo $badAddr; } echo ''; } echo '
'; } else echo '' . _("Message Sent") . ''; } //------------------------------------------------------------- // STYLE 2 //------------------------------------------------------------- else if ($sent_conf_message_style == 2) { if ($sent_conf_include_recip_addr) { $addresses = sc_parseEmailAddresses($sent_conf_message_sent_status); $output = ''; $firstTime = TRUE; foreach ($addresses as $addressAndNick) { $address = trim($addressAndNick[0]); if (!empty($address)) { if (!$firstTime) $output .= ', '; $firstTime = FALSE; $output .= $address; } } echo '
' . _("Your message has been sent to ") . $output; // if any disallowed addresses from the // restrict senders plugin, display them // if ($blockedAddresses) { echo '
BLOCKED ADDRESSES: '; $first = 1; foreach ($blockedAddresses as $badAddr) { if (!$first) echo ', '; $first = 0; echo $badAddr; } echo ''; } echo '
'; } else echo '
' . _("Your message has been sent") . '
'; } //------------------------------------------------------------- // STYLE 3 //------------------------------------------------------------- else if ($sent_conf_message_style == 3) { // if the quicksave plugin is installed and active, we // need to tell it here that the message was sent successfully // (in case the user doesn't return to the message list, // where quicksave usually does this for itself) // global $plugins; if (in_array('quicksave', $plugins)) { if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/quicksave/functions.php'); else include_once ('../plugins/quicksave/functions.php'); quicksave_turn_off(); } // code stolen from /src/read_body.php as // well as Wolf Bergenheim's Todo plugin // global $color, $base_uri, $sort, $startMessage, $sent_logo, $sent_logo_width, $sent_logo_height; $urlMailbox = urlencode($mailbox); echo '' . '
' . '' . '' . '
' . ''; if ($compose_new_win) { echo '' . _("Close") . ''; // echo '" // . _("Compose") . ''; } else { echo '' : '>') . _("Message List") . ''; } echo '
' . '
'; echo '
' . '
' . ''; if (isset($sent_logo) && !empty($sent_logo)) { echo ''. "\n"; } echo ''."\n" . ''."\n" . '
'. "\n" . _("Message Sent To:") . '
'."\n"; // grab actual email addresses // $addresses = sc_parseEmailAddresses($sent_conf_message_sent_status); // put addresses in the form // $x = 0; foreach ($addresses as $addressAndNick) { $address = trim($addressAndNick[0]); $nick = $addressAndNick[1]; if (!empty($address)) { if ($sent_conf_show_headers && strpos($address, 'Cc:') === 0) { $address = substr($address, 3); echo '
'."\n" . _("Cc:") . '
' . '' . ''."\n"; } else if ($sent_conf_show_headers && strpos($address, 'Bcc:') === 0) { $address = substr($address, 4); echo '
 '."\n" . $address . '
'."\n" . _("Bcc:") . '
' . '' . ''."\n"; } else echo ''."\n"; } } echo '
 '."\n" . $address . '
 '."\n" . $address . '
' . '
'; // if is reply, offer deletion of original message here // if ($sent_conf_enable_orig_msg_options && isset($sent_conf_orig_reply_msg) && !empty($sent_conf_orig_reply_msg)) { list($mailbox, $passed_id, $sort) = explode('|', $sent_conf_orig_reply_msg); //echo '
' . _("Original Message") . ':' //. $sent_conf_orig_subject //. '
 ' //Note: if we use this Delete link, have to retrofit w/if statement about $pp_noPageHeader (for preview pane plugin) //. _("Delete") . '
'; //echo '' //Note: if we use this Delete link, have to retrofit w/if statement about $pp_noPageHeader (for preview pane plugin) //. _("Delete Original Message") . '
' . _("Subject") . ': ' //. $sent_conf_orig_subject . '
'; // this one looked nice (only delete link) //echo '
' //Note: if we use this Delete link, have to retrofit w/if statement about $pp_noPageHeader (for preview pane plugin) //. _("Delete Original Message") . '
' . _("From") //. ':' . $sent_conf_orig_sender . '
' //. _("Subject") . ':' //. $sent_conf_orig_subject . '
'; $safe_name = preg_replace("/[^0-9A-Za-z_]/", '_', $mailbox); $form_name = "FormMsgs" . $safe_name; echo '
' . "\n" . '' . '' . '' . '' . '' . "\n" . '' //// . '' . '' . '
' . _("Original Message") . '
' . _("From") . ':' . $sent_conf_orig_sender . '
' . _("Subject") . ':' . $sent_conf_orig_subject . '


'; if ($pp_noPageHeader) echo ''; // was: echo ''; else echo ''; echo 'Delete | Return To Message
' . '
' . _("Move to:") . '  ' . getButton('SUBMIT', 'moveButton', _("Move")) . "\n" . "" . '
'; // read links as constructed in mailbox_display.php // but stuff like startMessage and searchstr don't //////// note - startMessage has been fixed // appear to be available after the send button is // pressed // //' . _("BLOCKED ADDRESSES") . ':
'."\n"; foreach ($blockedAddresses as $badAddr) echo ''; echo '
' . $badAddr . '
'; } echo '
' . '
'; echo '' . '' . '

' . ''; if ($compose_new_win) { echo '' . _("Close") . ''; // echo '" // . _("Compose") . ''; } else { echo '' : '>') . _("Message List") . ''; } echo '
'; echo '
' . ''; $sent_conf_message_sent_status = 'not_sent'; compatibility_sqsession_register($sent_conf_message_sent_status, 'sent_conf_message_sent_status'); exit; } //------------------------------------------------------------- // STYLE 4 //------------------------------------------------------------- else if ($sent_conf_message_style == 4) { // if the quicksave plugin is installed and active, we // need to tell it here that the message was sent successfully // (in case the user doesn't return to the message list, // where quicksave usually does this for itself) // global $plugins; if (in_array('quicksave', $plugins)) { if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/quicksave/functions.php'); else include_once ('../plugins/quicksave/functions.php'); quicksave_turn_off(); } // code stolen from /src/read_body.php as // well as Wolf Bergenheim's Todo plugin // global $color, $base_uri, $mailbox, $sort, $startMessage, $sent_logo, $sent_logo_width, $sent_logo_height; $urlMailbox = urlencode($mailbox); echo '' . '
' . '' . '' . '
' . ''; if ($compose_new_win) { echo '" . _("Compose") . ''; } else { echo '' : '>') . _("Message List") . ''; } echo '
' . '
'; echo '
' . '
' . ''; if (isset($sent_logo) && !empty($sent_logo)) { echo ''; } echo '' . ''."\n" . '
' . _("Message Sent To:") . '
'; // grab actual email addresses // $addresses = sc_parseEmailAddresses($sent_conf_message_sent_status); // put addresses in the form // $x = 0; foreach ($addresses as $addressAndNick) { $address = trim($addressAndNick[0]); if (!empty($address)) { if ($sent_conf_show_headers && strpos($address, 'Cc:') === 0) { $address = substr($address, 4); echo '
'."\n" . _("Cc:") . '
' . '' . ''."\n"; } else if ($sent_conf_show_headers && strpos($address, 'Bcc:') === 0) { $address = substr($address, 5); echo '
' . $address . '
'."\n" . _("Bcc:") . '
' . '' . ''."\n"; } else echo ''; } } echo '
' . $address . '
' . $address . '
' . '
'; // if is reply, offer deletion of original message here // if ($sent_conf_enable_orig_msg_options && isset($sent_conf_orig_reply_msg) && !empty($sent_conf_orig_reply_msg)) { list($mailbox, $passed_id, $sort) = explode('|', $sent_conf_orig_reply_msg); //echo '
' . _("Original Message") . ':' //. $sent_conf_orig_subject //. '
 ' //Note: if we use this Delete link, have to retrofit w/if statement about $pp_noPageHeader (for preview pane plugin) //. _("Delete") . '
'; //echo '' //Note: if we use this Delete link, have to retrofit w/if statement about $pp_noPageHeader (for preview pane plugin) //. _("Delete Original Message") . '
' . _("Subject") . ': ' //. $sent_conf_orig_subject . '
'; // this one looked nice (only delete link) //echo '
' //Note: if we use this Delete link, have to retrofit w/if statement about $pp_noPageHeader (for preview pane plugin) //. _("Delete Original Message") . '
' . _("From") //. ':' . $sent_conf_orig_sender . '
' //. _("Subject") . ':' //. $sent_conf_orig_subject . '
'; $safe_name = preg_replace("/[^0-9A-Za-z_]/", '_', $mailbox); $form_name = "FormMsgs" . $safe_name; echo '
' . "\n" . '' . '' . '' . '' . '' . "\n" . '' //// . '' . '' . '
' . _("Original Message") . '
' . _("From") . ':' . $sent_conf_orig_sender . '
' . _("Subject") . ':' . $sent_conf_orig_subject . '


'; if ($pp_noPageHeader) echo ''; // was: echo ''; else echo ''; echo 'Delete | Return To Message
' . '
' . _("Move to:") . '  ' . getButton('SUBMIT', 'moveButton', _("Move")) . "\n" . "" . '
'; // read links as constructed in mailbox_display.php // but stuff like startMessage and searchstr don't //////// note - startMessage has been fixed // appear to be available after the send button is // pressed // //' . _("BLOCKED ADDRESSES") . ':
'."\n"; foreach ($blockedAddresses as $badAddr) echo ''; echo '
' . $badAddr . '
'; } echo '
' . '
'; echo '' . '' . '

' . ''; if ($compose_new_win) { echo '" . _("Compose") . ''; } else { echo '' : '>') . _("Message List") . ''; } echo '
'; echo '' . ''; $sent_conf_message_sent_status = 'not_sent'; compatibility_sqsession_register($sent_conf_message_sent_status, 'sent_conf_message_sent_status'); exit; } echo ''; } $sent_conf_message_sent_status = 'not_sent'; compatibility_sqsession_register($sent_conf_message_sent_status, 'sent_conf_message_sent_status'); bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); } /** * Parse Out Email Addresses * * Takes a string of email addresses (possibly with * full names, Cc or Bcc headers) and parses them * into an array of real email addresses and optional * nick names. * * @param string $emailAddressWithJunk The messy string * of email addresses. * @param string $header An optional string that will be * prepended to the first email address * that is parsed out. (optional) * */ function sc_parseEmailAddresses($emailAddressWithJunk, $header='') { // need to grab headers and do this one section at // a time if headers are there (headers being CC: and BCC:) // if (strpos($emailAddressWithJunk, 'Cc:') !== FALSE || strpos($emailAddressWithJunk, 'Bcc:') !== FALSE) { if (preg_match('/(.*)Cc:(.*)Bcc:(.*)/', $emailAddressWithJunk, $matches)) { $toAddresses = sc_parseEmailAddresses($matches[1]); $ccAddresses = sc_parseEmailAddresses($matches[2], 'Cc: '); $bccAddresses = sc_parseEmailAddresses($matches[3], 'Bcc: '); return array_merge($toAddresses, $ccAddresses, $bccAddresses); } else if (preg_match('/(.*)Cc:(.*)/', $emailAddressWithJunk, $matches)) { $toAddresses = sc_parseEmailAddresses($matches[1]); $ccAddresses = sc_parseEmailAddresses($matches[2], 'Cc: '); return array_merge($toAddresses, $ccAddresses); } else if (preg_match('/(.*)Bcc:(.*)/', $emailAddressWithJunk, $matches)) { $toAddresses = sc_parseEmailAddresses($matches[1]); $bccAddresses = sc_parseEmailAddresses($matches[2], 'Bcc: '); return array_merge($toAddresses, $bccAddresses); } } // grab actual email addresses // preg_match_all('/\s*([\'"].*?[\'"]){0,1}(.*?)([,;]|$)/', $emailAddressWithJunk, $matches, PREG_SET_ORDER); $addresses = array(); $isFirst = TRUE; foreach ($matches as $match) { $nick = preg_replace('/[\'"]/', '', $match[1]); if (!empty($match[2])) { // first try to get email address from within // brackets (avoids malformed addresses with // full name in front without quotes) // preg_match('/(.*)<(.*)>/', $match[2], $moreMatches); // also try to grab nickname if didn't find it already // if (empty($nick) && !empty($moreMatches[1])) { $nick = trim($moreMatches[1]); } if (!empty($moreMatches[2])) { if (!empty($header) && $isFirst) $moreMatches[2] = $header . $moreMatches[2]; $isFirst = FALSE; $addresses[] = array($moreMatches[2], $nick); } // otherwise, it's properly formed, but might // still have extraneous characters on front // or back (spaces, brackets...) // else { $address = preg_replace(array('/^(\W*)/', '/(\W*)$/'), '', $match[2]); if (!empty($address)) { if (!empty($header) && $isFirst) $address = $header . $address; $isFirst = FALSE; $addresses[] = array($address, $nick); } } } } return $addresses; } // clear out sent indicator // function sent_conf_compose_bottom_do() { global $sent_conf_message_sent_status; $sent_conf_message_sent_status = 'not_sent'; compatibility_sqsession_register($sent_conf_message_sent_status, 'sent_conf_message_sent_status'); } ?> sent_confirmation/INSTALL0100644000000000000000000000415110022450413014317 0ustar rootrootInstalling Sent Confirmation ============================ 1) Start with untaring the file into the plugins directory. Here is a example for the 1.0 version of the sent_confirmation plugin. $ cd plugins $ tar -zxvf sent_confirmation-1.0-1.2.tar.gz 2) Change into the sent_confirmation directory, copy config.php.sample to config.php and edit config.php, making adjustments as you deem necessary. $ cd sent_confirmation $ cp config.php.sample config.php $ vi config.php 3) Then go to your config directory and run conf.pl. Choose option 8 and move the plugin from the "Available Plugins" category to the "Installed Plugins" category. Save and exit. $ cd ../../config/ $ ./conf.pl 4) Also, please verify that you have the "compatibility" plugin installed. Upgrading Sent Confirmation =========================== 1) Start with untaring the file into the plugins directory. Here is a example for the 1.0 version of the sent_confirmation plugin. $ cd plugins $ tar -zxvf sent_confirmation-1.0-1.2.tar.gz 2) Change into the sent_confirmation directory, check your config.php file against the new version, to see if there are any new settings that you must add to your config.php file. $ diff -Nau config.php config.php.sample Or simply replace your config.php file with the provided sample and reconfigure the plugin from scratch (see step 2 under the installation procedure above). * As of version 1.6, there is an extra entry in the user preferences that might disable the confirmation message for users who had had it turned on under version 1.5. To avoid this happening, you can either set the default style in config.php to anything other than 'off', or you can make sure that all users view their preferences screen once after version 1.6 is installed, verify their new settings, and click "Submit". The best solution is to simply add the new preference entry to any preference files that need it: $ echo 'sent_conf_enable=1' | tee -a `grep -rEin 'sent_conf_style=[1234]' /path/to/squirrelmail/data/directory/ | sed 's/:.*//'` sent_confirmation/README0100644000000000000000000001145210022450764014161 0ustar rootrootSent Confirmation plugin for SquirrelMail ========================================= Ver 1.6, 29/02/04 Original author: Paul Lesneiwski Thanks to: Dustin Anders, Andy Brook and Christian Sauer for their address_book_import_export plugin, from which the address book import code was stolen and modified for use here. Wolf Bergenheim for ideas and some code borrowed from his To-Do Reminder plugin. Description =========== This plugin displays a confirmation message above the message index after a message is successfully sent. It can also display a screen offering the option to add any of the message's recipients to the user's address book or move, delete or return to the original message in the case of replies and forwards. In combination with the "Restrict Senders" plugin, it also displays any addresses on the outgoing mail that were blocked. Warning: SquirrelMail 1.4.1 =========================== It has been reported that deleting the original message in a nested folder may delete ALL messages in the folder when using this plugin with SquirrelMail 1.4.1. Although this has only been reported once and has not been reproducable by the author of this plugin, this is a serious enough problem that it is advisable to upgrade to the latest stable release of SquirrelMail. Known Bugs =========== When SMTP/sendmail errors occur upon sending, the next time this plugin has the chance to run, it displays the sent confirmation, even though the message DID NOT get sent due to the SMTP/sendmail errors. This is an architectural compromise. It could be solved by adding a new hook just after the message was sent in the SM core, but for now, I'll assume that most SM installations actually have working SMTP or sendmail servers. Change Log ========== 1.6 - Paul Lesneiwski * New options descriptions - make much more sense - thanks to Kurt Yoder * Many changes for full compatibility with new "Preview Pane" plugin * Full internationalization - send your translations! * Minor fix; some PHP installations were showing a zero at bottom of the confirmation screen. * Minor code refactoring 1.5 - Paul Lesneiwski * Removed PHP notice/warnings that appeared on compose screen when replying. 1.4 - Paul Lesneiwski * Fixed double page headers with styles one and two * Page header now shows current mailbox for styles three and four * Changed "Compose" links to "Close" links for styles three and four when using "compose in new window" functionality * Fixed bad hyperlink URI for address book after adding addresses 1.3 - Paul Lesneiwski * Fixed poor address parsing - sorry! It now correctly pulls apart addresses in the form "Name" * Smarter parsing of nicknames (in the case of addresses as above, anything in quotes is used as the nickname). It also attempts to pull out first and last name from the nickname 1.2 - Paul Lesneiwski * Added same controls for forwarded messages as we already have for replies * When user sent a reply to a message not on page one of message list, the correct page is returned to after confirmation * Saved Drafs no longer interpreted as sent messages * Resumed and sent drafts ARE interpreted as sent messages * Removed need for patching SquirrelMail source for compose in new window functionality * Added ability to display addresses blocked by the "Restrict Senders" plugin. * Themes should always display correctly * Don't get reply info if we won't be using it (styles 1 and 2) (because it costs an actual extra imap login) * Fixed conflict with Quicksave plugin where Quicksave would give false alerts if Sent Confirmation modes 3 or 4 were used to not return to the message list 1.1 - Paul Lesneiwski * Added ability to move, delete or return to the original message from confirmation screen (display modes 3 and 4) after sending a reply. * Added source patch to make this plugin work with "Compose In New Window" functionality * Fixed clash with other plugins such as Link Buttons 1.0 - Paul Lesneiwski * Initial release Future Work =========== * Disable checkboxes in confirmation screen for addresses already in address book. Problem is that the primary key is the nickname; that doesn't stop us for grepping the address book for an email address, but for now, this is left up to the user... * Ideas? sent_confirmation/config.php.sample0100644000000000000000000000563210022456751016544 0ustar rootroot * This program is licensed under GPL. See COPYING for details * */ global $sent_conf_message_style, $sent_conf_include_recip_addr, $sent_conf_show_only_first_recip_addr, $sent_conf_allow_user_override, $emailAddressDelimiter, $sent_logo, $sent_logo_width, $sent_logo_height, $sent_conf_show_headers, $sent_conf_enable_orig_msg_options; // setting this to 1 gives the user the ability to change // any of the settings below for their own account // $sent_conf_allow_user_override = 1; // message confirmation style: // // 'off' : No message shown // 1 : "Message Sent" (above mailbox listing) // 2 : "Your message has been sent" (centered) // (above mailbox listing) // 3 : Allow user to add addresses to address // book (with optional image) (separate, // intermediary screen) // 4 : "Message Sent To:" (with user list and // optional image) (separate, intermediary screen) // $sent_conf_message_style = 'off'; //$sent_conf_message_style = 3; // this allows you to indicate the email address to which // the message was sent in the confirmation message (0 = off, // 1 = on) // $sent_conf_include_recip_addr = 1; // when using the "$sent_conf_include_recip_addr" setting // above, this setting will determine if all of the "To:" // addresses will be shown or not (0 = off, 1 = on) // $sent_conf_show_only_first_recip_addr = 1; // when using the "$sent_conf_include_recip_addr" setting // above, this setting will also include any addresses in // the "Cc:" field (0 = off, 1 = on) // $sent_conf_include_cc = 0; // when using the "$sent_conf_include_recip_addr" setting // above, this setting will also include any addresses in // the "Bcc:" field (0 = off, 1 = on) // $sent_conf_include_bcc = 0; // this allows you to place a logo above the confirmation // message when the confirmation style is 3 or 4. No logo // will be shown if $sent_logo is empty/blank. Width // and height values are optional // $sent_logo = ''; //$sent_logo = '../images/sm_logo.png'; $sent_logo_width = ''; $sent_logo_height = ''; // set this to 1 in order to include "To:", "Cc:", and "Bcc:" // in the list of recipients (so you know which address was // in which header field) // $sent_conf_show_headers = 0; // this allows users to delete, move, or return to the // original message after sending a reply // $sent_conf_enable_orig_msg_options = 1; // the delimiter between account name and domain used in // email addresses on your system... it is rarely anything // except '@' // $emailAddressDelimiter = '@'; ?> sent_confirmation/index.php0100644000000000000000000000074607661412036015132 0ustar rootroot sent_confirmation/version0100644000000000000000000000002607775440064014721 0ustar rootrootSent Confirmation 1.6 sent_confirmation/address_book_import.php0100644000000000000000000002427510022456631020051 0ustar rootroot $varValue) { if (strpos($varName, 'address') !== FALSE) $addresses[] = urldecode($varValue); } displayPageHeader($color, "None"); // These shouldn't be set at all at this point. $ADDRS['csvdata'] = array(); $ADDRS['csvorder'] = array(); foreach ($addresses as $addr) { list($address, $nick) = explode('---', $addr); if (empty($nick)) $nick = substr($address, 0, strpos($address, $emailAddressDelimiter)); if (preg_match('/(\w+), (\w+)/', $nick, $matches)) $temp = array($nick, $matches[2], $matches[1], $address, ''); else if (preg_match('/(\w+)[_ ](\w+)/', $nick, $matches)) $temp = array($nick, $matches[1], $matches[2], $address, ''); else $temp = array($nick, $nick, '', $address, ''); $ADDRS['csvdata'][$key] = $temp; $key++; } unset($ADDRS['csvorder']); echo '
'; // user's data table // Here I will create the headers that I want. echo ' '; // //'; // The Omit column for($x = 0; $x < $csvmax; $x++) { // The Drop down boxes to select what each column is echo ' '; } echo ' '; do { if (count($ADDRS['csvdata'][$row]) >= 5) { // This if ensures the minimum number of columns $cols = count($ADDRS['csvdata'][$row]); // so importing can function for all 5 fields } else { $cols = 5; } $colspan = $cols + 1; if ($row % 2) { // Set up the alternating colored rows echo ' '; } else { echo ' '; } //echo ' '; } else { // if empty, put space in cell keeping colors correct. echo ' '; } } echo ' '; $row++; } while ($row < count($ADDRS['csvdata'])); echo '
' . _("Add To Address Book:") . '

' . _("Omit") . ''; create_Select($csvmax,$x); echo '
//'; // Print the omit checkbox, to be checked before write for($c = 0; $c < $cols; $c++) { // For each column in the current row if ($ADDRS['csvdata'][$row][$c] != "") { // if not empty, put data in cell. echo '

'; if(strlen($errorstring)) { echo _("The following rows have errors") . ':

' . $errorstring; } } else { /** ** $abook ---->Setup the addressbook functions for Pallo's Addressbook. **/ $abook = addressbook_init(true, true); // We only need to do this here because we will only access the address book in this section // rebuild submit data // foreach ($_POST as $varName => $varValue) { preg_match('/^data(\d)_(\d)$/', $varName, $matches); if (count($matches)) { $ADDRS['csvdata'][$matches[1]][$matches[2]] = $varValue; } } do { if (count($ADDRS['csvdata'][$row]) >= 5) { // This if ensures the minimum number of columns $cols = count($ADDRS['csvdata'][$row]); // so importing can function for all 5 fields } else { $cols = 5; } $reorg = array('', '', '', '', ''); for ($c=0; $c < $cols; $c++) { // Reorganize the data to fit the header cells that the user chose // concatenate fields based on user input into text boxes. $column = "COL$c"; if($_POST[$column] != 5) { if ($_POST[$column] == 4) { $reorg[4] .= $ADDRS['csvdata'][$row][$c] . ";"; } else { $reorg[$_POST[$column]] = $ADDRS['csvdata'][$row][$c]; $reorg[$c] = trim($reorg[$c],"\r\n \""); } } } $reorg[4] = trim($reorg[4],";"); $ADDRS['csvdata'][$row] = $reorg; unset($reorg); // So that we don't get any weird information from a previous rows // If finished, do the import. This uses Pallo's excellent class and object stuff $selrow = 'sel' . $row; if (!isset($_POST[$selrow])) { if (eregi('[ \\:\\|\\#\\"\\!]', $ADDRS['csvdata'][$row][0])) { $ADDRS['csvdata'][$row][0] = ''; } //Here we should create the right data to input if (count($ADDRS['csvdata'][$row]) < 5) { array_pad($ADDRS['csvdata'][$row],5,''); } $addaddr['nickname'] = $ADDRS['csvdata'][$row][0]; $addaddr['firstname'] = $ADDRS['csvdata'][$row][1]; $addaddr['lastname'] = $ADDRS['csvdata'][$row][2]; $addaddr['email'] = $ADDRS['csvdata'][$row][3]; $addaddr['label'] = $ADDRS['csvdata'][$row][4]; if (false == $abook->add($addaddr,$abook->localbackend)) { $errorstring .= $abook->error . "
\n"; $error++; } unset($addaddr); // Also so we don't get any weird information from previous rows } $row++; } while($row < count($ADDRS['csvdata'])); unset($ADDRS['csvdata']); // Now that we've uploaded this information, we dont' need this variable anymore, aka cleanup // Print out that we've completed this operation if ($error) { // Since we will print something to the page at this point displayPageHeader($color, "None"); echo '
' . _("There were errors uploading the data, as listed below. Entries not listed here were uploaded.") . '
' . $errorstring . '
'; } else { header('Location: ../../src/addressbook.php'); exit; // Since we will print something to the page at this point displayPageHeader($color, "None"); echo '

' . _("Upload Completed!") . '

' . _("Click on the link below to verify your work.") . ''; } echo '

' . _("Addresses") . '
'; } // Send the field numbers entered in the text boxes by the user back to this script for more processing // email is handled differently, not being an array function create_Select($csvmax,$column) { // $column is the one that should be selected out of the bunch echo "\n"; } bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); ?>
sent_confirmation/COPYING0100644000000000000000000003667210022456545014352 0ustar rootrootThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS sent_confirmation/options.php0100644000000000000000000002106410022456713015505 0ustar rootroot * This program is licensed under GPL. See COPYING for details * */ global $sent_confirmation_debug; $sent_confirmation_debug = 0; // include compatibility plugin // if (defined('SM_PATH')) include_once(SM_PATH . 'plugins/compatibility/functions.php'); else if (file_exists('../plugins/compatibility/functions.php')) include_once('../plugins/compatibility/functions.php'); else if (file_exists('./plugins/compatibility/functions.php')) include_once('./plugins/compatibility/functions.php'); function sent_conf_options() { global $sent_conf_allow_user_override, $sent_conf_message_style, $sent_conf_include_recip_addr, $sent_conf_show_only_first_recip_addr, $username, $data_dir, $sent_conf_include_cc, $sent_conf_include_bcc, $sent_conf_show_headers, $sent_conf_enable_orig_msg_options, $sent_conf_enable; if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/sent_confirmation/config.php'); else include_once ('../plugins/sent_confirmation/config.php'); if (!$sent_conf_allow_user_override) return; $sent_conf_enable = ($sent_conf_message_style == 'off' ? 0 : 1); $sent_conf_enable = getPref($data_dir, $username, 'sent_conf_enable', $sent_conf_enable); $sent_conf_style = getPref($data_dir, $username, 'sent_conf_style', $sent_conf_message_style); $sent_conf_incl_recip = getPref($data_dir, $username, 'sent_conf_incl_recip', $sent_conf_include_recip_addr); $sent_conf_show_only_first_recip_addr = getPref($data_dir, $username, 'sent_conf_show_only_first_recip_addr', $sent_conf_show_only_first_recip_addr); $sent_conf_include_cc = getPref($data_dir, $username, 'sent_conf_include_cc', $sent_conf_include_cc); $sent_conf_include_bcc = getPref($data_dir, $username, 'sent_conf_include_bcc', $sent_conf_include_bcc); $sent_conf_show_headers = getPref($data_dir, $username, 'sent_conf_show_headers', $sent_conf_show_headers); $sent_conf_enable_orig_msg_options = getPref($data_dir, $username, 'sent_conf_enable_orig_msg_options', $sent_conf_enable_orig_msg_options); bindtextdomain('sent_confirmation', SM_PATH . 'plugins/sent_confirmation/locale'); textdomain('sent_confirmation'); echo " \n" . "" . _("Sent Mail Confirmation") . "\n"; echo "\n". _("Confirm Recipients:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; echo "\n". _("Above Message List:") . "\n". "\n\n". "\n". _("Above Message List, Expanded:") . "\n". "\n\n". "\n". _("Transitional Window,
With Address Book Functionality:") . "\n". "\n\n". "\n". _("Transitional Window, Simple:") . "\n". "\n\n". "\n". _("Show Header Fields:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; echo "\n". _("Include Recipient Address:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; echo "\n". _("Only Show First Recipient:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; echo "\n". _("Show Cc Recipients:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; echo "\n". _("Show Bcc Recipients:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; echo "\n". _("Enable Original Message Options:") . "\n". " " . _("Yes") . "\n". "     " . _("No") . "\n". "\n"; bindtextdomain('squirrelmail', SM_PATH . 'locale'); textdomain('squirrelmail'); } function sent_conf_options_save() { global $sent_conf_allow_user_override, $username, $data_dir, $sent_conf_style, $sent_conf_incl_recip, $sent_conf_include_cc, $sent_conf_show_only_first_recip_addr, $sent_conf_include_bcc, $sent_conf_show_headers, $sent_conf_enable_orig_msg_options, $sent_conf_enable; if (compatibility_check_sm_version(1, 3)) include_once (SM_PATH . 'plugins/sent_confirmation/config.php'); else include_once ('../plugins/sent_confirmation/config.php'); if (!$sent_conf_allow_user_override) return; compatibility_sqextractGlobalVar('sent_conf_enable'); compatibility_sqextractGlobalVar('sent_conf_style'); compatibility_sqextractGlobalVar('sent_conf_incl_recip'); compatibility_sqextractGlobalVar('sent_conf_show_only_first_recip_addr'); compatibility_sqextractGlobalVar('sent_conf_include_cc'); compatibility_sqextractGlobalVar('sent_conf_include_bcc'); compatibility_sqextractGlobalVar('sent_conf_show_headers'); compatibility_sqextractGlobalVar('sent_conf_enable_orig_msg_options'); setPref($data_dir, $username, 'sent_conf_enable', $sent_conf_enable); setPref($data_dir, $username, 'sent_conf_style', $sent_conf_style); setPref($data_dir, $username, 'sent_conf_incl_recip', $sent_conf_incl_recip); setPref($data_dir, $username, 'sent_conf_show_only_first_recip_addr', $sent_conf_show_only_first_recip_addr); setPref($data_dir, $username, 'sent_conf_include_cc', $sent_conf_include_cc); setPref($data_dir, $username, 'sent_conf_include_bcc', $sent_conf_include_bcc); setPref($data_dir, $username, 'sent_conf_show_headers', $sent_conf_show_headers); setPref($data_dir, $username, 'sent_conf_enable_orig_msg_options', $sent_conf_enable_orig_msg_options); } ?> sent_confirmation/locale/0040755000000000000000000000000010022452005014526 5ustar rootrootsent_confirmation/locale/sent_confirmation.pot0100644000000000000000000000711510022454050020776 0ustar rootroot# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2004-03-06 15:00-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: address_book_import.php:190 msgid "The following rows have errors" msgstr "" #: address_book_import.php:278 msgid "" "There were errors uploading the data, as listed below. Entries not listed " "here were uploaded." msgstr "" #: address_book_import.php:285 msgid "Upload Completed!" msgstr "" #: address_book_import.php:285 msgid "Click on the link below to verify your work." msgstr "" #: address_book_import.php:288 msgid "Addresses" msgstr "" #: address_book_import.php:306 msgid "Nickname" msgstr "" #: address_book_import.php:308 msgid "First Name" msgstr "" #: address_book_import.php:310 msgid "Last Name" msgstr "" #: address_book_import.php:312 msgid "Email" msgstr "" #: address_book_import.php:314 msgid "Additional Info" msgstr "" #: address_book_import.php:316 msgid "Do Not Include" msgstr "" #: functions.php:391 msgid "Message Sent To: " msgstr "" #: functions.php:413 msgid "Message Sent" msgstr "" #: functions.php:438 msgid "Your message has been sent to " msgstr "" #: functions.php:459 msgid "Your message has been sent" msgstr "" #: functions.php:503 functions.php:697 msgid "Close" msgstr "" #: functions.php:513 functions.php:707 functions.php:770 functions.php:955 msgid "Message List" msgstr "" #: functions.php:533 msgid "Please select an address to add to your address book." msgstr "" #: functions.php:534 functions.php:791 msgid "Message Sent To:" msgstr "" #: functions.php:556 functions.php:812 msgid "Cc:" msgstr "" #: functions.php:566 functions.php:820 msgid "Bcc:" msgstr "" #: functions.php:580 msgid "Add To Address Book" msgstr "" #: functions.php:628 functions.php:878 msgid "Original Message" msgstr "" #: functions.php:629 functions.php:879 msgid "From" msgstr "" #: functions.php:631 functions.php:881 msgid "Subject" msgstr "" #: functions.php:646 functions.php:896 msgid "Move to:" msgstr "" #: functions.php:648 functions.php:898 msgid "Move" msgstr "" #: functions.php:680 functions.php:930 msgid "BLOCKED ADDRESSES" msgstr "" #: functions.php:763 functions.php:948 msgid "Compose" msgstr "" #: options.php:49 msgid "Sent Mail Confirmation" msgstr "" #: options.php:52 msgid "Confirm Recipients:" msgstr "" #: options.php:55 options.php:86 options.php:96 options.php:106 #: options.php:116 options.php:126 options.php:136 msgid "Yes" msgstr "" #: options.php:58 options.php:89 options.php:99 options.php:109 #: options.php:119 options.php:129 options.php:139 msgid "No" msgstr "" #: options.php:62 msgid "Above Message List:" msgstr "" #: options.php:67 msgid "Above Message List, Expanded:" msgstr "" #: options.php:72 msgid "Transitional Window,
With Address Book Functionality:" msgstr "" #: options.php:77 msgid "Transitional Window, Simple:" msgstr "" #: options.php:83 msgid "Show Header Fields:" msgstr "" #: options.php:93 msgid "Include Recipient Address:" msgstr "" #: options.php:103 msgid "Only Show First Recipient:" msgstr "" #: options.php:113 msgid "Show Cc Recipients:" msgstr "" #: options.php:123 msgid "Show Bcc Recipients:" msgstr "" #: options.php:133 msgid "Enable Original Message Options:" msgstr "" sent_confirmation/getpot0100744000000000000000000000017210020726242014517 0ustar rootroot#!/bin/sh xgettext --keyword=_ -keyword=N_ --default-domain=sent_confirmation \ *.php --output=sent_confirmation.pot