Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-2010, 12:53 AM
Member
 
Posts: 11
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.
Reply With Quote
  #2 (permalink)  
Old 01-15-2010, 01:31 AM
Member
 
Posts: 11
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.
Reply With Quote
  #3 (permalink)  
Old 01-15-2010, 03:03 AM
Member
 
Posts: 11
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.
Reply With Quote
  #4 (permalink)  
Old 01-15-2010, 05:18 AM
Member
 
Posts: 11
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..
Reply With Quote
  #5 (permalink)  
Old 08-10-2010, 02:19 AM
Partner (VAR/HSP)
 
Posts: 15
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.
Reply With Quote
  #6 (permalink)  
Old 11-12-2010, 01:19 AM
Active Member
 
Posts: 26
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?
Reply With Quote
  #7 (permalink)  
Old 11-15-2010, 01:29 AM
Member
 
Posts: 11
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.
Reply With Quote
  #8 (permalink)  
Old 11-15-2010, 03:19 AM
Active Member
 
Posts: 26
Default

Many thanks, just a question arise: What you mean by add 1? In binary or in decimal base?
Reply With Quote
  #9 (permalink)  
Old 11-15-2010, 03:30 AM
Member
 
Posts: 11
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
Reply With Quote
  #10 (permalink)  
Old 11-23-2010, 10:26 AM
Active Member
 
Posts: 26
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?.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.