+++ /dev/null
-Address Book Take
-
-If you would like to add the sender of a message you're reading to your
-address book quickly and easily without cutting and pasting, then this
-plugin simplifies the process. It scans the mail message you're reading
-for any email address and lets you add it with a quick form.
-
-
-Features
-========
-
-* Saves you the need to Cut & Paste
-* Steals from the To, From, Reply-To, and CC fields
-* Steals from the body of the message
-* Address verification (pretty good)
-
-
-Description
-===========
-
-By pulling down a list and selecting the address you want to add, you
-are then presented with a familiar Add to Personal Address Book screen.
-By filling out this form, you will then add the email address to your
-personal address book.
-
-The user can decide if the box is shown, where it is shown on the bottom
-of the Read screen, and whether or not to attempt to verify that the
-address works.
-
-When trying to verify if the address works, it checks to see if the host
-has any DNS record available. Usually this will work.
-
-
-Future Work
-===========
-
-* Maybe grab the name, if available
-* Search more headers (when they become available)
-* Steal from the body of the message directly (when possible)
-* When new domains are added, update the email verification function
-
-
-Installation
-============
-
-Go back to the main directory, run configure and add the plugin.
-
-
-Credits
-=======
-
-This plugin has been originally developed by Tyler Akins and is now
-maintained by the SquirrelMail Project Team.
+++ /dev/null
-<?php
-
-/**
- * functions.php
- *
- * Functions for the Address Take plugin
- *
- * @copyright © 1999-2007 The SquirrelMail Project Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id$
- * @package plugins
- * @subpackage abook_take
- */
-
-/** */
-function valid_email ($email, $verify) {
- global $Email_RegExp_Match;
-
- if (! eregi('^' . $Email_RegExp_Match . '$', $email)) {
- return false;
- }
-
- if (! $verify) {
- return true;
- }
-
- return checkdnsrr(substr(strstr($email, '@'), 1), 'ANY') ;
-}
-
-function abook_take_read_string($str) {
- global $abook_found_email, $Email_RegExp_Match;
-
- while (eregi('(' . $Email_RegExp_Match . ')', $str, $hits)) {
- $str = substr(strstr($str, $hits[0]), strlen($hits[0]));
- if (! isset($abook_found_email[$hits[0]])) {
- echo addHidden('email[]', $hits[0]);
- $abook_found_email[$hits[0]] = 1;
- }
- }
-
- return;
-}
-
-function abook_take_read_array($array) {
- foreach ($array as $item)
- abook_take_read_string($item->getAddress());
-}
-
-function abook_take_read() {
- global $message;
-
- echo '<br />' . addForm(SM_PATH . 'plugins/abook_take/take.php') .
- '<div style="text-align: center;">' . "\n";
-
- if (isset($message->rfc822_header->reply_to))
- abook_take_read_array($message->rfc822_header->reply_to);
- if (isset($message->rfc822_header->from))
- abook_take_read_array($message->rfc822_header->from);
- if (isset($message->rfc822_header->cc))
- abook_take_read_array($message->rfc822_header->cc);
- if (isset($message->rfc822_header->to))
- abook_take_read_array($message->rfc822_header->to);
-
- echo addSubmit(_("Take Address")) .
- '</div></form>';
-}
-
-function abook_take_pref() {
- global $username, $data_dir, $abook_take_verify;
-
- $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify', false);
-}
-
-function abook_take_options() {
- global $optpage_data;
-
- $optpage_data['grps']['abook_take'] = _("Address Book Take");
- $optionValues = array();
- $optionValues[] = array(
- 'name' => 'abook_take_verify',
- 'caption' => _("Try to verify addresses"),
- 'type' => SMOPT_TYPE_BOOLEAN,
- 'refresh' => SMOPT_REFRESH_NONE
- );
- $optpage_data['vals']['abook_take'] = $optionValues;
-}
+++ /dev/null
-<?php
-
-/**
- * index.php
- *
- * This file simply takes any attempt to view source files and sends those
- * people to the login screen. At this point no attempt is made to see if the
- * person is logged in or not.
- *
- * @copyright © 1999-2007 The SquirrelMail Project Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id$
- * @package plugins
- * @subpackage abook_take
- */
-
-header('Location: ../index.php');
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * setup.php
- *
- * Address Take -- steals addresses from incoming email messages. Searches
- * the To, Cc, From and Reply-To headers, also searches the body of the
- * message.
- *
- * @copyright © 1999-2007 The SquirrelMail Project Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id$
- * @package plugins
- * @subpackage abook_take
- */
-
-
-/**
- * Initialize the plugin
- */
-function squirrelmail_plugin_init_abook_take()
-{
- global $squirrelmail_plugin_hooks;
-
- $squirrelmail_plugin_hooks['read_body_bottom']['abook_take'] = 'abook_take_read_body_bottom';
- $squirrelmail_plugin_hooks['loading_prefs']['abook_take'] = 'abook_take_loading_prefs';
- $squirrelmail_plugin_hooks['optpage_loadhook_display']['abook_take'] = 'abook_take_optpage_loadhook_display';
-}
-
-function abook_take_read_body_bottom() {
- include_once(SM_PATH . 'plugins/abook_take/functions.php');
-
- abook_take_read();
-}
-
-function abook_take_loading_prefs() {
- include_once(SM_PATH . 'plugins/abook_take/functions.php');
-
- abook_take_pref();
-}
-
-function abook_take_optpage_loadhook_display() {
- include_once(SM_PATH . 'plugins/abook_take/functions.php');
-
- abook_take_options();
-}
+++ /dev/null
-<?php
-
-/**
- * take.php
- *
- * Address Take -- steals addresses from incoming email messages. Searches
- * the To, Cc, From and Reply-To headers.
- *
- * @copyright © 1999-2007 The SquirrelMail Project Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id$
- * @package plugins
- * @subpackage abook_take
- */
-
-/**
- * Include the SquirrelMail initialization file.
- */
-require('../../include/init.php');
-
-/* SquirrelMail required files. */
-require(SM_PATH . 'functions/forms.php');
-require(SM_PATH . 'functions/addressbook.php');
-
-displayPageHeader($color);
-
-/* input form data */
-sqgetGlobalVar('email', $email, SQ_POST);
-
-$abook_take_verify = getPref($data_dir, $username, 'abook_take_verify');
-
-$abook = addressbook_init(false, true);
-
-$addrs = array();
-foreach ($email as $Val) {
- if (valid_email($Val, $abook_take_verify)) {
- $addrs[$Val] = $Val;
- } else {
- $addrs[$Val] = 'FAIL - ' . $Val;
- }
-}
-
-$formdata=array('email'=>$addrs);
-
-abook_create_form(SM_PATH . 'src/addressbook.php','addaddr',_("Add to address book"),_("Add address"),$formdata);
-echo '</form>';
-?>
-</body></html>