Results 1 to 10 of 10

Thread: Imported sent items not recognised as sent by me

  1. #1
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    11
    Rep Power
    7

    Default Imported sent items not recognised as sent by me

    We migrated to zimbra recently. It went reasonably well. We do have an annoying problem though.

    The problem is this: all imported messages are displayed as though I received them, even the messages sent by me to someone else. Now, I think this is some kind of itemflag as moving the message to the Sent Items folder doesn't change anything. The 'from'-address also changes nothing. Please note the following example (pietje is an alias of zimbraldap, so I'm sending to myself):

    vincent@lt-vam:~$ telnet mailserver 25
    Trying 10.254.5.112...
    Connected to mailserver.
    Escape character is '^]'.
    220 mailserver.domain ESMTP Postfix
    EHLO pietje
    250-mailserver.domain
    250-PIPELINING
    250-SIZE 153600000
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-ENHANCEDSTATUSCODES
    250-8BITMIME
    250 DSN
    MAIL FROM:<zimbraldap@domain.com>
    250 2.1.0 Ok
    RCPT TO:<pietje@domain.com>
    250 2.1.5 Ok
    DATA
    354 End data with <CR><LF>.<CR><LF>
    From: Zimbra MigrationLdap <zimbraldap@domain.com>
    To: Frits Spits <pietje@domain.com>
    Subject: Sent item test
    Een leuke test voor sent items...klopt dit?
    .
    250 2.0.0 Ok: queued as 304CE14819D

    So, when I log into my webmail account, I see a From-column with zimbraldap in it. I expected to see pietje as the To-address.

    Using this example, I think 'sent by me' is a message flag. Can anyone help me? I need to change this for about a hundred thousand emails.

  2. #2
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    11
    Rep Power
    7

    Default Found some flags through zmmailbox, but no luck so far

    Example of a message which is displayed as sent by me:
    mbox zimbraldap@domain.com> gm 10172
    Id: 10172
    Conversation-Id: 10174
    Folder: /Sent
    Subject: lalala
    From: joop <joop@domain.com>
    To: Zimbra MigratieLdap <zimbraldap@domain.com>
    Date: Wed, 18 Nov 2009 16:24:55 +0100 (CET)
    Flags: sentByMe
    Size: 463 B


    Notice the 'sentByMe'-flag?
    Now, it looks as though I can't set this flag myself...

    mbox zimbraldap@domain.com> gm 10241
    Id: 10241
    Conversation-Id: -10241
    Folder: /Sent
    Subject: Sent item test
    From: Zimbra MigratieLdap <zimbra.ldap@domain.com>
    To: Frits Spits <pietje@domain.com>
    Date: Fri, 15 Jan 2010 09:39:43 +0100 (CET)
    Flags: notificationSent, y
    Size: 684 B

    Een leuke test voor sent items...klopt dit?

    mbox zimbraldap@domain.com> mif 10241 +sentByMe
    mbox zimbraldap@domain.com> mif 10241 sentByMe
    mbox zimbraldap@domain.com> mif 10241 s

    They don't work.

    I even tried this script:
    [zimbra@mailbox ~]$ for x in a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
    echo $x
    echo "mif 10241 $x" > /tmp/zmmailbox
    echo "gm 10241" >> /tmp/zmmailbox
    zmmailbox -z -m zimbraldap@domain.com -f /tmp/zmmailbox \
    | grep -E "^Flags"
    done

    a
    b
    Flags: b
    c
    d
    e
    f
    Flags: flagged
    g
    h
    i
    Flags: i
    j
    k
    l
    m
    n
    Flags: notificationSent
    o
    Flags: o
    p
    q
    r
    Flags: replied
    s
    t
    u
    v
    w
    Flags: forwarded
    x
    Flags: deleted
    y
    Flags: y
    z

    So, I can't find the 'sentByMe'-flag. I even tried upper case and numbers.

  3. #3
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    11
    Rep Power
    7

    Default

    I just downloaded the source and found the message definition. It appears sentByMe is the 's'-flag. Take a look at the source:

    public class ZMessage implements ZItem, ToZJSONObject {

    public enum Flag {
    unread('u'),
    flagged('f'),
    highPriority('!'),
    lowPriority('?'),
    attachment('a'),
    replied('r'),
    sentByMe('s'),
    forwarded('w'),
    draft('d'),
    deleted('x'),
    notificationSent('n');

    Down side though, it seems as though I can't change it. I tried to set the flag, but to no avail.

  4. #4
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    11
    Rep Power
    7

    Default Inside the mysql database

    Hi again,

    I opened the mysql database and found that the flags column is responsible for this. It seems to be a bitmask, but I can't find any information on the meaning of the bits. It looks like:
    1. Sentbyme
    2. Attachment
    ....the rest is unknown

    So 3 would be attachment AND sentbyme. I can change 3 to 1 and back again, but changing from 3 to 2 and back again does strange things...there's more to this...

    If anyone can help me I would be very happy. Maybe one of the Zimbra developers?
    Last edited by adrighem; 01-15-2010 at 05:23 AM.

  5. #5
    Join Date
    Oct 2007
    Location
    Paris
    Posts
    15
    Rep Power
    7

    Default

    Hello,
    In one of my installation, i had this problem. I have solved it by exporting with the REST interface and reimporting it with the flag. It may be an ugly solution, but it saved me
    Here are the commands lines i have made to done that :

    su - zimbra
    zmmailbox -z -m USER@Domain.com getRestURL /sent.zip > /tmp/USER.zip
    zmmailbox -z -m USER@Domain.com emptyFolder /Sent
    unzip /tmp/USER.zip -d /tmp/USER
    zmmailbox -z -m USER@Domain.com addMessage -f sentByMe /Sent /tmp/USER/Sent
    rm -rf /tmp/USER*


    And thats it. You can put this commands lines into your migrations scripts until Zimbra get the command modifyItemFlags work with this flag.

  6. #6
    Join Date
    Mar 2009
    Location
    Arfgentina
    Posts
    26
    Rep Power
    6

    Default

    Any updates on this issue, I have more than 150k email account and I can not reimport all Sent folders. Is there any way to have this Flag field documented?

  7. #7
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    11
    Rep Power
    7

    Default My solution

    Hi,

    I solved it by editing the mysql database by hand (by script actually) and setting the bitmask. This requires a restart of the mailbox service, but does work.

    So, in short, two workarounds
    1. Edit the bitmask field inside the mysql database for the messages and add the 1 for every sent message. (restart mailboxd afterwards)
    2. export and reimport sent items for all users by using the above commands. I didn't try this one, but it looks fairly straight forward.

    I think I'd recommend the second one, even though I used the first one. It's pretty dodgy to edit the mysql database by hand.

  8. #8
    Join Date
    Mar 2009
    Location
    Arfgentina
    Posts
    26
    Rep Power
    6

    Default

    Many thanks, just a question arise: What you mean by add 1? In binary or in decimal base?

  9. #9
    Join Date
    Oct 2008
    Location
    Netherlands
    Posts
    11
    Rep Power
    7

    Default

    Do a bitmask binary OR, so 2 becomes 3, 0 becomes 1, 1 stays 1 and 3 stays 3.

    I mean, a bitmask binary OR, not an ADD...
    Last edited by adrighem; 11-15-2010 at 03:34 AM. Reason: correct explanation

  10. #10
    Join Date
    Mar 2009
    Location
    Arfgentina
    Posts
    26
    Rep Power
    6

    Default

    I do not know why in same cases worked and in others the content of the "To" field has disappeared, did it happend to anyone?.

Similar Threads

  1. Why is Zimbra so buggy?
    By edwin.arneson in forum Users
    Replies: 50
    Last Post: 11-14-2011, 08:38 AM
  2. [SOLVED] Very few items imported
    By gmeazell in forum Migration
    Replies: 1
    Last Post: 01-06-2010, 01:47 PM
  3. Zimbra, IMAP, and Entourage / No sent items on server
    By stevegarriques in forum Installation
    Replies: 0
    Last Post: 05-19-2009, 08:04 AM
  4. Finding items shared with a distribution list
    By jurg in forum Administrators
    Replies: 0
    Last Post: 07-18-2008, 03:12 AM
  5. 'Deleted Items' & 'Sent Items'
    By bowergo in forum Administrators
    Replies: 1
    Last Post: 06-17-2008, 10:18 AM

Posting Permissions

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