0010096: Mail application with IMAP direct access
authorFlávio Gomes da Silva Lisboa <flavio.lisboa@serpro.gov.br>
Mon, 27 Apr 2015 20:05:13 +0000 (17:05 -0300)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 13 Aug 2015 08:00:20 +0000 (10:00 +0200)
- Expressomail is an application derived from Felamimail.
- Backend has been changed to access directly IMAP, without database cache.
- Application is in production for almost two years for almost 11000 users.

Change-Id: Ie8e6d1abde072f897bf9816c3b6a835af7a6828b
Reviewed-on: https://gerrit.tine20.org/tine20/3017
Tested-by: jenkins user
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
191 files changed:
tests/tine20/Expressomail/AllTests.php [new file with mode: 0755]
tests/tine20/Expressomail/Controller/AccountTest.php [new file with mode: 0755]
tests/tine20/Expressomail/Controller/Cache/MessageTest.php [new file with mode: 0755]
tests/tine20/Expressomail/Controller/FolderTest.php [new file with mode: 0755]
tests/tine20/Expressomail/Controller/MessageTest.php [new file with mode: 0755]
tests/tine20/Expressomail/JsonTest.php [new file with mode: 0755]
tests/tine20/Expressomail/Model/AccountTest.php [new file with mode: 0755]
tests/tine20/Expressomail/Model/MessageTest.php [new file with mode: 0755]
tests/tine20/Expressomail/Model/resultado.txt [new file with mode: 0755]
tests/tine20/Expressomail/Sieve/Backend/ScriptTest.php [new file with mode: 0755]
tests/tine20/Expressomail/files/Amazon.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/Amazon2.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/Angebotsformular.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/Terminbestaetigung.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/UTF8inFrom.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/UmlauteUTF8TextISO-8859-15Signatur.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/Wortmann1.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/attachmentUmlaut.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/calendar_cancel.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/calendar_reply_accepted.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/calendar_reply_declined.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/calendar_request.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/complete.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/decode_subject_header.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/decode_utf8_header.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/empty_date_header.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/facebook_notification.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/heavyhtml.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/iOSInvitation.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/invalid_body_chars.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/invaliddate.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/invaliddate2.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/invitation.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/invite_outlook.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/leading_spaces.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/longfrom.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/mac_invitation.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/mail.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/mail_to_comma.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/meetup.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_alternative.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_alternative_related.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_mixed.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_related.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_rfc2822-2.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_rfc2822-3.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_rfc2822.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/multipart_signed.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/mw_newsletter_multipart_related.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/noattachment.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/other/README [new file with mode: 0755]
tests/tine20/Expressomail/files/outlookimip.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/punycode_from.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/text_html.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/text_html_urls.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/text_plain.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/text_plain2.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/unparseable.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/vacation_template.tpl [new file with mode: 0755]
tests/tine20/Expressomail/files/vacation_template_sig.tpl [new file with mode: 0755]
tests/tine20/Expressomail/files/withoutfrom.eml [new file with mode: 0755]
tests/tine20/Expressomail/files/yahoo.eml [new file with mode: 0755]
tine20/Expressomail/Acl/Rights.php [new file with mode: 0644]
tine20/Expressomail/Backend/Account.php [new file with mode: 0644]
tine20/Expressomail/Backend/Folder.php [new file with mode: 0644]
tine20/Expressomail/Backend/FolderComparator.php [new file with mode: 0644]
tine20/Expressomail/Backend/Imap.php [new file with mode: 0644]
tine20/Expressomail/Backend/ImapFactory.php [new file with mode: 0644]
tine20/Expressomail/Backend/ImapProxy.php [new file with mode: 0644]
tine20/Expressomail/Backend/Message.php [new file with mode: 0644]
tine20/Expressomail/Backend/MessageComparator.php [new file with mode: 0644]
tine20/Expressomail/Backend/Sieve.php [new file with mode: 0644]
tine20/Expressomail/Backend/SieveFactory.php [new file with mode: 0644]
tine20/Expressomail/Config.php [new file with mode: 0644]
tine20/Expressomail/Controller.php [new file with mode: 0644]
tine20/Expressomail/Controller/Account.php [new file with mode: 0644]
tine20/Expressomail/Controller/Folder.php [new file with mode: 0644]
tine20/Expressomail/Controller/Message.php [new file with mode: 0644]
tine20/Expressomail/Controller/Message/Flags.php [new file with mode: 0644]
tine20/Expressomail/Controller/Message/Move.php [new file with mode: 0644]
tine20/Expressomail/Controller/Message/Send.php [new file with mode: 0644]
tine20/Expressomail/Controller/Sieve.php [new file with mode: 0644]
tine20/Expressomail/Exception.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAP.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAPCacheTooMuchResults.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAPFolderDuplicated.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAPFolderNotFound.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAPInvalidCredentials.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAPMessageNotFound.php [new file with mode: 0644]
tine20/Expressomail/Exception/IMAPServiceUnavailable.php [new file with mode: 0644]
tine20/Expressomail/Exception/SMTP.php [new file with mode: 0644]
tine20/Expressomail/Exception/Sieve.php [new file with mode: 0644]
tine20/Expressomail/Exception/SievePutScriptFail.php [new file with mode: 0644]
tine20/Expressomail/Expressomail.jsb2 [new file with mode: 0644]
tine20/Expressomail/Frontend/Http.php [new file with mode: 0644]
tine20/Expressomail/Frontend/Json.php [new file with mode: 0644]
tine20/Expressomail/Frontend/WebDAV.php [new file with mode: 0644]
tine20/Expressomail/Frontend/WebDAV/Container.php [new file with mode: 0644]
tine20/Expressomail/Frontend/WebDAV/Directory.php [new file with mode: 0644]
tine20/Expressomail/Frontend/WebDAV/File.php [new file with mode: 0644]
tine20/Expressomail/HTMLPurifier/AttrTransform/AValidator.php [new file with mode: 0644]
tine20/Expressomail/HTMLPurifier/URIFilter/TransformURI.php [new file with mode: 0644]
tine20/Expressomail/Java/ExpressoCertMail-all.jar [new file with mode: 0644]
tine20/Expressomail/Mail.php [new file with mode: 0644]
tine20/Expressomail/Message.php [new file with mode: 0644]
tine20/Expressomail/Model/Account.php [new file with mode: 0644]
tine20/Expressomail/Model/AccountFilter.php [new file with mode: 0644]
tine20/Expressomail/Model/Filter/DateTime.php [new file with mode: 0644]
tine20/Expressomail/Model/Folder.php [new file with mode: 0644]
tine20/Expressomail/Model/FolderFilter.php [new file with mode: 0644]
tine20/Expressomail/Model/Message.php [new file with mode: 0644]
tine20/Expressomail/Model/MessageFilter.php [new file with mode: 0644]
tine20/Expressomail/Model/PreparedMessagePart.php [new file with mode: 0644]
tine20/Expressomail/Model/Sieve/Rule.php [new file with mode: 0644]
tine20/Expressomail/Model/Sieve/Vacation.php [new file with mode: 0644]
tine20/Expressomail/Preference.php [new file with mode: 0644]
tine20/Expressomail/Protocol/Imap.php [new file with mode: 0644]
tine20/Expressomail/Record/SearchTotalCountInterface.php [new file with mode: 0644]
tine20/Expressomail/Record/SearchTotalCountRecordSet.php [new file with mode: 0644]
tine20/Expressomail/Session.php [new file with mode: 0644]
tine20/Expressomail/Setup/Initialize.php [new file with mode: 0644]
tine20/Expressomail/Setup/Update/Release0.php [new file with mode: 0644]
tine20/Expressomail/Setup/setup.xml [new file with mode: 0644]
tine20/Expressomail/Sieve/Backend/Abstract.php [new file with mode: 0644]
tine20/Expressomail/Sieve/Backend/Script.php [new file with mode: 0644]
tine20/Expressomail/Sieve/Backend/Sql.php [new file with mode: 0644]
tine20/Expressomail/Sieve/Rule.php [new file with mode: 0644]
tine20/Expressomail/Sieve/Rule/Action.php [new file with mode: 0644]
tine20/Expressomail/Sieve/Rule/Condition.php [new file with mode: 0644]
tine20/Expressomail/Sieve/Vacation.php [new file with mode: 0644]
tine20/Expressomail/Smime.php [new file with mode: 0644]
tine20/Expressomail/Transport.php [new file with mode: 0644]
tine20/Expressomail/css/Expressomail.css [new file with mode: 0644]
tine20/Expressomail/css/editorplugins/googiespell.css [new file with mode: 0644]
tine20/Expressomail/images/decrypted.png [new file with mode: 0755]
tine20/Expressomail/images/editorplugins/blank.gif [new file with mode: 0644]
tine20/Expressomail/images/editorplugins/change_lang.gif [new file with mode: 0644]
tine20/Expressomail/images/editorplugins/indicator.gif [new file with mode: 0644]
tine20/Expressomail/images/editorplugins/ok.gif [new file with mode: 0644]
tine20/Expressomail/images/editorplugins/spellc.gif [new file with mode: 0644]
tine20/Expressomail/images/editorplugins/spellc.png [new file with mode: 0644]
tine20/Expressomail/images/encrypted.png [new file with mode: 0755]
tine20/Expressomail/js/AccountEditDialog.js [new file with mode: 0644]
tine20/Expressomail/js/AclsEditDialog.js [new file with mode: 0644]
tine20/Expressomail/js/AclsGrid.js [new file with mode: 0644]
tine20/Expressomail/js/AddressbookGridPanelHook.js [new file with mode: 0644]
tine20/Expressomail/js/AdminPanel.js [new file with mode: 0644]
tine20/Expressomail/js/ComposeEditor.js [new file with mode: 0644]
tine20/Expressomail/js/ContactGrid.js [new file with mode: 0644]
tine20/Expressomail/js/ContactSearchCombo.js [new file with mode: 0644]
tine20/Expressomail/js/Expressomail.js [new file with mode: 0644]
tine20/Expressomail/js/FileUploadGrid.js [new file with mode: 0644]
tine20/Expressomail/js/FolderFilterModel.js [new file with mode: 0644]
tine20/Expressomail/js/FolderSelect.js [new file with mode: 0644]
tine20/Expressomail/js/FolderSelectPanel.js [new file with mode: 0644]
tine20/Expressomail/js/FolderStore.js [new file with mode: 0644]
tine20/Expressomail/js/GridDetailsPanel.js [new file with mode: 0644]
tine20/Expressomail/js/GridPanel.js [new file with mode: 0644]
tine20/Expressomail/js/GridPanelHook.js [new file with mode: 0644]
tine20/Expressomail/js/ImportEmlDialog.js [new file with mode: 0644]
tine20/Expressomail/js/MessageDisplayDialog.js [new file with mode: 0644]
tine20/Expressomail/js/MessageEditDialog.js [new file with mode: 0644]
tine20/Expressomail/js/MimeDisplayManager.js [new file with mode: 0644]
tine20/Expressomail/js/Model.js [new file with mode: 0644]
tine20/Expressomail/js/MultiWindow.js [new file with mode: 0644]
tine20/Expressomail/js/ReadConfirmationDetailsPanel.js [new file with mode: 0644]
tine20/Expressomail/js/RecipientGrid.js [new file with mode: 0644]
tine20/Expressomail/js/RecipientPickerDialog.js [new file with mode: 0644]
tine20/Expressomail/js/RecipientPickerFavoritePanel.js [new file with mode: 0644]
tine20/Expressomail/js/SignatureAppletPanel.js [new file with mode: 0644]
tine20/Expressomail/js/TreeContextMenu.js [new file with mode: 0644]
tine20/Expressomail/js/TreeLoader.js [new file with mode: 0644]
tine20/Expressomail/js/TreeLoaderSieve.js [new file with mode: 0644]
tine20/Expressomail/js/TreePanel.js [new file with mode: 0644]
tine20/Expressomail/js/editorplugins/Ext.ux.form.HtmlEditor.SpellChecker.js [new file with mode: 0644]
tine20/Expressomail/js/editorplugins/Ext.ux.form.HtmlEditor.Table.js [new file with mode: 0644]
tine20/Expressomail/js/editorplugins/Ext.ux.form.HtmlEditor.TextAlign.js [new file with mode: 0644]
tine20/Expressomail/js/editorplugins/Ext.ux.form.HtmlEditor.UploadImage.js [new file with mode: 0644]
tine20/Expressomail/js/editorplugins/HtmlEditor.js [new file with mode: 0644]
tine20/Expressomail/js/sieve/RuleConditionsPanel.js [new file with mode: 0644]
tine20/Expressomail/js/sieve/RuleEditDialog.js [new file with mode: 0644]
tine20/Expressomail/js/sieve/RulesDialog.js [new file with mode: 0644]
tine20/Expressomail/js/sieve/RulesGridPanel.js [new file with mode: 0644]
tine20/Expressomail/js/sieve/VacationEditDialog.js [new file with mode: 0644]
tine20/Expressomail/translations/de.po [new file with mode: 0644]
tine20/Expressomail/translations/en.po [new file with mode: 0644]
tine20/Expressomail/translations/es.po [new file with mode: 0644]
tine20/Expressomail/translations/pt_BR.po [new file with mode: 0644]
tine20/Expressomail/translations/template.pot [new file with mode: 0644]
tine20/Tinebase/Helper.php
tine20/Zend/Mail/Storage.php [new file with mode: 0644]

diff --git a/tests/tine20/Expressomail/AllTests.php b/tests/tine20/Expressomail/AllTests.php
new file mode 100755 (executable)
index 0000000..6e45c2e
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schüle <p.schuele@metaways.de>
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+class Expressomail_AllTests
+{
+    /**
+     * run Felamimail tests
+     *
+     */
+    public static function main()
+    {
+        PHPUnit_TextUI_TestRunner::run(self::suite());
+    }
+    
+    /**
+     * get all Felamimail test suites 
+     *
+     * @return PHPUnit_Framework_TestSuite
+     */
+    public static function suite()
+    {
+        $suite = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail All Tests');
+        
+        // only call Felamimail tests if imap is configured in config.inc.php
+        $imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
+        if (! empty($imapConfig) && array_key_exists('useSystemAccount', $imapConfig) && $imapConfig['useSystemAccount']) {
+#           $suite->addTestSuite('Expressomail_Controller_Cache_MessageTest');
+            $suite->addTestSuite('Expressomail_JsonTest');
+#           $suite->addTestSuite('Expressomail_Controller_FolderTest');
+#           $suite->addTestSuite('Expressomail_Controller_MessageTest');
+#           $suite->addTestSuite('Expressomail_Controller_AccountTest');
+#           $suite->addTestSuite('Expressomail_Model_MessageTest');
+#           $suite->addTestSuite('Expressomail_Model_AccountTest');
+        }
+#        $suite->addTestSuite('Expressomail_Sieve_Backend_ScriptTest');
+        
+        return $suite;
+    }
+}
diff --git a/tests/tine20/Expressomail/Controller/AccountTest.php b/tests/tine20/Expressomail/Controller/AccountTest.php
new file mode 100755 (executable)
index 0000000..083fe5f
--- /dev/null
@@ -0,0 +1,219 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schüle <p.schuele@metaways.de>
+ * 
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Felamimail_Controller_Account
+ */
+class Expressomail_Controller_AccountTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Felamimail_Controller_Account
+     */
+    protected $_controller = array();
+    
+    /**
+     * @var Felamimail_Model_Account
+     */
+    protected $_account = NULL;
+    
+    /**
+     * folders to delete in tearDown
+     * 
+     * @var array
+     */
+    protected $_foldersToDelete = array();
+    
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail Account Controller Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+        Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
+        
+        $this->_controller = Expressomail_Controller_Account::getInstance();
+        $this->_account = $this->_controller->search()->getFirstRecord();
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+        foreach ($this->_foldersToDelete as $foldername) {
+            try {
+                Expressomail_Controller_Folder::getInstance()->delete($this->_account->getId(), $foldername);
+            } catch (Expressomail_Exception_IMAP $fei) {
+                // do nothing
+            }
+        }
+        
+        Tinebase_TransactionManager::getInstance()->rollBack();
+    }
+    
+    /**
+     * set new password & credentials
+     * 
+     * @param string $_username
+     * @param string $_password
+     */
+    protected function _setCredentials($_username, $_password)
+    {
+        Tinebase_User::getInstance()->setPassword(Tinebase_Core::getUser(), $_password, true, false);
+        
+        $oldCredentialCache = Tinebase_Core::get(Tinebase_Core::USERCREDENTIALCACHE);
+        
+        // update credential cache
+        $credentialCache = Tinebase_Auth_CredentialCache::getInstance()->cacheCredentials($_username, $_password);
+        Tinebase_Core::set(Tinebase_Core::USERCREDENTIALCACHE, $credentialCache);
+        $event = new Tinebase_Event_User_ChangeCredentialCache($oldCredentialCache);
+        Tinebase_Event::fireEvent($event);
+    }
+
+    /**
+     * check if default account pref is set
+     */
+    public function testDefaultAccountPreference()
+    {
+        $this->assertEquals($this->_account->getId(), Tinebase_Core::getPreference('Expressomail')->{Expressomail_Preference::DEFAULTACCOUNT}, 'current account is not the default account');
+        
+        $userAccount = clone($this->_account);
+        unset($userAccount->id);
+        $userAccount->type = Expressomail_Model_Account::TYPE_USER;
+        $userAccount = $this->_controller->create($userAccount);
+
+        // deleting original account and check if user account is new default account
+        $this->_controller->delete($this->_account->getId());
+        $this->assertEquals($userAccount->getId(), Tinebase_Core::getPreference('Expressomail')->{Expressomail_Preference::DEFAULTACCOUNT}, 'other account is not default account');
+    }
+    
+    /**
+     * test account capabilities
+     */
+    public function testGetAccountCapabilities()
+    {
+        $capabilities = $this->_controller->updateCapabilities($this->_account);
+        $account = $this->_controller->get($this->_account);
+        $accountToString = print_r($this->_account->toArray(), TRUE);
+        
+        $this->assertEquals('', $account->ns_personal, $accountToString);
+        $this->assertEquals(1, preg_match('@/|\.@', $account->delimiter), $accountToString);
+        
+        $this->assertTrue(in_array('IMAP4', $capabilities['capabilities']) || in_array('IMAP4rev1', $capabilities['capabilities']), 
+            'no IMAP4(rev1) capability found in ' . print_r($capabilities['capabilities'], TRUE));
+        $this->assertTrue(in_array('QUOTA', $capabilities['capabilities']), 'no QUOTA capability found in ' . print_r($capabilities['capabilities'], TRUE));
+        
+        $this->assertEquals($capabilities, Tinebase_Helper::array_value($this->_account->getId(), Expressomail_Session::getSessionNamespace()->account));
+    }
+
+    /**
+     * test reset account capabilities
+     */
+    public function testResetAccountCapabilities()
+    {
+        $capabilities = $this->_controller->updateCapabilities($this->_account);
+        
+        $account = clone($this->_account);
+        $account->host = 'unittest.org';
+        $account->type = Expressomail_Model_Account::TYPE_USER;
+        $this->_controller->update($account);
+        
+        $this->assertFalse(array_key_exists($this->_account->getId(), Expressomail_Session::getSessionNamespace()->account), print_r(Expressomail_Session::getSessionNamespace()->account, TRUE));
+    }
+    
+    /**
+     * test create trash on the fly
+     */
+    public function testCreateTrashOnTheFly()
+    {
+        // make sure that the delimiter is correct / fetched from server
+        $capabilities = $this->_controller->updateCapabilities($this->_account);\r
+        
+        // set another trash folder
+        $this->_account->trash_folder = 'newtrash';
+        $this->_foldersToDelete[] = 'newtrash';
+        $accountBackend = new Expressomail_Backend_Account();
+        $account = $accountBackend->update($this->_account);
+        $newtrash = $this->_controller->getSystemFolder($account, Expressomail_Model_Folder::FOLDER_TRASH);
+    }
+
+    /**
+     * test change pw + credential cache
+     */
+    public function testChangePasswordAndUpdateCredentialCache()
+    {
+        $testConfig = Zend_Registry::get('testConfig');
+        
+        $account = clone($this->_account);
+        unset($account->id);
+        $account->type = Expressomail_Model_Account::TYPE_USER;
+        $account->user = $testConfig->username;
+        $imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
+        if (isset($imapConfig['domain']) && ! empty($imapConfig['domain'])) {
+            $account->user .= '@' . $imapConfig['domain'];
+        }
+        $account->password = $testConfig->password;
+        $account = $this->_controller->create($account);
+        
+        $testPw = 'testpwd';
+        
+        // change pw & update credential cache
+        $this->_setCredentials($testConfig->username, $testPw);
+        $account = $this->_controller->get($account->getId());
+
+        // try to connect to imap
+        $loginSuccessful = TRUE;
+        try {
+            $imap = Expressomail_Backend_ImapFactory::factory($account);
+            $imapAccountConfig = $account->getImapConfig();
+            $imap->connectAndLogin((object)$imapAccountConfig);
+        } catch (Expressomail_Exception_IMAPInvalidCredentials $e) {
+            $loginSuccessful = FALSE;
+        }
+        
+        $this->assertTrue($loginSuccessful, 'wrong credentials');
+    }
+    
+    /**
+     * testEmptySignature
+     * 
+     * @see 0006666: Signature delimeter not removed if no Signature is used
+     */
+    public function testEmptySignature()
+    {
+        $this->_account->signature = '<html><body><div><br /></div><p>   </p>&nbsp;<br /></body></html>';
+        $account = $this->_controller->update($this->_account);
+        
+        $this->assertEquals('', $account->signature, 'did not save empty signature');
+    }
+}
diff --git a/tests/tine20/Expressomail/Controller/Cache/MessageTest.php b/tests/tine20/Expressomail/Controller/Cache/MessageTest.php
new file mode 100755 (executable)
index 0000000..ed8bd9a
--- /dev/null
@@ -0,0 +1,366 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schüle <p.schuele@metaways.de>
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Felamimail_Controller_Cache_*
+ */
+class Expressomail_Controller_Cache_MessageTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Felamimail_Controller_Cache_Message
+     */
+    protected $_controller = NULL;
+    
+    /**
+     * @var Felamimail_Backend_Imap
+     */
+    protected $_imap = NULL;
+    
+    /**
+     * @var Felamimail_Model_Account
+     */
+    protected $_account = NULL;
+    
+    /**
+     * @var Felamimail_Model_Folder
+     */
+    protected $_folder = NULL;
+    
+    /**
+     * 
+     * @var Felamimail_Controller_MessageTest
+     */
+    protected $_emailTestClass;
+    
+    /**
+     * name of the folder to use for tests
+     * @var string
+     */
+    protected $_testFolderName = 'Junk';
+    
+    /**
+     * delete messages with this header in tearDown
+     * 
+     * @var string
+     */
+    protected $_headerValueToDelete = NULL;
+    
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail Message Cache Controller Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+        // get (or create) test accout
+        $this->_account = Expressomail_Controller_Account::getInstance()->search()->getFirstRecord();
+        
+        // init controller and imap backend
+        $this->_controller = Felamimail_Controller_Cache_Message::getInstance();
+        $this->_imap = Expressomail_Backend_ImapFactory::factory($this->_account);
+        try {
+            $this->_imap->createFolder($this->_testFolderName, '', $this->_account->delimiter);
+        } catch (Zend_Mail_Storage_Exception $zmse) {
+            // exists
+        }
+        $this->_imap->selectFolder($this->_testFolderName);
+        
+        // init folder cache and get INBOX
+        //Expressomail_Controller_Cache_Folder::getInstance()->update($this->_account->getId());
+        
+        $this->_folder = $this->_getFolder($this->_testFolderName);
+        
+        $this->_emailTestClass = new Expressomail_Controller_MessageTest();
+        $this->_emailTestClass->setup();
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+        if ($this->_emailTestClass instanceof Expressomail_Controller_MessageTest) {
+            $this->_emailTestClass->tearDown();
+        }
+        
+        if ($this->_headerValueToDelete !== NULL) {
+            $result = $this->_imap->search(array(
+                $this->_headerValueToDelete
+            ));
+            foreach($result as $messageUid) {
+                $this->_imap->removeMessage($messageUid);
+            }
+        }
+    }
+    
+    /**
+     * test clear message cache
+     *
+     */
+    public function testClear()
+    {
+        $this->_controller->clear($this->_folder);
+        
+        $messageCacheBackend = new Expressomail_Backend_Cache_Sql_Message();
+        $count = $messageCacheBackend->searchCountByFolderId($this->_folder->getId());
+        
+        // check if empty
+        $this->assertEquals(0, $count);
+        $this->assertEquals(Expressomail_Model_Folder::CACHE_STATUS_EMPTY, $this->_folder->cache_status);
+        $this->assertEquals(0, $this->_folder->cache_job_actions_est);
+    }
+
+    /**
+     * test update message cache
+     *
+     */
+    public function testUpdateCache()
+    {
+        // update message cache
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        
+        // check folder status after update
+        if ($updatedFolder->cache_status == Expressomail_Model_Folder::CACHE_STATUS_COMPLETE) {
+            $this->assertEquals($updatedFolder->imap_totalcount, $updatedFolder->cache_totalcount, 'totalcounts should be equal');
+            $this->assertGreaterThan(-1, Tinebase_DateTime::now()->compare($updatedFolder->cache_timestamp), 'timestamp incorrect'); // later or equals
+            $this->assertEquals(0, $updatedFolder->cache_job_actions_done, 'done/estimate wrong');
+            $this->assertEquals(0, $updatedFolder->cache_job_actions_est, 'done/estimate wrong');
+        } else if ($updatedFolder->cache_status == Expressomail_Model_Folder::CACHE_STATUS_EMPTY) {
+            $this->assertEquals(0, $updatedFolder->cache_totalcount, 'cache should be empty');
+        } else {
+            $this->assertNotEquals($updatedFolder->imap_totalcount, $updatedFolder->cache_totalcount, 'totalcounts should not be equal: ' . print_r($updatedFolder->toArray(), TRUE));
+            $this->assertGreaterThan(-1, Tinebase_DateTime::now()->compare($updatedFolder->cache_timestamp), 'timestamp incorrect'); // later or equals
+            $this->assertNotEquals(0, $updatedFolder->cache_job_actions_done, 'done wrong');
+            $this->assertNotEquals(0, $updatedFolder->cache_job_actions_est, 'estimate wrong');
+        }
+    }
+
+    /**
+     * test update message cache, remove oldest mail on imap + add new
+     */
+    public function testUpdateCacheAgainRemoveOldest()
+    {
+        $this->_updateAgainHelper('oldest');
+    }
+    
+    /**
+     * test update message cache again, remove latest mail on imap + add new
+     */
+    public function testUpdateCacheAgainRemoveLatest()
+    {
+        $this->_updateAgainHelper('latest');
+    }
+    
+    /**
+     * helper function for update again tests
+     */
+    protected function _updateAgainHelper($_mode)
+    {
+        // add three messages to folder
+        for($i = 0; $i < 3; $i++) {
+            $this->_appendMessage('multipart_alternative.eml', $this->_testFolderName);
+        }
+        $this->_headerValueToDelete = 'HEADER X-Tine20TestMessage multipart/alternative';
+        
+        // update message cache
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 10, 1);
+        $loopCount = 1;
+        do {
+            $updatedFolder = $this->_controller->updateCache($this->_folder, 10, 1);
+            $loopCount++;
+        } while ($updatedFolder->cache_status != Expressomail_Model_Folder::CACHE_STATUS_COMPLETE && $loopCount < 10);
+        
+        $this->assertGreaterThan(0, $updatedFolder->cache_totalcount);
+        $this->assertNotEquals(10, $loopCount, 'should complete cache update with < 10 iterations.');
+        
+        $result = $this->_imap->search(array(
+            $this->_headerValueToDelete
+        ));
+        
+        if ($_mode == 'oldest') {
+            // now lets delete one message from folder and add another one
+            $this->_imap->removeMessage($result[0]);
+            $this->_appendMessage('multipart_alternative.eml', $this->_testFolderName);
+            $expected = $updatedFolder->cache_totalcount;
+        } else {
+            // just delete the newest message
+            $this->_imap->removeMessage($result[count($result) - 1]);
+            $expected = $updatedFolder->cache_totalcount - 1;
+        }
+        
+        $updatedFolderAgain = $this->_controller->updateCache($this->_folder, 30, 1);
+        $this->assertEquals($expected, $updatedFolderAgain->cache_totalcount);
+    }
+
+    /**
+     * test update of message cache counters only
+     */
+    public function testUpdateCountersOnly()
+    {
+        // update message cache
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        
+        $this->_appendMessage('multipart_alternative.eml', $this->_testFolderName);
+        $this->_headerValueToDelete = 'HEADER X-Tine20TestMessage multipart/alternative';
+        
+        // update message cache + check folder status after update
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 0);
+        $this->assertEquals(Expressomail_Model_Folder::CACHE_STATUS_INCOMPLETE, $updatedFolder->cache_status);
+        $this->assertNotEquals($updatedFolder->imap_totalcount, $updatedFolder->cache_totalcount, 'totalcounts should not be equal');
+        $this->assertGreaterThan(-1, Tinebase_DateTime::now()->compare($updatedFolder->cache_timestamp), 'timestamp incorrect'); // later or equals
+        $this->assertEquals(0, $updatedFolder->cache_job_actions_done, 'done wrong');
+        $this->assertNotEquals(0, $updatedFolder->cache_job_actions_est, 'estimate wrong');
+    }
+
+    /**
+     * test message cache unread counter sanitizing
+     */
+    public function testFolderCounterSanitizing()
+    {
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        $unreadcount = $updatedFolder->cache_unreadcount;
+        
+        // change unreadcount of folder
+        Expressomail_Controller_Folder::getInstance()->updateFolderCounter($updatedFolder, array('cache_unreadcount' => '+1'));
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        $this->assertEquals($unreadcount, $updatedFolder->cache_unreadcount, 'unreadcount should have been sanitized');
+        
+        // add new unread message
+        $message = $this->_emailTestClass->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        $this->_imap->clearFlags($message->messageuid, array(Zend_Mail_Storage::FLAG_SEEN));
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        $this->assertEquals($unreadcount+1, $updatedFolder->cache_unreadcount, 'unreadcount should have been increased by 1');
+        
+        // mark message as seen twice
+        Expressomail_Controller_Message_Flags::getInstance()->addFlags($message, array(Zend_Mail_Storage::FLAG_SEEN));
+        Expressomail_Controller_Message_Flags::getInstance()->addFlags($message, array(Zend_Mail_Storage::FLAG_SEEN));
+        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        $this->assertEquals($unreadcount, $updatedFolder->cache_unreadcount, 'unreadcount should be the same as before');
+    }    
+    
+    /**
+     * get folder
+     *
+     * @return Felamimail_Model_Folder
+     */
+    protected function _getFolder($_folderName = null)
+    {
+        $folderName = ($_folderName !== null) ? $_folderName : $this->_testFolderName;
+        
+        $filter = new Expressomail_Model_FolderFilter(array(
+            array('field' => 'globalname', 'operator' => 'equals', 'value' => '',),
+            array('field' => 'account_id', 'operator' => 'equals', 'value' => $this->_account->getId())
+        ));
+        $result = Expressomail_Controller_Folder::getInstance()->search($filter);
+        $folder = $result->filter('localname', $folderName)->getFirstRecord();
+        if (empty($folder)) {
+            print_r($result->toArray());
+            throw new Exception('folder not found');
+        }
+
+        return $folder;
+    }
+    
+    /**
+     * append message (from given filename) to folder
+     *
+     * @param string $_filename
+     * @param string $_folder
+     */
+    protected function _appendMessage($_filename, $_folder)
+    {
+        $mailAsString = file_get_contents(dirname(dirname(dirname(__FILE__))) . '/files/' . $_filename);
+        Expressomail_Backend_ImapFactory::factory($this->_account->getId())
+            ->appendMessage($mailAsString, $_folder);
+    }
+    
+    /**
+     * test flag update
+     */
+    public function testUpdateFlags() 
+    {
+        $message = $this->_emailTestClass->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        // appended messages already have the SEEN flag
+        $this->assertTrue(in_array(Zend_Mail_Storage::FLAG_SEEN, $message->flags), 'SEEN flag not found: ' . print_r($message->flags, TRUE));
+        // add another flag
+        Expressomail_Controller_Message_Flags::getInstance()->addFlags($message, Zend_Mail_Storage::FLAG_ANSWERED);
+        
+        while (! isset($updatedFolder) || $updatedFolder->cache_status === Expressomail_Model_Folder::CACHE_STATUS_INCOMPLETE) {
+            $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        }
+        
+        // clear/add flag on imap
+        $this->_imap->clearFlags($message->messageuid, array(Zend_Mail_Storage::FLAG_SEEN));
+        $flagsToAdd = array(Zend_Mail_Storage::FLAG_FLAGGED, Zend_Mail_Storage::FLAG_DRAFT, Zend_Mail_Storage::FLAG_PASSED);
+        try {
+            $this->_imap->addFlags($message->messageuid, $flagsToAdd);
+        } catch (Zend_Mail_Storage_Exception $zmse) {
+            // some imap servers (dbmail, ...) do not support PASSED flag
+            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $zmse->getMessage());
+            $this->_imap->addFlags($message->messageuid,  array(Zend_Mail_Storage::FLAG_FLAGGED, Zend_Mail_Storage::FLAG_DRAFT));
+        }
+        
+        $this->_controller->updateFlags($updatedFolder);
+        
+        $cachedMessage = Expressomail_Controller_Message::getInstance()->get($message->getId());
+        $this->assertTrue(! in_array(Zend_Mail_Storage::FLAG_SEEN, $cachedMessage->flags),  'SEEN flag found: ' . print_r($cachedMessage->flags, TRUE));
+        
+        $expectedFlags = array(Zend_Mail_Storage::FLAG_FLAGGED, Zend_Mail_Storage::FLAG_DRAFT, Zend_Mail_Storage::FLAG_ANSWERED);
+        $this->assertEquals(3, count($cachedMessage->flags), 'found too many flags: ' . print_r($cachedMessage->flags, TRUE));
+        foreach ($expectedFlags as $expectedFlag) {
+            $this->assertTrue(in_array($expectedFlag, $cachedMessage->flags), $expectedFlag . ' flag not found: ' . print_r($cachedMessage->flags, TRUE));
+        }
+        
+        $this->_controller->updateFlags($updatedFolder);
+        $cachedMessageAgain = Expressomail_Controller_Message::getInstance()->get($message->getId());
+        // cached message should not have been updated again
+        $this->assertEquals($cachedMessage->timestamp->__toString(), $cachedMessageAgain->timestamp->__toString());
+    }
+
+    /**
+     * test update folder quota
+     */
+    public function testUpdateFolderQuota() 
+    {
+        $folderToTest = $this->_getFolder('INBOX');
+        $folderToTest = $this->_controller->updateCache($folderToTest);
+        
+        $quota = $this->_imap->getQuota('INBOX');
+        
+        if (empty($quota)) {
+            $this->assertEquals(0, $folderToTest->quota_usage);
+            $this->assertEquals(0, $folderToTest->quota_limit);
+        } else {
+            $this->assertEquals($quota['STORAGE']['usage'], $folderToTest->quota_usage);
+            $this->assertEquals($quota['STORAGE']['limit'], $folderToTest->quota_limit);
+        }
+    }
+}
diff --git a/tests/tine20/Expressomail/Controller/FolderTest.php b/tests/tine20/Expressomail/Controller/FolderTest.php
new file mode 100755 (executable)
index 0000000..c34025d
--- /dev/null
@@ -0,0 +1,269 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schüle <p.schuele@metaways.de>
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Felamimail_Controller_Folder
+ */
+class Expressomail_Controller_FolderTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Felamimail_Controller_Folder
+     */
+    protected $_controller = array();
+    
+    /**
+     * @var Felamimail_Model_Account
+     */
+    protected $_account = NULL;
+    
+    /**
+     * @var Felamimail_Backend_Imap
+     */
+    protected $_imap = NULL;
+    
+    /**
+     * folders to delete in tearDown()
+     * 
+     * @var array
+     */
+    protected $_createdFolders = array();
+    
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Felamimail Folder Controller Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+        $this->_account = Expressomail_Controller_Account::getInstance()->search()->getFirstRecord();
+        $this->_controller = Expressomail_Controller_Folder::getInstance();
+        $this->_imap       = Expressomail_Backend_ImapFactory::factory($this->_account);
+        
+        // fill folder cache first
+        $this->_controller->search($this->_getFolderFilter(''));
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+        foreach ($this->_createdFolders as $foldername) {
+            $this->_controller->delete($this->_account->getId(), $foldername);
+        }
+        
+        // delete all remaining folders from cache of account
+        $folderBackend = new Expressomail_Backend_Folder();
+        // TODO delete folders
+        $folders = array();
+        foreach ($folders as $folder) {
+            $folderBackend->delete($folder);
+        }
+    }
+
+    /**
+     * get folders from the server
+     */
+    public function testGetFolders()
+    {
+        $inboxFolder = $this->_getInbox();
+        
+        $this->assertFalse($inboxFolder === NULL, 'inbox not found');
+        $this->assertTrue(($inboxFolder->is_selectable == 1), 'should be selectable');
+        $this->assertTrue(($inboxFolder->has_children == 0), 'has children');
+        
+        // check if entry is created/exists in db
+        $folder = $this->_controller->getByBackendAndGlobalName($this->_account->getId(), 'INBOX');
+        //print_r($folder->toArray());
+        $this->assertTrue(!empty($folder->id));
+        $this->assertEquals('INBOX', $folder->localname);
+    }
+    
+    /**
+     * returns inbox
+     * 
+     * @return Felamimail_Model_Folder
+     */
+    protected function _getInbox()
+    {
+        $result = $this->_controller->search($this->_getFolderFilter(''));
+        $this->assertGreaterThan(0, count($result));
+        
+        // get inbox folder and do more checks
+        $inboxFolder = $result->filter('localname', 'INBOX')->getFirstRecord();
+        return $inboxFolder;
+    }
+    
+    /**
+     * create a mail folder on the server
+     */
+    public function testCreateFolder()
+    {
+        $this->_createdFolders[] = 'INBOX' . $this->_account->delimiter . 'test';
+        $newFolder = $this->_controller->create($this->_account->getId(), 'test', 'INBOX');
+
+        // check returned data (id)
+        $this->assertTrue(!empty($newFolder->id));
+        $this->assertEquals('INBOX' . $this->_account->delimiter . 'test', $newFolder->globalname);
+        
+        // get inbox folder and do more checks -> inbox should have children now
+        $result = $this->_controller->search($this->_getFolderFilter(''));
+        $inboxFolder = $result->filter('localname', 'INBOX')->getFirstRecord();
+        $this->assertTrue($inboxFolder->has_children == 1);
+        
+        // search for subfolders
+        $resultInboxSub = $this->_controller->search($this->_getFolderFilter());
+        
+        $this->assertGreaterThan(0, count($resultInboxSub), 'No subfolders found.');
+        $testFolder = $resultInboxSub->filter('localname', 'test')->getFirstRecord();
+        
+        $this->assertFalse($testFolder === NULL, 'No test folder created.');
+        $this->assertTrue(($testFolder->is_selectable == 1));
+    }
+
+    /**
+     * rename mail folder
+     */
+    public function testRenameFolder()
+    {
+        $this->_createdFolders[] = 'INBOX' . $this->_account->delimiter . 'test';
+        $this->_controller->create($this->_account->getId(), 'test', 'INBOX');
+
+        $this->_createdFolders = array('INBOX' . $this->_account->delimiter . 'test_renamed');
+        $renamedFolder = $this->_controller->rename($this->_account->getId(), 'test_renamed', 'INBOX' . $this->_account->delimiter . 'test');
+        
+        $this->_checkFolder($renamedFolder);
+    }
+    
+    /**
+     * check folder
+     * 
+     * @param Felamimail_Model_Folder $_folder
+     */
+    protected function _checkFolder($_folder)
+    {
+        $this->assertEquals('test_renamed', $_folder->localname);
+        
+        $resultInboxSub = $this->_controller->search($this->_getFolderFilter());
+        $this->assertGreaterThan(0, count($resultInboxSub), 'No subfolders found.');
+        $testFolder = $resultInboxSub->filter('localname', $_folder->localname)->getFirstRecord();
+        
+        $this->assertFalse($testFolder === NULL, 'No folder found.');
+        $this->assertTrue(($testFolder->is_selectable == 1));
+    }
+
+    /**
+     * rename mail folder directly on the server (i.e. another client) and try to rename it with tine
+     */
+    public function testRenameFolderByAnotherClient()
+    {
+        $testFolderName = 'INBOX' . $this->_account->delimiter . 'test';
+        $this->_controller->create($this->_account->getId(), 'test', 'INBOX');
+        $this->_imap->renameFolder($testFolderName, $testFolderName . '_renamed');
+        
+        $this->_createdFolders = array($testFolderName . '_renamed');
+        
+        $this->setExpectedException('Expressomail_Exception_IMAPFolderNotFound');
+        $renamedFolder = $this->_controller->rename($this->_account->getId(), $testFolderName, $testFolderName);
+    }
+    
+    /**
+     * rename mail folder on the server
+     */
+    public function testRenameFolderWithSubfolder()
+    {
+        $this->_controller->create($this->_account->getId(), 'test', 'INBOX');
+        $this->_controller->create($this->_account->getId(), 'testsub', 'INBOX' . $this->_account->delimiter . 'test');
+
+        $renamedFolder = $this->_controller->rename($this->_account->getId(), 'test_renamed', 'INBOX' . $this->_account->delimiter . 'test');
+
+        $this->_createdFolders[] = 'INBOX' . $this->_account->delimiter . 'test_renamed' . $this->_account->delimiter . 'testsub';
+        $this->_createdFolders[] = 'INBOX' . $this->_account->delimiter . 'test_renamed';
+        
+        $this->assertEquals('test_renamed', $renamedFolder->localname);
+        
+        $resultTestSub = $this->_controller->search($this->_getFolderFilter('INBOX' . $this->_account->delimiter . 'test'));
+        $this->assertGreaterThan(0, count($resultTestSub), 'No subfolders found.');
+        $testFolder = $resultTestSub->filter('localname', 'testsub')->getFirstRecord();
+        
+        //print_r($testFolder->toArray());
+        $this->assertFalse($testFolder === NULL, 'No renamed folder found.');
+        $this->assertTrue(($testFolder->is_selectable == 1));
+        $this->assertEquals('INBOX' . $this->_account->delimiter . 'test_renamed' . $this->_account->delimiter . 'testsub', $testFolder->globalname);
+    }
+
+    /**
+     * rename mail folder on the server and create a subfolder afterwards
+     */
+    public function testRenameFolderAndCreateSubfolder()
+    {
+        $this->_controller->create($this->_account->getId(), 'test', 'INBOX');
+
+        $renamedFolder = $this->_controller->rename($this->_account->getId(), 'test_renamed', 'INBOX' . $this->_account->delimiter . 'test');
+
+        $this->_createdFolders[] = 'INBOX' . $this->_account->delimiter . 'test_renamed' . $this->_account->delimiter . 'testsub';
+        $this->_createdFolders[] = 'INBOX' . $this->_account->delimiter . 'test_renamed';
+
+        $subfolder = $this->_controller->create($this->_account->getId(), 'testsub', 'INBOX' . $this->_account->delimiter . 'test_renamed');
+        
+        $this->assertEquals('INBOX' . $this->_account->delimiter . 'test_renamed' . $this->_account->delimiter . 'testsub', $subfolder->globalname);
+    }
+    
+    /**
+     * folder counts test helper
+     * 
+     * @param Felamimail_Model_Folder $_folder
+     * @param array $_newCounters
+     * @param array $_expectedValues
+     */
+    protected function _folderCountsTestHelper($_folder, $_newCounters, $_expectedValues)
+    {
+        $updatedFolder = $this->_controller->updateFolderCounter($_folder, $_newCounters);
+        foreach ($_expectedValues as $key => $value) {
+            $this->assertEquals($value, $updatedFolder->{$key}, $key . ' does not match.');
+        }
+        $folderInDb = $this->_controller->get($_folder->getId());
+        $this->assertTrue($updatedFolder->toArray() == $folderInDb->toArray(), 'folder values do not match');
+    }
+    
+    /**
+     * get folder filter
+     *
+     * @return Felamimail_Model_FolderFilter
+     */
+    protected function _getFolderFilter($_globalname = 'INBOX')
+    {
+        return new Expressomail_Model_FolderFilter(array(
+            array('field' => 'globalname', 'operator' => 'equals', 'value' => $_globalname),
+            array('field' => 'account_id', 'operator' => 'equals', 'value' => $this->_account->getId())
+        ));
+    }
+}
diff --git a/tests/tine20/Expressomail/Controller/MessageTest.php b/tests/tine20/Expressomail/Controller/MessageTest.php
new file mode 100755 (executable)
index 0000000..6ee08a1
--- /dev/null
@@ -0,0 +1,1514 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ *
+ * @package     Expressomail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2009-2014 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @copyright   Copyright (c) 2014 Serpro (http://www.serpro.gov.br)
+ * @author      Flávio Gomes da Silva Lisboa <flavio.lisboa@serpro.gov.br>
+ *
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Expressomail_Controller
+ */
+class Expressomail_Controller_MessageTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Felamimail_Controller_Message
+     */
+    protected $_controller = NULL;
+    
+    /**
+     * @var Felamimail_Model_Account
+     */
+    protected $_account = NULL;
+    
+    /**
+     * keep track of created messages
+     *
+     * @var Tinebase_Record_RecordSet
+     */
+    protected $_createdMessages;
+    
+    /**
+     * @var Felamimail_Backend_Imap
+     */
+    protected $_imap = NULL;
+    
+    /**
+     * @var Felamimail_Model_Folder
+     */
+    protected $_folder = NULL;
+    
+    /**
+     * name of the folder to use for tests
+     * @var string
+     */
+    protected $_testFolderName = 'Junk';
+    
+    /**
+     * accounts to delete in tearDown
+     *
+     * @var array
+     */
+    protected $_accountsToDelete = array();
+    
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail Message Controller Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+        $this->_account    = Expressomail_Controller_Account::getInstance()->search()->getFirstRecord();
+        $this->_controller = Expressomail_Controller_Message::getInstance();
+        $this->_imap       = Expressomail_Backend_ImapFactory::factory($this->_account);
+        
+        $this->_folder     = $this->getFolder($this->_testFolderName);
+        $this->_imap->selectFolder($this->_testFolderName);
+        $this->_createdMessages = new Tinebase_Record_RecordSet('Expressomail_Model_Message');
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+        try {
+            Expressomail_Controller_Message_Flags::getInstance()->addFlags($this->_createdMessages, array(Zend_Mail_Storage::FLAG_DELETED));
+        } catch (Zend_Mail_Storage_Exception $zmse) {
+            // do nothing
+        }
+        
+        foreach ($this->_accountsToDelete as $account) {
+            Expressomail_Controller_Account::getInstance()->delete($account);
+        }
+    }
+
+    /********************************* test funcs *************************************/
+    
+    /**
+     * test getting multiple messages
+     */
+    public function testGetMultipleMessages()
+    {
+        $message1 = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+        $message2 = $this->messageTestHelper('text_plain.eml', 'text/plain');
+        
+        $messages = $this->_controller->getMultiple(array(
+            $message1->getId(),
+            $message2->getId()
+        ));
+        
+        $this->assertEquals(2, count($messages));
+    }
+    
+    /**
+     * test search with cache
+     * - test text_plain.eml message
+     * - test from header
+     */
+    public function testSearchWithCache()
+    {
+        // get inbox folder id
+        Expressomail_Controller_Folder::getInstance()->update($this->_account->getId());
+        $folderBackend = new Expressomail_Backend_Folder();
+        $folder = Expressomail_Controller_Folder::getInstance()->getByBackendAndGlobalName($this->_account->getId(), $this->_testFolderName);
+        
+        // clear empty folder
+        Expressomail_Controller_Folder::getInstance()->emptyFolder($folder->getId());
+        
+        // append message
+        $this->_appendMessage('text_plain.eml', $this->_folder);
+        
+        // search messages in test folder
+        $result = $this->_controller->search($this->_getFilter($folder->getId()));
+        
+        //print_r($result->toArray());
+        
+        // check result
+        $firstMessage = $result->getFirstRecord();
+        $this->_createdMessages->addRecord($firstMessage);
+
+        $this->assertGreaterThan(0, count($result));
+        $this->assertEquals($folder->getId(), $firstMessage->folder_id);
+        $this->assertEquals("Re: [gentoo-dev] `paludis --info' is not like `emerge --info'", $firstMessage->subject);
+        $this->assertEquals('Pipping, Sebastian (Luxembourg)', $firstMessage->from_name);
+        $this->assertEquals('webmaster@changchung.org', $firstMessage->from_email);
+        $this->assertEquals(array('gentoo-dev@lists.gentoo.org', 'webmaster@changchung.org') , $firstMessage->to);
+    }
+    
+    /**
+     * testBodyStructureTextPlain
+     */
+    public function testBodyStructureTextPlain()
+    {
+        $expectedStructure = array(
+            'partId'      => 1,
+            'contentType' => 'text/plain',
+            'type'        => 'text',
+            'subType'     => 'plain',
+            'parameters'  => array (
+                'charset' => 'ISO-8859-1'
+            ),
+            'id'          => '',
+            'description' => '',
+            'encoding'    => '7bit',
+            'size'        => 388,
+            'disposition' => '',
+            'language'    => '',
+            'location'    => '',
+            
+        );
+
+        $message = $this->messageTestHelper('text_plain.eml', 'text/plain');
+        
+        $lines = $message['structure']['lines'];
+        $structure = $message['structure'];
+        unset($structure['lines']);
+        
+        $this->assertEquals($expectedStructure, $structure, 'structure does not match');
+        // dbmail always has one more line than dovecot
+        $this->assertTrue(in_array($lines, array(17, 18)));
+    }
+    
+    /**
+     * testBodyStructureMultipartAlternative
+     */
+    public function testBodyStructureMultipartAlternative()
+    {
+        $expectedStructure = array(
+            'partId'      => null,
+            'contentType' => 'multipart/alternative',
+            'type'        => 'multipart',
+            'subType'     => 'alternative',
+            'parts'       => array(
+                1 => array(
+                    'partId'      => 1,
+                    'contentType' => 'text/plain',
+                    'type'        => 'text',
+                    'subType'     => 'plain',
+                    'parameters'  => array (
+                        'charset' => 'iso-8859-1'
+                    ),
+                    'id'          => '',
+                    'description' => '',
+                    'encoding'    => 'quoted-printable',
+                    'size'        => 1726,
+                    'disposition' => '',
+                    'language'    => '',
+                    'location'    => '',
+                ),
+                2 => array(
+                    'partId'      => 2,
+                    'contentType' => 'text/html',
+                    'type'        => 'text',
+                    'subType'     => 'html',
+                    'parameters'  => array (
+                        'charset' => 'iso-8859-1'
+                    ),
+                    'id'          => '',
+                    'description' => '',
+                    'encoding'    => 'quoted-printable',
+                    'size'        => 10713,
+                    'disposition' => '',
+                    'language'    => '',
+                    'location'    => '',
+                )
+            ),
+            'parameters'  => array (
+                'boundary' => '=_m192h4woyec67braywzx'
+            ),
+            'disposition' => '',
+            'language'    => '',
+            'location'    => '',
+            
+        );
+        
+        $message = $this->messageTestHelper('multipart_alternative.eml', 'multipart/alternative');
+        $structure = $message['structure'];
+        $lines = $this->_getLinesFromPartsAndRemoveFromStructure($structure);
+        
+        $this->assertEquals($expectedStructure, $structure, 'structure does not match');
+        $this->assertTrue(in_array($lines[1], array(49, 50)));
+        $this->assertTrue(in_array($lines[2], array(172, 173)));
+    }
+    
+    /**
+     * get lines from structure parts and remove them from structure array
+     *
+     * @param array $_structure
+     * @return array
+     */
+    protected function _getLinesFromPartsAndRemoveFromStructure(&$_structure)
+    {
+        $lines = array();
+        foreach ($_structure['parts'] as $key => $part) {
+            $lines[$key] = $part['lines'];
+            unset($_structure['parts'][$key]['lines']);
+        }
+        
+        return $lines;
+    }
+    
+    /**
+     * testBodyStructureMultipartMixed
+     */
+    public function testBodyStructureMultipartMixed()
+    {
+        $expectedStructure = array(
+            'partId'      => null,
+            'contentType' => 'multipart/mixed',
+            'type'        => 'multipart',
+            'subType'     => 'mixed',
+            'parts'       => array(
+                1 => array(
+                    'partId'      => 1,
+                    'contentType' => Expressomail_Model_Message::CONTENT_TYPE_PLAIN,
+                    'type'        => 'text',
+                    'subType'     => 'plain',
+                    'parameters'  => array (
+                        'charset' => 'us-ascii'
+                    ),
+                    'id'          => null,
+                    'description' => null,
+                    'encoding'    => '7bit',
+                    'size'        => 3896,
+                    'disposition' => array(
+                        'type'    => 'inline'
+                    ),
+                    'language'    => '',
+                    'location'    => '',
+                ),
+                2 => array(
+                    'partId'      => 2,
+                    'contentType' => Expressomail_Model_Message::CONTENT_TYPE_PLAIN,
+                    'type'        => 'text',
+                    'subType'     => 'plain',
+                    'parameters'  => array (
+                        'charset' => 'us-ascii'
+                    ),
+                    'id'          => '',
+                    'description' => '',
+                    'encoding'    => '7bit',
+                    'size'        => 2787,
+                    'disposition' => array(
+                        'type'    => 'attachment',
+                    ),
+                    'language'    => '',
+                    'location'    => '',
+                )
+            ),
+            'parameters'  => array (
+                'boundary' => '0F1p//8PRICkK4MWrobbat28989323553773'
+            ),
+            'disposition' => array(
+                'type'    => 'inline'
+            ),
+            'language'    => '',
+            'location'    => '',
+        );
+        
+        $expectedParameters = array(
+            'foobar'   => 'Test Subjäct',
+            'filename' => 'add-removals.1239580800.log'
+        );
+        
+        $message = $this->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        $structure = $message['structure'];
+        $lines = $this->_getLinesFromPartsAndRemoveFromStructure($structure);
+        // attachment parameters could have different order
+        $parameters = $structure['parts'][2]['disposition']['parameters'];
+        unset($structure['parts'][2]['disposition']['parameters']);
+        
+        $this->assertEquals($expectedStructure, $structure, 'structure does not match');
+        $this->assertEquals(Expressomail_Model_Message::CONTENT_TYPE_PLAIN, $message['body_content_type']);
+        $this->assertTrue(in_array($lines[1], array(61, 62)));
+        $this->assertTrue(in_array($lines[2], array(52, 53)));
+        $this->assertTrue($expectedParameters == $parameters);
+    }
+    
+    /**
+     * testBodyStructureMultipartMixedWithMessageRFC822
+     */
+    public function testBodyStructureMultipartMixedWithMessageRFC822()
+    {
+        $expectedStructure = array(
+            'partId'      => null,
+            'contentType' => 'multipart/mixed',
+            'type'        => 'multipart',
+            'subType'     => 'mixed',
+            'parts'       => array(
+                1 => array(
+                    'partId'      => 1,
+                    'contentType' => 'text/plain',
+                    'type'        => 'text',
+                    'subType'     => 'plain',
+                    'parameters'  => array (
+                        'charset' => 'ISO-8859-1',
+                        'format'  => 'flowed'
+                    ),
+                    'id'          => null,
+                    'description' => null,
+                    'encoding'    => '7bit',
+                    'size'        => 49,
+                    'disposition' => null,
+                    'language'    => '',
+                    'location'    => '',
+                ),
+                2 => array(
+                    'partId'      => 2,
+                    'contentType' => 'message/rfc822',
+                    'type'        => 'message',
+                    'subType'     => 'rfc822',
+                    'parameters'  => array (
+                        'name'    => '[Officespot-cs-svn] r15209 - trunk/tine20/Tinebase.eml'
+                    ),
+                    'id'          => '',
+                    'description' => '',
+                    'encoding'    => '7bit',
+                    'size'        => 4121,
+                    'disposition' => null,
+                    'language'    => null,
+                    'location'    => null,
+                    'messageEnvelop' => array(
+                        'Wed, 30 Jun 2010 13:20:09 +0200',
+                        '[Officespot-cs-svn] r15209 - trunk/tine20/Tinebase',
+                        array(array(
+                            'NIL', 'NIL', 'c.weiss', 'metaways.de'
+                        )),
+                        array(array(
+                            'NIL', 'NIL', 'c.weiss', 'metaways.de'
+                        )),
+                        array(array(
+                            'NIL', 'NIL', 'c.weiss', 'metaways.de'
+                        )),
+                        array(array(
+                            'NIL', 'NIL', 'officespot-cs-svn', 'lists.sourceforge.net'
+                        )),
+                        'NIL',
+                        'NIL',
+                        'NIL',
+                        '<20100630112010.06CD21C059@publicsvn.hsn.metaways.net>'
+                    ),
+                    'messageStructure' => array(
+                        'partId'  => 2,
+                        'contentType' => 'text/plain',
+                        'type'        => 'text',
+                        'subType'     => 'plain',
+                        'parameters'  => array (
+                            'charset' => 'us-ascii'
+                        ),
+                        'id'          => null,
+                        'description' => null,
+                        'encoding'    => '7bit',
+                        'size'        => 1562,
+                        'disposition' => null,
+                        'language'    => '',
+                        'location'    => '',
+                    ),
+                )
+            ),
+            'parameters'  => array (
+                'boundary' => '------------040506070905080909080505'
+            ),
+            'disposition' => null,
+            'language'    => '',
+            'location'    => '',
+        );
+        
+        $message = $this->messageTestHelper('multipart_rfc2822.eml', 'multipart/rfc2822');
+        $structure = $message['structure'];
+        $lines = $this->_getLinesFromPartsAndRemoveFromStructure($structure);
+        $lines[3] = $structure['parts'][2]['messageStructure']['lines'];
+        $lines[4] = $structure['parts'][2]['messageLines'];
+        unset($structure['parts'][2]['messageStructure']['lines']);
+        unset($structure['parts'][2]['messageLines']);
+        // remove disposition -> dbmail finds none, dovecot does
+        $structure['parts'][2]['disposition'] = null;
+        
+        $this->assertEquals($expectedStructure, $structure, 'structure does not match');
+        $this->assertTrue(in_array($lines[1], array(4, 5)));
+        $this->assertEquals(NULL, $lines[2]);
+        $this->assertTrue(in_array($lines[3], array(33, 34)));
+        $this->assertTrue(in_array($lines[4], array(80, 81)));
+    }
+    
+    /**
+     * testGetBodyMultipartRelated
+     */
+    public function testGetBodyMultipartRelated()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+
+        $body = $this->_controller->getMessageBody($cachedMessage, null, Zend_Mime::TYPE_TEXT, $this->_account);
+        
+        $this->assertContains('würde', $body);
+    }
+    
+    /**
+     * test reading a message without setting the \Seen flag
+     */
+    public function testGetBodyMultipartRelatedReadOnly()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+
+        $body = $this->_controller->getMessageBody($cachedMessage, null, Zend_Mime::TYPE_TEXT, $this->_account, true);
+        
+        $this->assertContains('würde', $body);
+        
+        // @todo check for seen flag
+    }
+    
+    /**
+     * testGetBodyPlainText
+     */
+    public function testGetBodyPlainText()
+    {
+        $cachedMessage = $this->messageTestHelper('text_plain.eml', 'text/plain');
+        
+        $body = $this->_controller->getMessageBody($cachedMessage, null, Zend_Mime::TYPE_TEXT, $this->_account);
+        
+        $this->assertContains('a converter script be written to', $body);
+    }
+    
+    /**
+     * testGetBodyPart
+     */
+    public function testGetBodyPart()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+        
+        $part = $this->_controller->getMessagePart($cachedMessage, '2');
+        
+        $this->assertContains(Zend_Mime::MULTIPART_RELATED, $part->type);
+        $this->assertContains("------------080303000508040404000908", $part->boundary);
+        
+        $part = $this->_controller->getMessagePart($cachedMessage, '2.1');
+        
+        $this->assertContains(Zend_Mime::TYPE_HTML, $part->type);
+        $this->assertContains(Zend_Mime::ENCODING_QUOTEDPRINTABLE, $part->encoding);
+        
+        $part = $this->_controller->getMessagePart($cachedMessage, '2.2');
+        
+        $this->assertContains(Zend_Mime::DISPOSITION_ATTACHMENT, $part->disposition);
+        $this->assertContains(Zend_Mime::ENCODING_BASE64, $part->encoding);
+    }
+    
+    /**
+     * testGetCompleteMessageAsPart
+     */
+    public function testGetCompleteMessageAsPart()
+    {
+        $cachedMessage = $this->messageTestHelper('complete.eml', 'text/service');
+        
+        $messagePart = $this->_controller->getMessagePart($cachedMessage);
+        
+        ob_start();
+        fpassthru($messagePart->getRawStream());
+        $out = ob_get_clean();
+        
+        $this->assertContains('URL: https://service.metaways.net/Ticket/Display.html?id=3D59648', $out);
+    }
+        
+    /**
+     * testGetMessagePartRfc822
+     */
+    public function testGetMessagePartRfc822()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_rfc2822-2.eml', 'multipart/rfc2822-2');
+        
+        $messagePart = $this->_controller->getMessagePart($cachedMessage, 2);
+        
+        ob_start();
+        fpassthru($messagePart->getRawStream());
+        $out = ob_get_clean();
+        
+        $this->assertContains('X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]', $out, 'header not found');
+        $this->assertContains('This component, from the feedback I have, will mostly be used on', $out, 'body not found');
+    }
+    
+    /**
+     * validate fetching a complete message
+     */
+    public function testGetCompleteMessage()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertEquals('robbat2@gentoo.org', $message->from_email);
+        $this->assertEquals($this->_account->getId(), $message->account_id);
+        $this->assertEquals('Robin H. Johnson', $message->from_name);
+        $this->assertEquals('"Robin H. Johnson" <robbat2@stork.gentoo.org>', $message->sender);
+        $this->assertEquals('1', $message->text_partid);
+        $this->assertEquals('1', $message->has_attachment);
+        $this->assertEquals(null, $message->html_partid);
+        $this->assertEquals('9606', $message->size);
+        $this->assertContains("Automated Package Removal", $message->subject);
+        $this->assertContains('\Seen', $message->flags);
+        $this->assertContains('11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85', $message->body);
+        $this->assertEquals('add-removals.1239580800.log', $message->attachments[0]["filename"]);
+    }
+
+    /**
+     * validate fetching a complete message in 'other' dir and check its body
+     *
+     * howto:
+     * - copy mails to tests/tine20/Felamimail/files/other
+     * - add following header:
+     *      X-Tine20TestMessage: _filename_
+     * - run the test!
+     */
+    public function testCheckOtherMails()
+    {
+        $otherFilesDir = dirname(dirname(__FILE__)) . '/files/other';
+        if (file_exists($otherFilesDir)) {
+            foreach (new DirectoryIterator($otherFilesDir) as $item) {
+                $filename = $item->getFileName();
+                if ($item->isFile() && $filename !== 'README') {
+                    $fileName = 'other/' . $filename;
+                    echo "\nchecking message: " . $fileName . "\n";
+                    $cachedMessage = $this->messageTestHelper($fileName, $filename);
+                    $message = $this->_controller->getCompleteMessage($cachedMessage);
+                    echo $message->body;
+                    $this->assertTrue(! empty($message->body));
+                }
+            }
+        }
+    }
+    
+    /**
+     * validate fetching a complete message
+     */
+    public function testGetCompleteMessage2()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertEquals('1', $message->text_partid, 'no text part found');
+        $this->assertEquals('1', $message->has_attachment, 'no attachments found');
+        $this->assertEquals('2.1', $message->html_partid, 'no html part found');
+        $this->assertTrue(in_array($message->size, array('38455', '38506')));
+        $this->assertContains("Tine 2.0 bei Metaways", $message->subject);
+        $this->assertContains('\Seen', $message->flags);
+        $this->assertContains('Autovervollständigung', $message->body);
+        $this->assertEquals('moz-screenshot-83.png', $message->attachments[0]["filename"]);
+    }
+    
+    /**
+     * validate fetching a complete message
+     */
+    public function testGetCompleteMessage3()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_rfc2822.eml', 'multipart/rfc2822');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertEquals('multipart/mixed', $message->content_type);
+        $this->assertEquals('5377', $message->size);
+        $this->assertContains("Fwd: [Officespot-cs-svn] r15209 - trunk/tine20/Tinebase", $message->subject);
+        $this->assertContains('est for parsing forwarded email', $message->body);
+        $this->assertEquals('message/rfc822', $message->attachments[0]["content-type"]);
+    }
+
+    /**
+     * validate fetching a complete message from amazon
+     */
+    public function testGetCompleteMessageAmazon()
+    {
+        $cachedMessage = $this->messageTestHelper('Amazon.eml', 'multipart/amazon');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertEquals('multipart/alternative', $message->content_type);
+        $this->assertContains('Samsung Wave S8500 Smartphone', $message->subject);
+        $this->assertContains('Sie suchen Produkte aus der Kategorie Elektronik &amp; Foto?', $message->body);
+    }
+    
+    /**
+     * validate fetching a message from yahoo
+     *
+     * test was created for task #4680
+     */
+    public function testGetCompleteMessageYahoo()
+    {
+        $cachedMessage = $this->messageTestHelper('yahoo.eml');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertContains('Bitte aktualisieren Sie Ihre Kontoeinstellungen bzw. Daten-Feeds so schnell wie möglich', $message->body);
+    }
+    
+    /**
+     * validate fetching a complete message from amazon #2 -> check if images got removed correctly
+     */
+    public function testGetCompleteMessageAmazon2()
+    {
+        $cachedMessage = $this->messageTestHelper('Amazon2.eml', 'multipart/amazon2');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertContains('Fritz Meier, wir haben Empfehlungen', $message->body);
+        $this->assertNotContains('<img', $message->body);
+        $this->assertNotContains('style="background-image:url', $message->body);
+        $this->assertNotContains('http://www.xing.com/img/xing/newsletter/navigation_bg.gif', $message->body);
+    }
+    
+    /**
+     * validate fetching a complete message from order form
+     */
+    public function testGetCompleteMessageOrder()
+    {
+        $cachedMessage = $this->messageTestHelper('Angebotsformular.eml', 'text/angebot');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertEquals('text/plain', $message->content_type);
+        $this->assertContains('Angebotsformular', $message->subject);
+        $this->assertContains('*Formular-Weiterleitungs-Service*', $message->body);
+    }
+
+    /**
+     * validate fetching a complete message with different encodings
+     */
+    public function testGetCompleteMessageDifferentEncoding()
+    {
+        $cachedMessage = $this->messageTestHelper('UmlauteUTF8TextISO-8859-15Signatur.eml', 'text/different');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        //print_r($message->toArray());
+        $this->assertEquals('text/plain', $message->content_type);
+        $this->assertContains('Umlaute UTF8 Text + ISO-8859-15 Signatur', $message->subject);
+        $this->assertContains('O Ö', $message->body);
+    }
+    
+    /**
+     * validate fetching a complete message (rfc2822 part)
+     */
+    public function testGetMessageRFC822()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_rfc2822.eml', 'multipart/rfc2822');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage, 2);
+        
+        $this->assertEquals('4121', $message->size);
+        $this->assertContains("[Officespot-cs-svn] r15209 - trunk/tine20/Tinebase", $message->subject);
+        $this->assertTrue(isset($message->body), 'no body found');
+        $this->assertContains('getLogger()-&gt;debug', $message->body);
+    }
+    
+    /**
+     * validate fetching a complete message
+     */
+    public function testGetMessageRFC822_2()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_rfc2822-2.eml', 'multipart/rfc2822-2');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage, 2);
+        
+        $this->assertEquals('19131', $message->size);
+        $this->assertContains("Proposal: Zend_Grid", $message->subject);
+        $this->assertTrue(isset($message->body), 'no body found');
+        $this->assertContains('Bento Vilas Boas wrote', $message->body ,'string not found in body: ' . $message->body);
+        $this->assertEquals('smime.p7s', $message->attachments[0]["filename"]);
+    }
+    
+    /**
+     * validate fetching a complete message / rfc822 with base64
+     */
+    public function testGetMessageRFC822_3()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_rfc2822-3.eml', 'multipart/rfc2822-3');
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage, 2);
+        
+        $this->assertTrue(isset($message->body), 'no body found');
+        $this->assertContains('this is base64 encoded', $message->body ,'string not found in body: ' . $message->body);
+    }
+    
+    /**
+     * test adding message with duplicate to: header
+     */
+    public function testAddMessageToCacheDuplicateTo()
+    {
+        $cachedMessage = $this->messageTestHelper('text_plain2.eml', 'text_plain2.eml');
+        
+        $this->assertGreaterThan(0, count($cachedMessage->to));
+        $this->assertContains('c.weiss@metaways.de', $cachedMessage->to[0], 'wrong "to" header:' . print_r($cachedMessage->to, TRUE));
+        $this->assertContains('online', $cachedMessage->subject);
+    }
+    
+    /**
+     * test adding message with invalid date
+     */
+    public function testAddMessageToCacheInvalidDate()
+    {
+        $cachedMessage = $this->messageTestHelper('invaliddate.eml', 'text/invaliddate');
+        
+        $this->assertEquals('2010-03-01 21:39:42', $cachedMessage->sent->toString());
+    }
+    
+    /**
+     * test adding message with another invalid date
+     */
+    public function testAddMessageToCacheInvalidDate2()
+    {
+        $cachedMessage = $this->messageTestHelper('invaliddate2.eml', 'text/invaliddate2');
+        
+        $this->assertEquals('2009-03-16 19:51:23', $cachedMessage->sent->toString());
+    }
+    
+    /**
+     * test adding message with empty date header
+     */
+    public function testAddMessageToCacheEmptyDate()
+    {
+        $cachedMessage = $this->messageTestHelper('empty_date_header.eml', 'empty_date_header.eml');
+        
+        $this->assertEquals(0, $cachedMessage->sent->getTimestamp(), 'no timestamp should be set');
+    }
+    
+    /**
+     * test forward with attachment
+     */
+    public function testForwardMessageWithAttachment()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+        
+        $forwardMessage = new Expressomail_Model_Message(array(
+            'account_id'    => $this->_account->getId(),
+            'subject'       => 'test forward',
+            'to'            => array($this->getEmailAddress()),
+            'body'          => 'aaaaaä <br>',
+            'headers'       => array('X-Tine20TestMessage' => Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822),
+            'original_id'   => $cachedMessage->getId(),
+            'attachments'   => array(new Tinebase_Model_TempFile(array(
+                'type'  => Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822,
+                'name'  => $cachedMessage->subject,
+            ), TRUE)),
+        ));
+        $sentFolder = $this->getFolder('Sent');
+
+        Expressomail_Controller_Message_Send::getInstance()->sendMessage($forwardMessage);
+        
+        $forwardedMessage = $this->searchAndCacheMessage(Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $this->getFolder('INBOX'));
+        $forwardedMessageInSent = $this->searchAndCacheMessage(Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $sentFolder);
+        $completeForwardedMessage = $this->_controller->getCompleteMessage($forwardedMessage);
+        
+        $this->assertEquals(Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $forwardedMessage['structure']['parts'][2]['contentType']);
+        $this->assertEquals($cachedMessage->subject . '.eml', $forwardedMessage['structure']['parts'][2]['parameters']['name'],
+            'filename mismatch in structure' . print_r($forwardedMessage['structure']['parts'][2], TRUE));
+        $this->assertEquals($cachedMessage->subject . '.eml', $completeForwardedMessage->attachments[0]['filename'],
+            'filename mismatch of attachment' . print_r($completeForwardedMessage->attachments[0], TRUE));
+        
+        return $forwardedMessage;
+    }
+    
+    /**
+     * get email address
+     *
+     * @return string
+     */
+    public function getEmailAddress()
+    {
+        $config = TestServer::getInstance()->getConfig();
+        $email = ($config->email) ? $config->email : Tinebase_Core::getUser()->accountEmailAddress;
+        
+        return $email;
+    }
+
+    /**
+     * test forward message part
+     */
+    public function testForwardMessagePart()
+    {
+        $forwardedMessage = $this->testForwardMessageWithAttachment();
+        
+        $forwardMessage = new Expressomail_Model_Message(array(
+            'account_id'    => $this->_account->getId(),
+            'subject'       => 'test forward part',
+            'to'            => array($this->getEmailAddress()),
+            'body'          => 'aaaaaä <br>',
+            'headers'       => array('X-Tine20TestMessage' => Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822 . 'part'),
+            'original_id'   => $forwardedMessage->getId() . '_2', // part 2 is the original forwared message
+            'attachments'   => array(new Tinebase_Model_TempFile(array(
+                'type'  => Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822,
+                'name'  => $forwardedMessage->subject,
+            ), TRUE)),
+        ));
+        Expressomail_Controller_Message_Send::getInstance()->sendMessage($forwardMessage);
+        
+        $forwardedMessage = $this->searchAndCacheMessage(Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822 . 'part', $this->getFolder('INBOX'));
+        $completeForwardedMessagePart = $this->_controller->getCompleteMessage($forwardedMessage, 2);
+        
+        //print_r($completeForwardedMessagePart->toArray());
+        $this->assertTrue(! empty($completeForwardedMessagePart->headers), 'headers should not be empty');
+        $this->assertEquals('moz-screenshot-83.png', $completeForwardedMessagePart->attachments[0]['filename']);
+    }
+    
+    /**
+     * testGetBodyPartIdMultipartAlternative
+     */
+    public function testGetBodyPartIdMultipartAlternative()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_alternative.eml', 'multipart/alternative');
+        $cachedMessage->parseBodyParts();
+
+        $this->assertEquals(1, $cachedMessage->text_partid, 'did not find all partIds');
+        $this->assertEquals(2, $cachedMessage->html_partid, 'did not find all partIds');
+    }
+        
+    /**
+     * testGetBodyPartIdMultipartMixed
+     */
+    public function testGetBodyPartIdMultipartMixed()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        $cachedMessage->parseBodyParts();
+
+        $this->assertEquals(1, $cachedMessage->text_partid, 'did not find all partIds');
+    }
+    
+    /**
+     * testGetBodyPartIdMultipartSigned
+     */
+    public function testGetBodyPartIdMultipartSigned()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_signed.eml', 'multipart/signed');
+        $cachedMessage->parseBodyParts();
+
+        $this->assertEquals(1, $cachedMessage->text_partid, 'did not find all partIds');
+    }
+    
+    /**
+     * testGetBodyPartIdMultipartRelated
+     */
+    public function testGetBodyPartIdMultipartRelated()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_related.eml', 'multipart/related');
+        $cachedMessage->parseBodyParts();
+
+        $this->assertEquals(1, $cachedMessage->text_partid, 'did not find all partIds');
+        $this->assertEquals('2.1', $cachedMessage->html_partid, 'did not find all partIds');
+    }
+
+    /**
+     * testGetMessageWithoutFromHeader
+     */
+    public function testGetMessageWithoutFromHeader()
+    {
+        $cachedMessage = $this->messageTestHelper('withoutfrom.eml', 'text/withoutfrom');
+        $completeMessage = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertContains('Hier ist Ihr Hot Web Email-Deal Angebot von M&amp;M Computer.', $completeMessage->body);
+    }
+    
+    /**
+     * testGetMessageWithCommaInTo
+     */
+    public function testGetMessageWithCommaInTo()
+    {
+        $cachedMessage = $this->messageTestHelper('mail_to_comma.eml', 'text/comma');
+        $completeMessage = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertEquals('inscription@arrakeen.net', $completeMessage->to[0]);
+        $this->assertEquals('November 2010 Crystal Newsletter - Cut the Rope Update Released!', $completeMessage->subject);
+    }
+    
+    /**
+     * testUnparseableMail
+     */
+    public function testUnparseableMail()
+    {
+        $cachedMessage = $this->messageTestHelper('unparseable.eml', 'multipart/unparseable');
+        $completeMessage = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertEquals(1, preg_match('@NIL|Content-Type: image/jpeg@', $completeMessage->body), 'parsed mail body:' . $completeMessage->body);
+    }
+    
+    /**
+     * test utf8 header decode
+     */
+    public function testUtf8HeaderDecode()
+    {
+        $cachedMessage = $this->messageTestHelper('decode_utf8_header.eml');
+        $completeMessage = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertEquals('"Jörn Meier" <j.meier@test.local>', $completeMessage->headers['reply-to']);
+        $this->assertEquals('Jörn Meier <j.meier@test.local>', $completeMessage->headers['from']);
+        $this->assertEquals('j.meier@test.local', $completeMessage->to[0]);
+    }
+    
+    /**
+     * testLongFrom
+     */
+    public function testLongFrom()
+    {
+        $cachedMessage = $this->messageTestHelper('longfrom.eml');
+        $this->assertEquals('nDqIxSoSTIC', $cachedMessage->subject);
+    }
+        
+    /**
+     * testGetMessageWithQuotedPrintableDecodeProblem
+     */
+    public function testGetMessageWithQuotedPrintableDecodeProblem()
+    {
+        $cachedMessage = $this->messageTestHelper('Terminbestaetigung.eml', 'Terminbestaetigung.eml');
+        $completeMessage = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertContains('Veröffentlichungen, Prospekte und Ähnliches bereithalten würden.', $completeMessage->body);
+    }
+    
+    /**
+     * test move to another account
+     */
+    public function testMoveMessageToAnotherAccount()
+    {
+        $clonedAccount = $this->_cloneAccount();
+        $folder = $this->getFolder('INBOX', $clonedAccount);
+        
+        $cachedMessage = $this->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        $this->_moveTestHelper($cachedMessage, $folder);
+    }
+    
+    /**
+     * test move to another account (with message filter)
+     */
+    public function testMoveMessageToAnotherAccountWithFilter()
+    {
+        $clonedAccount = $this->_cloneAccount();
+        $folder = $this->getFolder('INBOX', $clonedAccount);
+        
+        $cachedMessage = $this->messageTestHelper('multipart_mixed.eml', 'multipart/mixed');
+        $messageFilter = new Expressomail_Model_MessageFilter(array(
+            array('field' => 'id', 'operator' => 'in', 'value' => array($cachedMessage->getId()))
+        ));
+        
+        $this->_moveTestHelper($messageFilter, $folder);
+    }
+    
+    /**
+     * move message test helper
+     *
+     * @param mixed $_toMove
+     * @param Felamimail_Model_Folder $_folder
+     */
+    protected function _moveTestHelper($_toMove, $_folder)
+    {
+        Expressomail_Controller_Message_Move::getInstance()->moveMessages($_toMove, $_folder);
+        $message = $this->_searchMessage('multipart/mixed', $_folder);
+        
+        $result = $this->_controller->search($this->_getFilter($folder->getId()));
+        foreach ($result as $messageInCache) {
+            if ($messageInCache->messageuid == $message['uid']) {
+                $foundMessage = $messageInCache;
+                break;
+            }
+        }
+        
+        $this->assertTrue(isset($foundMessage));
+        $this->_createdMessages[] = $foundMessage;
+        $completeMessage = $this->_controller->getCompleteMessage($foundMessage);
+        $this->assertContains('The attached list notes all of the packages that were added or removed', $completeMessage->body);
+    }
+    
+     /**
+     * test delete in different accounts
+     */
+    public function testDeleteMessagesInDifferentAccounts()
+    {
+        $clonedAccount = $this->_cloneAccount();
+        
+        $trashFolderMainAccount = $this->getFolder('Trash');
+        $trashFolderClonedAccount = $this->getFolder('Trash', $clonedAccount);
+        
+        // empty trash
+        Expressomail_Controller_Folder::getInstance()->emptyFolder($trashFolderMainAccount);
+        
+        $cachedMessage1 = $this->messageTestHelper('multipart_mixed.eml', 'multipart/mixed', $trashFolderMainAccount);
+        $cachedMessage2 = $this->messageTestHelper('complete.eml', 'text/service', $trashFolderClonedAccount);
+        
+        Expressomail_Controller_Message_Flags::getInstance()->addFlags(array($cachedMessage1->getId(), $cachedMessage2->getId()), array(Zend_Mail_Storage::FLAG_DELETED));
+        
+        $result1 = $this->_searchOnImap('multipart/mixed', $trashFolderMainAccount);
+        $this->assertEquals(0, count($result1), $trashFolderMainAccount->globalname . ' still contains multipart/mixed messages:' . print_r($result1, TRUE));
+        $result2 = $this->_searchOnImap('text/service', $trashFolderClonedAccount);
+        $this->assertEquals(0, count($result2), $trashFolderClonedAccount->globalname . ' still contains text/service messages:' . print_r($result2, TRUE));
+    }
+    
+    /**
+     * test converting from punycode (xn--stermnn-9wa0n.org -> östermänn.org)
+     */
+    public function testPunycodedFromHeader()
+    {
+        $cachedMessage = $this->messageTestHelper('punycode_from.eml', 'punycode');
+        $this->assertEquals('albert@östermänn.org', $cachedMessage->from_email);
+    }
+
+    /**
+     * test converting to punycode
+     */
+    public function testEncodeToPunycode()
+    {
+        $message = new Expressomail_Model_Message(array(
+            'to'        => array('albert@östermänn.org'),
+            'subject'   => 'punycode test',
+        ));
+        $mail = Expressomail_Controller_Message_Send::getInstance()->createMailForSending($message, $this->_account);
+        
+        $recipients = $mail->getRecipients();
+        $this->assertEquals('albert@xn--stermnn-9wa0n.org', $recipients[0]);
+    }
+    
+    /**
+     * test line end encoding of Zend_Mime_Part / Smtp Protocol
+     */
+    public function testSendWithWrongLineEnd()
+    {
+        $config = TestServer::getInstance()->getConfig();
+        $mailDomain = ($config->maildomain) ? $config->maildomain : 'tine20.org';
+        
+        // build message with wrong line end rfc822 part
+        $mail = new Tinebase_Mail('utf-8');
+        $mail->setBodyText('testmail' . "\r\n" . "\r\n");
+        $mail->setFrom('unittest@' . $mailDomain, 'unittest');
+        $mail->setSubject('line end test');
+        $mail->addTo('unittest@' . $mailDomain);
+        $mail->addHeader('X-Tine20TestMessage', 'lineend');
+        
+        // replace EOLs
+        $content = file_get_contents(dirname(dirname(__FILE__)) . '/files/text_plain.eml');
+        $content = preg_replace("/\\x0a/", "\r\n", $content);
+        $stream = fopen("php://temp", 'r+');
+        fputs($stream, $content);
+        rewind($stream);
+        
+        $attachment = new Zend_Mime_Part($stream);
+        $attachment->type        = Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822;
+        $attachment->encoding    =  null;
+        $attachment->charset     = 'ISO-8859-1';
+        $attachment->filename    = 'attach.eml';
+        $attachment->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
+                
+        $mail->addAttachment($attachment);
+        
+        $smtpConfig = $this->_account->getSmtpConfig();
+        $transport = new Expressomail_Transport($smtpConfig['hostname'], $smtpConfig);
+        $mail->send($transport);
+        
+        $smtpLog = $transport->getConnection()->getLog();
+        
+        $badLineEndCount = preg_match_all("/\\x0d\\x0d\\x0a/", $smtpLog, $matches);
+        $this->assertEquals(0, $badLineEndCount);
+        
+        $badLineEndCount = preg_match_all("/\\x0d/", $smtpLog, $matches);
+        $this->assertTrue(preg_match_all("/\\x0d/", $smtpLog, $matches) > 70, 'unix line ends are missing');
+        
+    }
+    
+   /**
+    * validate email invitation
+    */
+    public function testEmailInvitation()
+    {
+        $email = $this->_getTestEmailAddress();
+        $cachedMessage = $this->messageTestHelper('invitation.eml', NULL, NULL, array('unittest@tine20.org', $email));
+        $this->_testInvitationMessage($cachedMessage, 'pwulf@tine20.org', 'testevent', 2);
+    }
+    
+    /**
+     * _testInvitationMessage
+     * 
+     * @param Felamimail_Model_Message $cachedMessage
+     * @param string $expectedOriginator
+     * @param string $expectedEventSummary
+     * @param integer $expectedAttendeeCount
+     */
+    protected function _testInvitationMessage($cachedMessage, $expectedOriginator, $expectedEventSummary, $expectedAttendeeCount)
+    {
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertEquals(1, count($message->preparedParts));
+        $preparediMIPPart = $message->preparedParts->getFirstRecord()->preparedData;
+        $this->assertTrue($preparediMIPPart instanceof Calendar_Model_iMIP, 'is no iMIP');
+        $this->assertEquals($expectedOriginator, $preparediMIPPart->originator);
+        $event = $preparediMIPPart->getEvent();
+        $this->assertTrue($event instanceof Calendar_Model_Event, 'is no event');
+        $this->assertEquals($expectedEventSummary, $event->summary);
+        $this->assertEquals($expectedAttendeeCount, count($event->attendee));
+    }
+
+   /**
+    * validate email invitation from mac
+    */
+    public function testEmailInvitationFromMac()
+    {
+        $cachedMessage = $this->messageTestHelper('mac_invitation.eml');
+    
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+    
+        $this->assertEquals(1, count($message->preparedParts));
+        $preparediMIPPart = $message->preparedParts->getFirstRecord()->preparedData;
+        $this->assertTrue($preparediMIPPart instanceof Calendar_Model_iMIP, 'is no iMIP');
+        $this->assertEquals('pwulf@tine20.org', $preparediMIPPart->originator);
+    }
+
+   /**
+    * validate email invitation from outlook
+    * 
+    * @see 0006110: handle iMIP messages from outlook
+    */
+    public function testEmailInvitationFromOutlook()
+    {
+        $email = $this->_getTestEmailAddress();
+        $cachedMessage = $this->messageTestHelper('outlookimip.eml', NULL, NULL, array('name@example.net', $email));
+        $this->_testInvitationMessage($cachedMessage, 'name@example.com', 'test', 1);
+    }
+    
+   /**
+    * validate email invitation from outlook (base64 encoded ics)
+    * 
+    * @see 0006110: handle iMIP messages from outlook
+    */
+    public function testEmailInvitationFromOutlookBase64()
+    {
+        $email = $this->_getTestEmailAddress();
+        $cachedMessage = $this->messageTestHelper('invite_outlook.eml', NULL, NULL, array('oliver@example.org', $email));
+        $this->_testInvitationMessage($cachedMessage, 'user@telekom.ch', 'Test von Outlook an Tine20', 1);
+    }
+    
+    /**
+     * get test email address
+     * 
+     * @return string
+     */
+    protected function _getTestEmailAddress()
+    {
+        $testConfig = Zend_Registry::get('testConfig');
+        $email = ($testConfig->email) ? $testConfig->email : 'unittest@tine20.org';
+        return $email;
+    }
+    
+    /**
+     * testFromUTF8Encoding
+     * 
+     * @see 0006538: charset problems with recipients/senders
+     */
+    public function testFromUTF8Encoding()
+    {
+        $cachedMessage = $this->messageTestHelper('UTF8inFrom.eml');
+        $this->assertEquals('Philipp Schüle', $cachedMessage->from_name, print_r($cachedMessage->toArray(), TRUE));
+    }
+    
+    /**
+     * testHeaderWithoutEncodingInformation
+     * 
+     * @see 0006250: missing Umlauts in some mails
+     */
+    public function testHeaderWithoutEncodingInformation()
+    {
+        $cachedMessage = $this->messageTestHelper('Wortmann1.eml');
+        
+        $this->assertTrue(! empty($cachedMessage->subject) && is_string($cachedMessage->subject), 'subject empty or no string: '. print_r($cachedMessage->toArray(), TRUE));
+        $this->assertContains('Höchstgeschwindigkeit', $cachedMessage->subject, print_r($cachedMessage->toArray(), TRUE));
+    }
+    
+    /**
+     * testFilterTooMuchHtml
+     * 
+     * @see 0007142: sometimes we filter to much html content
+     */
+    public function testFilterTooMuchHtml()
+    {
+        $cachedMessage = $this->messageTestHelper('heavyhtml.eml');
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertContains('unwahrscheinlichen Fall, dass Probleme auftreten sollten,', $message->body, print_r($message->toArray(), TRUE));
+    }
+    
+    /**
+     * testUmlautAttachment
+     * 
+     * @see 0007624: losing umlauts in attached filenames
+     */
+    public function testUmlautAttachment()
+    {
+        $cachedMessage = $this->messageTestHelper('attachmentUmlaut.eml');
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertEquals(1, count($message->attachments));
+        $this->assertEquals('äöppopä.txt', $message->attachments[0]['filename']);
+    }
+
+    /**
+     * testNewsletterMultipartRelated
+     * 
+     * @see 0007722: improve handling of newsletters
+     */
+    public function testNewsletterMultipartRelated()
+    {
+        $cachedMessage = $this->messageTestHelper('mw_newsletter_multipart_related.eml');
+        $this->assertEquals(1, $cachedMessage->has_attachment);
+        $bodyParts = $cachedMessage->getBodyParts();
+        $this->assertEquals(Zend_Mime::TYPE_HTML, $bodyParts['2.1']['contentType'], 'multipart/related html part missing: ' . print_r($bodyParts, TRUE));
+        
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertNotContains('----------------------------<br />TINE 2.0<br />-----------------------', $message->body, 'message body contains plain/text part');
+        $this->assertContains('<p style="color:#999999;"><strong>Die Glühweinzeit hat bereits begonnen und kälter geworden ist es auch...</strong></p>', $message->body);
+        $this->assertEquals(Zend_Mime::TYPE_HTML, $message->body_content_type);
+    }
+
+    /**
+     * testNewsletterMultipartRelated
+     * 
+     * @see 0007858: could not parse structure of multipart/related msg
+     */
+    public function testMultipartRelatedAlternative()
+    {
+        $cachedMessage = $this->messageTestHelper('multipart_alternative_related.eml');
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        $this->assertContains('some body contentsome body contentsome body content', $message->body);
+    }
+
+    /**
+     * testNoAttachement
+     * 
+     * @see 0008014: js client shows wrong attachment icon in grid
+     */
+    public function testNoAttachement()
+    {
+        $cachedMessage = $this->messageTestHelper('noattachment.eml');
+        $this->assertEquals(0, $cachedMessage->has_attachment);
+    }
+    
+    /**
+     * testHtmlPurify
+     * 
+     * @see 0007726: show inline images of multipart/related message parts
+     * 
+     * @todo allow external resources
+     * @todo remove $_SERVER stuff?
+     */
+    public function testHtmlPurify()
+    {
+//         $_SERVER['SERVER_NAME'] = 'localhost';
+//         $_SERVER['REQUEST_URI'] = '/tine20';
+        $cachedMessage = $this->messageTestHelper('text_html_urls.eml');
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+//         unset($_SERVER['SERVER_NAME']);
+//         unset($_SERVER['REQUEST_URI']);
+        
+//         $this->assertContains('<div></div>
+//     <img src="http://localhost/tine20/index.php?Felamimail.getResource&amp;uri=aHR0cDovL3d3dy50aW5lMjAub3JnL2ZpbGVhZG1pbi90ZW1wbGF0ZXMvaW1hZ2VzL3RpbmUyMC5wbmc=&amp;type=img" alt="tine20.png" /><img src="http://localhost/tine20.png" alt="tine20.png" />
+    
+//     <p>text</p>', $message->body);
+        $this->assertContains('<div></div>
+    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAAB" />
+    
+    <p>text</p>', $message->body);
+    }
+
+    /**
+     * testNewsletterMultipartRelated
+     * 
+     * @see 0007726: show inline images of multipart/related message parts
+     * 
+     * @todo implement
+     */
+    public function testNewsletterMultipartRelatedWithImages()
+    {
+        $this->markTestIncomplete('implement');
+        $cachedMessage = $this->messageTestHelper('mw_newsletter_multipart_related.eml');
+    }
+    
+    /**
+     * testFacebookNotification
+     * 
+     * @see 0008016: links in facebook/twitter emails are removed
+     */
+    public function testFacebookNotification()
+    {
+        $cachedMessage = $this->messageTestHelper('facebook_notification.eml');
+        $message = $this->_controller->getCompleteMessage($cachedMessage);
+        
+        $this->assertContains('http://www.facebook.com/n/?notifications&amp;id=295475095891&amp;'
+            . 'mid=7a0ffadG5af33a8a9c98Ga61c449Gdd&amp;bcode=1.1362559617.Abl6w95TdWQc0VVS&amp;n_m=tine20%40metaways.de', $message->body);
+    }
+    
+    /********************************* protected helper funcs *************************************/
+    
+    /**
+     * clones the account
+     *
+     * @return Felamimail_Model_Account
+     */
+    protected function _cloneAccount()
+    {
+        $account = clone($this->_account);
+        unset($account->id);
+        $this->_accountsToDelete[] = $account;
+        $account = Expressomail_Controller_Account::getInstance()->create($account);
+        
+        return $account;
+    }
+    
+    /**
+     * helper function
+     * - appends message from file
+     * - adds appended message to cache
+     *
+     * @param string $_filename
+     * @param string $_testHeaderValue
+     * @param Felamimail_Model_Folder $_folder
+     * @param array $_replacements
+     * @return Felamimail_Model_Message
+     */
+    public function messageTestHelper($_filename, $_testHeaderValue = NULL, $_folder = NULL, $_replacements = array())
+    {
+        $testHeaderValue = ($_testHeaderValue !== NULL) ? $_testHeaderValue : $_filename;
+        $folder = ($_folder !== NULL) ? $_folder : $this->_folder;
+        $this->_appendMessage($_filename, $folder, $_replacements);
+        return $this->searchAndCacheMessage($testHeaderValue, $folder);
+    }
+    
+    /**
+     * search message in folder
+     *
+     * @param string $_testHeaderValue
+     * @param Felamimail_Model_Folder $_folder
+     * @param boolean $_assert
+     * @return array|NULL
+     */
+    protected function _searchMessage($_testHeaderValue, $_folder, $_assert = TRUE)
+    {
+        $imap = $this->_getImapFromFolder($_folder);
+
+        $count = 0;
+        do {
+            sleep(1);
+            $result = $this->_searchOnImap($_testHeaderValue, $_folder, $imap);
+        } while (count($result) === 0 && $count++ < 5);
+        
+        if ($_assert) {
+            $this->assertGreaterThan(0, count($result), 'No messages with HEADER X-Tine20TestMessage: ' . $_testHeaderValue . ' in folder ' . $_folder->globalname . ' found.');
+        }
+        $message = (! empty($result)) ? $imap->getSummary($result[0]) : NULL;
+        
+        return $message;
+    }
+    
+    /**
+     * get imap backend
+     *
+     * @param Felamimail_Model_Folder $_folder
+     * @return Felamimail_Backend_ImapProxy
+     */
+    protected function _getImapFromFolder($_folder) {
+        if ($_folder->account_id == $this->_account->getId()) {
+            $imap = $this->_imap;
+        } else {
+            $imap = Expressomail_Backend_ImapFactory::factory($_folder->account_id);
+        }
+        
+        return $imap;
+    }
+    
+    /**
+     * search for messages on imap server
+     *
+     * @param string $_testHeaderValue
+     * @param Felamimail_Model_Folder $_folder
+     * @return array
+     */
+    protected function _searchOnImap($_testHeaderValue, $_folder, $_imap = NULL)
+    {
+        if ($_imap === NULL) {
+            $imap = $this->_getImapFromFolder($_folder);
+        } else {
+            $imap = $_imap;
+        }
+        
+        $imap->expunge($_folder->globalname);
+        $result = $imap->search(array(
+            'HEADER X-Tine20TestMessage ' . $_testHeaderValue
+        ));
+        
+        return $result;
+     }
+    
+    /**
+     * append message (from given filename) to cache
+     *
+     * @param string $_filename
+     * @param string $_folder
+     * @param array $_replacements
+     */
+    protected function _appendMessage($_filename, $_folder, $_replacements = array())
+    {
+        $filename = dirname(dirname(__FILE__)) . '/files/' . $_filename;
+        if (! empty($_replacements)) {
+            $message = file_get_contents($filename);
+            $message = preg_replace('/' . preg_quote($_replacements[0], '/') . '/m', $_replacements[1], $message);
+        } else {
+            $message = fopen($filename, 'r');
+        }
+        $this->_controller->appendMessage($_folder, $message);
+    }
+    
+    /**
+     * get message filter
+     *
+     * @param string $_folderId
+     * @return Felamimail_Model_MessageFilter
+     */
+    protected function _getFilter($_folderId)
+    {
+        return new Expressomail_Model_MessageFilter(array(
+            array('field' => 'folder_id', 'operator' => 'equals', 'value' => $_folderId)
+        ));
+    }
+    
+    /**
+     * get folder
+     *
+     * @return Felamimail_Model_Folder
+     */
+    public function getFolder($_folderName = null, $_account = NULL)
+    {
+        $folderName = ($_folderName !== null) ? $_folderName : $this->_testFolderName;
+        $account = ($_account !== NULL) ? $_account : $this->_account;
+        
+        $filter = new Expressomail_Model_FolderFilter(array(
+            array('field' => 'globalname', 'operator' => 'equals', 'value' => '',),
+            array('field' => 'account_id', 'operator' => 'equals', 'value' => $account->getId())
+        ));
+        $result = Expressomail_Controller_Folder::getInstance()->search($filter);
+        $folder = $result->filter('localname', $folderName)->getFirstRecord();
+        if (empty($folder)) {
+            $folder = Expressomail_Controller_Folder::getInstance()->create($account, $_folderName);
+        }
+
+        return $folder;
+    }
+}
diff --git a/tests/tine20/Expressomail/JsonTest.php b/tests/tine20/Expressomail/JsonTest.php
new file mode 100755 (executable)
index 0000000..03ac0ed
--- /dev/null
@@ -0,0 +1,1468 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     ExpressoMail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2009-2013 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schüle <p.schuele@metaways.de>
+ * 
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Tinebase_Group
+ */
+class Expressomail_JsonTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Felamimail_Frontend_Json
+     */
+    protected $_json = array();
+
+    /**
+     * message ids to delete
+     *
+     * @var array
+     */
+    protected $_messageIds = array();
+    
+    /**
+     * @var Felamimail_Model_Account
+     */
+    protected $_account = NULL;
+    
+    /**
+     * imap backend
+
+     * @var Felamimail_Backend_ImapProxy
+     */
+    protected $_imap = NULL;
+    
+    /**
+     * name of the folder to use for tests
+     * @var string
+     */
+    protected $_testFolderName = 'Junk';
+    
+    /**
+     * folders to delete in tearDown()
+     * 
+     * @var array
+     */
+    protected $_createdFolders = array();
+    
+    /**
+     * are there messages to delete?
+     * 
+     * @var array
+     */
+    protected $_foldersToClear = array();
+
+    /**
+     * active sieve script name to be restored
+     * 
+     * @var string
+     */
+    protected $_oldActiveSieveScriptName = NULL;
+
+    /**
+     * was sieve_vacation_active ?
+     * 
+     * @var boolean
+     */
+    protected $_oldSieveVacationActiveState = FALSE;
+    
+    /**
+     * old sieve data
+     * 
+     * @var Felamimail_Sieve_Backend_Sql
+     */
+    protected $_oldSieveData = NULL;
+
+    /**
+     * sieve script name to delete
+     * 
+     * @var string
+     */
+    protected $_testSieveScriptName = NULL;
+
+    /**
+     * sieve vacation template file name
+     * 
+     * @var string
+     */
+    protected $_sieveVacationTemplateFile = 'vacation_template.tpl';
+    
+    /**
+     * test email domain
+     * 
+     * @var string
+     */
+    protected $_mailDomain = 'tine20.serpro.gov.br';
+    
+    /**
+     * @var Felamimail_Model_Folder
+     */
+    protected $_folder = NULL;
+    
+    /**
+     * paths in the vfs to delete
+     * 
+     * @var array
+     */
+    protected $_pathsToDelete = array();
+    
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Felamimail Json Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+        // get (or create) test accout
+        $this->_account = Expressomail_Controller_Account::getInstance()->search()->getFirstRecord();
+        $this->_oldSieveVacationActiveState = $this->_account->sieve_vacation_active;
+        try {
+            $this->_oldSieveData = new Expressomail_Sieve_Backend_Sql($this->_account);
+        } catch (Tinebase_Exception_NotFound $tenf) {
+            // do nothing
+        }
+        
+        $this->_json = new Expressomail_Frontend_Json();
+        $this->_imap = Expressomail_Backend_ImapFactory::factory($this->_account);
+        
+        foreach (array($this->_testFolderName, $this->_account->sent_folder, $this->_account->trash_folder) as $folderToCreate) {
+            // create folder if it does not exist
+            $this->_getFolder($folderToCreate);
+        }
+        
+        $config = TestServer::getInstance()->getConfig();
+        $this->_mailDomain = ($config->maildomain) ? $config->maildomain : 'tine20.serpro.gov.br';
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+        if (count($this->_createdFolders) > 0) {
+            foreach ($this->_createdFolders as $folderName) {
+                //echo "delete $folderName\n";
+                try {
+                    $this->_imap->removeFolder(Expressomail_Model_Folder::encodeFolderName($folderName));
+                } catch (Zend_Mail_Storage_Exception $zmse) {
+                    // already deleted
+                }
+            }
+//No necessary with Expressomail
+//           Expressomail_Controller_Cache_Folder::getInstance()->clear($this->_account);
+        }
+        
+        if (! empty($this->_foldersToClear)) {
+            foreach ($this->_foldersToClear as $folderName) {
+                // delete test messages from given folders on imap server (search by special header)
+                $this->_imap->selectFolder($folderName);
+                $result = $this->_imap->search(array(
+                    'HEADER X-Tine20TestMessage jsontest'
+                ));
+                //print_r($result);
+                foreach ($result as $messageUid) {
+                    $this->_imap->removeMessage($messageUid);
+                }
+                
+                // clear message cache
+                $folder = Expressomail_Controller_Folder::getInstance()->getByBackendAndGlobalName($this->_account->getId(), $folderName);
+//No necessary with Expressomail
+//              Expressomail_Controller_Cache_Message::getInstance()->clear($folder);
+            }
+        }
+        
+        // sieve cleanup
+        if ($this->_testSieveScriptName !== NULL) {
+            Expressomail_Controller_Sieve::getInstance()->setScriptName($this->_testSieveScriptName);
+            try {
+                Expressomail_Controller_Sieve::getInstance()->deleteScript($this->_account->getId());
+            } catch (Zend_Mail_Protocol_Exception $zmpe) {
+                // do not delete script if active
+            }
+            Expressomail_Controller_Account::getInstance()->setVacationActive($this->_account, $this->_oldSieveVacationActiveState);
+            
+            if ($this->_oldSieveData !== NULL) {
+                $this->_oldSieveData->save();
+            }
+        }
+        if ($this->_oldActiveSieveScriptName !== NULL) {
+            Expressomail_Controller_Sieve::getInstance()->setScriptName($this->_oldActiveSieveScriptName);
+            Expressomail_Controller_Sieve::getInstance()->activateScript($this->_account->getId());
+        }
+        
+        // vfs cleanup
+        foreach ($this->_pathsToDelete as $path) {
+            $webdavRoot = new Sabre_DAV_ObjectTree(new Tinebase_WebDav_Root());
+            //echo "delete $path";
+            $webdavRoot->delete($path);
+        }
+    }
+
+    /************************ test functions *********************************/
+    
+    /*********************** folder tests ****************************/
+    
+    /**
+     * test search folders (check order of folders as well)
+     */
+    public function testSearchFolders()
+    {
+       $filter = $this->_getFolderFilter();
+        $result = $this->_json->searchFolders($filter);
+        $this->assertGreaterThan(1, $result['totalcount']);
+        $expectedFolders = array('INBOX', $this->_testFolderName);
+        
+        $foundCount = 0;        
+        foreach ($result['results'] as $index => $folder) {
+            if (in_array($folder['localname'], $expectedFolders)) {
+                $foundCount++;
+            }
+        }
+        $this->assertEquals(count($expectedFolders), $foundCount);
+    }
+    
+    /**
+     * clear test folder
+     */
+    public function testClearFolder()
+    {
+        $folderName = $this->_testFolderName;
+        $folder = $this->_getFolder($this->_testFolderName);
+        $folder = Expressomail_Controller_Folder::getInstance()->emptyFolder($folder->getId());
+        
+        $filter = $this->_getMessageFilter($folder->getId());
+        $result = $this->_json->searchMessages($filter, '');
+        
+        $this->assertEquals(0, $result['totalcount'], 'Found too many messages in folder ' . $this->_testFolderName);
+        $this->assertEquals(0, $folder->cache_totalcount);
+    }
+
+    /**
+     * try to create some folders
+     */
+    public function testCreateFolders()
+    {
+        $filter = $this->_getFolderFilter();
+        
+        $result = $this->_json->searchFolders($filter);
+        $foldernames = array('test' => 'test', 'usuario' => 'usuario', 'test//1' => 'test1', 'test\2' => 'test2');
+        foreach ($foldernames as $foldername => $expected) {
+           $result = $this->_json->addFolder($foldername, $this->_testFolderName, $this->_account->getId());
+        $globalname = $this->_testFolderName . $this->_account->delimiter . $expected;
+            $this->_createdFolders[] = $globalname;
+            $this->assertEquals($expected, $result['localname']);
+            $this->assertEquals($globalname, $result['globalname']);
+            //$this->assertEquals(Expressomail_Model_Folder::CACHE_STATUS_EMPTY, $result['cache_status']);
+        }
+    }
+    
+    /**
+     * test emtpy folder (with subfolder)
+     */
+        
+    /**
+     * testUpdateFolderCache
+     */
+    /**
+    public function testUpdateFolderCache()
+    {
+        $result = $this->_json->updateFolderCache($this->_account->getId(), '');
+        
+        // create folders directly on imap server
+        $this->_imap->createFolder('test', $this->_testFolderName, $this->_account->delimiter);
+        $this->_imap->createFolder('testsub', $this->_testFolderName . $this->_account->delimiter . 'test', $this->_account->delimiter);
+        // if something goes wrong, we need to delete these folders in tearDown
+        $this->_createdFolders[] = $this->_testFolderName . $this->_account->delimiter . 'test' . $this->_account->delimiter . 'testsub';
+        $this->_createdFolders[] = $this->_testFolderName . $this->_account->delimiter . 'test';
+        
+        // update cache and check if folder is found
+        $result = $this->_json->updateFolderCache($this->_account->getId(), $this->_testFolderName);
+        $testfolder = $result[0];
+        //print_r($testfolder);
+        $this->assertGreaterThan(0, count($result));
+        $this->assertEquals($this->_testFolderName . $this->_account->delimiter . 'test', $testfolder['globalname']);
+        $this->assertEquals(TRUE, (bool)$testfolder['has_children'], 'should have children');
+        
+        // delete subfolder directly on imap server
+        $this->_imap->removeFolder($this->_testFolderName . $this->_account->delimiter . 'test' . $this->_account->delimiter . 'testsub');
+        array_shift($this->_createdFolders);
+        
+        // check if has_children got updated and folder is removed from cache
+        $this->_json->updateFolderCache($this->_account->getId(), '');
+        $testfolder = $this->_getFolder($this->_testFolderName . $this->_account->delimiter . 'test');
+        $this->assertEquals(FALSE, (bool)$testfolder['has_children'], 'should have no children');
+        $this->setExpectedException('Tinebase_Exception_NotFound');
+        $testfoldersub = $this->_getFolder($this->_testFolderName . $this->_account->delimiter . 'test' . $this->_account->delimiter . 'testsub');
+
+        $this->_imap->removeFolder($this->_testFolderName . $this->_account->delimiter . 'test');
+        array_shift($this->_createdFolders);
+        
+        // try to update message cache of nonexistant folder
+        $this->setExpectedException('Expressomail_Exception_IMAPFolderNotFound');
+       $removedTestfolder = $this->_json->updateMessageCache($testfolder['id'], 1);
+        
+        // update cache and check if folder is deleted
+        $result = $this->_json->updateFolderCache($this->_account->getId(), $this->_testFolderName);
+        $this->assertEquals(0, count($result));
+    }
+    /**
+    /*********************** accounts tests **************************/
+    
+    /**
+     * test search for accounts and check default account from config
+     */
+    public function testSearchAccounts()
+    {
+        $system = $this->_getSystemAccount();
+        
+        $this->assertTrue(! empty($system), 'no accounts found');
+        if (TestServer::getInstance()->getConfig()->mailserver) {
+            $this->assertEquals(TestServer::getInstance()->getConfig()->mailserver, $system['host']);
+            $this->assertEquals(TestServer::getInstance()->getConfig()->mailserver, $system['sieve_hostname']);
+        }
+    }
+    
+    /**
+     * get system account
+     * 
+     * @return array
+     */
+    protected function _getSystemAccount()
+    {
+        $results = $this->_json->searchAccounts(array());
+        
+        $this->assertGreaterThan(0, $results['totalcount']);
+        $system = array();
+        foreach ($results['results'] as $result) {
+            if ($result['name'] == Tinebase_Core::getUser()->accountLoginName . '@' . $this->_mailDomain) {
+                $system = $result;
+            }
+        }
+        
+        return $system;
+    }
+    
+    /**
+     * test change / delete of account
+     */
+      
+    public function testChangeDeleteAccount() 
+    {
+        $system = $this->_getSystemAccount();
+        unset($system['id']);
+        $system['type'] = Expressomail_Model_Account::TYPE_USER;
+        $account = $this->_json->saveAccount($system);
+        
+        $accountRecord = new Expressomail_Model_Account($account, TRUE);
+        $accountRecord->resolveCredentials(FALSE);
+        if (TestServer::getInstance()->getConfig()->mailserver) {
+            $this->assertEquals(TestServer::getInstance()->getConfig()->mailserver, $account['host']);
+        }
+        
+        $this->_json->changeCredentials($account['id'], $accountRecord->user, 'neuespasswort');
+        $account = $this->_json->getAccount($account['id']);
+        
+        $accountRecord = new Expressomail_Model_Account($account, TRUE);
+        $accountRecord->resolveCredentials(FALSE);
+        $this->assertEquals('neuespasswort', $accountRecord->password);
+        
+        $this->_json->deleteAccounts($account['id']);
+    }
+    
+    /*********************** message tests ****************************/
+    
+    /**
+     * test update message cache
+     */
+    /** No necessary with ExpressoMail
+    public function testUpdateMessageCache()
+    {
+        $message = $this->_sendMessage();
+        $inbox = $this->_getFolder('INBOX');
+        // update message cache and check result
+       $result = $this->_json->updateMessageCache($inbox['id'], 30);
+        
+        if ($result['cache_status'] == Expressomail_Model_Folder::CACHE_STATUS_COMPLETE) {
+            $this->assertEquals($result['imap_totalcount'], $result['cache_totalcount'], 'totalcounts should be equal');
+        } else if ($result['cache_status'] == Expressomail_Model_Folder::CACHE_STATUS_INCOMPLETE) {
+            $this->assertNotEquals(0, $result['cache_job_actions_est']);
+        }
+    }
+    /**
+     * test folder status
+     */
+    public function testGetFolderStatus()
+    {
+        $filter = $this->_getFolderFilter();
+        $result = $this->_json->searchFolders($filter);
+        $this->assertGreaterThan(1, $result['totalcount']);        
+        $teste = array();
+        foreach ($result['results'] as $folder) {
+            $this->_json->updateMessageCache($folder['id'], 30);
+            $teste[] = $folder['id'];
+        }
+        $message = $this->_sendMessage();
+        $status = $this->_json->getFolderStatus(array(array('field' => 'id', 'operator' => 'in', 'value' => $teste)));
+        $this->assertEquals($this->_account->sent_folder, $status[0]['globalname']);
+    }
+
+    /**
+     * test folder status of deleted folder
+     * 
+     * @see 0007134: getFolderStatus should ignore non-existent folders
+     */
+       
+    /**
+     * test send message
+     */
+    public function testSendMessage()
+    {
+        // set email to unittest@tine20.org
+        $contactFilter = new Addressbook_Model_ContactFilter(array(
+            array('field' => 'n_family', 'operator' => 'equals', 'value' => 'Clever')
+        ));
+        $contactIds = Addressbook_Controller_Contact::getInstance()->search($contactFilter, NULL, FALSE, TRUE);
+        $contact = Addressbook_Controller_Contact::getInstance()->get($contactIds[0]);
+        $originalEmail =  $contact->email;
+        $contact->email = $this->_account->email;
+        $contact = Addressbook_Controller_Contact::getInstance()->update($contact, FALSE);
+
+        // send email
+        $messageToSend = $this->_getMessageData('unittest@' . $this->_mailDomain);
+        $messageToSend['note'] = 1;
+        $messageToSend['bcc']  = array('unittest@' . $this->_mailDomain);
+        //print_r($messageToSend);
+        $returned = $this->_json->saveMessage($messageToSend);
+        $this->_foldersToClear = array('INBOX', $this->_account->sent_folder);
+        
+        // check if message is in sent folder
+        $message = $this->_searchForMessageBySubject($messageToSend['subject'], $this->_account->sent_folder);
+        $this->assertEquals($message['from_email'], $messageToSend['from_email']);
+        $this->assertTrue(isset($message['to'][0]));
+        $this->assertEquals($message['to'][0],      $messageToSend['to'][0], 'recipient not found');
+        $this->assertEquals($message['bcc'][0],     $messageToSend['bcc'][0], 'bcc recipient not found');
+        $this->assertEquals($message['subject'],    $messageToSend['subject']);
+        
+        // check if email note has been added to contact(s)
+        $contact = Addressbook_Controller_Contact::getInstance()->get($contact->getId());
+        $emailNoteType = Tinebase_Notes::getInstance()->getNoteTypeByName('email');
+        
+        // check / delete notes
+        $emailNoteIds = array();
+        foreach ($contact->notes as $note) {
+            if ($note->note_type_id == $emailNoteType->getId()) {
+                $this->assertEquals(1, preg_match('/' . $messageToSend['subject'] . '/', $note->note));
+                $this->assertEquals(Tinebase_Core::getUser()->getId(), $note->created_by);
+                $this->assertContains('teste', $note->note);
+                $emailNoteIds[] = $note->getId();
+            }
+        }
+        $this->assertGreaterThan(0, count($emailNoteIds), 'no email notes found');
+        Tinebase_Notes::getInstance()->deleteNotes($emailNoteIds);
+        
+        // reset sclevers original email address
+        $contact->email = $originalEmail;
+        Addressbook_Controller_Contact::getInstance()->update($contact, FALSE);
+    }
+     
+    
+    /**
+     * try to get a message from imap server (with complete body, attachments, etc)
+     * 
+     * @see 0006300: add unique message-id header to new messages (for message-id check)
+     */
+    public function testGetMessage()
+    {
+        $message = $this->_sendMessage();
+        
+        // get complete message
+        
+        $message = $this->_json->getMessage($message['id']);
+        
+        // check
+        $this->assertTrue(isset($message['headers']) && $message['headers']['message-id']);
+        $this->assertContains('@' . $this->_mailDomain, $message['headers']['message-id']);
+        $this->assertGreaterThan(0, preg_match('/teste/', $message['body']));
+        
+        // delete message on imap server and check if correct exception is thrown when trying to get it
+        $this->_imap->removeMessage($message['messageuid']);
+   //   Tinebase_Core::getCache()->clean();
+        $this->setExpectedException('Tinebase_Exception_NotFound');
+        $message = $this->_json->getMessage($message['id']);
+    }
+    
+         
+    /**
+     * try search for a message with path filter
+     */
+    public function testEmptyFolderWithSubfolder()
+    {
+       $folderName = $this->_testFolderName;
+       $folder = $this->_getFolder($this->_testFolderName);
+       $this->testCreateFolders();
+       //  Faltava parametro para excluir subpastas
+       $folderArray = $this->_json->emptyFolder($folder->getId(), 1);
+       $this->assertEquals(1, $folderArray['has_children']);
+       //  Eliminada as chamadas para update no cache
+        $result = $this->_json->updateFolderCache($this->_account->getId(), $this->_testFolderName);
+       $this->assertEquals(0, count($result));
+    }
+    
+     public function testSearchMessageWithPathFilter()
+    {
+        $filter = $this->_getFolderFilter();
+       $resultado = $this->_json->searchFolders($filter);
+       
+        $sentMessage = $this->_sendMessage();
+        $env = $this->_getFolder($this->_account->trash_folder);
+        $sent = $this->_getFolder($this->_account->sent_folder);
+        $inb = $this->_getFolder('INBOX');
+        
+        $filtro = array('condition' => 'OR', 'filters' => array
+                        (array('condition' => 'AND', 'filters' => array
+                            (array('field' => 'query', 'operator' => 'contains', 'value' => ''),
+                                array('field' => 'path', 'operator' => 'in', 'value' => array
+                                    ('/'. $this->_account->getId().'/'. $env['id'].'/'. $inb['id']))),'label' => 'Messages')));
+        $pagina = array('paging'  => array('sort' => 'received', 'dir' => 'DESC','start' => '0', 'limit' => '50'));        
+                     
+        $result = $this->_json->searchMessages($filtro, '');
+        
+        $message = $this->_getMessageFromSearchResult($result, $sentMessage['subject']);
+        $this->assertTrue(! empty($message), 'Sent message not found with account path filter');
+
+        $inbox = $this->_getFolder('INBOX');
+        $filter = array(array(
+            'field' => 'path', 'operator' => 'in', 'value' => '/' . $this->_account->getId() . '/' . $inbox->getId()
+        ));
+        $result = $this->_json->searchMessages($filter, '');
+        
+        $message = $this->_getMessageFromSearchResult($result, $sentMessage['subject']);
+        $this->assertTrue(! empty($message), 'Sent message not found with path filter');
+        
+//        foreach ($result['results'] as $mail) {
+//            $this->assertEquals($inbox->getId(), $mail['folder_id'], 'message is in wrong folder: ' . print_r($mail, TRUE));
+//        }
+    }   
+    
+
+    
+    
+    
+    /**
+     * try search for a message with all inboxes and flags filter
+     */
+    public function testSearchMessageWithAllInboxesFilter()
+    {
+        $sentMessage = $this->_sendMessage();
+        $filter = array(
+            array('field' => 'path',  'operator' => 'in',       'value' => Expressomail_Model_MessageFilter::PATH_ALLINBOXES),
+            array('field' => 'flags', 'operator' => 'notin',    'value' => Zend_Mail_Storage::FLAG_FLAGGED),
+        );
+        $result = $this->_json->searchMessages($filter, '');
+        $this->assertGreaterThan(0, $result['totalcount']);
+        $this->assertEquals($result['totalcount'], count($result['results']));
+        
+        $message = $this->_getMessageFromSearchResult($result, $sentMessage['subject']);
+        $this->assertTrue(! empty($message), 'Sent message not found with all inboxes filter');
+    }
+    
+    /**
+     * try search for a message with empty path filter
+    
+    Busca por filtro sem "path" não implementada
+    
+    public function testSearchMessageEmptyPath()
+    {
+        $sentMessage = $this->_sendMessage();
+        
+        $filter = array(
+            array('field' => 'path',  'operator' => 'equals',   'value' => ''),
+        );
+        $result = $this->_json->searchMessages($filter, '');
+        
+        $this->assertEquals(0, $result['totalcount']);
+        $accountFilterFound = FALSE;
+        
+        foreach ($result['filter'] as $filter) {
+            if ($filter['field'] === 'account_id' && empty($filter['value'])) {
+                $accountFilterFound = TRUE;
+                break;
+            }
+        }
+        $this->assertTrue($accountFilterFound);
+    }
+    */
+    
+    
+    /**
+     * test flags (add + clear + deleted)
+     * 
+     */
+    public function testAddAndClearFlags()
+    {
+        $message = $this->_sendMessage();
+        $inboxBefore = $this->_getFolder('INBOX');
+        
+        $this->_json->addFlags($message['id'], Zend_Mail_Storage::FLAG_SEEN);
+        
+        // check if unread count got decreased
+        $inboxAfter = $this->_getFolder('INBOX');
+//      $this->assertTrue($inboxBefore->cache_unreadcount - 1 == $inboxAfter->cache_unreadcount, 'wrong cache unreadcount');
+        
+        $message = $this->_json->getMessage($message['id']);
+        $this->assertTrue(in_array(Zend_Mail_Storage::FLAG_SEEN, $message['flags']), 'seen flag not set');
+        
+        // try with a filter
+        $filter = array(
+            array('field' => 'id', 'operator' => 'in', array($message['id']))
+        );
+        $this->_json->clearFlags($filter, Zend_Mail_Storage::FLAG_SEEN);
+        
+        $message = $this->_json->getMessage($message['id']);
+        $this->assertFalse(in_array(Zend_Mail_Storage::FLAG_SEEN, $message['flags']), 'seen flag should not be set');
+
+        $this->setExpectedException('Tinebase_Exception_NotFound');
+        $this->_json->addFlags(array($message['id']), Zend_Mail_Storage::FLAG_DELETED);
+        $this->_json->getMessage($message['id']);
+    }
+
+    /**
+     * test delete from trash
+     */
+    public function testDeleteFromTrashWithFilter()
+    {
+        $message = $this->_sendMessage();
+        $this->_foldersToClear = array('INBOX', $this->_account->sent_folder, $this->_account->trash_folder);
+        
+        $trash = $this->_getFolder($this->_account->trash_folder);
+        $result = $this->_json->moveMessages(array(array(
+            'field' => 'id', 'operator' => 'in', 'value' => array($message['id'])
+        )), $trash->getId());
+
+        $messageInTrash = $this->_searchForMessageBySubject($message['subject'], $this->_account->trash_folder);
+        
+        // delete messages in trash with filter
+        $this->_json->addFlags(array(array(
+            'field' => 'folder_id', 'operator' => 'equals', 'value' => $trash->getId()
+        ), array(
+            'field' => 'id', 'operator' => 'in', 'value' => array($messageInTrash['id'])
+        )), Zend_Mail_Storage::FLAG_DELETED);
+        
+        //in Expressomail this exeption is not thrown
+        //$this->setExpectedException('Tinebase_Exception_NotFound');
+        $this->_json->getMessage($messageInTrash['id']);
+    }
+    
+    /**
+     * move message to trash with trash folder constant (Felamimail_Model_Folder::FOLDER_TRASH)
+     */
+    public function testMoveMessagesToTrash()
+    {
+        $message = $this->_sendMessage();
+        $this->_foldersToClear = array('INBOX', $this->_account->sent_folder, $this->_account->trash_folder);
+        $result = $this->_json->moveMessages(array(array(
+            'field' => 'id', 'operator' => 'in', 'value' => array($message['id'])
+        )), Expressomail_Model_Folder::FOLDER_TRASH);
+
+        $messageInTrash = $this->_searchForMessageBySubject($message['subject'], $this->_account->trash_folder);
+    }
+    
+    /**
+     * test reply mail and check some headers
+     * 
+     * @see 0006106: Add References header / https://forge.tine20.org/mantisbt/view.php?id=6106
+     */
+    public function testReplyMessage()
+    {
+        $message = $this->_sendMessage();
+        
+        $replyMessage = $this->_getReply($message);
+        $returned = $this->_json->saveMessage($replyMessage);
+        
+        $result = $this->_getMessages();
+        
+        $replyMessageFound = array();
+        $originalMessage = array();
+        foreach ($result['results'] as $mail) {
+            if ($mail['subject'] == $replyMessage['subject']) {
+                $replyMessageFound = $mail;
+            }
+            if ($mail['subject'] == $message['subject']) {
+                $originalMessage = $mail;
+            }
+        }
+        $replyMessageFound = $this->_json->getMessage($replyMessageFound['id']);
+        $originalMessage = $this->_json->getMessage($originalMessage['id']);
+        
+        $this->assertTrue(! empty($replyMessageFound), 'replied message not found');
+        $this->assertTrue(! empty($originalMessage), 'original message not found');
+        
+        // check headers
+        $this->assertTrue(isset($replyMessageFound['headers']['in-reply-to']));
+        $this->assertEquals($originalMessage['headers']['message-id'], $replyMessageFound['headers']['in-reply-to']);
+        $this->assertTrue(isset($replyMessageFound['headers']['references']));
+        $this->assertEquals($originalMessage['headers']['message-id'], $replyMessageFound['headers']['references']);
+        
+        // check answered flag
+        $this->assertTrue(in_array(Zend_Mail_Storage::FLAG_ANSWERED, $originalMessage['flags'], 'could not find flag'));
+    }
+    
+    /**
+     * get reply message data
+     * 
+     * @param array $_original
+     * @return array
+     */
+    protected function _getReply($_original)
+    {
+        $replyMessage               = $this->_getMessageData();
+        $replyMessage['subject']    = 'Re: ' . $_original['subject'];
+        $replyMessage['original_id']= $_original['id'];
+        $replyMessage['flags']      = Zend_Mail_Storage::FLAG_ANSWERED;
+        
+        return $replyMessage;
+    }
+
+    /**
+     * test reply mail in sent folder
+     */
+    public function testReplyMessageInSentFolder()
+    {
+        $messageInSent = $this->_sendMessage($this->_account->sent_folder);
+        $replyMessage = $this->_getReply($messageInSent);
+        $returned = $this->_json->saveMessage($replyMessage);
+        
+        $result = $this->_getMessages();
+        $sentMessage = $this->_getMessageFromSearchResult($result, $replyMessage['subject']);
+        $this->assertTrue(! empty($sentMessage));
+    }
+
+    /**
+     * test reply mail with long references header
+     * 
+     * @see 0006644: "At least one mail header line is too long"
+     */
+    public function testReplyMessageWithLongHeader()
+    {
+        $messageInSent = $this->_sendMessage($this->_account->sent_folder, array(
+            'references' => '<c95d8187-2c71-437e-adb8-5e1dcdbdc507@email.test.org>
+   <2601bbfa-566e-4490-a3db-aad005733d32@email.test.org>
+   <20120530154350.1854610131@ganymed.de>
+   <7e393ce1-d193-44fc-bf5f-30c61a271fe6@email.test.org>
+   <4FC8B49C.8040704@funk.de>
+   <dba2ad5c-6726-4171-8710-984847c010a1@email.test.org>
+   <20120601123551.5E98610131@ganymed.de>
+   <f1cc3195-8641-46e3-8f20-f60f3e16b107@email.test.org>
+   <20120619093658.37E4210131@ganymed.de>
+   <CA+6Rn2PX2Q3tOk2tCQfCjcaC8zYS5XZX327OoyJfUb+w87vCLQ@mail.net.com>
+   <20120619130652.03DD310131@ganymed.de>
+   <37616c6a-4c47-4b54-9ca6-56875bc9205d@email.test.org>
+   <20120620074843.42E2010131@ganymed.de>
+   <CA+6Rn2MAb2x0qeSfcaW6F=0S7LEQL442Sx2ha9RtwMs4B0esBg@mail.net.com>
+   <20120620092902.88C8C10131@ganymed.de>
+   <c95d8187-2c71-437e-adb8-5e1dcdbdc507@email.test.org>
+   <2601bbfa-566e-4490-a3db-aad005733d32@email.test.org>
+   <20120530154350.1854610131@ganymed.de>
+   <7e393ce1-d193-44fc-bf5f-30c61a271fe6@email.test.org>
+   <4FC8B49C.8040704@funk.de>
+   <dba2ad5c-6726-4171-8710-984847c010a1@email.test.org>
+   <20120601123551.5E98610131@ganymed.de>
+   <f1cc3195-8641-46e3-8f20-f60f3e16b107@email.test.org>
+   <20120619093658.37E4210131@ganymed.de>
+   <CA+6Rn2PX2Q3tOk2tCQfCjcaC8zYS5XZX327OoyJfUb+w87vCLQ@mail.net.com>
+   <20120619130652.03DD310131@ganymed.de>
+   <37616c6a-4c47-4b54-9ca6-56875bc9205d@email.test.org>
+   <20120620074843.42E2010131@ganymed.de>
+   <CA+6Rn2MAb2x0qeSfcaW6F=0S7LEQL442Sx2ha9RtwMs4B0esBg@mail.net.com>
+   <20120620092902.88C8C10131@ganymed.de>'
+        ));
+        $replyMessage = $this->_getReply($messageInSent);
+        $returned = $this->_json->saveMessage($replyMessage);
+        
+        $result = $this->_getMessages();
+        $sentMessage = $this->_getMessageFromSearchResult($result, $replyMessage['subject']);
+        $this->assertTrue(! empty($sentMessage));
+    }
+    
+    /**
+     * test move
+     */
+     public function testMoveMessage()
+    {
+        $message = $this->_sendMessage();
+        $this->_foldersToClear = array('INBOX', $this->_account->sent_folder, $this->_testFolderName);
+        
+        $inbox = $this->_getFolder('INBOX');
+        $inboxBefore = $this->_json->updateMessageCache($inbox['id'], 30);
+        
+        // move
+        $testFolder = $this->_getFolder($this->_testFolderName);
+        $result = $this->_json->moveMessages(array(array(
+            'field' => 'id', 'operator' => 'in', 'value' => array($message['id'])
+        )), $testFolder->getId());
+
+        $inboxAfter = $this->_getFolder('INBOX');
+        
+        // check if count was decreased correctly
+        $this->assertEquals($inboxBefore['cache_unreadcount'] - 1, $inboxAfter['cache_unreadcount']);
+        $this->assertEquals($inboxBefore['cache_totalcount'] - 1, $inboxAfter['cache_totalcount']);
+        
+        $result = $this->_getMessages($this->_testFolderName);
+        $movedMessage = array();
+        foreach ($result['results'] as $mail) {
+            if ($mail['subject'] == $message['subject']) {
+                $movedMessage = $mail;
+            }
+        }
+        $this->assertTrue(! empty($movedMessage), 'moved message not found');
+    }
+    
+    
+    /**
+     * forward message test
+     * 
+     * @see 0007624: losing umlauts in attached filenames
+     */
+    public function testForwardMessageWithAttachment()
+    {
+        /*
+        $testFolder = $this->_getFolder($this->_testFolderName);
+        $message = fopen(dirname(__FILE__) . '/files/multipart_rfc2822.eml', 'r');
+        Expressomail_Controller_Message::getInstance()->appendMessage($testFolder, $message);
+        $subject = 'Fwd: [Officespot-cs-svn] r15209 - trunk/tine20/Tinebase';
+        $message = $this->_searchForMessageBySubject($subject, $this->_testFolderName);
+        $fwdSubject = 'Fwd: ' . $subject;
+        $forwardMessageData = array(
+            'account_id'    => $this->_account->getId(),
+            'subject'       => $fwdSubject,
+            'to'            => array('unittest@' . $this->_mailDomain),
+            'body'          => "aaaaaä <br>",
+            'headers'       => array('X-Tine20TestMessage' => 'jsontest'),
+            'original_id'   => $message['id'],
+            'attachments'   => array(new Tinebase_Model_TempFile(array(
+                'type'  => Expressomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822,
+                'name'  => 'Verbessurüngsvorschlag',
+            ), TRUE)),
+            'flags'         => Zend_Mail_Storage::FLAG_PASSED,
+        );
+        
+        $this->_foldersToClear[] = 'INBOX';
+        $this->_json->saveMessage($forwardMessageData);
+        $forwardMessage = $this->_searchForMessageBySubject($fwdSubject);
+        
+        // check attachment name
+        $forwardMessageComplete = $this->_json->getMessage($forwardMessage['id']);
+        $this->assertEquals(1, count($forwardMessageComplete['attachments']));
+        $this->assertEquals('Verbessurüngsvorschlag.eml', $forwardMessageComplete['attachments'][0]['filename'], 'umlaut missing from attachment filename');
+        
+        $forwardMessage = $this->_json->getMessage($forwardMessage['id']);
+        $this->assertTrue(array_key_exists('structure', $forwardMessage), 'structure should be set when fetching complete message: ' . print_r($forwardMessage, TRUE));
+        $this->assertEquals(Expresomail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $forwardMessage['structure']['parts'][2]['contentType']);
+        
+        $message = $this->_json->getMessage($message['id']);
+        $this->assertTrue(in_array(Zend_Mail_Storage::FLAG_PASSED, $message['flags']), 'forwarded flag missing in flags: ' . print_r($message, TRUE));
+         *
+         */
+    }
+    
+    /**
+     * testSendMessageWithAttachmentWithoutExtension
+     * 
+     * @see 0008328: email attachment without file extension is not sent properly
+     */
+    
+    /**
+     * save message in folder (draft) test
+     * 
+     * @see 0007178: BCC does not save the draft message
+     */
+    public function testSaveMessageInFolder()
+    {
+        $messageToSave = $this->_getMessageData();
+        $messageToSave['bcc'] = array('bccaddress@email.org');
+        
+        $draftsFolder = $this->_getFolder($this->_account->drafts_folder);
+        $returned = $this->_json->saveMessageInFolder($this->_account->drafts_folder, $messageToSave);
+        $this->_foldersToClear = array($this->_account->drafts_folder);
+        
+        // check if message is in drafts folder
+        $message = $this->_searchForMessageBySubject($messageToSave['subject'], $this->_account->drafts_folder);
+        $this->assertEquals($messageToSave['subject'],  $message['subject']);
+        $this->assertEquals($messageToSave['to'][0],    $message['to'][0], 'recipient not found');
+        $this->assertEquals(1, count($message['bcc']), 'bcc recipient not found: ' . print_r($message, TRUE));
+        $this->assertEquals($messageToSave['bcc'][0],   $message['bcc'][0], 'bcc recipient not found');
+    }
+    
+    /**
+     * testSendReadingConfirmation
+     * 
+     * @see 0007736: ask user before sending reading confirmation
+     */
+    /** Método foi alterado no Frontend aberto ticket #8132 para correção
+    public function testSendReadingConfirmation()
+    {
+        $messageToSave = $this->_getMessageData();
+        $messageToSave['headers']['disposition-notification-to'] = $this->_account->email;
+        $returned = $this->_json->saveMessageInFolder($this->_testFolderName, $messageToSave);
+        $messageWithReadingConfirmationHeader = $this->_searchForMessageBySubject($messageToSave['subject'], $this->_testFolderName);
+        $this->_messageIds[] = $messageWithReadingConfirmationHeader['id'];
+//      $this->_json->sendReadingConfirmation($messageWithReadingConfirmationHeader['id']);
+        
+        $translate = Tinebase_Translation::getTranslation('Felamimail');
+        $subject = $translate->_('Reading Confirmation:') . ' '. $messageToSave['subject'];
+        $message = $this->_searchForMessageBySubject($subject);
+        $this->_messageIds[] = $message['id'];
+        
+        $complete = $this->_json->getMessage($message['id']);
+        $this->assertContains($translate->_('Was read by:') . ' ' . $this->_account->from, $complete['body']);
+    }
+    
+    /**
+     * save message in non-existant folder (templates) test
+     * 
+     * @see 0008476: Drafts are not working
+     */
+    /**
+    public function testSaveMessageInNonExistantTemplatesFolder()
+    {
+        $messageToSave = $this->_getMessageData();
+         
+        $templatesFolder = $this->_getFolder($this->_account->templates_folder, FALSE);
+
+    //  print_r($templatesFolder);
+
+        if ($templatesFolder) {
+            $this->_json->deleteFolder($templatesFolder['id'], $this->_account->getId());
+        }
+        $returned = $this->_json->saveMessageInFolder($this->_account->templates_folder, $messageToSave);
+        $this->_foldersToClear = array($this->_account->templates_folder);
+        
+        // check if message is in templates folder
+        $message = $this->_searchForMessageBySubject($messageToSave['subject'], $this->_account->templates_folder);
+        $this->assertEquals($messageToSave['subject'],  $message['subject']);
+        $this->assertEquals($messageToSave['to'][0],    $message['to'][0], 'recipient not found');
+    }
+    
+    /*********************** sieve tests ****************************/
+    
+    /**
+     * set and get vacation sieve script
+     * 
+     * @see 0007768: Sieve - Vacation notify frequency not being set (Cyrus)
+     */
+    public function testGetSetVacation()
+    {
+        $vacationData = $this->_getVacationData();
+        
+        $this->_sieveTestHelper($vacationData);
+        
+        // check if script was activated
+        $activeScriptName = Expressomail_Controller_Sieve::getInstance()->getActiveScriptName($this->_account->getId());
+        $this->assertEquals($this->_testSieveScriptName, $activeScriptName);
+        $updatedAccount = Expressomail_Controller_Account::getInstance()->get($this->_account->getId());
+        $this->assertTrue((bool) $updatedAccount->sieve_vacation_active);
+        
+        $result = $this->_json->getVacation($this->_account->getId());
+
+        $this->assertEquals($this->_account->email, $result['addresses'][0]);
+        
+        $sieveBackend = Expressomail_Backend_SieveFactory::factory($this->_account->getId());
+        if (preg_match('/dbmail/i', $sieveBackend->getImplementation())) {
+            $translate = Tinebase_Translation::getTranslation('Felamimail');
+            $vacationData['subject'] = sprintf($translate->_('Out of Office reply from %1$s'), Tinebase_Core::getUser()->accountFullName);
+        }
+        
+        foreach (array('reason', 'enabled', 'subject', 'days') as $field) {
+            $this->assertEquals($vacationData[$field], $result[$field], 'vacation data mismatch: ' . $field);
+        }
+    }
+    
+    /**
+     * get vacation data
+     * 
+     * @return array
+     */
+    protected function _getVacationData()
+    {
+        return array(
+            'id'                    => $this->_account->getId(),
+            'subject'               => 'unittest vacation subject',
+            'from'                  => $this->_account->from . ' <' . $this->_account->email . '>',
+            'days'                  => 3,
+            'enabled'               => TRUE,
+            'reason'                => 'unittest vacation message<br /><br />signature',
+            'mime'                  => NULL,
+        );
+    }
+    
+    /**
+     * test mime vacation sieve script
+     */
+    public function testMimeVacation()
+    {
+        $vacationData = $this->_getVacationData();
+        $vacationData['reason'] = "\n<html><body><h1>unittest vacation&nbsp;message</h1></body></html>";
+        
+        $_sieveBackend = Expressomail_Backend_SieveFactory::factory($this->_account->getId());
+        if (! in_array('mime', $_sieveBackend->capability())) {
+            $vacationData['mime'] = 'text/html';
+        }
+        
+        $this->_sieveTestHelper($vacationData, TRUE);
+    }
+    
+    /**
+     * test get/set of rules sieve script
+     */
+    public function testGetSetRules()
+    {
+        $ruleData = $this->_getRuleData();
+        
+        $this->_sieveTestHelper($ruleData);
+        
+        // check getRules
+        $result = $this->_json->getRules($this->_account->getId());
+        $this->assertEquals($result['totalcount'], count($ruleData));
+        
+        // check by sending mail
+        $messageData = $this->_getMessageData('', 'viagra');
+        $returned = $this->_json->saveMessage($messageData);
+        $this->_foldersToClear = array('INBOX', $this->_testFolderName);
+        // check if message is in test folder
+        $message = $this->_searchForMessageBySubject($messageData['subject'], $this->_testFolderName);
+    }
+    
+    /**
+     * testRemoveRules
+     * 
+     * @see 0006490: can not delete single filter rule
+     */
+    public function testRemoveRules()
+    {
+        $this->testGetSetRules();
+        $this->_json->saveRules($this->_account->getId(), array());
+        
+        $result = $this->_json->getRules($this->_account->getId());
+        $this->assertEquals(0, $result['totalcount'], 'found rules: ' . print_r($result, TRUE));
+    }
+    
+    /**
+     * get sieve rule data
+     * 
+     * @return array
+     */
+    protected function _getRuleData()
+    {
+        return array(array(
+            'id'            => '1',
+            'action_type'   => Expressomail_Sieve_Rule_Action::FILEINTO, 
+            'action_argument' => $this->_testFolderName,
+            'conditions'    => array(array(
+                'test'          => Expressomail_Sieve_Rule_Condition::TEST_ADDRESS,
+                'comperator'    => Expressomail_Sieve_Rule_Condition::COMPERATOR_CONTAINS,
+                'header'        => 'From',
+                'key'           => '"abcd" <info@example.org>',
+            )),
+            'enabled'       => 1,
+        ), array(
+            'id'            => '2',
+            'action_type'   => Expressomail_Sieve_Rule_Action::FILEINTO, 
+            'action_argument' => $this->_testFolderName,
+            'conditions'    => array(array(
+                'test'          => Expressomail_Sieve_Rule_Condition::TEST_ADDRESS,
+                'comperator'    => Expressomail_Sieve_Rule_Condition::COMPERATOR_CONTAINS,
+                'header'        => 'From',
+                'key'           => 'info@example.org',
+            )),
+            'enabled'       => 0,
+        ), array(
+            'id'            => '3',
+            'action_type'   => Expressomail_Sieve_Rule_Action::FILEINTO, 
+            'action_argument' => $this->_testFolderName,
+            'conditions'    => array(array(
+                'test'          => Expressomail_Sieve_Rule_Condition::TEST_HEADER,
+                'comperator'    => Expressomail_Sieve_Rule_Condition::COMPERATOR_REGEX,
+                'header'        => 'subject',
+                'key'           => '[vV]iagra|cyalis',
+            )),
+            'enabled'       => 1,
+        ));
+    }
+    
+    /**
+     * test to set a forward rule to this accounts email address
+     * -> should throw exception to prevent mail cycling
+     */
+    public function testSetForwardRuleToSelf()
+    {
+        $ruleData = array(array(
+            'id'            => '1',
+            'action_type'   => Expressomail_Sieve_Rule_Action::REDIRECT, 
+            'action_argument' => $this->_account->email,
+            'conditions'    => array(array(
+                'test'          => Expressomail_Sieve_Rule_Condition::TEST_ADDRESS,
+                'comperator'    => Expressomail_Sieve_Rule_Condition::COMPERATOR_CONTAINS,
+                'header'        => 'From',
+                'key'           => 'info@example.org',
+            )),
+            'enabled'       => 1,
+        ));
+        
+        try {
+            $this->_sieveTestHelper($ruleData);
+            $this->assertTrue(FALSE, 'it is not allowed to set own email address for redirect!');
+        } catch (Expressomail_Exception_Sieve $e) {
+            $this->assertTrue(TRUE);
+        }
+
+        // this should work
+        $ruleData[0]['enabled'] = 0;
+        $this->_sieveTestHelper($ruleData);
+    }
+    
+    /**
+     * testGetVacationTemplates
+     * 
+     * @return array
+     */
+    /** Aguarda configuracao de WEBDAV
+    public function testGetVacationTemplates()
+    {
+        $this->_addVacationTemplateFile();
+        $result = $this->_json->getVacationMessageTemplates();
+        
+        $this->assertTrue($result['totalcount'] > 0, 'no templates found');
+        $found = FALSE;
+        foreach ($result['results'] as $template) {
+            if ($template['name'] === $this->_sieveVacationTemplateFile) {
+                $found = TRUE;
+                break;
+            }
+        }
+        
+        $this->assertTrue($found, 'wrong templates: ' . print_r($result['results'], TRUE));
+        
+        return $template;
+    }
+    
+    /**
+     * add vacation template file to vfs
+     */
+    protected function _addVacationTemplateFile()
+    {
+        $webdavRoot = new Sabre_DAV_ObjectTree(new Tinebase_WebDav_Root());
+        $path = 'webdav/shared/vacation/templates';
+        
+       $node = $webdavRoot->getNodeForPath($path);
+
+        $this->_pathsToDelete[] = $path . '/' . $this->_sieveVacationTemplateFile;
+        $node->createFile($this->_sieveVacationTemplateFile, fopen(dirname(__FILE__) . '/files/' . $this->_sieveVacationTemplateFile, 'r'));
+    }
+    
+    /**
+     * testGetVacationMessage
+     */
+    /** Aguarda configuracao de Webdav
+    public function testGetVacationMessage()
+    {
+        $result = $this->_getVacationMessageWithTemplate();
+        $sclever = Tinebase_User::getInstance()->getFullUserByLoginName('sclever');
+        $this->assertEquals("Ich bin vom 18.04.2012 bis zum 20.04.2012 im Urlaub. Bitte kontaktieren Sie<br /> Paul Wulf (pwulf@tine20.serpro.gov.br) oder Susan Clever (" .
+            $sclever->accountEmailAddress . ").<br /><br />I am on vacation until Apr 20, 2012. Please contact Paul Wulf<br />(pwulf@tine20.serpro.gov.br) or Susan Clever (" .
+            $sclever->accountEmailAddress . ") instead.<br /><br />" .
+            Addressbook_Controller_Contact::getInstance()->getContactByUserId(Tinebase_Core::getUser()->getId())->n_fn, $result['message']);
+    }
+    
+    /**
+     * get vacation message with template
+     * 
+     * @return array
+     */
+    protected function _getVacationMessageWithTemplate()
+    {
+        $template = $this->testGetVacationTemplates();
+        $sclever = Tinebase_User::getInstance()->getFullUserByLoginName('sclever');
+        $result = $this->_json->getVacationMessage(array(
+            'start_date' => '2012-04-18',
+            'end_date'   => '2012-04-20',
+            'contact_ids' => array(
+                Tinebase_User::getInstance()->getFullUserByLoginName('pwulf')->contact_id,
+                $sclever->contact_id,
+            ),
+            'template_id' => $template['id'],
+            'signature' => $this->_account->signature
+        ));
+        
+        return $result;
+    }
+    
+    /**
+     * testGetVacationWithSignature
+     * 
+     * @see 0006866: check signature linebreaks in vacation message from template
+     */
+    /** Aguarda configuracao de Webdav   
+    public function testGetVacationWithSignature()
+    {
+        $this->_sieveVacationTemplateFile = 'vacation_template_sig.tpl';
+        
+        // set signature with <br> + linebreaks
+        $this->_account->signature = "llalala<br>\nxyz<br>\nblubb<br>";
+        
+        $result = $this->_getVacationMessageWithTemplate();
+        $this->assertContains('-- <br />llalala<br />xyz<br />blubb<br />', $result['message'], 'wrong linebreaks or missing signature');
+    }
+    
+    /**
+    * testSetVacationWithStartAndEndDate
+    *
+    * @see 0006266: automatic deactivation of vacation message
+    */
+    public function testSetVacationWithStartAndEndDate()
+    {
+        $vacationData = $this->_getVacationData();
+        $vacationData['start_date'] = '2012-04-18';
+        $vacationData['end_date'] = '2012-04-20';
+        $result = $this->_sieveTestHelper($vacationData);
+        
+        $this->assertContains($vacationData['start_date'], $result['start_date']);
+        $this->assertContains($vacationData['end_date'], $result['end_date']);
+    }
+    
+    protected function _setTestScriptname()
+    {
+        $this->_oldActiveSieveScriptName = Expressomail_Controller_Sieve::getInstance()->getActiveScriptName($this->_account->getId());
+        $this->_testSieveScriptName = 'Expressomail_Unittest';
+        Expressomail_Controller_Sieve::getInstance()->setScriptName($this->_testSieveScriptName);
+    }
+    
+    /**
+     * set disabled vacation message
+     */
+    protected function _setDisabledVacation()
+    {
+        $vacationData = $this->_getVacationData();
+        $vacationData['enabled'] = FALSE;
+        $resultSet = $this->_json->saveVacation($vacationData);
+    }
+    
+    /**
+     * get folder filter
+     *
+     * @return array
+     */
+    protected function _getFolderFilter()
+    {
+        return array(array(
+            'field' => 'globalname', 'operator' => 'equals', 'value' => ''
+        ));
+    }
+
+    /**
+     * get message filter
+     *
+     * @param string $_folderId
+     * @return array
+     */
+    protected function _getMessageFilter($_folderId)
+    {
+        $result = array(array(
+            'field' => 'folder_id', 'operator' => 'equals', 'value' => $_folderId
+        ));
+        
+        return $result;
+    }
+    
+    /**
+     * get mailbox
+     *
+     * @param string $name
+     * @param boolean $createFolder
+     * @return Felamimail_Model_Folder|NULL
+     */
+    protected function _getFolder($name, $createFolder = TRUE)
+    {
+//      Expressomail_Controller_Cache_Folder::getInstance()->update($this->_account->getId());
+        try {
+            $folder = Expressomail_Controller_Folder::getInstance()->getByBackendAndGlobalName($this->_account->getId(), $name);
+        } catch (Tinebase_Exception_NotFound $tenf) {
+            $folder = ($createFolder) ? Expressomail_Controller_Folder::getInstance()->create($this->_account, $name) : NULL;
+        }
+        
+        return $folder;
+    }
+
+    /**
+     * get message data
+     *
+     * @return array
+     */
+    protected function _getMessageData($_emailFrom = '', $_subject = 'test')
+    {
+        return array(
+            'account_id'    => $this->_account->getId(),
+            'subject'       => $_subject,
+            'to'            => array('unittest@' . $this->_mailDomain),
+            'body'          => 'teste<br>',
+            'headers'       => array('X-Tine20TestMessage' => 'jsontest'),
+            'from_email'    => $_emailFrom,
+            'content_type'  => Expressomail_Model_Message::CONTENT_TYPE_HTML,
+        );
+    }
+
+    /**
+     * send message and return message array
+     *
+     * @param string $folderName
+     * @param array $addtionalHeaders
+     * @return array
+     */
+    protected function _sendMessage($folderName = 'INBOX', $addtionalHeaders = array())
+    {
+        $messageToSend = $this->_getMessageData();
+           $messageToSend['headers'] = array_merge($messageToSend['headers'], $addtionalHeaders);
+        $returned = $this->_json->saveMessage($messageToSend);
+        $this->_foldersToClear = array('INBOX', $this->_account->sent_folder);
+        
+        $result = $this->_getMessages($folderName);
+        $message = $this->_getMessageFromSearchResult($result, $messageToSend['subject']);
+        $this->assertTrue(! empty($message), 'Sent message not found.');
+        return $message;
+     }
+    
+    /**
+     * returns message array from result
+     * 
+     * @param array $_result
+     * @param string $_subject
+     * @return array
+     */
+    protected function _getMessageFromSearchResult($_result, $_subject)
+    {
+        $message = array();
+        foreach ($_result['results'] as $mail) {
+            if ($mail['subject'] == $_subject) {
+                $message = $mail;
+            }
+        }
+        
+        return $message;
+    }
+    
+    /**
+     * get messages from folder
+     * 
+     * @param string $_folderName
+     * @return array
+     */
+    protected function _getMessages($_folderName = 'INBOX')
+    {
+        $folder = $this->_getFolder($_folderName);
+        $filter = $this->_getMessageFilter($folder->getId());
+        // update cache
+//No necessary with Expressomail
+//      $folder = Expressomail_Controller_Cache_Message::getInstance()->updateCache($folder, 10, 1);
+//      $i = 0;
+//      while ($folder->cache_status != Expressomail_Model_Folder::CACHE_STATUS_COMPLETE && $i < 10) {
+//No necessary with Expressomail
+//          $folder = Expressomail_Controller_Cache_Message::getInstance()->updateCache($folder, 10);
+//          $i++;
+//      }
+        $result = $this->_json->searchMessages($filter, '');
+//      print_r($result);
+        
+        return $result;
+    }
+    
+    /**
+     * search for message defined by subject in folder
+     * 
+     * @param string $_subject
+     * @param string $_folderName
+     * @return string message data
+     */
+    protected function _searchForMessageBySubject($_subject, $_folderName = 'INBOX')
+    {
+        $result = $this->_getMessages($_folderName);
+        
+        $message = array();
+        foreach ($result['results'] as $mail) {
+            if ($mail['subject'] == $_subject) {
+                $message = $mail;
+            }
+        }
+        $this->assertGreaterThan(0, $result['totalcount'], 'folder is empty');
+        $this->assertTrue(! empty($message), 'Message not found');
+        
+        return $message;
+    }
+    
+    /**
+     * sieve test helper
+     * 
+     * @param array $_sieveData
+     * @return array
+     */
+    protected function _sieveTestHelper($_sieveData, $_isMime = FALSE)
+    {
+        $this->_setTestScriptname();
+        
+        // check which save fn to use
+        if (array_key_exists('reason', $_sieveData)) {
+            $resultSet = $this->_json->saveVacation($_sieveData);
+            $this->assertEquals($this->_account->email, $resultSet['addresses'][0]);
+            
+            $_sieveBackend = Expressomail_Backend_SieveFactory::factory($this->_account->getId());
+            
+            if (preg_match('/dbmail/i', $_sieveBackend->getImplementation())) {
+                $translate = Tinebase_Translation::getTranslation('Felamimail');
+                $this->assertEquals(sprintf(
+                    $translate->_('Out of Office reply from %1$s'), Tinebase_Core::getUser()->accountFullName), 
+                    $resultSet['subject']
+                );
+            } else {
+                $this->assertEquals($_sieveData['subject'], $resultSet['subject']);
+            }
+            
+            if ($_isMime) {
+                $this->assertEquals(html_entity_decode('unittest vacation&nbsp;message', ENT_NOQUOTES, 'UTF-8'), $resultSet['reason']);
+            } else {
+                $this->assertEquals($_sieveData['reason'], $resultSet['reason']);
+            }
+            
+        } else if (array_key_exists('action_type', $_sieveData[0])) {
+            $resultSet = $this->_json->saveRules($this->_account->getId(), $_sieveData);
+            $this->assertEquals($_sieveData, $resultSet);
+        }
+        
+        return $resultSet;
+    }
+}
diff --git a/tests/tine20/Expressomail/Model/AccountTest.php b/tests/tine20/Expressomail/Model/AccountTest.php
new file mode 100755 (executable)
index 0000000..f931e68
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2010 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schuele <p.schuele@metaways.de>
+ * 
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Expressomail_Model_AccountTest::main');
+}
+
+/**
+ * Test class for Felamimail_Model_AccountTest
+ */
+class Expressomail_Model_AccountTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail Account Model Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+    }
+
+    /********************************* test funcs *************************************/
+    
+    /**
+     * test get smtp config
+     */
+    public function testGetSmtpConfig()
+    {
+        $smtpConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::SMTP, new Tinebase_Config_Struct())->toArray();
+        
+        $account = new Expressomail_Model_Account(array(
+            'type'      => Expressomail_Model_Account::TYPE_SYSTEM,
+        ));
+        $accountSmtpConfig = $account->getSmtpConfig();
+        
+        if (array_key_exists('primarydomain', $smtpConfig)) {
+            $this->assertContains($smtpConfig['primarydomain'], $accountSmtpConfig['username']);
+        }
+        
+        if (TestServer::getInstance()->getConfig()->mailserver) {
+            $this->assertEquals(TestServer::getInstance()->getConfig()->mailserver, $accountSmtpConfig['hostname']);
+        }
+    }
+}
diff --git a/tests/tine20/Expressomail/Model/MessageTest.php b/tests/tine20/Expressomail/Model/MessageTest.php
new file mode 100755 (executable)
index 0000000..2e13379
--- /dev/null
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2010-2013 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Philipp Schüle <p.schuele@metaways.de>
+ * 
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Felamimail_Model_MessageTest
+ */
+class Expressomail_Model_MessageTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail Message Model Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+    }
+
+    /********************************* test funcs *************************************/
+    
+    /**
+     * test conversion to plain text (blockquotes to quotes) / tests linebreaks, too
+     */
+    public function testGetPlainTextBody()
+    {
+        $message = new Expressomail_Model_Message(array(
+            'body'  =>  'blabla<br/><blockquote class="felamimail-body-blockquote">lalülüüla<br/><br/><div>lala</div><br/><blockquote class="felamimail-body-blockquote">xyz</blockquote></blockquote><br/><br/>jojo<br/>' .
+                        'lkjlhk<div><br></div><div><br><div>jjlöjlö</div><div><font face="arial"><br></font></div></div><div><font face="arial">Pickhuben 2-4, 20457 Hamburg</font></div>'
+        ));
+        
+        $result = $message->getPlainTextBody();
+        //echo $result;
+        
+        $this->assertEquals("blabla\n" .
+            "> lalülüüla\n" .
+            "> \n" .
+            "> lala\n" .
+            "> \n" . 
+            "> > xyz\n" .
+            "\n\n" .
+            "jojo\n" .
+            "lkjlhk\n\n\n" .
+            "jjlöjlö\n\n" .
+            "Pickhuben 2-4, 20457 Hamburg\n", $result);
+    }
+
+    /**
+     * test conversion from plain text to html (quotes ('> > ...') to blockquotes)
+     * 
+     * @see 0005334: convert plain text quoting ("> ") to html blockquotes
+     */
+    public function testTextToHtml()
+    {
+        $plaintextMessage = "blabla\n" .
+            "> lalülüüla\n" .
+            "> \n" .
+            "> > >lala\n" .
+            ">  >\n" . 
+            ">  > xyz\n" .
+            "\n\n" .
+            "> jojo\n" .
+            "jojo\n" ;
+        
+        $result = Expressomail_Message::convertFromTextToHTML($plaintextMessage);
+        
+        $this->assertEquals('blabla<br /><blockquote class="felamimail-body-blockquote">lalülüüla<br /><br />'
+            . '<blockquote class="felamimail-body-blockquote"><blockquote class="felamimail-body-blockquote">lala<br />'
+            . '</blockquote><br />xyz<br /></blockquote></blockquote><br /><br /><blockquote class="felamimail-body-blockquote">jojo<br /></blockquote>jojo<br />', $result);
+    }
+    
+    /**
+     * testReplaceUris
+     * 
+     * @see 0008020: link did not get an anchor in html mail
+     */
+    public function testReplaceUris()
+    {
+        $message = new Expressomail_Model_Message(array(
+            'body'  =>  'http://www.facebook.com/media/set/?set=a.164136103742229.1073741825.100004375207149&type=1&l=692e495b17'
+        ));
+        
+        $result = Expressomail_Message::replaceUris($message->body);
+        $this->assertContains('a href=', $result);
+    }
+}
diff --git a/tests/tine20/Expressomail/Model/resultado.txt b/tests/tine20/Expressomail/Model/resultado.txt
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/tests/tine20/Expressomail/Sieve/Backend/ScriptTest.php b/tests/tine20/Expressomail/Sieve/Backend/ScriptTest.php
new file mode 100755 (executable)
index 0000000..c4416c5
--- /dev/null
@@ -0,0 +1,251 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Felamimail
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Lars Kneschke <l.kneschke@metaways.de>
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
+
+/**
+ * Test class for Felamimail_Sieve_Backend_Script
+ */
+class Expressomail_Sieve_Backend_ScriptTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * serialized rule
+     * 
+     * @var string
+     */
+    protected $_serializedSieveRule;
+    
+    /**
+     * smart rule file into
+     * 
+     * @var string
+     */
+    protected $_smartSieveRuleFileInto = '#rule&&13&&ENABLED&&&&&&&&folder&&Listen/Icecast&&0&&List-Id&&icecast.xiph.org&&0';
+    
+    /**
+     * smart rule discard
+     * 
+     * @var string
+     */
+    protected $_smartSieveRuleDiscard  = '#rule&&15&&ENABLED&&&&&&Bacula: Backup OK of&&discard&&&&0&&&&&&0';
+    
+    /**
+     * sieve vacation
+     * 
+     * @var string
+     */
+    protected $_smartSieveVacation = '#vacation&&7&&"info@example.com"&&Thank you very much for your email.\n\n&&off';
+    
+    /**
+     * Runs the test methods of this class.
+     *
+     * @access public
+     * @static
+     */
+    public static function main()
+    {
+        $suite  = new PHPUnit_Framework_TestSuite('Tine 2.0 Expressomail Sieve Script Tests');
+        PHPUnit_TextUI_TestRunner::run($suite);
+    }
+
+    /**
+     * Sets up the fixture.
+     * This method is called before a test is executed.
+     *
+     * @access protected
+     */
+    protected function setUp()
+    {
+        $rule      = new Expressomail_Sieve_Rule();
+        $condition = new Expressomail_Sieve_Rule_Condition();
+        $action    = new Expressomail_Sieve_Rule_Action();
+        
+        $condition->setComperator(Expressomail_Sieve_Rule_Condition::COMPERATOR_CONTAINS)
+            ->setTest(Expressomail_Sieve_Rule_Condition::TEST_ADDRESS)
+            ->setHeader('From')
+            ->setKey('info@example.com');
+        
+        $action->setType(Expressomail_Sieve_Rule_Action::FILEINTO)
+            ->setArgument('INBOX/UNITTEST');
+            
+        $rule->setEnabled(true)
+            ->setId(12)
+            ->setAction($action)
+            ->addCondition($condition);
+            
+        $this->_serializedSieveRule = '#SieveRule' . serialize($rule);
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+    }
+
+    /**
+     * test enabled rule
+     */
+    public function testEnabledRule()
+    {
+        $script    = new Expressomail_Sieve_Backend_Script();
+        $rule      = new Expressomail_Sieve_Rule();
+        $condition = new Expressomail_Sieve_Rule_Condition();
+        $action    = new Expressomail_Sieve_Rule_Action();
+        
+        $condition->setComperator(Expressomail_Sieve_Rule_Condition::COMPERATOR_CONTAINS)
+            ->setTest(Expressomail_Sieve_Rule_Condition::TEST_ADDRESS)
+            ->setHeader('From')
+            ->setKey('info@example.com');
+        
+        $action->setType(Expressomail_Sieve_Rule_Action::FILEINTO)
+            ->setArgument('INBOX/UNITTEST');
+            
+        $rule->setEnabled(true)
+            ->setId(12)
+            ->setAction($action)
+            ->addCondition($condition);
+        
+        $script->addRule($rule);
+        
+        $sieveScript = $script->getSieve();
+        #echo $sieveScript;
+        $this->assertContains('if allof (address :contains "From" "info@example.com")', $sieveScript);
+        $this->assertContains('fileinto "INBOX/UNITTEST";', $sieveScript);
+        $this->assertContains('Expressomail_Sieve_Rule', $sieveScript);
+    }
+    
+    /**
+     * test enabled vacation
+     */
+    public function testEnabledVacation()
+    {
+        $script = new Expressomail_Sieve_Backend_Script();
+        $script->setVacation($this->_getVacation());
+        
+        $sieveScript = $script->getSieve();
+        
+        $this->assertContains(':days 8', $sieveScript);
+        $this->assertContains(':from "sieve@example.com"', $sieveScript);
+        $this->assertContains(':addresses ["info@example.com"]', $sieveScript);
+        $this->assertContains('?Q?L=C3=B6=C3=9Flich?=', $sieveScript, $sieveScript);
+        $this->assertContains('Expressomail_Sieve_Vacation', $sieveScript);
+        $this->assertContains('Tine 2.0 Unit Test', $sieveScript);
+    }
+    
+    /**
+     * get vacation
+     * 
+     * @return Felamimail_Sieve_Vacation
+     */
+    protected function _getVacation()
+    {
+        $vacation = new Expressomail_Sieve_Vacation();
+        
+        $vacation->setEnabled(true)
+            ->addAddress('info@example.com')
+            ->setDays(8)
+            ->setSubject('Lößlich')
+            ->setFrom('sieve@example.com')
+            ->setReason('Tine 2.0 Unit Test');
+            
+        return $vacation;
+    }
+
+    /**
+     * test enabled vacation
+     */
+    public function testMimeVacation()
+    {
+        $vacation = $this->_getVacation();
+        $vacation->setMime('multipart/alternative')->setReason('<html><body><strong>AWAY!</strong></body></html>');
+        
+        $script = new Expressomail_Sieve_Backend_Script();
+        $script->setVacation($vacation);
+        
+        $sieveScript = $script->getSieve();
+        
+        $this->assertContains('Content-Type: multipart/alternative; boundary=foo', $sieveScript);
+        $this->assertContains('vacation :days 8 :subject "=?UTF-8?Q?L=C3=B6=C3=9Flich?=" :from "sieve@example.com" :addresses ["info@example.com"] :mime text:', $sieveScript);
+        $this->assertContains('<html><body><strong>AWAY!</strong></body></html>', $sieveScript);
+        $this->assertContains('--foo--', $sieveScript);
+    }
+    
+    /**
+     * testStartAndEndDate
+     * 
+     * @see 0006266: automatic deactivation of vacation message
+     */
+    public function testStartAndEndDate()
+    {
+        $vacation = $this->_getVacation();
+        $vacation->setStartdate('2012-05-08');
+        $vacation->setEnddate('2012-05-18');
+        $vacation->setDateEnabled(TRUE);
+        
+        $script = new Expressomail_Sieve_Backend_Script();
+        $script->setVacation($vacation);
+        $sieveScript = $script->getSieve();
+        
+        $this->assertContains('require ["vacation","date","relational"]', $sieveScript);
+        $this->assertContains('if allof(currentdate :value "le" "date" "2012-05-18",', $sieveScript);
+        $this->assertContains('currentdate :value "ge" "date" "2012-05-08")', $sieveScript);
+    }
+    
+    /**
+     * test disabled vacation
+     */
+    public function testDisabledVacation()
+    {
+        $script = new Expresomail_Sieve_Backend_Script();
+        
+        $vacation = new Expressomail_Sieve_Vacation();
+        
+        $vacation->setEnabled(false)
+            ->addAddress('info@example.com')
+            ->setDays(8)
+            ->setReason('Tine 2.0 Unit Test');
+        
+        $script->setVacation($vacation);
+        
+        $sieveScript = $script->getSieve();
+        
+        $this->assertNotContains('vacation :days 8 :addresses ["info@example.com"]', $sieveScript);
+        $this->assertContains('Expressomail_Sieve_Vacation', $sieveScript);
+        $this->assertContains('Tine 2.0 Unit Test', $sieveScript);
+    }
+
+    /**
+     * parse serialized sieve rule
+     */
+    public function testParseSerializedSieveRule()
+    {
+        $script = new Expressomail_Sieve_Backend_Script();
+        
+        $script->setScriptToParse($this->_serializedSieveRule);
+        $script->readScriptData();
+        $script->setScriptToParse($this->_smartSieveRuleFileInto);
+        $script->readScriptData();
+        $script->setScriptToParse($this->_smartSieveRuleDiscard);
+        $script->readScriptData();
+        $script->setScriptToParse($this->_smartSieveVacation);
+        $script->readScriptData();
+        
+        $rules = $script->getRules();
+        
+        $this->assertEquals(3, count($rules));
+    }
+}
diff --git a/tests/tine20/Expressomail/files/Amazon.eml b/tests/tine20/Expressomail/files/Amazon.eml
new file mode 100755 (executable)
index 0000000..edf7d14
--- /dev/null
@@ -0,0 +1,1929 @@
+Return-Path: <emailSenderApp+Correios-RTFM-BgCT2I37P9@bounces.amazon.com>\r
+Delivery-Date: Wed, 14 Jul 2010 09:04:52 +0200\r
+Received-SPF: softfail (mxeu1: transitioning domain of bounces.amazon.com does not designate 111.111.111.111 as permitted sender) client-ip=111.111.111.111; envelope-from=emailSenderApp+Correios-RTFM-BgCT2I37P9@bounces.amazon.com; helo=mc-eue004.v300.gmx.net;\r
+Received: from mc-eue004.v300.gmx.net (nat-gw-distg.bs.ka.schlund.net [111.111.111.111])\r
+       by mx.kundenserver.de (node=mxeu1) with ESMTP (Nemesis)\r
+       id 0M7GxG-1PKsEs2HRO-00wTC0 for 11293700^6c6f65726b6540676d782e6e6574@multimail.kundenserver.de; Wed, 14 Jul 2010 09:04:52 +0200\r
+Delivered-To: GMX delivery to user@mail.com\r
+Received: from pop.gmx.net [212.227.17.169]\r
+       by mc-eue004.v300.gmx.net with POP3 (fetchmail-6.3.9)\r
+       for <11293700^6c6f65726b6540676d782e6e6574@multimail.kundenserver.de> (single-drop); Wed, 14 Jul 2010 09:04:52 +0200 (CEST)\r
+Received: (qmail invoked by alias); 14 Jul 2010 06:55:42 -0000\r
+Received: from mm-retail-out-12102.amazon.com (EHLO mm-retail-out-12102.amazon.com) [87.238.84.26]\r
+  by mx0.gmx.net (mx046) with SMTP; 14 Jul 2010 08:55:42 +0200\r
+Received: from unknown (HELO massmail-sender-eu-13031.dub3.amazon.com) ([10.32.8.35])\r
+  by mm-retail-out-12102.amazon.com with ESMTP; 14 Jul 2010 06:55:15 +0000\r
+Date: Wed, 14 Jul 2010 06:55:15 +0000 (UTC)\r
+From: "Amazon.de" <vfe-campaign-response@amazon.de>\r
+To: "user@mail.com" <user@mail.com>\r
+Message-ID: <23318898.165431279090515776.JavaMail.em-build@eu-mm-relay.amazon.com>\r
+Subject: Amazon.de: Samsung Wave S8500 Smartphone (1 Ghz, 2GB interner\r
+ Speicher, Super Amoled Display, Touchscreen, bada-Betriebssystem)\r
+ ebony-gray\r
+MIME-Version: 1.0\r
+Content-Type: multipart/alternative; \r
+       boundary="----=_Part_32672_22223462.1279090515774"\r
+Bounces-to: emailSenderApp+Correios-RTFM-BgCT2I37P9@bounces.amazon.com\r
+X-AMAZON-MAIL-RELAY-TYPE: merchandizing\r
+X-AMAZON-RTE-VERSION: 2.0\r
+X-GMX-Antivirus: 0 (no virus found)\r
+X-GMX-Antispam: 0 (Mail was not recognized as spam);\r
+ Detail=5D7Q89H36p4WX0t+AtsdW2ORvUlAfcdS8VUDf3GWklDPSGdIbl6b7Fb6GfaSFFRur/Q6Q\r
+ aPnyp+z1rWH+eVa3xii+plD9rTOZBsI+YEZxphNZmIDNWH5zeHs8dcDK/IJ3pEQtgKStzGorphCz\r
+ n4TnA==V1;\r
+X-UI-Application: 2:movetofolder=MQ==,name=bG9lcmtlQGdteC5uZXQ=\r
+X-UI-Junk: AutoMaybeJunk +0 ();\r
+  V01:34RTq3t6:KvSxHtz0DtFkcy3Fcdf/oCRYp5k0MhCHIuxpb5R6OmHzQJTItUW\r
+  suyNLiRdNJD0jED0L6gVfHTqac9PCW47JXpR0Hiq7zUs9z1BSjX18JjL7A+zVOeX\r
+  QWstlnTxbW+r4\r
+Envelope-To: 11293700@multimail.kundenserver.de\r
+X-Tine20TestMessage: multipart/amazon\r
+\r
+------=_Part_32672_22223462.1279090515774\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+\r
+\r
+Sie suchen Produkte aus der Kategorie Elektronik & Foto? Dann haben wir die=\r
+ folgende Auswahl f=FCr Sie.\r
+\r
+In dieser Nachricht:\r
+ * Samsung Wave S8500 Smartphone (1 Ghz, 2GB interner Speicher, Super Amole=\r
+d Display, Touchscreen, bada-Betriebssystem) ebony-gray\r
+ * Samsung Wave S8500 Smartphone (Super Amoled Display, Touchscreen, bada-B=\r
+etriebssystem) metallic-black\r
+ * Samsung Galaxy S I9000 Smartphone (HD Video, 1 GHz-Prozessor, 8GB intern=\r
+er Speicher, Super Amoled Display, Android 2.1) metallic-black\r
+ * Samsung I8910 HD 8 GB Smartphone (8 MP-Kamera, AMOLED Touchscreen, WLAN,=\r
+ Navi) schwarz\r
+ * Samsung Omnia II I8000 Smartphone (Touchscreen, 5MP Kamera, Windows Mobi=\r
+le) rose-black\r
+ * HTC Desire Smartphone (5 MP, AMOLED, 4GB Speicherkarte,  HSPA, Android 2=\r
+.1, HTC Sense)\r
+\r
+ . . .\r
+\r
+* Samsung Wave S8500 Smartphone (1 Ghz, 2GB interner Speicher, Super Amoled=\r
+ Display, Touchscreen, bada-Betriebssystem) ebony-gray\r
+  =20\r
+von Samsung\r
+   http://www.amazon.de/dp/B003DA5P22/ref=3Dpe_vfe_x1\r
+\r
+Listenpreis: EUR 429,00\r
+Jetzt: EUR 311,99=20\r
+Sie sparen: EUR 117,01 (27%)\r
+\r
+ . . .\r
+\r
+* Samsung Wave S8500 Smartphone (Super Amoled Display, Touchscreen, bada-Be=\r
+triebssystem) metallic-black\r
+  =20\r
+von Samsung\r
+   http://www.amazon.de/dp/B003SBJUHW/ref=3Dpe_vfe_x2\r
+\r
+Jetzt: EUR 312,39=20\r
+\r
+ . . .\r
+\r
+* Samsung Galaxy S I9000 Smartphone (HD Video, 1 GHz-Prozessor, 8GB interne=\r
+r Speicher, Super Amoled Display, Android 2.1) metallic-black\r
+  =20\r
+von Samsung\r
+   http://www.amazon.de/dp/B003NCX6ZS/ref=3Dpe_vfe_x3\r
+\r
+Listenpreis: EUR 649,00\r
+Jetzt: EUR 442,99=20\r
+Sie sparen: EUR 206,01 (32%)\r
+\r
+ . . .\r
+\r
+* Samsung I8910 HD 8 GB Smartphone (8 MP-Kamera, AMOLED Touchscreen, WLAN, =\r
+Navi) schwarz\r
+  =20\r
+von Samsung\r
+   http://www.amazon.de/dp/B00280A2AI/ref=3Dpe_vfe_x4\r
+\r
+Listenpreis: EUR 695,00\r
+Jetzt: EUR 358,95=20\r
+Sie sparen: EUR 336,05 (48%)\r
+\r
+ . . .\r
+\r
+* Samsung Omnia II I8000 Smartphone (Touchscreen, 5MP Kamera, Windows Mobil=\r
+e) rose-black\r
+  =20\r
+von Samsung\r
+   http://www.amazon.de/dp/B002AK2UNI/ref=3Dpe_vfe_x5\r
+\r
+Listenpreis: EUR 649,00\r
+Jetzt: EUR 343,39=20\r
+Sie sparen: EUR 305,61 (47%)\r
+\r
+ . . .\r
+\r
+* HTC Desire Smartphone (5 MP, AMOLED, 4GB Speicherkarte,  HSPA, Android 2.=\r
+1, HTC Sense)\r
+  =20\r
+von HTC\r
+   http://www.amazon.de/dp/B0038JDF3E/ref=3Dpe_vfe_x6\r
+\r
+Jetzt: EUR 479,99=20\r
+\r
+ . . .\r
+\r
+Weitere =E4hnliche Artikel anzeigen:\r
+http://www.amazon.de/sim/B003DA5P22/2/ref=3Dpe_vfe=20\r
+\r
+F=FCr alle Fragen, die nicht in Zusammenhang mit dieser E-Mail stehen, wend=\r
+en Sie sich bitte an unseren Kundenservice: http://www.amazon.de/gp/help/cu=\r
+stomer/display.html?nodeId=3D200217100/ref=3Dpe_vfe=20\r
+\r
+Vielen Dank,\r
+Amazon.de\r
+\r
+ . . .\r
+\r
+=20\r
+=20\r
+ Diese Nachricht ging an folgende E-Mail-Adresse: user@mail.com\r
+\r
+Klicken Sie hier, um zuk=FCnftig keine Nachrichten dieser Art mehr von uns =\r
+zu erhalten: http://www.amazon.de//gp/gss/o/1IECYaiu7ty3uGu.WRZRpTGN79gOvzE=\r
+rwDjKU5rhCik4eMROCICHLnXqjWYHWs43M (Bitte beachten Sie, dass diese Nachrich=\r
+t an folgende Adresse versandt wurde: user@mail.com). Unter "Mein Konto" k=\r
+=F6nnen Sie au=DFerdem Ihr gew=FCnschtes E-Mail-Format festlegen: HTML oder=\r
+ Text.\r
+\r
+Alle Euro-Preise beinhalten die deutsche Mehrwertsteuer. Die in Ihrem Land =\r
+geltenden Steuers=E4tze finden Sie hier: http://www.amazon.de/gp/help/custo=\r
+mer/display.html/ref=3Dpe_121/?nodeId=3D526796\r
+\r
+Aus rechtlichen Gr=FCnden sind preisgebundene B=FCcher in unseren reduziert=\r
+en Angeboten nicht inbegriffen. Die Preisvergleiche beziehen sich auf fr=FC=\r
+here Ladenpreise oder Originalausgaben. Alle Angebote gelten, solange der V=\r
+orrat reicht. Einige Artikel sind noch nicht im Handel erh=E4ltlich, k=F6nn=\r
+en jedoch bei uns vorbestellt werden.\r
+\r
+Preisvergleiche f=FCr Artikel aus den Bereichen Elektronik und Foto sowie H=\r
+aus und Garten beziehen sich auf die unverbindliche Preisempfehlung (U.V.P.=\r
+) des Herstellers, soweit nichts anderes angegeben ist.\r
+\r
+Reference 20950531\r
+\r
+Die Preise f=FCr neue und gebrauchte Marketplace-Artikel werden von den jew=\r
+eiligen Amazon.de-Marketplace-Verk=E4ufern festgelegt. Verf=FCgbarkeitund P=\r
+reise k=F6nnen sich daher jederzeit =E4ndern. Nicht alle Marketplace-H=E4nd=\r
+ler versenden au=DFerhalb Deutschlands. Beachten Sie dazu die besonderen Ve=\r
+rsandbedingungen. Gleiches gilt f=FCr die Zeitschriften-Abonnements.\r
+\r
+Bitte antworten Sie nicht auf diese E-Mail. Falls Sie uns kontaktieren m=F6=\r
+chten, benutzen Sie bitte unser Kontaktformular: http://www.amazon.de/gp/he=\r
+lp/customer/display.html/?ie=3DUTF8&nodeId=3D3961931\r
+\r
+\r
+\r
+------=_Part_32672_22223462.1279090515774\r
+Content-Type: text/html; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+\r
+\r
+\r
+<html><head>\r
+  <meta name=3D"description" content=3D"Find, shop for and buy books at Ama=\r
+zon.com" /\r
+\r
+>\r
+  <meta name=3D"keywords" content=3D"Amazon.com, Books" />\r
+  <title>Amazon.de: Mehr entdecken</title\r
+\r
+>\r
+  <style><!-- for amabot -->\r
+    td {\r
+        font-family: Verdana, Arial, Helvetica, sans-serif;\r
+        font-size: 10pt;\r
+    }\r
+  </style>\r
+</head\r
+\r
+>\r
+<body bgcolor=3D"#FFFFFF" link=3D"#003399" alink=3D"#FF9933" vlink=3D"#9966=\r
+33" text=3D"#000000"=20\r
+\r
+><img src=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0L=\r
+CWPG&H=3DILHHHA7WZPWTGSB3I8A4GTPASJSA&T=3DO&U=3Dhttp%3A%2F%2Fimages-eu.amaz=\r
+on.com%2Fimages%2FG%2F01%2Fnav%2Ftransp.gif" /\r
+\r
+>\r
+<div align=3D"center">=20\r
+  <table width=3D"590" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">=20\r
+    <!-- BANNER -->\r
+   =20\r
+   =20\r
+       =20\r
+   =20\r
+    <!-- TOP TABLE OUTLINE -->\r
+    <tr\r
+\r
+>=20\r
+      <td width=3D"12" height=3D"12"><img src=3D"http://g-ecx.images-amazon=\r
+.com/images/G/03/marketing/automated-emails/recommendations/bb-tl._V1922143=\r
+46_.gif" width=3D"12" alt=3D"" height=3D"12" border=3D"0" /></td>=20\r
+      <td style=3D"border-top: solid 1px #5C9EBF"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D"" heigh=\r
+t=3D"1" border=3D"0" /></td>=20\r
+      <td width=3D"12" height=3D"12"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/bb-tr._V192214347_.gif" width=3D"12" alt=3D"" heigh=\r
+t=3D"12" border=3D"0" /></td>=20\r
+    </tr>\r
+    <!--CONTENT ROW-->\r
+    <tr\r
+\r
+>=20\r
+      <td style=3D"border-left: solid 1px #5C9EBF"><img src=3D"http://g-ecx=\r
+.images-amazon.com/images/G/03/marketing/automated-emails/recommendations/s=\r
+pacer._V192214338_.gif" width=3D"1" alt=3D"" height=3D"1" border=3D"0" /></=\r
+td>\r
+      <td>\r
+     =20\r
+        <!-- HEADER AND INTRODUCTION -->\r
+        <table width=3D"100%" border=3D"0" cellspacing=3D"2" cellpadding=3D=\r
+"0"\r
+\r
+>\r
+          <tr>\r
+            <td><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG=\r
+&C=3D3TM7SJC0LCWPG&H=3DEFGXA4VEAYXG0ZONNRQ7XCXXJW4A&T=3DC&U=3Dhttp%3A%2F%2F=\r
+www.amazon.de%2Fref%3Dpe_23451_20950531_pe_vfe_hd"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/amazon-logo._V192214347_.gif" width=3D"168" vspace=\r
+=3D"6" alt=3D"Amazon.de" height=3D"45" border=3D"0" /></a></td>=20\r
+            <td align=3D"right"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/more-to-explore._V192214337_.gif" width=3D"198" alt=\r
+=3D"Mehr entdecken" height=3D"23" border=3D"0" /></td>=20\r
+          </tr\r
+\r
+>\r
+          <tr>\r
+            <td colspan=3D"2"><img src=3D"http://g-ecx.images-amazon.com/im=\r
+ages/G/03/marketing/automated-emails/recommendations/spacer._V192214338_.gi=\r
+f" width=3D"1" alt=3D"" height=3D"6" border=3D"0" /></td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td colspan=3D"2">\r
+               <font face=3D"verdana,arial,helvetica" size=3D"2">\r
+               Sie suchen Produkte aus der Kategorie Elektronik & Foto? Dan=\r
+n haben wir die folgende Auswahl f=FCr Sie.               </font>\r
+            </td>\r
+          </tr>=20\r
+        </table\r
+\r
+>=20\r
+       =20\r
+        <hr width=3D"100%" size=3D"1" noshade=3D"noshade" style=3D"border-t=\r
+op: 1px dashed #999999;" />\r
+\r
+\r
+   =20\r
+       =20\r
+   =20\r
+        <!-- 8 RECOMMENDATION BLOCK TABLE -->\r
+        <table width=3D"88%" border=3D"0" align=3D"center" cellpadding=3D"1=\r
+" cellspacing=3D"3"\r
+\r
+>=20\r
+         =20\r
+<tr align=3D'center' valign=3D'middle'>\r
+<td width=3D'33%'><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MO=\r
+CG&C=3D3TM7SJC0LCWPG&H=3DQFZWLOSP1SQBK0JCHCGMIZI9TUWA&T=3DC&U=3Dhttp%3A%2F%=\r
+2Fwww.amazon.de%2Fdp%2FB003DA5P22%2Fref%3Dpe_23451_20950531_pe_vfe_t1'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41rzM28JvVL._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DTTCWJKE7GTNBF0OTKYFBU2YXK8SA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB003SBJUHW%2Fref%3Dpe_23451_20950531_pe_vfe_t2'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/4148WuDns-L._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DA2S9XYV45KXHZQDMHQMAIYGHMUWA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB003NCX6ZS%2Fref%3Dpe_23451_20950531_pe_vfe_t3'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41EVtE0P1BL._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a></td>\r
+</tr\r
+\r
+>\r
+<tr align=3D'center' valign=3D'top'>\r
+<td width=3D'33%'><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MO=\r
+CG&C=3D3TM7SJC0LCWPG&H=3DQFZWLOSP1SQBK0JCHCGMIZI9TUWA&T=3DC&U=3Dhttp%3A%2F%=\r
+2Fwww.amazon.de%2Fdp%2FB003DA5P22%2Fref%3Dpe_23451_20950531_pe_vfe_t1'\r
+\r
+><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Wave =\r
+S8500 Smartphone (1 Ghz, 2GB interner Speicher, Super Amoled Display, Touch=\r
+screen, bada-Betriebssystem) ebony-gray</font></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DTTCWJKE7GTNBF0OTKYFBU2YXK8SA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB003SBJUHW%2Fref%3Dpe_23451_20950531_pe_vfe_t2'\r
+\r
+><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Wave =\r
+S8500 Smartphone (Super Amoled Display, Touchscreen, bada-Betriebssystem) m=\r
+etallic-black</font></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DA2S9XYV45KXHZQDMHQMAIYGHMUWA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB003NCX6ZS%2Fref%3Dpe_23451_20950531_pe_vfe_t3'\r
+\r
+><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Galax=\r
+y S I9000 Smartphone (HD Video, 1 GHz-Prozessor, 8GB interner Speicher, Sup=\r
+er Amoled Display, Android 2.1) metallic-black</font></a></td>\r
+</tr\r
+\r
+>\r
+<tr align=3D'center' valign=3D'top'><td colspan=3D'3'><img src=3D"http://g-=\r
+ecx.images-amazon.com/images/G/03/marketing/automated-emails/recommendation=\r
+s/spacer._V192214338_.gif" width=3D"1" vspace=3D"1" alt=3D"" height=3D"1" b=\r
+order=3D"0" /></td></tr\r
+\r
+>\r
+<tr align=3D'center' valign=3D'middle'>\r
+<td width=3D'33%'><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MO=\r
+CG&C=3D3TM7SJC0LCWPG&H=3DAI1RDBO3ERZOPEQBU7QCW4QRRYAA&T=3DC&U=3Dhttp%3A%2F%=\r
+2Fwww.amazon.de%2Fdp%2FB00280A2AI%2Fref%3Dpe_23451_20950531_pe_vfe_t4'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41HP5jaJrrL._SL110_.jpg"=\r
+ width=3D"58" alt=3D"" height=3D"110" border=3D"0" /></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DV01UZFLAEBHNBH3DAZMJLACGZSAA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB002AK2UNI%2Fref%3Dpe_23451_20950531_pe_vfe_t5'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41fVEwoiwkL._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DO4Q2FI6J0CFQEGL7F1Y4XVVZF6SA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB0038JDF3E%2Fref%3Dpe_23451_20950531_pe_vfe_t6'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41r%2B661x5rL._SL110_.jp=\r
+g" width=3D"59" alt=3D"" height=3D"110" border=3D"0" /></a></td>\r
+</tr\r
+\r
+>\r
+<tr align=3D'center' valign=3D'top'>\r
+<td width=3D'33%'><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MO=\r
+CG&C=3D3TM7SJC0LCWPG&H=3DAI1RDBO3ERZOPEQBU7QCW4QRRYAA&T=3DC&U=3Dhttp%3A%2F%=\r
+2Fwww.amazon.de%2Fdp%2FB00280A2AI%2Fref%3Dpe_23451_20950531_pe_vfe_t4'\r
+\r
+><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung I8910=\r
+ HD 8 GB Smartphone (8 MP-Kamera, AMOLED Touchscreen, WLAN, Navi) schwarz</=\r
+font></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DV01UZFLAEBHNBH3DAZMJLACGZSAA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB002AK2UNI%2Fref%3Dpe_23451_20950531_pe_vfe_t5'\r
+\r
+><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Omnia=\r
+ II I8000 Smartphone (Touchscreen, 5MP Kamera, Windows Mobile) rose-black</=\r
+font></a></td>\r
+<td width=3D'33%'\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DO4Q2FI6J0CFQEGL7F1Y4XVVZF6SA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fdp%2FB0038JDF3E%2Fref%3Dpe_23451_20950531_pe_vfe_t6'\r
+\r
+><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>HTC Desire Sm=\r
+artphone (5 MP, AMOLED, 4GB Speicherkarte,  HSPA, Android 2.1, HTC Sense)</=\r
+font></a></td>\r
+</tr\r
+\r
+>\r
+<tr align=3D'center' valign=3D'top'><td colspan=3D'3'><img src=3D"http://g-=\r
+ecx.images-amazon.com/images/G/03/marketing/automated-emails/recommendation=\r
+s/spacer._V192214338_.gif" width=3D"1" vspace=3D"1" alt=3D"" height=3D"1" b=\r
+order=3D"0" /></td></tr>\r
+\r
+        </table\r
+\r
+>\r
+       =20\r
+        <table border=3D"0" cellpadding=3D"3" cellspacing=3D"3" width=3D"10=\r
+0%"\r
+\r
+>=20\r
+          <tr>\r
+            <td align=3D"left">\r
+            </td>\r
+            <td align=3D"right"\r
+\r
+>=20\r
+              <img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-loca=\r
+le/common/orange-arrow._V192196120_.gif" width=3D"11" alt=3D"-" height=3D"1=\r
+2" border=3D"0" /\r
+\r
+>\r
+              <font face=3D"verdana,arial,helvetica" size=3D"-1"><a href=3D=\r
+'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3DJNL=\r
+IAPDA3QOXHDFOIQJLLLESUC8A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fsim%2FB003=\r
+DA5P22%2F2%2Fref%3Dpe_23451_20950531_pe_vfe'>Weitere =E4hnliche Artikel anz=\r
+eigen</a></font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>=20\r
+       =20\r
+        <hr width=3D"100%" size=3D"1" noshade=3D"noshade" style=3D"border-t=\r
+op: 1px dashed #999999;" />=20\r
+\r
+        <!-- DETAIL LIST OF RECOMMENDED ASINS -->=20\r
+\r
+\r
+   =20\r
+       =20\r
+            <table width=3D'100%' border=3D'0' cellspacing=3D'2' cellpaddin=\r
+g=3D'0'\r
+\r
+>\r
+          <tr align=3D'left'>\r
+            <td width=3D'25%' align=3D'center' valign=3D'top'\r
+\r
+>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DUG91HUGAV2XMVKCNVEDAN6IZYW0A&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB003DA5P22%2Fref%3Dpe_23451_20950531_pe_vfe_d1'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41rzM28JvVL._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a>\r
+            </td>\r
+            <td width=3D'50%' valign=3D'top'\r
+\r
+><p>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DUG91HUGAV2XMVKCNVEDAN6IZYW0A&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB003DA5P22%2Fref%3Dpe_23451_20950531_pe_vfe_d1'\r
+\r
+><b><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Wa=\r
+ve S8500 Smartphone (1 Ghz, 2GB interner Speicher, Super Amoled Display, To=\r
+uchscreen, bada-Betriebssystem) ebony-gray</font></b></a\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'><br /\r
+\r
+>\r
+               =20\r
+\r
+\r
+\r
+von Samsung\r
+                <br />Durchschnittliche Kundenrezension:<img src=3D"http://=\r
+g-ecx.images-amazon.com/images/G/03/detail/stars-4-5._V192563316_.gif" widt=\r
+h=3D"64" height=3D"12" border=3D"0" />\r
+              </font> </p\r
+\r
+>\r
+              <font face=3D'verdana,arial,helvetica' size=3D'-1'>\r
+                <b>Listenpreis:</b\r
+\r
+> <s>EUR 429,00</s><br /><b>Jetzt:</b> <b><font color=3D'#990000'>EUR 311,9=\r
+9</font></b\r
+\r
+><font size=3D'1' color=3D'#990000'> </font><br /><b>Sie sparen:</b> <font =\r
+color=3D'#990000'>EUR 117,01 (27%)</font\r
+\r
+><br /><br />\r
+              </font>\r
+            </td>\r
+            <td width=3D'25%' align=3D'left'\r
+\r
+>=20\r
+              <table width=3D'95' border=3D'0' align=3D'center' cellpadding=\r
+=3D'0' cellspacing=3D'0'\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"top"\r
+\r
+>\r
+                    <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DQH4RXFCQVQXOJCVAA1KJISOGKTYA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_b1%=\r
+3Faction%3DaddToCart%26quantity.1%3D1%26offeringID.1%3DIb3INm0BlBwQoA0PiR9P=\r
+oA5dhPFyTM6rX8XwqXcdO9vgs2jZLsY6x%252BRJtXl5WkN3R0hjE6jsFKpnVK2m7VtT1rsS4iB=\r
+b0A5p'\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-to-cart._V192214349_.gif" width=3D"146" alt=3D"=\r
+In den Einkaufswagen" height=3D"22" border=3D"0" /></a\r
+\r
+><br />\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DFISNYKIAFAEQQYO5GUDSJDLTQROA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_l1%=\r
+3Faction%3Dadd-to-registry.wishlist%26asin.1%3DB003DA5P22%26template-name%3=\r
+Dstores%2Fdetail%26B003DA5P22%3D1%26submit.add-to-registry.wishlist.x%3D1%2=\r
+6submit.add-to-registry.wishlist.y%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-wishlist._V192214349_.gif" width=3D"138" vspace=\r
+=3D"3" alt=3D"Der Wunschliste hinzuf=FCgen" height=3D"17" border=3D"0" /></=\r
+a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"\r
+\r
+>Diesen Artikel bewerten:<br /></font>\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3D7SQLHFMVEHAMDOHWCV3GHDA5R80A&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R1%3Frating_asin%3DB003DA5P22%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003DA5P22.rating.onetofive%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DBN5YB6YJA16OUWILM3QV03O0CPKA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R1%3Frating_asin%3DB003DA5P22%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003DA5P22.rating.onetofive%3D2"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DQ1NVAX4VOKZU51CZU416QEP1IY0A&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R1%3Frating_asin%3DB003DA5P22%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003DA5P22.rating.onetofive%3D3"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DSKU8SJBPA1NZRD640X3CR2MLLNGA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R1%3Frating_asin%3DB003DA5P22%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003DA5P22.rating.onetofive%3D4"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DIYG3QHIITJYX63AJOI1ZIH2IOPSA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R1%3Frating_asin%3DB003DA5P22%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003DA5P22.rating.onetofive%3D5"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DGVSNVSZXDHILGF8EAPNXH9BEBTUA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o1=\r
+%3Frating_asin%3DB003DA5P22%26B003DA5P22.rating.owned%3DOWN%26template-name=\r
+%3D%2Fgp%2Fyourstore%2Fiyr"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-locale/personaliz=\r
+ation/ratings-bar/light-blue/check-off._V192558299_.gif" width=3D"14" alt=\r
+=3D"[ ]" height=3D"14" border=3D"0" /></a\r
+\r
+> <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"><a href=\r
+=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D=\r
+GVSNVSZXDHILGF8EAPNXH9BEBTUA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyo=\r
+urstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o1%3Fratin=\r
+g_asin%3DB003DA5P22%26B003DA5P22.rating.owned%3DOWN%26template-name%3D%2Fgp=\r
+%2Fyourstore%2Fiyr">Geh=F6rt mir</a></font\r
+\r
+><br /><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/aut=\r
+omated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D""=\r
+ height=3D"8" border=3D"0" />\r
+                  </td>\r
+                </tr>\r
+              </table>\r
+            </td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td></td>=20\r
+            <td colspan=3D"2"\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'></font\r
+\r
+>\r
+              <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-seri=\r
+f">\r
+              </font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>\r
+\r
+        <hr width=3D'100%' size=3D'1' noshade=3D'noshade' style=3D'border-t=\r
+op: 1px dashed #999999;' /\r
+\r
+>\r
+        <table width=3D'100%' border=3D'0' cellspacing=3D'2' cellpadding=3D=\r
+'0'\r
+\r
+>\r
+          <tr align=3D'left'>\r
+            <td width=3D'25%' align=3D'center' valign=3D'top'\r
+\r
+>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DHAHKTRXTSDPAAOIEQCL14Z4QXB8A&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB003SBJUHW%2Fref%3Dpe_23451_20950531_pe_vfe_d2'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/4148WuDns-L._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a>\r
+            </td>\r
+            <td width=3D'50%' valign=3D'top'\r
+\r
+><p>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DHAHKTRXTSDPAAOIEQCL14Z4QXB8A&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB003SBJUHW%2Fref%3Dpe_23451_20950531_pe_vfe_d2'\r
+\r
+><b><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Wa=\r
+ve S8500 Smartphone (Super Amoled Display, Touchscreen, bada-Betriebssystem=\r
+) metallic-black</font></b></a\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'><br /\r
+\r
+>\r
+               =20\r
+\r
+\r
+\r
+von Samsung\r
+                <br />Durchschnittliche Kundenrezension:<img src=3D"http://=\r
+g-ecx.images-amazon.com/images/G/03/detail/stars-4-5._V192563316_.gif" widt=\r
+h=3D"64" height=3D"12" border=3D"0" />\r
+              </font> </p\r
+\r
+>\r
+              <font face=3D'verdana,arial,helvetica' size=3D'-1'>\r
+                <b>Jetzt:</b\r
+\r
+> <b><font color=3D'#990000'>EUR 312,39</font></b><font size=3D'1' color=3D=\r
+'#990000'> </font\r
+\r
+><br /><font size=3D'1'>Verkauft von: telbay</font><br /><br />\r
+              </font>\r
+            </td>\r
+            <td width=3D'25%' align=3D'left'\r
+\r
+>=20\r
+              <table width=3D'95' border=3D'0' align=3D'center' cellpadding=\r
+=3D'0' cellspacing=3D'0'\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"top"\r
+\r
+>\r
+                    <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DZXUNB01VL3Q0P9ATMWBXYAIOJSAA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_b2%=\r
+3Faction%3DaddToCart%26quantity.1%3D1%26offeringID.1%3DzXGBJSpC5gM9%252BuWF=\r
+flD5Npf%252BU7ZiSx8hqwygtdkkAn0vBWPFqkSCqysSHQ9hswBNk6FyG7lGMqPzM%252BPsNSY=\r
+w2UEEG%252FR7LnMsQBhzv5rUVt1Td9%252Fbmfv%252FvO6KxTIrR6Uol9hW71m4xMI%253D'\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-to-cart._V192214349_.gif" width=3D"146" alt=3D"=\r
+In den Einkaufswagen" height=3D"22" border=3D"0" /></a\r
+\r
+><br />\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DN2NUACVJCEWLVSH5IOFOJ5CNBAGA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_l2%=\r
+3Faction%3Dadd-to-registry.wishlist%26asin.1%3DB003SBJUHW%26template-name%3=\r
+Dstores%2Fdetail%26B003SBJUHW%3D1%26submit.add-to-registry.wishlist.x%3D1%2=\r
+6submit.add-to-registry.wishlist.y%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-wishlist._V192214349_.gif" width=3D"138" vspace=\r
+=3D"3" alt=3D"Der Wunschliste hinzuf=FCgen" height=3D"17" border=3D"0" /></=\r
+a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"\r
+\r
+>Diesen Artikel bewerten:<br /></font>\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DK9XSZXDBF7HYFDKJMIEVALQAYZ4A&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R2%3Frating_asin%3DB003SBJUHW%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003SBJUHW.rating.onetofive%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DRLPN4PTPFAJFW2KSB72MXZVQQF4A&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R2%3Frating_asin%3DB003SBJUHW%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003SBJUHW.rating.onetofive%3D2"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DXWMVDBFXR2IYWY5R0RRAONA7VEUA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R2%3Frating_asin%3DB003SBJUHW%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003SBJUHW.rating.onetofive%3D3"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DHDEAAYR3EOMNUPBB3DOCYCVHP9KA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R2%3Frating_asin%3DB003SBJUHW%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003SBJUHW.rating.onetofive%3D4"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DO7UEG5ORTAOL0SXIAH4DXEAVEOIA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R2%3Frating_asin%3DB003SBJUHW%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003SBJUHW.rating.onetofive%3D5"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DDVENVZFUKXZQ4DO0E1J7HWPK4C4A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o2=\r
+%3Frating_asin%3DB003SBJUHW%26B003SBJUHW.rating.owned%3DOWN%26template-name=\r
+%3D%2Fgp%2Fyourstore%2Fiyr"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-locale/personaliz=\r
+ation/ratings-bar/light-blue/check-off._V192558299_.gif" width=3D"14" alt=\r
+=3D"[ ]" height=3D"14" border=3D"0" /></a\r
+\r
+> <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"><a href=\r
+=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D=\r
+DVENVZFUKXZQ4DO0E1J7HWPK4C4A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyo=\r
+urstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o2%3Fratin=\r
+g_asin%3DB003SBJUHW%26B003SBJUHW.rating.owned%3DOWN%26template-name%3D%2Fgp=\r
+%2Fyourstore%2Fiyr">Geh=F6rt mir</a></font\r
+\r
+><br /><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/aut=\r
+omated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D""=\r
+ height=3D"8" border=3D"0" />\r
+                  </td>\r
+                </tr>\r
+              </table>\r
+            </td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td></td>=20\r
+            <td colspan=3D"2"\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'></font\r
+\r
+>\r
+              <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-seri=\r
+f">\r
+              </font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>\r
+\r
+        <hr width=3D'100%' size=3D'1' noshade=3D'noshade' style=3D'border-t=\r
+op: 1px dashed #999999;' /\r
+\r
+>\r
+        <table width=3D'100%' border=3D'0' cellspacing=3D'2' cellpadding=3D=\r
+'0'\r
+\r
+>\r
+          <tr align=3D'left'>\r
+            <td width=3D'25%' align=3D'center' valign=3D'top'\r
+\r
+>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3D3NLTUVQIHE1SR0RHXYEML0DFDGYA&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB003NCX6ZS%2Fref%3Dpe_23451_20950531_pe_vfe_d3'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41EVtE0P1BL._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a>\r
+            </td>\r
+            <td width=3D'50%' valign=3D'top'\r
+\r
+><p>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3D3NLTUVQIHE1SR0RHXYEML0DFDGYA&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB003NCX6ZS%2Fref%3Dpe_23451_20950531_pe_vfe_d3'\r
+\r
+><b><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Ga=\r
+laxy S I9000 Smartphone (HD Video, 1 GHz-Prozessor, 8GB interner Speicher, =\r
+Super Amoled Display, Android 2.1) metallic-black</font></b></a\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'><br /\r
+\r
+>\r
+               =20\r
+\r
+\r
+\r
+von Samsung\r
+                <br />Durchschnittliche Kundenrezension:<img src=3D"http://=\r
+g-ecx.images-amazon.com/images/G/03/detail/stars-4-0._V192187677_.gif" widt=\r
+h=3D"64" height=3D"12" border=3D"0" />\r
+              </font> </p\r
+\r
+>\r
+              <font face=3D'verdana,arial,helvetica' size=3D'-1'>\r
+                <b>Listenpreis:</b\r
+\r
+> <s>EUR 649,00</s><br /><b>Jetzt:</b> <b><font color=3D'#990000'>EUR 442,9=\r
+9</font></b\r
+\r
+><font size=3D'1' color=3D'#990000'> </font><br /><b>Sie sparen:</b> <font =\r
+color=3D'#990000'>EUR 206,01 (32%)</font\r
+\r
+><br /><br />\r
+              </font>\r
+            </td>\r
+            <td width=3D'25%' align=3D'left'\r
+\r
+>=20\r
+              <table width=3D'95' border=3D'0' align=3D'center' cellpadding=\r
+=3D'0' cellspacing=3D'0'\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"top"\r
+\r
+>\r
+                    <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DEMPNX4NHLBXPYJLDRPJV8BTL2DQA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_b3%=\r
+3Faction%3DaddToCart%26quantity.1%3D1%26offeringID.1%3DHupOOWhvbUo9FgU4pOID=\r
+ePa2UGbiIcXj49nkcJkx03mHyygzRZESQi63fhApdT9s%252BDe1wdbcG8rs4iofmS6Cgxpn6t8=\r
+87Pde'\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-to-cart._V192214349_.gif" width=3D"146" alt=3D"=\r
+In den Einkaufswagen" height=3D"22" border=3D"0" /></a\r
+\r
+><br />\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DPNTQ0BOZ7QXJIEYAVR3NKNJUM9QA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_l3%=\r
+3Faction%3Dadd-to-registry.wishlist%26asin.1%3DB003NCX6ZS%26template-name%3=\r
+Dstores%2Fdetail%26B003NCX6ZS%3D1%26submit.add-to-registry.wishlist.x%3D1%2=\r
+6submit.add-to-registry.wishlist.y%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-wishlist._V192214349_.gif" width=3D"138" vspace=\r
+=3D"3" alt=3D"Der Wunschliste hinzuf=FCgen" height=3D"17" border=3D"0" /></=\r
+a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"\r
+\r
+>Diesen Artikel bewerten:<br /></font>\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DVL4MCUJIPEENPT9WZUUYZFSKKMSA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R3%3Frating_asin%3DB003NCX6ZS%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003NCX6ZS.rating.onetofive%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DC7IZB5DE447KJALQUOSNZXANCZGA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R3%3Frating_asin%3DB003NCX6ZS%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003NCX6ZS.rating.onetofive%3D2"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DOOUKS8PSAFVACJHI19NJZNZ29QYA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R3%3Frating_asin%3DB003NCX6ZS%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003NCX6ZS.rating.onetofive%3D3"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DACUNXUKELRXCVVFOBTCZGG3CL0SA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R3%3Frating_asin%3DB003NCX6ZS%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003NCX6ZS.rating.onetofive%3D4"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DOQZXORYEQFYZJZOIGGV5R3ISMBAA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R3%3Frating_asin%3DB003NCX6ZS%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B003NCX6ZS.rating.onetofive%3D5"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3D3Q5TT90OFNOMGNF1BEVTF9AJPAMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o3=\r
+%3Frating_asin%3DB003NCX6ZS%26B003NCX6ZS.rating.owned%3DOWN%26template-name=\r
+%3D%2Fgp%2Fyourstore%2Fiyr"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-locale/personaliz=\r
+ation/ratings-bar/light-blue/check-off._V192558299_.gif" width=3D"14" alt=\r
+=3D"[ ]" height=3D"14" border=3D"0" /></a\r
+\r
+> <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"><a href=\r
+=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D=\r
+3Q5TT90OFNOMGNF1BEVTF9AJPAMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyo=\r
+urstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o3%3Fratin=\r
+g_asin%3DB003NCX6ZS%26B003NCX6ZS.rating.owned%3DOWN%26template-name%3D%2Fgp=\r
+%2Fyourstore%2Fiyr">Geh=F6rt mir</a></font\r
+\r
+><br /><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/aut=\r
+omated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D""=\r
+ height=3D"8" border=3D"0" />\r
+                  </td>\r
+                </tr>\r
+              </table>\r
+            </td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td></td>=20\r
+            <td colspan=3D"2"\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'></font\r
+\r
+>\r
+              <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-seri=\r
+f">\r
+              </font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>\r
+\r
+        <hr width=3D'100%' size=3D'1' noshade=3D'noshade' style=3D'border-t=\r
+op: 1px dashed #999999;' /\r
+\r
+>\r
+        <table width=3D'100%' border=3D'0' cellspacing=3D'2' cellpadding=3D=\r
+'0'\r
+\r
+>\r
+          <tr align=3D'left'>\r
+            <td width=3D'25%' align=3D'center' valign=3D'top'\r
+\r
+>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DNSD2PVIPRAR10IXO4DE8Q6AMLHEA&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB00280A2AI%2Fref%3Dpe_23451_20950531_pe_vfe_d4'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41HP5jaJrrL._SL110_.jpg"=\r
+ width=3D"58" alt=3D"" height=3D"110" border=3D"0" /></a>\r
+            </td>\r
+            <td width=3D'50%' valign=3D'top'\r
+\r
+><p>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DNSD2PVIPRAR10IXO4DE8Q6AMLHEA&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB00280A2AI%2Fref%3Dpe_23451_20950531_pe_vfe_d4'\r
+\r
+><b><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung I8=\r
+910 HD 8 GB Smartphone (8 MP-Kamera, AMOLED Touchscreen, WLAN, Navi) schwar=\r
+z</font></b></a\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'><br /\r
+\r
+>\r
+               =20\r
+\r
+\r
+\r
+von Samsung\r
+                <br />Durchschnittliche Kundenrezension:<img src=3D"http://=\r
+g-ecx.images-amazon.com/images/G/03/detail/stars-4-0._V192187677_.gif" widt=\r
+h=3D"64" height=3D"12" border=3D"0" />\r
+              </font> </p\r
+\r
+>\r
+              <font face=3D'verdana,arial,helvetica' size=3D'-1'>\r
+                <b>Listenpreis:</b\r
+\r
+> <s>EUR 695,00</s><br /><b>Jetzt:</b> <b><font color=3D'#990000'>EUR 358,9=\r
+5</font></b\r
+\r
+><font size=3D'1' color=3D'#990000'> </font><br /><b>Sie sparen:</b> <font =\r
+color=3D'#990000'>EUR 336,05 (48%)</font\r
+\r
+><br /><font size=3D'1'>Verkauft von: Vodafone BusinessPoint Heidelberg</fo=\r
+nt\r
+\r
+><br /><br />\r
+              </font>\r
+            </td>\r
+            <td width=3D'25%' align=3D'left'\r
+\r
+>=20\r
+              <table width=3D'95' border=3D'0' align=3D'center' cellpadding=\r
+=3D'0' cellspacing=3D'0'\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"top"\r
+\r
+>\r
+                    <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DAYGEJUCOE64YZGJONFUC5XMPCBWA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_b4%=\r
+3Faction%3DaddToCart%26quantity.1%3D1%26offeringID.1%3DoTlkS4t8XlHGa4Rc0tsy=\r
+GvySI8lLsSFzmdCsV0g3MBuisLYD9DtRcRpz748ousuI5QGN6EPIRn9D%252FIBuvKWfGbDkJGo=\r
+1bvwbPDpSgJ82UVyTmC2x4BSYxdCVHPtzVj78BAzY2HcqhSk%253D'\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-to-cart._V192214349_.gif" width=3D"146" alt=3D"=\r
+In den Einkaufswagen" height=3D"22" border=3D"0" /></a\r
+\r
+><br />\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DXQALJW0XDEIU8YH0DW5VIJWTUVUA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_l4%=\r
+3Faction%3Dadd-to-registry.wishlist%26asin.1%3DB00280A2AI%26template-name%3=\r
+Dstores%2Fdetail%26B00280A2AI%3D1%26submit.add-to-registry.wishlist.x%3D1%2=\r
+6submit.add-to-registry.wishlist.y%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-wishlist._V192214349_.gif" width=3D"138" vspace=\r
+=3D"3" alt=3D"Der Wunschliste hinzuf=FCgen" height=3D"17" border=3D"0" /></=\r
+a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"\r
+\r
+>Diesen Artikel bewerten:<br /></font>\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DBWK6J38NSTTADBIWD3ZHOWAXDLEA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R4%3Frating_asin%3DB00280A2AI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B00280A2AI.rating.onetofive%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DKKGYY79GPAGF2FSCUUZLNSJOY4WA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R4%3Frating_asin%3DB00280A2AI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B00280A2AI.rating.onetofive%3D2"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DUCXT7HG8UDGGOT6OLA1DGPAEQLUA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R4%3Frating_asin%3DB00280A2AI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B00280A2AI.rating.onetofive%3D3"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DCNAMAOPRDY6AIAR947UC9MFJGRAA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R4%3Frating_asin%3DB00280A2AI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B00280A2AI.rating.onetofive%3D4"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3D8V0ROVKJR8ASFH2Y4RMF6AGOOPOA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R4%3Frating_asin%3DB00280A2AI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B00280A2AI.rating.onetofive%3D5"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DDEASKG4T3DISLS5KNQ62KTBPOKAA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o4=\r
+%3Frating_asin%3DB00280A2AI%26B00280A2AI.rating.owned%3DOWN%26template-name=\r
+%3D%2Fgp%2Fyourstore%2Fiyr"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-locale/personaliz=\r
+ation/ratings-bar/light-blue/check-off._V192558299_.gif" width=3D"14" alt=\r
+=3D"[ ]" height=3D"14" border=3D"0" /></a\r
+\r
+> <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"><a href=\r
+=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D=\r
+DEASKG4T3DISLS5KNQ62KTBPOKAA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyo=\r
+urstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o4%3Fratin=\r
+g_asin%3DB00280A2AI%26B00280A2AI.rating.owned%3DOWN%26template-name%3D%2Fgp=\r
+%2Fyourstore%2Fiyr">Geh=F6rt mir</a></font\r
+\r
+><br /><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/aut=\r
+omated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D""=\r
+ height=3D"8" border=3D"0" />\r
+                  </td>\r
+                </tr>\r
+              </table>\r
+            </td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td></td>=20\r
+            <td colspan=3D"2"\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'></font\r
+\r
+>\r
+              <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-seri=\r
+f">\r
+              </font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>\r
+\r
+        <hr width=3D'100%' size=3D'1' noshade=3D'noshade' style=3D'border-t=\r
+op: 1px dashed #999999;' /\r
+\r
+>\r
+        <table width=3D'100%' border=3D'0' cellspacing=3D'2' cellpadding=3D=\r
+'0'\r
+\r
+>\r
+          <tr align=3D'left'>\r
+            <td width=3D'25%' align=3D'center' valign=3D'top'\r
+\r
+>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DPAZZ1BKTPR2O2OM5Y7EUEUAUQUEA&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB002AK2UNI%2Fref%3Dpe_23451_20950531_pe_vfe_d5'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41fVEwoiwkL._SL110_.jpg"=\r
+ width=3D"110" alt=3D"" height=3D"110" border=3D"0" /></a>\r
+            </td>\r
+            <td width=3D'50%' valign=3D'top'\r
+\r
+><p>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DPAZZ1BKTPR2O2OM5Y7EUEUAUQUEA&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB002AK2UNI%2Fref%3Dpe_23451_20950531_pe_vfe_d5'\r
+\r
+><b><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>Samsung Om=\r
+nia II I8000 Smartphone (Touchscreen, 5MP Kamera, Windows Mobile) rose-blac=\r
+k</font></b></a\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'><br /\r
+\r
+>\r
+               =20\r
+\r
+\r
+\r
+von Samsung\r
+                <br />Durchschnittliche Kundenrezension:<img src=3D"http://=\r
+g-ecx.images-amazon.com/images/G/03/detail/stars-4-0._V192187677_.gif" widt=\r
+h=3D"64" height=3D"12" border=3D"0" />\r
+              </font> </p\r
+\r
+>\r
+              <font face=3D'verdana,arial,helvetica' size=3D'-1'>\r
+                <b>Listenpreis:</b\r
+\r
+> <s>EUR 649,00</s><br /><b>Jetzt:</b> <b><font color=3D'#990000'>EUR 343,3=\r
+9</font></b\r
+\r
+><font size=3D'1' color=3D'#990000'> </font><br /><b>Sie sparen:</b> <font =\r
+color=3D'#990000'>EUR 305,61 (47%)</font\r
+\r
+><br /><font size=3D'1'>Verkauft von: TEL2BMARKET</font><br /><br />\r
+              </font>\r
+            </td>\r
+            <td width=3D'25%' align=3D'left'\r
+\r
+>=20\r
+              <table width=3D'95' border=3D'0' align=3D'center' cellpadding=\r
+=3D'0' cellspacing=3D'0'\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"top"\r
+\r
+>\r
+                    <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DOIDZ2YXCCGA0Y5GY19JAEO5XB1OA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_b5%=\r
+3Faction%3DaddToCart%26quantity.1%3D1%26offeringID.1%3Dxn53kJUTgdTCsHRUv8h%=\r
+252FSeSsgkNRwMJysEi3Su99K36u8pDbwpirF2byiOsAvBOoLk5klDOyW%252FKpirLw%252FUv=\r
+IiP05Z8qyT74UYjMwBSAsIfqTLHEMydNruqOfqbv8GccLLtuyfdqLBHM%253D'\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-to-cart._V192214349_.gif" width=3D"146" alt=3D"=\r
+In den Einkaufswagen" height=3D"22" border=3D"0" /></a\r
+\r
+><br />\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3D1ZVT7TMDVKXBSQFY09WKMJPJKMEA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_l5%=\r
+3Faction%3Dadd-to-registry.wishlist%26asin.1%3DB002AK2UNI%26template-name%3=\r
+Dstores%2Fdetail%26B002AK2UNI%3D1%26submit.add-to-registry.wishlist.x%3D1%2=\r
+6submit.add-to-registry.wishlist.y%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-wishlist._V192214349_.gif" width=3D"138" vspace=\r
+=3D"3" alt=3D"Der Wunschliste hinzuf=FCgen" height=3D"17" border=3D"0" /></=\r
+a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"\r
+\r
+>Diesen Artikel bewerten:<br /></font>\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DO2256MWGWDDHRJNYWXP5APGUDQGA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R5%3Frating_asin%3DB002AK2UNI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B002AK2UNI.rating.onetofive%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DC9EMEMDOQPMRG6AEOLOI5TXUY1YA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R5%3Frating_asin%3DB002AK2UNI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B002AK2UNI.rating.onetofive%3D2"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DFVTPM4JIVOWEU8XTCQGMWV43PTMA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R5%3Frating_asin%3DB002AK2UNI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B002AK2UNI.rating.onetofive%3D3"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DAAEKRORJPHPLCG8BHXRPW6EHZ6GA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R5%3Frating_asin%3DB002AK2UNI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B002AK2UNI.rating.onetofive%3D4"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DF8FL2ZZTWAFYAWGGYZWLQP1HPCIA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R5%3Frating_asin%3DB002AK2UNI%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B002AK2UNI.rating.onetofive%3D5"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DX4DIEZ2FBLFA4QZZO6TPVIVCZ5YA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o5=\r
+%3Frating_asin%3DB002AK2UNI%26B002AK2UNI.rating.owned%3DOWN%26template-name=\r
+%3D%2Fgp%2Fyourstore%2Fiyr"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-locale/personaliz=\r
+ation/ratings-bar/light-blue/check-off._V192558299_.gif" width=3D"14" alt=\r
+=3D"[ ]" height=3D"14" border=3D"0" /></a\r
+\r
+> <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"><a href=\r
+=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D=\r
+X4DIEZ2FBLFA4QZZO6TPVIVCZ5YA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyo=\r
+urstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o5%3Fratin=\r
+g_asin%3DB002AK2UNI%26B002AK2UNI.rating.owned%3DOWN%26template-name%3D%2Fgp=\r
+%2Fyourstore%2Fiyr">Geh=F6rt mir</a></font\r
+\r
+><br /><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/aut=\r
+omated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D""=\r
+ height=3D"8" border=3D"0" />\r
+                  </td>\r
+                </tr>\r
+              </table>\r
+            </td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td></td>=20\r
+            <td colspan=3D"2"\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'></font\r
+\r
+>\r
+              <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-seri=\r
+f">\r
+              </font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>\r
+\r
+        <hr width=3D'100%' size=3D'1' noshade=3D'noshade' style=3D'border-t=\r
+op: 1px dashed #999999;' /\r
+\r
+>\r
+        <table width=3D'100%' border=3D'0' cellspacing=3D'2' cellpadding=3D=\r
+'0'\r
+\r
+>\r
+          <tr align=3D'left'>\r
+            <td width=3D'25%' align=3D'center' valign=3D'top'\r
+\r
+>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DXR8QLT7XBQLIMKJK6VSHMZAZE54A&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB0038JDF3E%2Fref%3Dpe_23451_20950531_pe_vfe_d6'\r
+\r
+><img src=3D"http://ecx.images-amazon.com/images/I/41r%2B661x5rL._SL110_.jp=\r
+g" width=3D"59" alt=3D"" height=3D"110" border=3D"0" /></a>\r
+            </td>\r
+            <td width=3D'50%' valign=3D'top'\r
+\r
+><p>\r
+              <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=\r
+=3D3TM7SJC0LCWPG&H=3DXR8QLT7XBQLIMKJK6VSHMZAZE54A&T=3DC&U=3Dhttp%3A%2F%2Fww=\r
+w.amazon.de%2Fdp%2FB0038JDF3E%2Fref%3Dpe_23451_20950531_pe_vfe_d6'\r
+\r
+><b><font face=3D'verdana,arial,helvetica,sans-serif' size=3D'2'>HTC Desire=\r
+ Smartphone (5 MP, AMOLED, 4GB Speicherkarte,  HSPA, Android 2.1, HTC Sense=\r
+)</font></b></a\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'><br /\r
+\r
+>\r
+               =20\r
+\r
+\r
+\r
+von HTC\r
+                <br />Durchschnittliche Kundenrezension:<img src=3D"http://=\r
+g-ecx.images-amazon.com/images/G/03/detail/stars-4-5._V192563316_.gif" widt=\r
+h=3D"64" height=3D"12" border=3D"0" />\r
+              </font> </p\r
+\r
+>\r
+              <font face=3D'verdana,arial,helvetica' size=3D'-1'>\r
+                <b>Jetzt:</b\r
+\r
+> <b><font color=3D'#990000'>EUR 479,99</font></b><font size=3D'1' color=3D=\r
+'#990000'> </font\r
+\r
+><br /><font size=3D'1'>Verkauft von: eXpansys</font><br /><br />\r
+              </font>\r
+            </td>\r
+            <td width=3D'25%' align=3D'left'\r
+\r
+>=20\r
+              <table width=3D'95' border=3D'0' align=3D'center' cellpadding=\r
+=3D'0' cellspacing=3D'0'\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"top"\r
+\r
+>\r
+                    <a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3D4QCAQKCHHM5JLTHPWIAQULSRHNOA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_b6%=\r
+3Faction%3DaddToCart%26quantity.1%3D1%26offeringID.1%3Dr9x4uUgM0gR5fyTn%252=\r
+BdsSETHLMenTGwMOAboB0nlP3EeT4FukfGM8TwW%252FA1zQgWDQ6NOb%252BcnppnYVAF1adYO=\r
+zoN7M6ti9u%252FfzmI0qBBF7ma%252BT60rONwLkfPhU5UmYAnzxZpsVHGSq4QZicn7kKBYc%2=\r
+52BQ%253D%253D'\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-to-cart._V192214349_.gif" width=3D"146" alt=3D"=\r
+In den Einkaufswagen" height=3D"22" border=3D"0" /></a\r
+\r
+><br />\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DZWXI8FLCPALQJLELA4UORYCLWLOA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fitem-dispatch%2Fref%3Dpe_23451_20950531_pe_vfe_l6%=\r
+3Faction%3Dadd-to-registry.wishlist%26asin.1%3DB0038JDF3E%26template-name%3=\r
+Dstores%2Fdetail%26B0038JDF3E%3D1%26submit.add-to-registry.wishlist.x%3D1%2=\r
+6submit.add-to-registry.wishlist.y%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/add-wishlist._V192214349_.gif" width=3D"138" vspace=\r
+=3D"3" alt=3D"Der Wunschliste hinzuf=FCgen" height=3D"17" border=3D"0" /></=\r
+a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"\r
+\r
+>Diesen Artikel bewerten:<br /></font>\r
+                    <a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3D0EAWTSZQK2LLKP2JKXBH5KIBNUMA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R6%3Frating_asin%3DB0038JDF3E%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B0038JDF3E.rating.onetofive%3D1"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DLLIXD2RZYGKTDVZZMMWZYAJSI10A&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R6%3Frating_asin%3DB0038JDF3E%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B0038JDF3E.rating.onetofive%3D2"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DY8AHSAXEFXA6Y8OKZE0ZJDHUGSGA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R6%3Frating_asin%3DB0038JDF3E%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B0038JDF3E.rating.onetofive%3D3"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DAY3EJBJML7V5SNAW32SL7GUCKBCA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R6%3Frating_asin%3DB0038JDF3E%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B0038JDF3E.rating.onetofive%3D4"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a\r
+\r
+><a\r
+                       href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1=\r
+MOCG&C=3D3TM7SJC0LCWPG&H=3DZFTAOQYWQNLDQ17YZGZLA4YH5EKA&T=3DC&U=3Dhttp%3A%2=\r
+F%2Fwww.amazon.de%2Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451=\r
+_20950531_pe_vfe_R6%3Frating_asin%3DB0038JDF3E%26template-name%3D%2Fgp%2Fyo=\r
+urstore%2Fiyr%253Fcollection%3Drated%26B0038JDF3E.rating.onetofive%3D5"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/star._V192214356_.gif" width=3D"12" alt=3D"*" heigh=\r
+t=3D"12" border=3D"0" /></a>\r
+                  </td>\r
+                </tr\r
+\r
+>\r
+                <tr>\r
+                  <td align=3D"center" valign=3D"bottom"\r
+\r
+>\r
+                    <img src=3D"http://g-ecx.images-amazon.com/images/G/03/=\r
+marketing/automated-emails/recommendations/spacer._V192214338_.gif" width=\r
+=3D"1" alt=3D"" height=3D"23" border=3D"0" /\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DEEFI0QXAZI9QXST7FNAPYV1XMX4A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fgp%2Fyourstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o6=\r
+%3Frating_asin%3DB0038JDF3E%26B0038JDF3E.rating.owned%3DOWN%26template-name=\r
+%3D%2Fgp%2Fyourstore%2Fiyr"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/x-locale/personaliz=\r
+ation/ratings-bar/light-blue/check-off._V192558299_.gif" width=3D"14" alt=\r
+=3D"[ ]" height=3D"14" border=3D"0" /></a\r
+\r
+> <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-serif"><a href=\r
+=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D=\r
+EEFI0QXAZI9QXST7FNAPYV1XMX4A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyo=\r
+urstore%2Fratings%2Fsubmit.html%2Fref%3Dpe_23451_20950531_pe_vfe_o6%3Fratin=\r
+g_asin%3DB0038JDF3E%26B0038JDF3E.rating.owned%3DOWN%26template-name%3D%2Fgp=\r
+%2Fyourstore%2Fiyr">Geh=F6rt mir</a></font\r
+\r
+><br /><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/aut=\r
+omated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D""=\r
+ height=3D"8" border=3D"0" />\r
+                  </td>\r
+                </tr>\r
+              </table>\r
+            </td>\r
+          </tr\r
+\r
+>\r
+          <tr align=3D"left">\r
+            <td></td>=20\r
+            <td colspan=3D"2"\r
+\r
+>\r
+              <font size=3D'2' face=3D'Verdana, Arial, Helvetica, sans-seri=\r
+f'></font\r
+\r
+>\r
+              <font size=3D"1" face=3D"Verdana, Arial, Helvetica, sans-seri=\r
+f">\r
+              </font>\r
+            </td>\r
+          </tr>\r
+        </table\r
+\r
+>\r
+\r
+        <hr width=3D'100%' size=3D'1' noshade=3D'noshade' style=3D'border-t=\r
+op: 1px dashed #999999;' />\r
+\r
+   =20\r
+       =20\r
+   =20\r
+        <!-- FOOTER -->=20\r
+        <table width=3D"100%" border=3D"0" align=3D"left" cellpadding=3D"0"=\r
+ cellspacing=3D"2"\r
+\r
+>=20\r
+          <tr>=20\r
+            <td align=3D"left">\r
+              <p><font size=3D"2" face=3D"Verdana, Arial, Helvetica, sans-s=\r
+erif"\r
+\r
+><a href=3D'http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DJNLIAPDA3QOXHDFOIQJLLLESUC8A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+Fsim%2FB003DA5P22%2F2%2Fref%3Dpe_23451_20950531_pe_vfe'>Weitere =E4hnliche =\r
+Artikel anzeigen</a></font></p\r
+\r
+>\r
+              <p><font face=3D"verdana,arial,helvetica" size=3D"-1"\r
+\r
+>\r
+                Falls Sie einen dieser Artikel bereits besitzen oder kennen=\r
+, teilen Sie uns dies doch einfach mit. Klicken Sie dazu auf die Sternchen =\r
+rechts neben dem Artikel. Bei allen Fragen hilft Ihnen gerne unser <a href=\r
+=3Dhttp://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3D5=\r
+1THYAL5MIDD9UR7QG0NCRQN6OIA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fcontact-=\r
+us%3Fref_%3Dpe_23451_20950531>Kundenservice</a\r
+\r
+>.<br><br>Vielen Dank,<br>Amazon.de              </font></p>\r
+            </td>=20\r
+          </tr>\r
+        </table>\r
+\r
+      </td>\r
+\r
+      <td style=3D"border-right: solid 1px #5C9EBF"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D"" heigh=\r
+t=3D"1" border=3D"0" /></td>\r
+    </tr>\r
+   =20\r
+    <!--BOTTOM TABLE OUTLINE-->\r
+    <tr\r
+\r
+>=20\r
+     =20\r
+   =20\r
+       =20\r
+    <td width=3D"12" height=3D"12"><img src=3D"http://g-ecx.images-amazon.c=\r
+om/images/G/03/marketing/automated-emails/recommendations/bb-ll._V192214346=\r
+_.gif" width=3D"12" alt=3D"" height=3D"12" border=3D"0" /></td>\r
+<td style=3D"border-bottom: solid 1px #5C9EBF"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=3D"" heigh=\r
+t=3D"1" border=3D"0" /></td>\r
+<td width=3D"12" height=3D"12"\r
+\r
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/automated=\r
+-emails/recommendations/bb-lr._V192214346_.gif" width=3D"12" alt=3D"" heigh=\r
+t=3D"12" border=3D"0" /></td>\r
+=20\r
+    </tr>\r
+   =20\r
+   =20\r
+       =20\r
+   =20\r
+  </table\r
+\r
+>=20\r
+\r
+  <table width=3D"580" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">\r
+    <tbody\r
+\r
+>\r
+      <tr>=20\r
+        <td>=20\r
+          <img src=3D"http://g-ecx.images-amazon.com/images/G/03/marketing/=\r
+automated-emails/recommendations/spacer._V192214338_.gif" width=3D"1" alt=\r
+=3D"" height=3D"1" border=3D"0" /\r
+\r
+>\r
+\r
+         =20\r
+\r
+\r
+\r
+<table border=3D'0' cellpadding=3D'8' cellspacing=3D'0' width=3D'100%'><tr>=\r
+<td><font size=3D'1'  face=3D'Verdana, Arial, Helvetica, sans-serif'\r
+\r
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DHMTVKFOAELY5F9RSGBYJTX0FBPKA&T=3DX&U=3Dhttp%3A%2F%2Fwww.amazon.de%2=\r
+F%2Fgp%2Fgss%2Fo%2F1IECYaiu7ty3uGu.WRZRpTGN79gOvzErwDjKU5rhCik4eMROCICHLnXq=\r
+jWYHWs43M">Klicken Sie hier</a\r
+\r
+>, um zuk=FCnftig keine Nachrichten dieser Art mehr von uns zu erhalten. (B=\r
+itte beachten Sie, dass diese Nachricht an folgende Adresse versandt wurde:=\r
+ user@mail.com). Unter "Mein Konto" k=F6nnen Sie au=DFerdem Ihr gew=FCnsch=\r
+tes E-Mail-Format festlegen: HTML oder Text.<br />\r
+<br /\r
+\r
+>\r
+Alle Euro-Preise beinhalten die deutsche Mehrwertsteuer. Die in Ihrem Land =\r
+geltenden Steuers=E4tze finden Sie <a href=3D"http://www.amazon.de/gp/r.htm=\r
+l?R=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3DA4H4WKA4GTPX0JWZEOGVKYJYONQA&T=3D=\r
+C&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fhelp%2Fcustomer%2Fdisplay.html%2Fre=\r
+f%3Dpe_23451_20950531_pe_121%2F%3FnodeId%3D526796">hier</a\r
+\r
+>.<br />\r
+<br /\r
+\r
+>\r
+Aus rechtlichen Gr=FCnden sind preisgebundene B=FCcher in unseren reduziert=\r
+en Angeboten nicht inbegriffen. Die Preisvergleiche beziehen sich auf fr=FC=\r
+here Ladenpreise oder Originalausgaben. Alle Angebote gelten, solange der V=\r
+orrat reicht. Einige Artikel sind noch nicht im Handel erh=E4ltlich, k=F6nn=\r
+en jedoch bei uns vorbestellt werden.<br />\r
+<br /\r
+\r
+>\r
+Preisvergleiche f=FCr Artikel aus den Bereichen Elektronik und Foto sowie H=\r
+aus und Garten beziehen sich auf die unverbindliche Preisempfehlung (U.V.P.=\r
+) des Herstellers, soweit nichts anderes angegeben ist.<br />\r
+<br />\r
+<br>Reference 20950531<br />\r
+<br /\r
+\r
+>\r
+Die Preise f=FCr neue und gebrauchte Marketplace-Artikel werden von den jew=\r
+eiligen Amazon.de-Marketplace-Verk=E4ufern festgelegt. Verf=FCgbarkeit und =\r
+Preise k=F6nnen sich daher jederzeit =E4ndern. Nicht alle Marketplace-H=E4n=\r
+dler versenden au=DFerhalb Deutschlands. Beachten Sie dazu die besonderen V=\r
+ersandbedingungen. Gleiches gilt f=FCr die Zeitschriften-Abonnements.<br />\r
+<br /\r
+\r
+>\r
+Bitte antworten Sie nicht auf diese E-Mail. Falls Sie uns kontaktieren m=F6=\r
+chten, benutzen Sie bitte unser <a href=3D"http://www.amazon.de/gp/r.html?R=\r
+=3D13IA705T1MOCG&C=3D3TM7SJC0LCWPG&H=3DAHPDTXPUJNS9VDYKCATDA8AIMOSA&T=3DC&U=\r
+=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fhelp%2Fcustomer%2Fdisplay.html%2F%3Fie=\r
+%3DUTF8%26nodeId%3D3961931%26ref_%3Dpe_23451_20950531">Kontaktformular</a\r
+\r
+>.<br />\r
+<br /\r
+\r
+>\r
+Diese Nachricht ging an folgende E-Mail-Adresse: user@mail.com<br />\r
+<br />\r
+</font></td></tr></table>\r
+         =20\r
+        </td>\r
+      </tr>\r
+    </tbody>\r
+  </table>=20\r
+</div\r
+\r
+>\r
+<img src=3D"http://www.amazon.de/gp/r.html?R=3D13IA705T1MOCG&C=3D3TM7SJC0LC=\r
+WPG&H=3DHIXSGNA81WOMCT3BODGW8GDG0IKA&T=3DE&U=3Dhttp%3A%2F%2Fimages-eu.amazo=\r
+n.com%2Fimages%2FG%2F01%2Fnav%2Ftransp.gif" /></body></html>\r
+\r
+\r
+------=_Part_32672_22223462.1279090515774--\r
+\r
diff --git a/tests/tine20/Expressomail/files/Amazon2.eml b/tests/tine20/Expressomail/files/Amazon2.eml
new file mode 100755 (executable)
index 0000000..4027d05
--- /dev/null
@@ -0,0 +1,1009 @@
+Received: from mm-retail2-out-12101.amazon.com (mm-retail2-out-12101.amazon.com [87.238.85.54])
+       by mx01.metaways.net (Postfix) with ESMTP id 2FA75100BB
+       for <bugreports@tine20.org>; Wed,  5 Jan 2011 11:49:32 +0100 (CET)
+Date: Wed, 5 Jan 2011 10:30:59 +0000 (UTC)
+From: "Amazon.de" <promotion5@amazon.de>
+To: "bugreports@tine20.org" <bugreports@tine20.org>
+Message-ID: <22605554.59566971294223459822.JavaMail.em-build@massmail-sender-eu-12018.dub2.amazon.com>
+Subject: Fritz Meier: Alles muss raus
+Bounces-to: 201101051030592d190d1b920f4b019e21055860d3eac8-C28WOR8P08F4KF@bounces.amazon.com
+X-AMAZON-MAIL-RELAY-TYPE: merchandizing
+X-AMAZON-RTE-VERSION: 2.0
+X-Spam-Status: No, score=-11.5 required=5.0 tests=HTML_MESSAGE,
+       RCVD_IN_DNSWL_MED,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=disabled
+       version=3.2.4
+X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
+       mail01.metaways.net
+Return-Path: 201101051030592d190d1b920f4b019e21055860d3eac8-C28WOR8P08F4KF@bounces.amazon.com
+MIME-Version: 1.0
+X-Tine20TestMessage: multipart/amazon2
+Content-Type: multipart/mixed;
+       boundary="----=_Part_11825522_15900125.1294223459816"
+
+------=_Part_11825522_15900125.1294223459816
+Content-Type: multipart/alternative; 
+       boundary="----=_Part_11825523_5910854.1294223459816"
+
+------=_Part_11825523_5910854.1294223459816
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: quoted-printable
+
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+AMAZON.DE
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+ =20
+Hallo Fritz Meier,
+Alles muss raus: Restposten und Sonderangebote bis zu 60% reduziert. Greife=
+n Sie zu, solange der Vorrat reicht.
+
+Hier klicken
+http://www.amazon.de/gp/b/ref=3Dpe_g1/?node=3D872398
+
+  Wir w=FCnschen Ihnen viel Spa=DF beim Einkauf!
+
+Herzliche Gr=FC=DFe
+
+<table>
+<tbody><tr bgcolor="#006567" style="background-color:#006567;">
+    <td width="40" align="center" bgcolor="#006567" style="background-image:url(&quot;http://www.xing.com/img/xing/newsletter/navigation_bg.gif&quot;);background-color:#006567;">
+        <a href="http://www.xing.com/" target="_blank"></a>
+    </td>
+    <td width="64" align="center" bgcolor="#ffffff" style="background-image:url(&quot;http://www.xing.com/img/xing/newsletter/navigation_tab_bg.gif&quot;);background-color:#ffffff;">
+        <a href="http://www.xing.com?dpt=ma&amp;ttp=mail&amp;plf=own&amp;pid=wsnl-32011&amp;xtr=tnv2" style="font-family:arial, helvetica, sans-serif;font-size:11px;font-weight:bold;color:#333333;text-transform:uppercase;text-decoration:none;" target="_blank">Start</a>
+    </td>
+</tr></tbody>
+</table>
+
+Amazon.de
+http://www.amazon.de
+
+!----------------------------------------------------------------------
+
+ =20
+=20
+
+Klicken Sie hier, um zuk=FCnftig keine Nachrichten dieser Art mehr von uns =
+zu erhalten:
+http://www.amazon.de//gp/gss/o/1Btb7OsPwqaclG7l5WFs6ao3wtsoaYN0JxIbjEewDu4w=
+BCVsYUMDasF1OgJsYZ3tS
+Bitte beachten Sie, dass diese Nachricht an folgende Adresse versandt wurde=
+: bugreports@tine20.org. Unter "Mein Konto" k=F6nnen Sie au=DFerdem Ihr gew=FCns=
+chtes E-Mail-Format festlegen: HTML oder Text.
+
+Bitte antworten Sie nicht auf diese E-Mail. Falls Sie uns kontaktieren m=F6=
+chten, benutzen Sie bitte unser Kontaktformular:
+http://www.amazon.de/gp/browse.html/ref=3Dpe_120/?node=3D3961931
+
+Alle Euro-Preise beinhalten die deutsche Mehrwertsteuer. Die in Ihrem Land =
+geltenden Steuers=E4tze finden Sie hier:
+http://www.amazon.de/gp/help/customer/display.html/ref=3Dpe_121/?nodeId=3D5=
+26796
+
+Bestellungen liefern wir nach Deutschland, =D6sterreich, Belgien, Liechtens=
+tein, Luxemburg, Niederlande und in die Schweiz ab einem Bestellwert von 20=
+,00 EUR in der Regel versandkostenfrei. Reine Buchbestellungen liefern wir =
+in diese L=E4nder auch unter 20 EUR Bestellwert kostenlos. F=FCr einzelne P=
+rodukte aus den Bereichen Elektronik & Foto, K=FCche, Haus & Garten sowie S=
+pielwaren & Kinderwelt k=F6nnen Versandkosten anfallen. Details zu unseren =
+Versandkosten finden Sie hier:
+http://www.amazon.de/gp/browse.html/ref=3Dpe_122/?node=3D504950
+
+Aus rechtlichen Gr=FCnden sind preisgebundene B=FCcher in unseren reduziert=
+en Angeboten nicht inbegriffen. Die Preisvergleiche beziehen sich auf fr=FC=
+here Ladenpreise oder Originalausgaben.
+
+Alle Preise gelten, solange der Vorrat reicht. Einige Artikel sind noch nic=
+ht im Handel erh=E4ltlich, k=F6nnen jedoch bei uns vorbestellt werden. Prei=
+svergleiche f=FCr Artikel aus den Bereichen Elektronik und Foto sowie K=FCc=
+he, Haus und Garten beziehen sich auf die unverbindliche Preisempfehlung (U=
+.V.P.) des Herstellers, soweit nichts anderes angegeben ist.
+
+Die hier dargestellten Angebote beziehen sich ausschlie=DFlich auf Produkte=
+, die von Amazon.de selbst angeboten werden und schlie=DFen Produkte, die a=
+uf der Amazon.de Website, jedoch von dritten Parteien oder auf Drittanbiete=
+r-Seiten, wie z.B. Amazon.de Marketplace, Auktionen und zShops angeboten we=
+rden, nicht mit ein.
+
+Die Preise f=FCr neue und gebrauchte Marketplace-Artikel werden von den jew=
+eiligen Amazon.de-Marketplace-Verk=E4ufern festgelegt. Verf=FCgbarkeit und =
+Preise k=F6nnen sich daher jederzeit =E4ndern. Nicht alle Marketplace-H=E4n=
+dler versenden au=DFerhalb Deutschlands. Beachten Sie dazu die besonderen V=
+ersandbedingungen. Gleiches gilt f=FCr die Zeitschriften-Abonnements.
+
+
+------=_Part_11825523_5910854.1294223459816
+Content-Type: text/html; charset=ISO-8859-1
+Content-Transfer-Encoding: quoted-printable
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
+w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+
+>
+<html xmlns=3D"http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" /
+
+>
+<title>Amazon.de</title>
+<style type=3D"text/css">
+a:link {
+=09color: #3E7CBB;
+=09text-decoration:underline;
+=09}
+a:visited {
+=09color: #3E7CBB;
+=09text-decoration:underline;
+=09}
+</style>
+</head
+
+>
+
+<body><img src=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2=
+732PXAOL&H=3DSLCZRHXOACDSA80ZTBV6ZCPPDSWA&T=3DO&U=3Dhttp%3A%2F%2Fimages-eu.=
+amazon.com%2Fimages%2FG%2F01%2Fnav%2Ftransp.gif" />
+
+<table width=3D"580" cellspacing=3D"0" cellpadding=3D"0" border=3D"0">
+<tr height=3D"38" bgcolor=3D"#006567" style=3D"background-color: #006567"=
+>
+<td width=3D"40" align=3D"center" bgcolor=3D"#006567" style=3D"background=
+-image: url(http://www.xing.com/img/xing/newsletter/navigation_bg.gif); b=
+ackground-color:#006567;"><a href=3D"http://www.xing.com"><img src=3D"htt=
+p://www.xing.com/img/users/6/3/4/2678a4964.3494157_s=
+1,2.jpg" width=3D"18" height=3D"24" hspace=3D"0" border=3D"0" alt=3D""></=
+a></td>
+</tr>
+</table>
+
+<table cellpadding=3D"0" cellspacing=3D"0" width=3D"650" align=3D"center" b=
+order=3D"0"
+
+>
+<tr>
+<td colspan=3D"2" align=3D"center" style=3D"padding:0 0 15px 0"><a href=3D"=
+http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DNDDA4=
+199XFQK5GS0ZISF80HEBHQA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fyoursto=
+re%2Fhome%2Fref%3Dpe_86361_23142531_pe_recQ3"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-si=
+ze:7pt; color:#3E7CBB;">Fritz Meier, wir haben Empfehlungen f=FCr Sie</sp=
+an>.</a></td>
+
+</tr
+
+>
+<tr>
+<td width=3D"200" align=3D"left" valign=3D"middle"><a href=3D"http://www.am=
+azon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3D2RXJZRHQTHS4TXX2D0=
+NPP4E99H4A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fref%3Dpe_86361_23142531_p=
+e_loQ3%2F"
+
+><img src=3D"http://images-eu.amazon.com/images/G/03/general/de-logo-153x37=
+.gif" alt=3D"Amazon.de" width=3D"153" height=3D"37" border=3D"0" /></a></td=
+>
+<td width=3D"450" align=3D"right" valign=3D"bottom" style=3D"padding:0"
+
+><table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
+<tr>
+<td width=3D"400" align=3D"right" valign=3D"bottom" style=3D"padding:0 0 10=
+px 0"
+
+><font style=3D"font-family:arial,verdana,sans-serif; font-size:12px; line-=
+height:15px; color:#004B91;">Gratis-Lieferung am n=E4chsten Tag&nbsp;</font
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DL6AR3YNGTWTAIMEWFBFGZ2TNMHWA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fsubs%2Fprimeclub%2Fsignup%2Fmain.html%2Fref%3Dpe_86361_23142531_pe_prQ=
+3" style=3D"font-family:arial,verdana,sans-serif; font-size:12px; line-heig=
+ht:15px; color:#cc6600; text-decoration:none; font-weight:bold">&rsaquo; Am=
+azon Prime</a></td>
+</tr>
+
+</table
+
+>
+<table cellpadding=3D"0" cellspacing=3D"0" width=3D"400" height=3D"1">
+<tr>
+<td width=3D"15" align=3D"right" valign=3D"top" bgcolor=3D"#146eb4"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/02/uk-marketing/email/=
+tep1l.gif" width=3D"15" height=3D"23" alt=3D"" /></td>
+<td width=3D"122" height=3D"20" valign=3D"bottom" align=3D"center" bgcolor=
+=3D"#146eb4"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D3CYAYDW26HQGMXK0A3MRS10K5JGA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+b%2Fref%3Dpe_86361_23142531_pe_tnav1aQ3%2F%3Fnode%3D77195031" style=3D"font=
+-family:arial,verdana,sans-serif; font-size:12px; color:#ffffff; text-decor=
+ation:underline; line-height:15px;">MP3-Downloads</a></td>
+
+<td width=3D"122" height=3D"20" valign=3D"bottom" align=3D"center" bgcolor=
+=3D"#146eb4"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DJW4OLWUDBKHFNYVNR7GYQTAZHLIA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+b%2Fref%3Dpe_86361_23142531_pe_tnav1bQ3%2F%3Fnode%3D872398" style=3D"font-f=
+amily:arial,verdana,sans-serif; font-size:12px; color:#ffffff; text-decorat=
+ion:underline; line-height:15px;">Sonderangebote</a></td>
+<td width=3D"123" height=3D"20" valign=3D"bottom" align=3D"center" bgcolor=
+=3D"#146eb4"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D6HGELSKU9MBONQA8LS25BPUVAQUA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fsite-directory%2Fref%3Dpe_86361_23142531_pe_tnav1cQ3%2F" style=3D"font=
+-family:arial,verdana,sans-serif; font-size:12px; color:#ffffff; text-decor=
+ation:underline; line-height:15px;">Alle Kategorien </a></td>
+<td width=3D"16" align=3D"right" valign=3D"top" bgcolor=3D"#146eb4"
+
+><img src=3D"http://g-ec2.images-amazon.com/images/G/01/ma8/d1/p3.gif" widt=
+h=3D"15" height=3D"23" alt=3D"" /></td>
+</tr>
+</table>
+</td>
+</tr
+
+>
+<tr>
+<td colspan=3D"2" height=3D"5" style=3D"padding:0"><img src=3D"http://g-ec2=
+.images-amazon.com/images/G/01/ma8/d1/p4.gif" width=3D"650" height=3D"5" al=
+ign=3D"left" alt=3D"" /></td>
+</tr>
+</table>
+
+<!--Start stripe-->
+<table width=3D"650" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" align=
+=3D"center"
+
+>
+<tr>
+
+ <td align=3D"center" style=3D"padding:0 0 10px 0"><a href=3D"http://www.am=
+azon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DUGA1WZHQWYFX6XCNNC=
+HHA1CPERWA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fbrowse.html%2Fref%3D=
+pe_86361_23142531_pe_freeship%2F%3Fnode%3D504950"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/email/export/DE-EES=
+-DE-stripe-28.gif" border=3D"0" align=3D"top" /></a></td>
+
+  </tr>
+</table>
+<!--Stop stripe-->
+<table width=3D"650" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" align=
+=3D"center"
+
+>
+  <tr>
+    <td  align=3D"left"><table width=3D"100%%" border=3D"0" cellspacing=3D"=
+0" cellpadding=3D"0"
+
+>
+      <tr>
+        <td align=3D"center"><a href=3D"http://www.amazon.de/gp/r.html?R=3D=
+68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DFXZVFKAUPQEEUFTVCDXYIDHAWR0A&T=3DC&U=3Dh=
+ttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fb%2Fref%3Dpe_86361_23142531_pe_01%2F%3Fnod=
+e%3D872398"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/email/de-jan-sale-2=
+011-650x300.gif" alt=3D"Amazon.de" border=3D"0" /></a></td>
+      </tr>
+    </table
+
+>
+      <p style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-=
+size:10pt; color: #000000"
+
+>Fritz Meier,<br />
+      Alles muss raus: Restposten und Sonderangebote bis zu 60% reduziert. =
+Greifen Sie zu, solange der Vorrat reicht.</p
+
+>
+      <table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
+        <tr
+
+>
+          <td width=3D"10" height=3D"27"><img style=3D"display:block" src=
+=3D"http://g-ecx.images-amazon.com/images/G/02/uk-marketing/email/butleft.g=
+if" width=3D"10" height=3D"27" alt=3D"" /></td>
+          <td=20
+
+><table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
+            <tr
+
+>
+              <td height=3D"2" bgcolor=3D"#1C408B"><img style=3D"display:bl=
+ock" src=3D"http://g-ec2.images-amazon.com/images/G/01/correios/1002_hallow=
+een/spacer.gif" width=3D"1" height=3D"2" alt=3D"" /></td>
+            </tr
+
+>
+            <tr>
+              <td height=3D"23" bgcolor=3D"#FFC435" valign=3D"middle" nowra=
+p=3D"nowrap" style=3D"font-family: verdana;font-size: 12px;"
+
+>&nbsp;<a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2=
+732PXAOL&H=3DGI5YRIF7QTAH5HVLES09WMWCTDMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon=
+.de%2Fgp%2Fb%2Fref%3Dpe_86361_23142531_pe_g1%2F%3Fnode%3D872398" style=3D"f=
+ont-family: verdana; font-weight: bold; font-size:13px; color:#000066; text=
+-decoration:none; font-size:12px;">Hier klicken</a>&nbsp;</td>
+            </tr
+
+>
+            <tr>
+              <td height=3D"2" bgcolor=3D"#1C408B"><img style=3D"display:bl=
+ock" src=3D"http://g-ec2.images-amazon.com/images/G/01/correios/1002_hallow=
+een/spacer.gif" width=3D"1" height=3D"2" alt=3D"" /></td>
+            </tr>
+          </table></td>
+          <td width=3D"25" height=3D"27"
+
+><img style=3D"display:block" src=3D"http://g-ecx.images-amazon.com/images/=
+G/02/uk-marketing/email/butright.gif" width=3D"25" height=3D"27" alt=3D"" /=
+></td>
+        </tr>
+      </table
+
+>
+      <br /></td>
+  </tr>
+</table>
+<table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" align=3D"center" wi=
+dth=3D"650"
+
+>
+<tr>
+<td align=3D"center" style=3D"padding:0 0 10px 0"><img src=3D"http://g-ecx.=
+images-amazon.com/images/G/02/uk-marketing/email/Q309spa.gif" alt=3D"" widt=
+h=3D"650" height=3D"1" />
+</td>
+</tr>
+</table>
+<!--Stop intro and TCG-->
+
+<!--Start related section header-->
+<!--Stop related section header-->
+<!--Start related section-->
+<!--Stop related section-->
+<!--Start GC-->
+
+<table width=3D"650" border=3D"0" cellspacing=3D"0" cellpadding=3D"0" align=
+=3D"center"
+
+>
+<tr>
+  <td style=3D"padding:0 0 12px 0"><a href=3D"http://www.amazon.de/gp/r.htm=
+l?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DZGQWQGPY1HVS0N9BTUAGO7HXEMCA&T=3DC=
+&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fgc%2Fref%3Dpe_86361_23142531_pe_gcQ3=
+"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/email/GC-stripe-650=
+x45._V219929141_.gif" alt=3D"Amazon Geschenkgutscheine " width=3D"650" heig=
+ht=3D"45" border=3D"0" /></a></td>
+  </tr>
+</table>
+<!--Stop GC-->
+<!--Start links and new stores section-->
+<table width=3D"650" cellspacing=3D"0" cellpadding=3D"0" align=3D"center"
+
+>
+  <tr>
+    <td colspan=3D"5"><img src=3D"http://g-ecx.images-amazon.com/images/G/0=
+2/uk-marketing/email/20090625tef1.gif" width=3D"650" height=3D"15" alt=3D""=
+ /></td>
+  </tr
+
+>
+  <tr>
+    <td bgcolor=3D"#146EB4" width=3D"1"><img src=3D"http://g-ec2.images-ama=
+zon.com/images/G/01/mk/da/s.gif" width=3D"1" height=3D"50" alt=3D"" /></td>
+    <td width=3D"24"
+
+><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk/da/s.gif" width=
+=3D"25" height=3D"1" alt=3D"" /></td>
+    <td width=3D"550" valign=3D"top" align=3D"center"><!--Start nav-->
+      <table width=3D"570" cellspacing=3D"0" cellpadding=3D"0" align=3D"cen=
+ter"
+
+>
+        <tr>
+          <td align=3D"center" colspan=3D"4" style=3D"padding:0 0 12px 0"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; color: =
+#cd6600; font-weight: bold; font-size: 10pt;">Entdecken Sie Hunderttausende=
+ von Artikeln</span></td>
+        </tr
+
+>
+        <tr>
+          <td width=3D"140" valign=3D"top"><table cellpadding=3D"0" cellspa=
+cing=3D"0" border=3D"0"
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DBCWNFTBR3MHKLGYMGETAPVUYBGMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav1Q3%2F%3Fnode%3D299956" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;">B&uuml;cher</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DJDS898KQW7JONC9YMONIKKUDJ7EA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav2Q3%2F%3Fnode%3D290380" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;">Musik</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D8ZHMY503FATNS5GARCLX8TJAQ0WA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav3Q3%2F%3Fnode%3D77195031" =
+style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;=
+font-size: 11px;text-decoration:none;">MP3-Downloads</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DRVPIOTGQRCE4N9YQ1ZZWK1SKLCYA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav4Q3%2F%3Fnode%3D284266" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;">DVD &amp; Blu-ray </a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D0QPLUNYS4OUX5RF6WD6FAMGBFJUA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav5Q3%2F%3Fnode%3D301052" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;">Video Games </a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DDM9FAXYFYW780EBMBVN7OPK9ZUCA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav6Q3%2F%3Fnode%3D301928" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;">Software</a
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D0QPLUNYS4OUX5RF6WD6FAMGBFJUA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav5Q3%2F%3Fnode%3D301052" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;"></a></td>
+            </tr>
+          </table></td>
+          <td width=3D"138" valign=3D"top"
+
+><table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
+            <tr
+
+>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DNM1NQSUJQVVA0AKEC8FLF9IT47IA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav7Q3%2F%3Fnode%3D562066" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;">Elektronik &amp; Foto </a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DUZP4HAF7G7N9ZTIUGXANDO2NJISA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav8Q3%2F%3Fnode%3D340843031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Computer & Zubeh=F6r</a
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DAWJAF3XJGOPENNPSY85V3KNCV5CA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav7Q3%2F%3Fnode%3D3034891" s=
+tyle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;f=
+ont-size: 11px;text-decoration:none;"></a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D1YVA5OURVXFZQWAKCC2SAPU80LMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav9Q3%2F%3Fnode%3D192416031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">B&uuml;robedarf</a
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DAWJAF3XJGOPENNPSY85V3KNCV5CA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav7Q3%2F%3Fnode%3D3034891" s=
+tyle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;f=
+ont-size: 11px;text-decoration:none;"></a
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DS5FJ9ZOQDW8QTKWMPZ0TRD0K2MSA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav8Q3%2F%3Fnode%3D301928" st=
+yle=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;fo=
+nt-size: 11px;text-decoration:none;"></a
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DRVKRXPJCZW2RCKLDMNYGACATZWMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav8Q3%2F%3Fnode%3D192416031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;"></a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DTFVRLZBB33YVIB6ARGEH9LGFDIMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav10Q3%2F%3Fnode%3D12950651"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Spielzeug</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DAOTS8A0AVSI6QXESKN0YT5XZZMCA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav11Q3%2F%3Fnode%3D355007011=
+" style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.=
+4;font-size: 11px;text-decoration:none;">Baby</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DRSYIQRQCBXGGLSN0NHJAKSOR9SSA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav12Q3%2F%3Fnode%3D340849031=
+" style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.=
+4;font-size: 11px;text-decoration:none;">Musikinstrumente</a></td>
+            </tr>
+          </table></td>
+          <td width=3D"169" valign=3D"top"
+
+><table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
+            <tr
+
+>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DBE0RI3ON29VH28DXJFALZPSCAHUA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav13Q3%2F%3Fnode%3D3167641" =
+style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4;=
+font-size: 11px;text-decoration:none;">K&uuml;che, Haus &amp; Garten</a></t=
+d>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DQTCFAQBQR6GJIPKCOTYFUCOWHDYA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav14Q3%2F%3Fnode%3D80084031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Baumarkt</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DEZ5ZHTDTRDOZZREWRYMP2HHJ9VGA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav15Q3%2F%3Fnode%3D78191031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Auto &amp; Motorrad </a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DSQCARFUCYANSGGLTFNC2IF1ETYEA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav16Q3%2F%3Fnode%3D64187031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Drogerie &amp; Bad </a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DGFH7AROKIAIROFTENW5OJEDO7F4A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav17Q3%2F%3Fnode%3D84230031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Parf&uuml;merie &amp; Kosmetik</a><=
+/td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D77NC2FI4KGFXRG0AYKTXCHT5ASSA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav18Q3%2F%3Fnode%3D340846031=
+" style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.=
+4;font-size: 11px;text-decoration:none;">Lebensmittel &amp; Getr&auml;nke</=
+a></td>
+            </tr>
+          </table></td>
+          <td width=3D"121" valign=3D"top"
+
+><table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
+            <tr
+
+>
+              <td width=3D"10"><img src=3D"http://g-ec2.images-amazon.com/i=
+mages/G/01/mk/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td width=3D"115"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DFR1AB1GYEVKWBJWSLOEB725YSECA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav19Q3%2F%3Fnode%3D355006011=
+" style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.=
+4;font-size: 11px;text-decoration:none;">Schuhe</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DRVGEAVCPMRDPV6H9EQMO3HKS1S8A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav20Q3%2F%3Fnode%3D77028031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Bekleidung</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DGPC02YRGESKRWJYATDIO4IHN00OA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav21Q3%2F%3Fnode%3D16435051"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Sport &amp; Freizeit </a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DQGQ1X8VKTU3FDCHU5SVP1TK46M0A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav22Q3%2F%3Fnode%3D193707031=
+" style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.=
+4;font-size: 11px;text-decoration:none;">Uhren</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DDLI8DBFTHXORJ2Z155RFWFIVGJWA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav23Q3%2F%3Fnode%3D327472011=
+" style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.=
+4;font-size: 11px;text-decoration:none;">Schmuck</a></td>
+            </tr
+
+>
+            <tr>
+              <td><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk=
+/da/a4.gif" width=3D"10" height=3D"13" alt=3D"" /></td>
+              <td
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D4HA4ZYRV9BMSHASIG2K0PULAVN0A&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_nav24Q3%2F%3Fnode%3D10925031"=
+ style=3D"font-family:verdana,arial,helvetica;color:#3E7CBB;line-height:1.4=
+;font-size: 11px;text-decoration:none;">Garten &amp; Haustier</a></td>
+            </tr>
+          </table></td>
+        </tr
+
+>
+        <tr>
+          <td colspan=3D"4" height=3D"8"><img src=3D"http://g-ec2.images-am=
+azon.com/images/G/01/mk/da/s.gif" width=3D"1" height=3D"8" alt=3D"" /></td>
+        </tr>
+      </table>
+      <!--Stop nav-->
+        <!--Start latest stores-->
+        <table width=3D"600" cellspacing=3D"0" cellpadding=3D"0" align=3D"c=
+enter"
+
+>
+          <tr>
+            <td align=3D"center" colspan=3D"4" style=3D"padding:12px 0 12px=
+ 0"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; color: =
+#cd6600; font-weight: bold; font-size: 10pt;">Ausgew=E4hlte neue Kategorien=
+</span></td>
+          </tr
+
+>
+          <tr>
+            <td width=3D"150" valign=3D"top" align=3D"center"><a href=3D"ht=
+tp://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DKLYCMAT=
+32JOHEIP8SLAATEH7OLSA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fbrowse.ht=
+ml%2Fref%3Dpe_86361_23142531_pe_ns1Q3%2F%3Fnode%3D77028031"
+
+><img src=3D"http://ecx.images-amazon.com/images/I/41EYkwerKXL._SS120_RO10,=
+1,201,225,243,255,255,255,15_.jpg" width=3D"120" height=3D"120" border=3D"0=
+" alt=3D"" /></a></td>
+            <td width=3D"150" valign=3D"top" align=3D"center"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D7A3EKGWETVEALHFQUPP9ELAPEBYA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns2Q3%2F%3Fnode%3D340846031"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/email/grocery_mailf=
+ooter_banner.jpg" width=3D"120" height=3D"120" border=3D"0" alt=3D"" /></a>=
+</td>
+            <td width=3D"150" valign=3D"top" align=3D"center"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DJ8LMZCV9JQDH0AIVBCH2JTX8PTAA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns3Q3%2F%3Fnode%3D340849031"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/musical_instruments=
+/store/main/Music_6Pack_1._V192631470_.gif" width=3D"120" height=3D"120" bo=
+rder=3D"0" alt=3D"" /></a></td>
+            <td width=3D"150" valign=3D"top" align=3D"center"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DEHYWRPALORHD7FBN6BBYP4MVGPMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns4Q3%2F%3Fnode%3D340852031"
+
+><img src=3D"http://g-ecx.images-amazon.com/images/G/03/email/pets120.jpg" =
+width=3D"120" height=3D"120" border=3D"0" alt=3D"" /></a></td>
+          </tr
+
+>
+          <tr>
+            <td width=3D"150" valign=3D"top" align=3D"center" style=3D"padd=
+ing:8px 0 12px 0"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DKLYCMAT32JOHEIP8SLAATEH7OLSA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns1Q3%2F%3Fnode%3D77028031"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-si=
+ze:10pt; color: #3E7CBB">Bekleidung</span></a></td>
+            <td width=3D"150" valign=3D"top" align=3D"center" style=3D"padd=
+ing:8px 0 12px 0"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3D7A3EKGWETVEALHFQUPP9ELAPEBYA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns2Q3%2F%3Fnode%3D340846031"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-si=
+ze:10pt; color: #3E7CBB">Lebensmittel & Getr=E4nke</span></a></td>
+            <td width=3D"150" valign=3D"top" align=3D"center" style=3D"padd=
+ing:8px 0 12px 0"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DJ8LMZCV9JQDH0AIVBCH2JTX8PTAA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns3Q3%2F%3Fnode%3D340849031"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-si=
+ze:10pt; color: #3E7CBB">Musikinstrumente</span></a></td>
+            <td width=3D"150" valign=3D"top" align=3D"center" style=3D"padd=
+ing:8px 0 12px 0"
+
+><a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DEHYWRPALORHD7FBN6BBYP4MVGPMA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F=
+gp%2Fbrowse.html%2Fref%3Dpe_86361_23142531_pe_ns4Q3%2F%3Fnode%3D340852031"
+
+><span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-si=
+ze:10pt; color: #3E7CBB">Haustierbedarf</span></a></td>
+          </tr>
+        </table>
+      <!--Stop latest stores-->
+    </td>
+    <td width=3D"24"
+
+><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk/da/s.gif" width=
+=3D"1" height=3D"1" alt=3D"" /></td>
+    <td bgcolor=3D"#146EB4" width=3D"1"
+
+><img src=3D"http://g-ec2.images-amazon.com/images/G/01/mk/da/s.gif" width=
+=3D"1" height=3D"50" alt=3D"" /></td>
+  </tr
+
+>
+  <tr>
+    <td colspan=3D"5" height=3D"9"><img src=3D"http://g-ecx.images-amazon.c=
+om/images/G/02/uk-marketing/email/20090625tef2.gif" width=3D"650" height=3D=
+"10" alt=3D"" /></td>
+  </tr>
+</table>
+
+<!--Stop links and new stores section-->
+<!--Start disclaimer section-->
+<table width=3D"650" cellpadding=3D"0" cellspacing=3D"0" align=3D"center" b=
+order=3D"0"
+
+>
+<tr>
+<td align=3D"left" style=3D"padding:20px">
+ <span style=3D"font-family: Verdana, Arial, Helvetica, sans-serif; font-si=
+ze:7pt; color: #000000"
+
+><font face=3D"Verdana, Arial, Helvetica, sans-serif"=20
+      size=3D"-2"><font face=3D"Verdana, Arial, Helvetica, sans-serif" size=
+=3D"-2"
+
+>&nbsp;<br />
+&nbsp;</font></font><br />
+
+=09=09<br />
+=09=09
+<a href=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAO=
+L&H=3DF8STINSU8ZCAJLCDMO6TWZUCSQ4A&T=3DX&U=3Dhttp%3A%2F%2Fwww.amazon.de%2F%=
+2Fgp%2Fgss%2Fo%2F1Btb7OsPwqaclG7l5WFs6ao3wtsoaYN0JxIbjEewDu4wBCVsYUMDasF1Og=
+JsYZ3tS">Klicken Sie hier</a
+
+>, um zuk=FCnftig keine Nachrichten dieser Art mehr von uns zu erhalten. (B=
+itte beachten Sie, dass diese Nachricht an folgende Adresse versandt wurde:=
+ bugreports@tine20.org). Unter &quot;Mein Konto&quot; k=F6nnen Sie au=DFerdem Ih=
+r gew=FCnschtes E-Mail-Format festlegen: HTML oder Text.<br />
+=09=09<br /
+
+>
+Bitte antworten Sie nicht auf diese E-Mail. Falls Sie uns kontaktieren m=F6=
+chten, benutzen Sie bitte unser <a href=3D"http://www.amazon.de/gp/r.html?R=
+=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DD2YW4BKFMMKYYYFHFHQ5U4NUXX8A&T=3DC&U=
+=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fhelp%2Fcontact-us%2Fgeneral-questions.=
+html%3Fie%3DUTF8%26amp%3Bbrowse_node_id%3D505030%23csTop%2Fre%3Dpe_contact%=
+26ref_%3Dpe_86361_23142531">Kontaktformular</a
+
+>.<br />
+<br /
+
+>
+Alle Euro-Preise beinhalten die deutsche Mehrwertsteuer. Die in Ihrem Land =
+geltenden Steuers=E4tze finden Sie <a href=3D"http://www.amazon.de/gp/r.htm=
+l?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DBHUWSXF51CR7ASZNXYNNJQP9MMYA&T=3DC=
+&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fhelp%2Fcustomer%2Fdisplay.html%2Fref=
+%3Dpe_86361_23142531_pe_121%2F%3FnodeId%3D526796">hier</a
+
+>.<br />
+<br /
+
+>
+Bestellungen liefern wir  nach Deutschland, &Ouml;sterreich, Belgien,  Liec=
+htenstein, Luxemburg, Niederlande und in die  Schweiz ab einem Bestellwert =
+von 20,00 EUR in der Regel  versandkostenfrei. Reine Buchbestellungen liefe=
+rn wir in diese L&auml;nder auch  unter 20 EUR Bestellwert kostenlos. F&uum=
+l;r einzelne Produkte aus den Bereichen  Elektronik &amp; Foto, K&uuml;che,=
+ Haus &amp; Garten sowie Spielwaren &amp;  Kinderwelt k&ouml;nnen Versandko=
+sten anfallen. Details zu unseren Versandkosten  finden Sie <a href=3D"http=
+://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXAOL&H=3DQSZA5CFLQ=
+KXMYEBDB9SLZNCU8DEA&T=3DC&U=3Dhttp%3A%2F%2Fwww.amazon.de%2Fgp%2Fbrowse.html=
+%2Fref%3Dpe_86361_23142531_pe_122%2F%3Fnode%3D504950">hier</a
+
+>.<br />
+<br /
+
+>
+Aus rechtlichen Gr=FCnden sind preisgebundene B=FCcher in unseren reduziert=
+en Angeboten nicht inbegriffen. Die Preisvergleiche beziehen sich auf fr=FC=
+here Ladenpreise oder Originalausgaben.<br />
+<br /
+
+>
+Alle Preise gelten, solange der Vorrat reicht. Einige Artikel sind noch nic=
+ht im Handel erh=E4ltlich, k=F6nnen jedoch bei uns vorbestellt werden. Prei=
+svergleiche f=FCr Artikel aus den Bereichen Elektronik &amp; Foto und K=FCc=
+he, Haus &amp; Garten beziehen sich auf die unverbindliche Preisempfehlung =
+(U.V.P.) des Herstellers, soweit nichts anderes angegeben ist.<br />
+<br /
+
+>
+Die hier dargestellten Angebote beziehen sich ausschlie=DFlich auf Produkte=
+, die von Amazon.de selbst angeboten werden und schlie=DFen Produkte, die a=
+uf der Amazon.de Website, jedoch von dritten Parteien oder auf Drittanbiete=
+r-Seiten, wie z.B. Amazon.de Marketplace, Auktionen und zShops angeboten we=
+rden, nicht mit ein.<br />
+<br />
+Die Preise f=FCr neue und gebrauchte Marketplace-Artikel werden von den jew=
+eiligen Amazon.de-Marketplace-Verk=E4ufern festgelegt. Verf=FCgbarkeit und =
+Preise k=F6nnen sich daher jederzeit =E4ndern. Nicht alle Marketplace-H=E4n=
+dler versenden au=DFerhalb Deutschlands. Beachten Sie dazu die besonderen V=
+ersandbedingungen. Gleiches gilt f=FCr die Zeitschriften-Abonnements.
+</span></td>
+  </tr>
+
+</table>
+<!--Stop disclaimer section-->
+<img src=3D"http://www.amazon.de/gp/r.html?R=3D68LD2MLBD6U8&C=3D1MJP2732PXA=
+OL&H=3DQEGZTDXWHMNCYW866QERKXVFFRQA&T=3DE&U=3Dhttp%3A%2F%2Fimages-eu.amazon=
+.com%2Fimages%2FG%2F01%2Fnav%2Ftransp.gif" /></body>
+</html>
+
+------=_Part_11825523_5910854.1294223459816--
+
+------=_Part_11825522_15900125.1294223459816--
+
diff --git a/tests/tine20/Expressomail/files/Angebotsformular.eml b/tests/tine20/Expressomail/files/Angebotsformular.eml
new file mode 100755 (executable)
index 0000000..6d29b92
--- /dev/null
@@ -0,0 +1,53 @@
+Return-Path: <spambox1@lala.de>
+X-Original-To: it-abteilung@irgendwo.de
+Delivered-To: xyzserver.com
+Received: from xyzserver.com (xyzserver.com [77.77.77.203])
+       by dd1006.kasserver.com (Postfix) with ESMTP id 46BD7413DE8
+       for <it-abteilung@irgendwo.de>; Mon, 23 Aug 2010 20:33:37 +0200 (CEST)
+Received: from nobody by xyzserver.com running ExIM with local
+       id 1Onbpx-0004Wz-3i; Mon, 23 Aug 2010 20:33:37 +0200
+Date: Mon, 23 Aug 2010 20:33:37 +0200
+Message-Id: <E1Onbpx-0004Wz-3i@xyzserver.com>
+To: it-abteilung@irgendwo.de
+Subject: Angebotsformular
+X-PHP-Script: lala.de/scripts/form/v23/formmail.php for 77.77.77.203, 77.77.77.204
+From: it-abteilung@irgendwo.de
+MIME-Version: 1.0
+X-bounce-key: lallala;1282588417;b190ba10;
+X-KasLoop: m01740c5
+X-Antivirus: avast! (VPS 100825-0, 25.08.2010), Inbound message
+X-Antivirus-Status: Clean
+X-Tine20TestMessage: text/angebot
+
+
+*Formular-Weiterleitungs-Service*
+-----------------------------------------------------------------
+
+
+
+
+email:  it-abteilung@irgendwo.de
+
+Name:  aaaaa
+
+Vorname:  bbbbbb.
+
+Strasse:  DORT 4
+
+Ort:  33333 DA
+
+Telefon:  323232/841117229
+
+Email:  
+
+Artikel:  Fahrrad-Ki-Anhänger
+
+Artikelbeschreibung:  Fahrrad-Kinder-Anhänger, kann auch als Lastenanhänger umgebaut werden.
+
+Preis:  40,00
+
+-----------------------------
+Monday 23rd 2010f August 2010 08:33:37 PM
+212.6.123.204
+Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
+
diff --git a/tests/tine20/Expressomail/files/Terminbestaetigung.eml b/tests/tine20/Expressomail/files/Terminbestaetigung.eml
new file mode 100755 (executable)
index 0000000..fe91741
--- /dev/null
@@ -0,0 +1,90 @@
+Received: from gatekeeper.abc-ddee.de (gatekeeper.abc-ddee.de [84.245.142.42])
+       by mx01.metaways.net (Postfix) with SMTP id 14E21C102
+       for <abcd@bbb.de>; Wed,  2 Mar 2011 08:07:52 +0100 (CET)
+Received: from MarionC ([213.122.0.166]) by gatekeeper.abc-ddee.de
+       with hMailServer         ; Wed, 2 Mar 2011 07:59:11 +0100
+Message-ID: <5F76A4368A3E40D292E1CA53B810BDEB@MarionC>
+From: mark anton <info@bbbb.de>
+To: abcd@bbb.de
+Subject: =?iso-8859-1?Q?Terminbest=E4tigung__Tine_2.0_Metaways?=
+Date: Wed, 2 Mar 2011 08:07:47 +0100
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.5931
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
+X-Spam-Status: No, score=0.0 required=5.0
+       tests=HTML_MESSAGE,MIME_QP_LONG_LINE
+       autolearn=disabled version=3.3.1
+X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
+       mail01.metaways.net
+Return-Path: info@bbbb.de
+MIME-Version: 1.0
+X-Tine20TestMessage: Terminbestaetigung.eml
+Content-Type: multipart/alternative;
+       boundary="----=_NextPart_000_0002_01CBD8B0.EAB70DE0"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0002_01CBD8B0.EAB70DE0
+Content-Type: text/plain; charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+
+Sehr geehrter Herr Hugo,
+
+herzlichen Dank f=FCr Ihre Reaktion auf unser Anschreiben vom =
+31.01.2011.Gerne best=E4tigen wir Ihnen hiermit den Interviewtermin in =
+Ihrem Hause.
+
+Als Termin wurde vorgesehen: Mittwoch, 30.03.2011 um 10:00 Uhr
+
+Es w=E4re sch=F6n, wenn Sie zu diesem Termin einige Unterlagen wie =
+Presse-Informationen, Ver=F6ffentlichungen, Prospekte und =C4hnliches =
+bereithalten w=FCrden.
+
+Der zust=E4ndige Redakteur wird Sie zum vereinbarten Termin besuchen. Um =
+die Anfahrt zu erleichtern, w=E4ren wir Ihnen dankbar, wenn Sie uns eine =
+kurze Wegbeschreibung zukommen lassen w=FCrden.
+
+Mit freundlichen Gr=FC=DFen
+
+Internationale Atomenergiebehörde
+
+mark anton
+
+------=_NextPart_000_0002_01CBD8B0.EAB70DE0
+Content-Type: text/html; charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD>
+<META content=3D"text/html; charset=3Diso-8859-1" =
+http-equiv=3DContent-Type>
+<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.19019">
+<STYLE></STYLE>
+</HEAD>
+<BODY bgColor=3D#ffffff>
+<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
+<DIV>Sehr geehrter Herr Hugo,<BR><BR>herzlichen Dank f=FCr Ihre =
+Reaktion auf=20
+unser Anschreiben vom 31.01.2011.Gerne best=E4tigen wir Ihnen hiermit =
+den=20
+Interviewtermin in Ihrem Hause.<BR><BR>Als Termin wurde vorgesehen:=20
+<STRONG>Mittwoch, 30.03.2011 um 10:00 Uhr<BR><BR></STRONG>Es w=E4re =
+sch=F6n, wenn=20
+Sie zu diesem Termin einige Unterlagen wie Presse-Informationen,=20
+Ver=F6ffentlichungen, Prospekte und =C4hnliches bereithalten =
+w=FCrden.<BR><BR>Der=20
+zust=E4ndige Redakteur wird Sie zum vereinbarten Termin besuchen. Um die =
+Anfahrt=20
+zu erleichtern, w=E4ren wir Ihnen dankbar, wenn Sie uns eine kurze =
+Wegbeschreibung=20
+zukommen lassen w=FCrden.<BR><BR>Mit freundlichen =
+Gr=FC=DFen<BR><BR>Internationale=20
+Atomenergiebehörde</DIV>
+<DIV><BR>mark anton</DIV></BODY></HTML>
+<br><hr />
+<p><strong>Wirtschaft<font color = #804040>heute</font></strong></p>
+
+------=_NextPart_000_0002_01CBD8B0.EAB70DE0--
+
diff --git a/tests/tine20/Expressomail/files/UTF8inFrom.eml b/tests/tine20/Expressomail/files/UTF8inFrom.eml
new file mode 100755 (executable)
index 0000000..b208548
--- /dev/null
@@ -0,0 +1,439 @@
+Return-Path: <git@tine20.org>\r
+Delivered-To: <pschuele@metaways.de>\r
+Received: from mail04.metaways.net ([10.129.3.200])\r
+       by mail03.metaways.net (Dovecot) with LMTP id loKrM4BAxk8DNgAA8j6Pxg\r
+       for <pschuele@metaways.de>; Wed, 30 May 2012 17:49:08 +0200\r
+Return-Path: <git@tine20.org>\r
+Received: from mx04.metaways.net ([127.0.0.1])\r
+       by mail04.metaways.net (Dovecot) with LMTP id 3BZeByNBxk9lbwAAUavrWA\r
+       ; Wed, 30 May 2012 17:49:08 +0200\r
+Received: from tine20-git.metaways.net (tine20-git.metaways.net [10.129.1.187])\r
+       by mx04.metaways.net (Postfix) with ESMTP id 6F93AA0CE\r
+       for <tine20@metaways.de>; Wed, 30 May 2012 17:49:07 +0200 (CEST)\r
+Received: by tine20-git.metaways.net (Postfix, from userid 33)\r
+       id 822F4416A2; Wed, 30 May 2012 17:49:06 +0200 (CEST)\r
+To: tine20@metaways.de\r
+From: Philipp Schüle <p.schuele@metaways.de>\r
+Subject: [tine20] branch, 2012-03, updated. 2012-03-3-14-g647a986\r
+Content-Type: text/plain; charset=utf-8\r
+X-Git-Refname: refs/heads/2012-03\r
+X-Git-Reftype: branch\r
+X-Git-Oldrev: 07cc55dcbdbffc876336e48557760c63f357dcfd\r
+X-Git-Newrev: 647a986a8efd86b5063ba24041d129c82025818b\r
+Message-Id: <20120530154906.822F4416A2@tine20-git.metaways.net>\r
+Date: Wed, 30 May 2012 17:49:05 +0200 (CEST)\r
+X-Tine20TestMessage: UTF8inFrom.eml\r
+X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,AWL\r
+       autolearn=disabled version=3.3.1\r
+X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail04.metaways.net\r
+\r
+The branch, 2012-03 has been updated\r
+       via  647a986a8efd86b5063ba24041d129c82025818b (commit)\r
+       via  1148b054816e22d42eb4629a3753a34865f02d7c (commit)\r
+       via  8e9a0f80cbe0122a5530065ba855761e71193a79 (commit)\r
+       via  d416c9863a2cb39af29242bd0143ee3f6b138a76 (commit)\r
+       via  a8bd47fd9985a1b2348d7ae8e503b16a4201bc0c (commit)\r
+       via  987dbc9778717745a13c348d1ab04128154b1dd2 (commit)\r
+      from  07cc55dcbdbffc876336e48557760c63f357dcfd (commit)\r
+\r
+Those revisions listed above that are new to this repository have\r
+not appeared on any other notification email; so we list those\r
+revisions in full, below.\r
+\r
+- Log -----------------------------------------------------------------\r
+http://git.tine20.org/git/tine20/?id=647a986a8efd86b5063ba24041d129c82025818b\r
+\r
+commit 647a986a8efd86b5063ba24041d129c82025818b\r
+Author: Philipp Schüle <p.schuele@metaways.de>\r
+Date:   Wed May 30 17:17:35 2012 +0200\r
+\r
+    updated documentation\r
+    \r
+    Change-Id: I287d8a6b9a63d9e291251ee86e8e1e5fadb1c922\r
+    Reviewed-on: https://gerrit.tine20.org/tine20/686\r
+    Reviewed-by: Philipp Schüle <p.schuele@metaways.de>\r
+    Tested-by: Philipp Schüle <p.schuele@metaways.de>\r
+\r
+diff --git a/tine20/Tinebase/EmailUser/Smtp/Postfix.php b/tine20/Tinebase/EmailUser/Smtp/Postfix.php\r
+index 479ec8d..86494cc 100644\r
+--- a/tine20/Tinebase/EmailUser/Smtp/Postfix.php\r
++++ b/tine20/Tinebase/EmailUser/Smtp/Postfix.php\r
+@@ -53,7 +53,7 @@ user     = smtpUser\r
+ password = smtpPass\r
+ hosts    = 127.0.0.1\r
+ dbname   = smtp\r
+-query    = SELECT DISTINCT 1 FROM smtp_aliases WHERE SUBSTRING_INDEX(source, '@', -1) = '%s';\r
++query    = SELECT DISTINCT 1 FROM smtp_destinations WHERE SUBSTRING_INDEX(source, '@', -1) = '%s';\r
+ -- ----------------------------------------------------\r
\r
+ --\r
+@@ -75,7 +75,7 @@ user     = smtpUser\r
+ password = smtpPass\r
+ hosts    = 127.0.0.1\r
+ dbname   = smtp\r
+-query = SELECT destination FROM smtp_aliases WHERE source='%s'\r
++query = SELECT destination FROM smtp_destinations WHERE source='%s'\r
\r
+ -- -----------------------------------------------------\r
+  */\r
+\r
+http://git.tine20.org/git/tine20/?id=1148b054816e22d42eb4629a3753a34865f02d7c\r
+\r
+commit 1148b054816e22d42eb4629a3753a34865f02d7c\r
+Author: Philipp Schüle <p.schuele@metaways.de>\r
+Date:   Wed May 30 15:55:38 2012 +0200\r
+\r
+     #6534: import with umlaut as first char fails\r
+    \r
+    - use stream filter to convert from one charset to another\r
+    - added test\r
+    \r
+    https://forge.tine20.org/mantisbt/view.php?id=6534\r
+    \r
+    Change-Id: I39d5dbafa6c414247e1a86a5bb7183a3f1996887\r
+    Reviewed-on: https://gerrit.tine20.org/tine20/684\r
+    Tested-by: jenkins user\r
+    Tested-by: Philipp Schüle <p.schuele@metaways.de>\r
+    Reviewed-by: Philipp Schüle <p.schuele@metaways.de>\r
+\r
+diff --git a/tests/tine20/Addressbook/Import/CsvTest.php b/tests/tine20/Addressbook/Import/CsvTest.php\r
+index 30be42b..d2715ee 100644\r
+--- a/tests/tine20/Addressbook/Import/CsvTest.php\r
++++ b/tests/tine20/Addressbook/Import/CsvTest.php\r
+@@ -202,6 +202,27 @@ class Addressbook_Import_CsvTest extends PHPUnit_Framework_TestCase\r
+     }\r
+     \r
+     /**\r
++     * testImportWithUmlautsWin1252\r
++     * \r
++     * @see 0006534: import of contacts with umlaut as first char fails\r
++     */\r
++    public function testImportWithUmlautsWin1252()\r
++    {\r
++        $filename = dirname(__FILE__) . '/files/adb_import_csv_win1252.xml';\r
++        $applicationId = Tinebase_Application::getInstance()->getApplicationByName('Addressbook')->getId();\r
++        $definition = Tinebase_ImportExportDefinition::getInstance()->getFromFile($filename, $applicationId);\r
++        \r
++        $this->_filename = dirname(__FILE__) . '/files/importtest_win1252.csv';\r
++        $this->_deleteImportFile = FALSE;\r
++        \r
++        $result = $this->_doImport(array(), $definition);\r
++        $this->_deletePersonalContacts = TRUE;\r
++        \r
++        $this->assertEquals(4, $result['totalcount']);\r
++        $this->assertEquals('Üglü, ÖzdemirÖ', $result['results'][2]->n_fileas, 'Umlauts were not imported correctly: ' . print_r($result['results'][2]->toArray(), TRUE));\r
++    }\r
++    \r
++    /**\r
+      * import helper\r
+      * \r
+      * @param array $_options\r
+diff --git a/tests/tine20/Addressbook/Import/files/adb_import_csv_win1252.xml b/tests/tine20/Addressbook/Import/files/adb_import_csv_win1252.xml\r
+new file mode 100644\r
+index 0000000..6b4a101\r
+--- /dev/null\r
++++ b/tests/tine20/Addressbook/Import/files/adb_import_csv_win1252.xml\r
+@@ -0,0 +1,28 @@\r
++<?xml version="1.0" encoding="UTF-8"?>\r
++<config>\r
++<name>adb_simple_csv</name>\r
++<model>Addressbook_Model_Contact</model>\r
++<plugin>Addressbook_Import_Csv</plugin>\r
++<type>import</type>\r
++<headline>1</headline>\r
++<dryrun>0</dryrun>\r
++<delimiter>;</delimiter>\r
++<encoding>WINDOWS-1252</encoding>\r
++<label>Simple CSV import</label>\r
++<description>simple import</description>\r
++<extension>csv</extension>\r
++<mapping>\r
++<field>\r
++<source>First Name</source>\r
++<destination>n_given</destination>\r
++</field>\r
++<field>\r
++<source>Last Name</source>\r
++<destination>n_family</destination>\r
++</field>\r
++<field>\r
++<source>E-Mail</source>\r
++<destination>email</destination>\r
++</field>\r
++</mapping>\r
++</config>\r
+\ No newline at end of file\r
+diff --git a/tests/tine20/Addressbook/Import/files/importtest_win1252.csv b/tests/tine20/Addressbook/Import/files/importtest_win1252.csv\r
+new file mode 100644\r
+index 0000000..9d75a3b\r
+--- /dev/null\r
++++ b/tests/tine20/Addressbook/Import/files/importtest_win1252.csv\r
+@@ -0,0 +1,5 @@\r
++First Name;Last Name;E-Mail\r
++Peter;Pan;peter.pan@ecologic.eu\r
++Maja;Biene;maja.biene@bienenstock.de\r
++�zdemir�;�gl�;oezdemir@ueglue.tu\r
++Weiss;Cornelius;c.weiss@metaways.de\r
+diff --git a/tine20/Tinebase/Import/Abstract.php b/tine20/Tinebase/Import/Abstract.php\r
+index e17b045..e0a4c4f 100644\r
+--- a/tine20/Tinebase/Import/Abstract.php\r
++++ b/tine20/Tinebase/Import/Abstract.php\r
+@@ -6,7 +6,7 @@\r
+  * @subpackage  Import\r
+  * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3\r
+  * @author      Cornelius Weiss <c.weiss@metaways.de>\r
+- * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)\r
++ * @copyright   Copyright (c) 2010-2012 Metaways Infosystems GmbH (http://www.metaways.de)\r
+  */\r
\r
+ /**\r
+@@ -42,6 +42,7 @@ abstract class Tinebase_Import_Abstract implements Tinebase_Import_Interface\r
+         'model'             => '',\r
+         'shared_tags'       => 'create', //'onlyexisting',\r
+         'autotags'          => array(),\r
++        'encodingTo'        => 'UTF-8',\r
+     );\r
+     \r
+     /**\r
+@@ -169,6 +170,13 @@ abstract class Tinebase_Import_Abstract implements Tinebase_Import_Interface\r
+     {\r
+         $clientRecordData = $this->_sortClientRecordsByIndex($_clientRecordData);\r
+         \r
++        if (isset($this->_options['encoding']) && $this->_options['encoding'] !== $this->_options['encodingTo']) {\r
++            $filter = 'convert.iconv.' . $this->_options['encoding'] . '/' . $this->_options['encodingTo'];\r
++            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__\r
++                . ' Add convert stream filter: ' . $filter);\r
++            stream_filter_append($_resource, $filter);\r
++        }\r
++        \r
+         $recordIndex = 0;\r
+         while (($recordData = $this->_getRawData($_resource)) !== FALSE) {\r
+             \r
+@@ -296,10 +304,6 @@ abstract class Tinebase_Import_Abstract implements Tinebase_Import_Interface\r
+             $data = $_data;\r
+         }\r
\r
+-        foreach ($data as $key => $value) {\r
+-            $data[$key] = $this->_encode($value);\r
+-        }\r
+-                \r
+         return $data;\r
+     }\r
+     \r
+@@ -336,30 +340,6 @@ abstract class Tinebase_Import_Abstract implements Tinebase_Import_Interface\r
+         \r
+         return $data;\r
+     }\r
+-    \r
+-    /**\r
+-     * encode values\r
+-     * \r
+-     * @param string|array $_value\r
+-     * @return string|array\r
+-     */\r
+-    protected function _encode($_value)\r
+-    {\r
+-        if (! isset($this->_options['encoding']) || ! isset($this->_options['encodingTo']) || $this->_options['encoding'] === $this->_options['encodingTo']) {\r
+-            return $_value;\r
+-        }\r
+-        \r
+-        if (is_array($_value)) {\r
+-            $result = array();\r
+-            foreach ($_value as $singleValue) {\r
+-                $result[] = @iconv($this->_options['encoding'], $this->_options['encodingTo'], $singleValue);\r
+-            }\r
+-        } else {\r
+-            $result = @iconv($this->_options['encoding'], $this->_options['encodingTo'], $_value);\r
+-        }\r
+-        \r
+-        return $result;\r
+-    }\r
\r
+     /**\r
+      * add some more values (overwrite that if you need some special/dynamic fields)\r
+diff --git a/tine20/Tinebase/Import/Csv/Abstract.php b/tine20/Tinebase/Import/Csv/Abstract.php\r
+index 0a9605c..48dfc19 100644\r
+--- a/tine20/Tinebase/Import/Csv/Abstract.php\r
++++ b/tine20/Tinebase/Import/Csv/Abstract.php\r
+@@ -5,7 +5,7 @@\r
+  * @package     Tinebase\r
+  * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3\r
+  * @author      Philipp Schüle <p.schuele@metaways.de>\r
+- * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)\r
++ * @copyright   Copyright (c) 2007-2012 Metaways Infosystems GmbH (http://www.metaways.de)\r
+  *\r
+  * @todo        add tests for notes\r
+  * @todo        add more documentation\r
+@@ -97,7 +97,6 @@ abstract class Tinebase_Import_Csv_Abstract extends Tinebase_Import_Abstract\r
+             // $this->_options['escape']\r
+         );\r
+         \r
+-        //if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . print_r($lineData, TRUE));\r
+         if (is_array($lineData) && count($lineData) == 1) {\r
+             Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Only got 1 field in line. Wrong delimiter?');\r
+         }\r
+\r
+http://git.tine20.org/git/tine20/?id=8e9a0f80cbe0122a5530065ba855761e71193a79\r
+\r
+commit 8e9a0f80cbe0122a5530065ba855761e71193a79\r
+Author: Cornelius Weiß <mail@corneliusweiss.de>\r
+Date:   Wed May 30 17:44:18 2012 +0200\r
+\r
+    change operator/value on select by blur\r
+    \r
+    @2012-03\r
+    \r
+    Change-Id: Icd8ca511194bb4762d9dcdcdc7153e4d34457d46\r
+    Reviewed-on: https://gerrit.tine20.org/tine20/682\r
+    Reviewed-by: Philipp Schüle <p.schuele@metaways.de>\r
+    Tested-by: Philipp Schüle <p.schuele@metaways.de>\r
+\r
+diff --git a/tine20/Tinebase/js/widgets/grid/FilterModel.js b/tine20/Tinebase/js/widgets/grid/FilterModel.js\r
+index e60ad26..5b2fa46 100644\r
+--- a/tine20/Tinebase/js/widgets/grid/FilterModel.js\r
++++ b/tine20/Tinebase/js/widgets/grid/FilterModel.js\r
+@@ -241,6 +241,13 @@ Ext.extend(Tine.widgets.grid.FilterModel, Ext.util.Observable, {\r
+                     this.onOperatorChange(combo.filter, combo.value);\r
+                 }\r
+             }, this);\r
++            \r
++            operator.on('blur', function(combo) {\r
++                if (combo.value != combo.filter.get('operator')) {\r
++                    this.onOperatorChange(combo.filter, combo.value);\r
++                }\r
++            }, this);\r
++            \r
+         } else if (this.operators[0] == 'freeform') {\r
+             var operator = new Ext.form.TextField({\r
+                 filter: filter,\r
+diff --git a/tine20/Tinebase/js/widgets/grid/FilterToolbar.js b/tine20/Tinebase/js/widgets/grid/FilterToolbar.js\r
+index 558a67b..f3c1c71 100644\r
+--- a/tine20/Tinebase/js/widgets/grid/FilterToolbar.js\r
++++ b/tine20/Tinebase/js/widgets/grid/FilterToolbar.js\r
+@@ -377,6 +377,12 @@ Ext.extend(Tine.widgets.grid.FilterToolbar, Ext.Panel, {\r
+             }\r
+         }, this);\r
+         \r
++        filter.formFields.field.on('blur', function(combo) {\r
++            if (combo.value != combo.filter.get('field')) {\r
++                this.onFieldChange(combo.filter, combo.value);\r
++            }\r
++        }, this);\r
++        \r
+         // operator\r
+         filter.formFields.operator = filterModel.operatorRenderer(filter, fRow.child('td[class^=tw-ftb-frow-operator]'));\r
+         \r
+\r
+http://git.tine20.org/git/tine20/?id=d416c9863a2cb39af29242bd0143ee3f6b138a76\r
+\r
+commit d416c9863a2cb39af29242bd0143ee3f6b138a76\r
+Author: Cornelius Weiß <mail@corneliusweiss.de>\r
+Date:   Tue May 29 20:29:13 2012 +0200\r
+\r
+    not able to drop token to typeAhead fields\r
+    \r
+    @2012-03\r
+    \r
+    Change-Id: I1b7863560674dfefdb08604e0f76f51979f65038\r
+    Reviewed-on: https://gerrit.tine20.org/tine20/683\r
+    Tested-by: jenkins user\r
+    Reviewed-by: Philipp Schüle <p.schuele@metaways.de>\r
+\r
+diff --git a/tine20/Tinebase/js/widgets/dialog/TokenModeEditDialogPlugin.js b/tine20/Tinebase/js/widgets/dialog/TokenModeEditDialogPlugin.js\r
+index cb07070..7cc23f8 100644\r
+--- a/tine20/Tinebase/js/widgets/dialog/TokenModeEditDialogPlugin.js\r
++++ b/tine20/Tinebase/js/widgets/dialog/TokenModeEditDialogPlugin.js\r
+@@ -98,7 +98,7 @@ Tine.widgets.dialog.TokenModeEditDialogPlugin.prototype = {\r
+         this.selection = [];\r
+         \r
+         this.form.items.each(function(item) {\r
+-            if (item instanceof Ext.form.TextField && ! item.disabled && ! Ext.isFunction(item.expand)) {\r
++            if (item instanceof Ext.form.TextField && ! item.disabled && ! item.forceSelection) {\r
+                 if (item.rendered) {\r
+                     this.tokenizeField(item);\r
+                 } else {\r
+\r
+http://git.tine20.org/git/tine20/?id=a8bd47fd9985a1b2348d7ae8e503b16a4201bc0c\r
+\r