Difference between revisions of "King0770-Notes-Always Bcc-Mishap"

(Created page with "== Scenario == After using Zimbra for a time, you decided to use the MTA's always_bcc feature.<br> <code><pre> postconf -e always_bcc=archive@example.com zmmtactl restart </...")
 
 
Line 71: Line 71:
 
Notable RFE ( please vote for it!!! )  <br>
 
Notable RFE ( please vote for it!!! )  <br>
 
https://bugzilla.zimbra.com/show_bug.cgi?id=107532
 
https://bugzilla.zimbra.com/show_bug.cgi?id=107532
 +
 +
 +
More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes
 +
 +
[[Category:Community Sandbox]]
 +
[[Category:Command Line Interface]]
 +
[[Category:MTA]]
 +
[[Category:King0770-Notes]]

Latest revision as of 22:32, 5 December 2018

Scenario

After using Zimbra for a time, you decided to use the MTA's always_bcc feature.

postconf -e always_bcc=archive@example.com
zmmtactl restart

Now, there's a new ZCS version you want to upgrade to; time for an upgrade!

After the upgrade completes, you noticed the always_bcc setting is blank.

postconf always_bcc

Nothing returns

Now you re-set the always_bcc setting

postconf -e always_bcc=archive@example.com
zmmtactl restart

How do you add the messages to the archive@example.com account between the times the upgrade completed, and re-setting always_bcc?

Find when the upgrade completed

perl -an -F: -e 'print scalar localtime(shift @F), " @F";' /opt/zimbra/.install_history

*run as the root user*

Get the time when the main.cf file was updated

ls -la /opt/zimbra/common/conf/main.cf

*run as the root user*

Most likely the timestamp of the main.cf file will reflect the time when always_bcc was updated, and the MTA restarted.

Action by example

Lets say for example, the missing messages are all between 5:08AM (when the upgrade started) and 2:39PM when always_bcc was fixed.

As the zimbra user, do the following...

cd /opt/zimbra/store/0

find . -type f -newermt "2018-02-01 05:08:00" ! -newermt "2018-02-01 14:39:00"

You should see output similar to this...

./2/msg/0/563-1803.msg
./8/msg/0/265-109.msg
./7/msg/0/801-1722.msg

Visually spot check a few of the *.msg files to see if the delivery date/time was within 2018-02-01 05:08:00 & 2018-02-01 14:39:00

Next, run the following to add the messages to the archive@example.com account; providing the archive@example.com's account resides is a zimbra account living on the same mailstore node.

find . -type f -newermt "2018-02-01 05:08:00" ! -newermt "2018-02-01 14:39:00" | xargs zmmailbox -z -m archive@example.com am /Inbox 

Done!

Notable RFE ( please vote for it!!! )
https://bugzilla.zimbra.com/show_bug.cgi?id=107532


More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes

Jump to: navigation, search