Results 1 to 7 of 7

Thread: Error: same email imported many times

  1. #1
    nik600 is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    30

    Default Error: same email imported many times

    Hi

    i've got a very strange problem:

    i'm using Version 4.5.1g (Build 1003), and i've configured an account to retrieve the mail using POP3.

    Here the settings:

    Code:
    ...
    Monitored Folder: 	INBOX 
    Mail Server Protocol: 	POP3 
    Use SSL: 	No 
    Use TLS: 	No 
    Auto-Reply Template: 	None
    Validate Certificate: 	No 
    Leave Messages On Server: 	Email left on server after import 
    No Auto-reply to Domain: 	none
    Import Only Since Last Check:: 	No. Check against all emails on mail server.
    The problem is that some emails (20%) are imported many times.
    Can you help me to guess the problem? I've also tried to change Import Only Since Last Check to yes, but i haven't fix the problem....

    Thanks to all in advance

  2. #2
    nik600 is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    30

    Default Re: Error: same email imported many times

    I've fond a bug, there is a problem with the length of the field message_id in the database.

    There is a bug in the duoble check of email:

    The field in the database is a varchar 100, but some emails can have a message id longer than 100 char.

    This produced some duplicate email importing errors, and is very stressful for the final user!

    I've temporary fixed id editing the query in the method importDupeCheck at line 1311 in the file InboundEmail.php

    Code:
    $query = 'SELECT count(emails.id) AS c FROM emails WHERE emails.message_id = \''.substr($this->compoundMessageId,0,100).'\'';
    NOTE: this can produce the inconvenient to don't deliver the mail to multiple user when a message id is longer of 100.

    I suggest to change the size of field message_id in the database

  3. #3
    nik600 is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    30

    Default Re: Error: same email imported many times


  4. #4
    chinwoei's Avatar
    chinwoei is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    91

    Default Re: Error: same email imported many times

    hi,

    This is a reported bugs,
    just alter the message_id field to varchar(255) will work on ur scenario.
    I am from iZeno Pte Ltd
    Personal Site: Technical Sharing
    SugarForge Project:
    iZeno SMS : http://www.sugarforge.org/projects/izeno-sms/

  5. #5
    rodrigocc is offline Junior Member
    Join Date
    Dec 2007
    Posts
    2

    Default Re: Error: same email imported many times

    We are having the same problem as the reporter.
    The difference is that we are using IMAP and checking a folder only.
    We try altering the message_id to 255, but the mails keeps being imported many times
    We tried the other solution (using $query = 'SELECT count(emails.id) AS c FROM emails WHERE emails.message_id = \''.substr($this->compoundMessageId,0,100).'\''; ) and the same, mail keeps being imported many times

    Any idea ?

    Thanks,
    Rodrigo

  6. #6
    clatus is offline Junior Member
    Join Date
    Dec 2007
    Posts
    1

    Arrow Re: Error: same email imported many times

    Hi there,

    we also had the same problem after we changed the message_id to 255...
    Comparing the message_ids in the database and on the mailserver, we discovered that Sugar manipulates the message_id on saving to the database.

    This ist be done by the xss-cleaner.
    For example: if the message_id contains a keyword like "Java" it will be eliminated...
    -> no idea, why...

    So this is what we did to fix this:

    in the file "/data/SugarBean.php"
    find the function "cleanBean"

    and replace


    foreach($potentials as $bad) {
    $this->$key = to_html(str_replace($bad, "", $str));
    }


    with


    foreach($potentials as $bad) {
    if($def['name'] == "message_id") {
    $this->$key = to_html($str);
    } else {
    $this->$key = to_html(str_replace($bad, "", $str));
    }
    }


    That's it...

  7. #7
    Systems Navigator is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    195

    Default Re: Error: same email imported many times

    Quote Originally Posted by chinwoei
    hi,

    This is a reported bugs,
    just alter the message_id field to varchar(255) will work on ur scenario.

    I have the same problem. Some users encounter that emails are displayed several times. After editing the database and changing message_id to 255 it still doesn't work. Also when I repair the database in sugar it recovers the message_id to varchar(100).

    Any suggestions?

    thanks,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HOW-TO guide for Email Campaigns.
    By agupta in forum Marketing/Campaign Management
    Replies: 146
    Last Post: 2012-01-31, 03:08 PM
  2. Poll: Dump Sugar Mail and integrate something better?
    By bjs3 in forum General Discussion
    Replies: 246
    Last Post: 2011-11-23, 04:05 PM
  3. email marketing feature requests
    By maxsutter in forum Feature Requests
    Replies: 1
    Last Post: 2008-10-11, 10:19 AM
  4. Replies: 1
    Last Post: 2007-02-21, 11:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •