หน้าเว็บ

แสดงบทความที่มีป้ายกำกับ Zimbra แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Zimbra แสดงบทความทั้งหมด

วันอังคารที่ 19 พฤศจิกายน พ.ศ. 2562

Zimbra : Status Error TLS: SSL

Zimbra : Status Error TLS: SSL
  1. /etc/init.d/zimbra status
Unable to start TLS: SSL connect attempt failed error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed when connecting to ldap master.
Cannot determine services - exiting
ต้อง run คำสั่ง
  1. zmlocalconfig -e ldap_starttls_required=false
  2. zmlocalconfig -e ldap_starttls_supported=0
  3. Zmcontrol start successfully.

ที่มา
https://forums.zimbra.org/viewtopic.php?t=65875
https://tweenpath.net/fix-unable-start-tls-ssl-connect-attempt-failed-error14090086ssl-routinesssl3_get_server_certificatecertificate-verify-failed-connecting-ldap-master-cannot-determine-services-exiting/

แล้ว Restart Service อีกครั้ง ถึงใช้งานได้ตามปกติ

วันอังคารที่ 28 พฤษภาคม พ.ศ. 2562

Zimbra Backup By zmbkpose

ใช้เครื่องมือช่วยคือ zmbkpose ตามแนบ
1.สร้าง folder สำหรับเก็บข้อมูล
  1. mkdir /opt/zimbra_backup

2.แตกไฟล์
  1. tar -zxvf Zmbkpose-1.0.5.tar.gz

3.จัดการ config file
  1. mkdir /etc/zmbkpose
  2. cp zmbkpose.conf /etc/zmbkpose/

แก้ zmbkpose.conf
  1. WORKDIR=/opt/zimbra_backup
  2. ADMINUSER=admin
  3. ADMINPASS=password
  4. LDAPMASTERSERVER=ldap://127.0.0.1:389
  5. LDAPZIMBRADN=uid=zimbra,cn=admins,cn=zimbra
  6. LDAPZIMBRAPASS=password #ใช้คำสั่ง zmlocalconfig -s zimbra_ldap_password เพื่อดู password
  7. LOGFILE=/opt/zimbra/log/backup.log
  8. PARALLEL_SUPPORT=0
  9. MAX_PARALLEL_PROCESS=3

4.ย้าย script ให้เรียกใช้สะดวก
  1. cp zmbkpose /usr/bin/

5.กำหนดสิทธิ
  1. chmod +x /usr/bin/zmbkpose
  2. chown zimbra:zimbra /opt/zimbra_backup

6.ติดตั้ง package ที่จำเป็นเพิ่ม
  1. apt-get install curl ldap-utils

7.สั่งให้ทำ full backup (ต้องเป็น root ก่อน)
  1. su - zimbra
  2. zmbkpose -f

8. restore Account ด้วยคำสั่ง
  1. zmbkpose -restoreAccount email1@sci.com, email2@sci.com

9.แสดงรายการที่ backup ไว้ด้วยคำสั่ง
  1. zmbkpose -l

10.restore ข้อมูลของ account ด้วยคำสั่ง
  1. zmbkpose -r email1@sci.com, email2@sci.com ชื่อรายการ backup #ที่ได้จาก -l เช่น full-20110214080105

9.คำสั่งอื่นให้พิมพ์ zmbkpose โดยไม่ใส่ parameter เพื่อดูรายละเอียด

Zimbra 8.8.11 : zmbkpose backup not send mail notification. When backup complete.

Zimbra 8.8.11 : zmbkpose backup not send mail notification. When backup complete.
Error Log :
/usr/bin/zmbkpose: line 146: /opt/zimbra/postfix/sbin/sendmail: No such file or directory

The path to sendmail was change on zimbra 8.7 version from:
/opt/zimbra/postfix/sbin/sendmail
to:
/opt/zimbra/common/sbin/sendmail


https://github.com/bggo/Zmbkpose/issues/68

Edit zmbkpose change path.
  1. nano /usr/bin/zmbkpose

Zimbra 8.6.0 Upgrade To Zimbra 8.8.11 Ubuntu 14.04

Zimbra 8.6.0 Upgrade To Zimbra 8.8.11 Ubuntu 14.04

***สำคัญ จะ Upgrade จาก 8.6 ไปเป็น 8.8 เลยไม่ได้ ไม่ผ่าน Error หลายอย่าง ต้อง Upgrad จาก 8.6 --> 8.7 --> 8.8 ถึงจะผ่าน ***
1. ทำ Snapshots ไว้ และมั่นใจว่ามี ข้อมูล Backup สำรองไว้แล้ว หรือ Copy Disk /opt ไว้ Data อยู่ในนั้น
Snapshots ต้องดู Disk Mode ใน VMware ด้วยว่าเป็น Dependent หรือ Independent persistent ถ้าเป็นตัวนี้จะไม่ถูก Snapshots ด้วย
2. Download zimbra software Version ที่ต้องการ แล้วเอาไฟล์ไปไว้ Server ตามที่ต้องการ ใช้ scp หรือ wget ก็ได้
https://www.zimbra.com/downloads/zimbra-collaboration-open-source/archives/
3. แตกไฟล์ ที่ Load มาได้
  1. tar -xvf zcs8.XXXXXX

4. ติดตั้ง dnsmasq
  1. apt-get install dnsmasq

แก้ config
  1. nano /etc/dnsmasq.conf

แก้ดังนี้
server=8.8.8.8
listen-address=127.0.0.1
domain=sci.com
mx-host=sci.com,zimbra.sci.com,0
address=/zimbra.sci.com/192.168.2.102
service dnsmasq restart

5. Test run
dig mx sci.com
dig zimbra.sci.com

6. สำคัญถ้าไม่ทำไม่ผ่าน
  1. nano /etc/apt/sources.list.d/zimbra.list
(เป็น http ถึงจะผ่าน ลบ s ออก)
สำหรับ ubuntu 16.04 ใช้เป็น xenial
8.8.7
deb [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra
deb [arch=amd64] http://repo.zimbra.com/apt/zv1 xenial zimbra
deb-src [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra


8.8.11
deb [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra
deb [arch=amd64] http://repo.zimbra.com/apt/8811 xenial zimbra
deb-src [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra


สำหรับ ubuntu 12.04, 14.04 ใช้เป็น trusty
8.8.11
deb [arch=amd64] http://repo.zimbra.com/apt/87 trusty zimbra
deb [arch=amd64] http://repo.zimbra.com/apt/8811 trusty zimbra
deb-src [arch=amd64] http://repo.zimbra.com/apt/87 trusty zimbra


เพิ่มเติม https://wiki.zimbra.com/wiki/Zimbra_Collaboration_repository

7. add key สำคัญ ต้องใช้ถ้าไม่ Run จะไม่ผ่าน ฟ้อง GPG key ไม่ผ่าน
  1. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9BE6ED79

Importing Zimbra GPG key
ERROR: Unable to retrive Zimbra GPG key for package validation
Please fix system to allow normal package installation before proceeding

8. Test ว่าหา zimbra program เจอหรือไม่ ต้องมีค่าออกมาคือเจอ pack ที่ค้นหา
  1. apt-get install aptitude
  2. apt-get update
  3. aptitude search zimbra-nginx

9. เริ่ม Upgrad เข้าไปที่ Folder ที่แตกไว้ในข้อ 3.
  1. ./install.sh

Y (ยอมรับเงือนไข)
N (*** สำคัญไม่ต้องตอบ Y เพราะ ถ้าตอบ Y sources list จะถูกแก้เป็น HTTPS จะ ลงไม่ได้)
ถ้าตอบ Y จะเป็นแบบนี้
Use Zimbra's package repository [Y] y
Configuring package repository
ERROR: Unable to install packages via apt-get
Please fix system to allow normal package installation before proceeding
(ไม่ผ่าน)

https://forums.zimbra.org/viewtopic.php?t=66069
เลือกตอบ Y หรือ N ถ้าไม่ต้องการในโปรแกรมที่จะลงเพิ่ม เช่น zimbra-chate, zimbra-dive , zimbra-imapd(beta)
แล้วsave yes modifile รอจนกว่าจะเสร็จ
10. ทดลองเข้า
[url]้https://zimbra.sci.com[/url]

11. แก้ Redirect http to https 8.8.11
  1. su – zimbra
  2. zmprov ms `zmhostname` zimbraReverseProxyMailMode redirect
  3. zmcontrol restart
  4.  

https://blog.christosoft.de/2015/06/zimbra-redirect-http-to-https/

Step Restore INC **** ไม่สำเร็จ ******

Step Restore INC **** ไม่สำเร็จ ******
Restore Full เสร็จไปแล้วแต่อยากจะ Restore INC เพิ่มสักวัน
เช่น Restore full-20190518180020
inc-20190520211002
inc-20190521211002
ต้องการ inc วันที่ 22 เข้าไป

1.แตกไฟล์ inc
  1. tar -xvf Zimbra_Inc_20190522.tar.gz


ที่ต้องมี
- inc-20190522211002
- sessions.txt

2. ถ้า run คำสั่งเลยจะฟ้องว่ามีชื่ออยู่แล้ว
zmbkpose -restoreAccount suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com
Account suwit_j@sci.com exists. Use zmbkpose -r suwit_j@sci.com SESSION_name.
Account boonta_p@sci.com exists. Use zmbkpose -r boonta_p@sci.com SESSION_name.
Account seksan_k@sci.com exists. Use zmbkpose -r seksan_k@sci.com SESSION_name.


zmbkpose -r suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com
Not implemented.
Not implemented.
Not implemented.



สามารถใช้คำสั่ง zmbkpose -r email1,email2,email3..... ตามด้วยชื่อที่ได้จากคำสั่ง zmbkpose -l
เช่น
zimbra@zimbra:/TestRestore$ zmbkpose -l
full-20190518180020
inc-20190520211002
inc-20190521211002
inc-20190522211002
zimbra@zimbra:/TestRestore$ zmbkpose -r suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com inc-20190522211002


หรือ จะใช้วิธีแก้ไฟล์ sessions.txt

ต้องทำการแก้ไฟล์ sessions.txt โดยลบ วัน full และวันที่ inc อื่นๆ ออก ให้เลือกเฉพาะ inc ของวันทีจะ Restore
โดย
nano sessions.txt
กด Ctrl + k (ลบทั้งแถว)
ให้เหลือไว้แค่ INC ของวันที่ที่จะ Restore เช่น วันที่ 20190522
SESSION: inc-20190522211002 started on Wed May 22 21:10:02 +07 2019
inc-20190522211002:admin@sci.com:05/22/19
inc-20190522211002:spam.9q7cb0mh8a@sci.com:05/22/19
inc-20190522211002:ham.whcctrpt@sci.com:05/22/19
inc-20190522211002:virus-quarantine.rl2yqjwk@sci.com:05/22/19
inc-20190522211002:galsync.zxqk9lahef@sci.com:05/22/19
inc-20190522211002:kamoltham_t@sci.com:05/22/19
inc-20190522211002:kittiya_s@sci.com:05/22/19
inc-20190522211002:jakkrit_h@sci.com:05/22/19
inc-20190522211002:jintana_y@sci.com:05/22/19
inc-20190522211002:jirayu_k@sci.com:05/22/19
inc-20190522211002:jureerat_w@sci.com:05/22/19
inc-20190522211002:charkrit_j@sci.com:05/22/19
inc-20190522211002:chamnarn_c@sci.com:05/22/19
inc-20190522211002:chumpol_l@sci.com:05/22/19


3. Run คำสั่ง จะเจอวันที่ที่เราจะ Restore วันเดียว
zmbkpose -l
inc-20190522211002


4. Run คำสั่ง Restore
  1. zmbkpose -r suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com inc-20190522211002


******* zmbkpose -r มีปัญหา Restore ไม่ได้ Error ตามด้านล่าง ไม่มีข้อมูลเพิ่ม *************
ให้ใช้ Full และ Full+INC เอา

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/seksan_k@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/seksan_k@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>


แบบแก้ ไฟล์ sessions.txt

zimbra@zimbra:/TestRestore$ zmbkpose -l
inc-20190522211002
zimbra@zimbra:/TestRestore$ zmbkpose -r suwit_j@sci.com
Not implemented.
zimbra@zimbra:/TestRestore$ zmbkpose -r suwit_j@sci.com inc-20190522211002
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>

Step Restore By zmbkpose FULL + INC

Step Restore By zmbkpose FULL + INC
***สำคัญ ใช้ zmbkpose Version ไหนต้องใช้ Version นั้น Restore เพราะ Code ไม่เหมือนกัน***
**** ต้องเตรียมไฟล์ให้พร้อม จาก Full จนถึงวันที่จะ Restore INC
เช่น
zimbra@zimbra:/TestRestore$ ls -la
total 80
drwxr-xr-x 5 root root 4096 May 27 16:15 .
drwxr-xr-x 25 root root 4096 May 27 16:09 ..
drwxr-xr-x 2 root root 4096 May 27 16:14 full-20190518180020
drwxr-xr-x 2 root root 20480 May 27 16:14 inc-20190520211002
drwxr-xr-x 2 root root 28672 May 27 16:14 inc-20190521211002
-rwxr-xr-x 1 root root 17778 May 27 16:14 sessions.txt


แตกไฟล์ inc ของวันต่าง ๆ ที่ต้องการ Restore ไว้
  1. tar -xvf Zimbra_Inc_20190521.tar.gz


1. ข้อมูลต้องมี ตามไฟล์ เช่น Full 20190518
- inc-20190520211002
- inc-20190521211002
- sessions.txt (ของวันที่ล่าสุด จะมี full เริ่มต้นและ Inc ของวันอื่นได ด้วย)

2. เช็คด้วยคำสั่ง zmbkpose -l
zmbkpose -l
full-20190518180020
inc-20190520211002
inc-20190521211002


3. Run คำสั่ง zmbkpose -restoreAccount เพื่อ Restore Data
  1. zmbkpose -restoreAccount suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com

โปรแกรมก็จะเริ่ม Restore จาก Full และ INC ที่มีอยู่ รอจนกว่าจะเสร็จ ช้าขึ้นอยู่กับปริมาณข้อมูล

zmbkpose -restoreAccount suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com
Sessions found full-20190518180020
inc-20190520211002
inc-20190521211002
Restoring from full-20190518180020
adding new entry "uid=suwit_j,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
suwit_j@sci.com restored from full-20190518180020
Restoring from inc-20190520211002
adding new entry "uid=suwit_j,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
suwit_j@sci.com restored from inc-20190520211002
Restoring from inc-20190521211002
adding new entry "uid=suwit_j,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
suwit_j@sci.com restored from inc-20190521211002
Sessions found full-20190518180020
inc-20190520211002
inc-20190521211002
Restoring from full-20190518180020
adding new entry "uid=boonta_p,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
boonta_p@sci.com restored from full-20190518180020
Restoring from inc-20190520211002
adding new entry "uid=boonta_p,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
boonta_p@sci.com restored from inc-20190520211002
Restoring from inc-20190521211002
adding new entry "uid=boonta_p,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
boonta_p@sci.com restored from inc-20190521211002
Sessions found full-20190518180020
inc-20190521211002
Restoring from full-20190518180020
adding new entry "uid=seksan_k,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/seksan_k@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
seksan_k@sci.com restored from full-20190518180020
Restoring from inc-20190521211002
adding new entry "uid=seksan_k,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/seksan_k@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/seksan_k@sci.com/Trash. Reason:
<pre> Server Error</pre></p>
</body>
</html>
seksan_k@sci.com restored from inc-20190521211002

ก็จะมี User และ Email ตามที่เรา Restore


Step Restore By zmbkpose FULL

Step Restore By zmbkpose FULL
***สำคัญ ใช้ zmbkpose Version ไหนต้องใช้ Version นั้น Restore เพราะ Code ไม่เหมือนกัน***
Mount จากไฟล์ ที่ Backup ไว้ได้เลย
  1. sudo mount -t cifs -o username=*******,password=******* //192.168.0.218/backup /DATA


1. ที่เราต้องมีคือ
- full-20190518180020 ข้อมูล Backup Full
- sessions.txt

2. นำ Foder Full และ ไฟล์ session.txt ไปไว้ ที่ Folder ที่ Config ไว้
  1. nano /etc/zmbkpose/zmbkpose.conf

ตรง WORKDIR=
ของจริงเอาไว้ใน WORKDIR=/DATA/zimbra_backup

3. Run คำสั่ง จะได้ ชื่อ Folder Full มา
เข้าเป็น
su zimbra
ก่อน Run
  1. zmbkpose -l


4. เริ่ม Restore ด้วยคำสั่ง
  1. zmbkpose -restoreAccount suwit_j@sci.com,boonta_p@sci.com,seksan_k@sci.com,.........(mail ของ user)

รอจนกว่าจะเสร็จครบทุก User อยู่ที่ข้อมูล ตัวอย่างลอง 3 USER
Sessions found full-20190518180020
Restoring from full-20190518180020
adding new entry "uid=suwit_j,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/suwit_j@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
suwit_j@sci.com restored from full-20190518180020
Sessions found full-20190518180020
Restoring from full-20190518180020
adding new entry "uid=boonta_p,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/boonta_p@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
boonta_p@sci.com restored from full-20190518180020
Sessions found full-20190518180020
Restoring from full-20190518180020
adding new entry "uid=seksan_k,ou=people,dc=sci,dc=com"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /service/home/seksan_k@sci.com/Junk. Reason:
<pre> Server Error</pre></p>
</body>
</html>
seksan_k@sci.com restored from full-20190518180020


5. ทดลองที่ Member จะเห็น User เพิ่มขึ้นมา และ View Mail ดูจะมีเมล์วันที่ Restore มา


ชื่อเมล์เอาได้จากไฟล์ sessions.txt มาแบ่งแล้ว : แล้วใส่ Comma คันเพื่อไป Run ต่อในคำสั่ง zmbkpose -restoreAccount ได้เลย

Zimbra 8.8.11 install on Ubuntu 16.04

Zimbra 8.8.11 install on Ubuntu 16.04
1. ติดตั้ง Ubuntu 16.04 Set network , apt, ntp, update , upgrade ให้เรียบร้อย
2. Add Disk เข้า Ubuntu ตามข้อ 1. mount /opt
3. แก้ fstab
/dev/sdb1 /opt ext4 defaults 0 0

4. Download zimbra software Version ที่ต้องการ แล้วเอาไฟล์ไปไว้ Server ข้อ 1. ใช้ scp หรือ wget ก็ได้
https://www.zimbra.com/downloads/zimbra-collaboration-open-source/archives/
5. แตกไฟล์ ที่ Load มาได้
  1. tar -xvf zcs8.XXXXXX

6. ติดตั้ง Program ที่ต้องใช้
  1. apt-get update -y
  2. apt-get install -y software-properties-common
  3. apt-get install -y language-pack-en-base
  4. export LC_ALL=en_US.UTF-8 && export LANG=en_US.UTF-8
  5. apt-get update -y && apt-get install -y iputils-ping

7. แก้ hosts และ resolv.conf
  1. nano /etc/hosts
192.168.2.114 zimbra.sci.com zimbra

  1. nano /etc/resolv.conf
nameserver 8.8.8.8

8. ติดตั้ง dnsmasq
  1. apt-get install dnsmasq

แก้ config
  1. nano /etc/dnsmasq.conf

แก้ดังนี้
server=8.8.8.8
listen-address=127.0.0.1
domain=sci.com
mx-host=sci.com,zimbra.sci.com,0
address=/zimbra.sci.com/192.168.2.114
service dnsmasq restart

9. Test run
dig mx sci.com
dig zimbra.sci.com

10. สำคัญถ้าไม่ทำไม่ผ่าน
  1. nano /etc/apt/sources.list.d/zimbra.list
(เป็น http ถึงจะผ่าน ลบ s ออก)
สำหรับ ubuntu 16.04 ใช้เป็น xenial
8.8.7
deb [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra
deb [arch=amd64] http://repo.zimbra.com/apt/zv1 xenial zimbra
deb-src [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra


8.8.11
deb [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra
deb [arch=amd64] http://repo.zimbra.com/apt/8811 xenial zimbra
deb-src [arch=amd64] http://repo.zimbra.com/apt/87 xenial zimbra


สำหรับ ubuntu 12.04, 14.04 ใช้เป็น trusty
8.8.11
deb [arch=amd64] http://repo.zimbra.com/apt/87 trusty zimbra
deb [arch=amd64] http://repo.zimbra.com/apt/8811 trusty zimbra
deb-src [arch=amd64] http://repo.zimbra.com/apt/87 trusty zimbra


เพิ่มเติม https://wiki.zimbra.com/wiki/Zimbra_Collaboration_repository

11. add key สำคัญ ต้องใช้ถ้าไม่ Run จะไม่ผ่าน ฟ้อง GPG key ไม่ผ่าน
  1. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9BE6ED79
  2.  

Error :
Importing Zimbra GPG key
ERROR: Unable to retrive Zimbra GPG key for package validation
Please fix system to allow normal package installation before proceeding

12. Test ว่าหา zimbra program เจอหรือไม่ ต้องมีค่าออกมาคือเจอ pack ที่ค้นหา
  1. apt-get install aptitude
  2. apt-get update
  3. aptitude search zimbra-nginx

13. เริ่มติดตั้ง เข้าไปที่ Folder ที่แตกไว้ในข้อ 5.
  1. ./install.sh

Y (ยอมรับเงือนไข)
N (*** สำคัญไม่ต้องตอบ Y เพราะ ถ้าตอบ Y sources list จะถูกแก้เป็น HTTPS จะ ลงไม่ได้)
Use Zimbra's package repository [Y] y
Configuring package repository
ERROR: Unable to install packages via apt-get
Please fix system to allow normal package installation before proceeding
(ไม่ผ่าน)

https://forums.zimbra.org/viewtopic.php?t=66069

Y ตาม Default หรือเลือกเอาว่าจะลงอะไรบ้าง รอ จนกว่าจะเสร็จ
No ตอนจะเปลี่ยน DNS และ Domain Name เพราะ Set ไว้ตั้งแต่ลง Ubuntu แล้ว
7 ---> 4 เปลี่ยนรหัส admin ตั้งตามที่ต้องการ แต่ห้ามซ้ำกับรหัส user root ทีใช้
r
5 เปลี่ยน DNS 192.168.0.253
แล้วsave yes modifile รอจนกว่าจะเสร็จ
14. ทดลองเข้า
https://192.168.2.114/7071

ข้อมูลเพิ่มเติม
https://blog.zimbra.com/2018/01/install-zimbra-collaboration-8-8-ubuntu-16-04-lts/https://blog.christosoft.de/2015/06/zimbra-redirect-http-to-https/

เข้าได้ใช้งานได้ Restore Data จาก Full backup
****ใช้ zmbkpose ต้องสร้างชื่อไว้ก่อนแล้วค่อยเอาเข้า****
https://intranet.sci.com/blog.php?u=3&b=389
https://intranet.sci.com/blog.php?u=3&b=390
ติดตั้ง Program อื่น ๆ เพิ่มเติม
https://intranet.sci.com/blog.php?u=281&b=627

วันอังคารที่ 27 มีนาคม พ.ศ. 2561

Zimbra : Zimbra mails going to Junk folder

Zimbra : Zimbra mails going to Junk folder

Use Command
  1. zmlocalconfig -e amavis_dspam_enabled=true

for
  1. zmlocalconfig -e amavis_dspam_enabled=false


https://forums.zimbra.org/viewtopic.php?t=19065

วันอังคารที่ 6 มีนาคม พ.ศ. 2561

Zimbra : Zimbra zmbkpose Backup Active User

Zimbra : Zimbra zmbkpose Backup Active User
https://wiki.zimbra.com/wiki/Create_a_distribution_list_that_contains_all_the_addresses_in_a_domain

1. แก้ Code ที่ /usr/bin
  1. nano /usr/bin/zmbkpose

2. หา Function 3 ตัวนี้
backup_all_accounts ()
incremental_all_accounts ()
backup_all_accounts_parallel()

แก้
  1. "(objectClass=zimbraAccount)"

เป็น
  1. "(&(objectClass=zimbraAccount)(ZimbraAccountStatus=active))"

3. ZimbraAccountStatus สามารถใส่ค่าที่เราต้องการได้
Active, Closed, Locked, Pending, Maintenance
ข้อมูลก็จะได้ไฟล์ และ sessions.txt ก็เฉพาะ User ที่เราเลือกตาม Status ไว้ตรงตาม ZimbraAccountStatus


วันพฤหัสบดีที่ 25 พฤษภาคม พ.ศ. 2560

Zimbra : Zimbra sync USER เวลเปลี่ยน Diseplay Name

Zimbra : Zimbra sync USER เวลเปลี่ยน Diseplay Name เช่นกรณีเปลี่ยนตำแหน่ง
  1. su - zimbra
  1. zmgsautil forceSync -a galsync.zxqk9lahef@sci.com -n InternalGAL


เสร็จแล้วที่แต่ละ User กดลืม ชื่อเดิมออก

วันจันทร์ที่ 27 มีนาคม พ.ศ. 2560

ปัญหา Zimbra ใช้ syslog-ng แล้วไม่ส่ง Log ไปที่ LogServer

ปัญหา Zimbra ใช้ syslog-ng แล้วไม่ส่ง Log ไปที่ LogServer

แก้โดยใช้ rsyslog ส่งแทน
- ติดตั้ง
  1. apt-get install -f rsyslog

- แก้ config
  1. nano /etc/rsyslog.conf

แก้
ลบ # ออก
  1. # provides UDP syslog reception
  2. $ModLoad imudp
  3. $UDPServerRun 514


เพิ่ม
  1. *.*   @@192.168.2.108:514


- Run คำสั่ง
  1. /opt/zimbra/libexec/zmsyslogsetup



วันอังคารที่ 31 มกราคม พ.ศ. 2560

Zimbra : Zimbra Delete All Email Contract All User.

Zimbra : Zimbra Delete All Email Contract All User.
Zimbra มีปัญหา จำ Email Contract เดิม ซึ่งแสดงชื่อตำแหน่งไม่ถูกต้อง จะต้องลบ Email Contract ของแต่ละ User ออก และ Reset RankingActionRequest เพื่อให้ Zimbra เรียนรู้ และจำ Contract ใหม่

** ใช้ Code นี้ Contract และ Contract Group ที่สร้างขึ้นเองยังอยู่ **

1. สร้างไฟล์ bash .sh สำหรับ Run คำสั่ง
https://forums.zimbra.org/viewtopic.php?t=28905

  1. #!/bin/bash
  2.  
  3. #for foo in `cat /usr/local/scripts/users.txt`
  4. #File User We Do It.
  5. for foo in `cat /home/sa/users.txt`
  6. do
  7.         echo $foo
  8.         echo "Verifting contacts from user $foo" >> /tmp/purge_emailed_contacts_log.txt
  9.  
  10.         /opt/zimbra/bin/zmmailbox -z -m $foo gact -f "/Emailed Contacts" | grep Id: | cut -d" " -f2 > /tmp/verContactos.txt
  11.         for contacto in `cat /tmp/verContactos.txt`
  12.         do
  13.                 /opt/zimbra/bin/zmmailbox -z -m $foo gct $contacto | grep email > /tmp/contacto_a_examinar.txt
  14.                 RESP=`grep sci.com /tmp/contacto_a_examinar.txt`
  15.                 if [ ${#RESP} -gt 1 ]
  16.                 then
  17.                         echo "Local Contact"
  18.                         echo "Deleting contact $RESP"
  19.                         /opt/zimbra/bin/zmmailbox -z -m $foo dct $contacto
  20.                         echo "Contact $RESP with ID $contacto has been deletec from account $foo" >> /tmp/purge_emailed_contacts_log.txt
  21.                         echo ""
  22.                 fi
  23.         done
  24.  
  25. /opt/zimbra/bin/zmsoap -z -m $foo RankingActionRequest/action @op=reset
  26. /opt/zimbra/bin/zmprov fc account $foo
  27.  
  28. done


2. นำไฟล์ User มาใส่ txt รูปแบบ เอา User มาเรียง เช่น


เอา User ที่เป็น Admin และพวกป้องกัน Virus , Spam ออก ให้เหลือเฉพาะ User ที่จะใช้งานจริง ๆ
https://community.bittitan.com/kb/Pages/How%20do%20I%20export%20a%20user%20list%20from%20Zimbra%20into%20a%20CSV%20file.aspx

https://wiki.zimbra.com/wiki/Reset_contact_Autocomplete_ranking

https://wiki.zimbra.com/wiki/King0770-Notes-Removal_of_Bad_Contact_Address

วันพุธที่ 16 พฤศจิกายน พ.ศ. 2559

Zimbra : Zimbra จำชื่อย่อตำแหน่งไม่ถูกต้อง

Zimbra : Zimbra จำชื่อย่อตำแหน่งไม่ถูกต้อง

เกิดจาก งทส. ได้ทำการ upgrade version ของ Zimbra Server ทำให้ Server ยังจำค่าชื่อตำแหน่งเดิมของพนักงานที่มีการเปลี่ยนตำแหน่งไปแล้ว เวลาส่งทำให้ขึ้นชื่อ ตำแหน่งไม่ถูกต้องเช่น ส่งหาหน.งทส. แทนที่จะเป็น mail suwit_j@sci.com แต่ยังเป็นnikom_c@sci.com และตำแหน่งอื่น ๆ ที่มีการเปลี่ยนแปลงตำแหน่ง

การแก้ไข 
1. เข้า zimbra แล้วพิมพ์ตำแหน่งย่อ ที่แสดงชื่อไม่ถูกเช่น หน ผจ เป็นต้น แล้วกด forget ในชื่อ Email และตำแหน่งที่ผิด
เช่น




2. เข้าไปลบ Email Contacts ที่ Menu Contacts --> Emailed Contacts ตามรูป



แล้วเลือกรายชื่อ Email Contacts ในตารางที่แสดงชื่อตำแหน่งไม่ถูกต้อง หรือเลือกทั้งหมด ด้วยการกดคีย์บอร์ด Shift แล้วเลือกคลิกที่ชื่อล่างสุด เพื่อเลือกทั้งหมด



แล้วกด Delete

3. ส่งเมล์ครั้งแรก ๆ ชื่อตำแหน่งอาจจะยังไม่ถูก ต้องรอ แล้วโปรแกรม Zimbra จะเรียนรู้ และ update ชื่อตำแหน่งให้เอง

วันจันทร์ที่ 7 พฤศจิกายน พ.ศ. 2559

Zimbra : สั่งให้ Update รายชื่อทันที

Zimbra : สั่งให้ Update รายชื่อทันที
หลังจากแก้ไขรายชื่อใน Zimbra แล้ว จะยังไม่ update ทันที ถ้าต้องการให้ใช้คำสั่งในขณะที่ login เป็น zimbra ดังนี้
  1. zmgsautil forceSync -a galsync.zxqk9lahef@sci.com -n InternalGAL

หมายเหตุ :
galsync.zxqk9lahef@sci.com ดูได้จาก Admin Console > Configuration > Domains แล้วคลิก Configure GAL

Zimbra : Zimbra Firefox Sidebar

Zimbra : Zimbra Firefox Sidebar
การเปิดใช้งาน Zimbra Firefox Sidebar
1. เปิดโปรแกรม Firefox เข้า web mail zimbra.sci.com
2. คลิกที่ลูกศรใต้ชื่อ แล้วเลือก Enable Firefox Sidebar ตามรูป

3. จะมี Box ข้อความขึ้นมาให้กด OK

4. จะมี Box ข้อความขึ้นมาให้กด Enable Services

5. จะมีโปรแกรม Zimbra Firefox Sidebar ขึ้นมาด้านข้าง สามารถย่อหรือขยายให้ใหญ่ขึ้นได้

6. เวลาไปใช้งาน website หน้าอื่น ก็สามารถเปิดเช็คเมล์ ตอบเมล์ได้ทันที เวลามีเมล์เข้ามาให้หรือที่ยังไม่ได้อ่านตัวหนังสือจะเป็นสีดำ ตามรูป

สามารถคลิกเปิดอ่านเมล์ได้ทันที

7. ถ้าไม่ต้องการใช้งานให้คลิกที่ Icon รูปเฟือง แล้วคลิกตรง Show Sidebar ตามรูป

วันศุกร์ที่ 9 กันยายน พ.ศ. 2559

Zimbra Server External Install BIND9 for Network Address Translator (NAT 1-1)

Zimbra Server External Install BIND9 for Network Address Translator (NAT 1-1)
1. Install bind9
  1. sudo apt-get install bind9

2. ทำการแก้ไขไฟล์ /etc/bind/named.conf.options และแก้บรรทัด forwarders โดยให้ใส่ไอพี DNS ของเราลงไป และใส่ zone ของโดเมนเราลงไป
  1. nano /etc/bind/named.conf.options

ใส่ข้อมูล
  1. options {
  2.         directory "/var/cache/bind";
  3.  
  4.         // If there is a firewall between you and nameservers you want
  5.         // to talk to, you may need to fix the firewall to allow multiple
  6.         // ports to talk.  See http://www.kb.cert.org/vuls/id/800113
  7.  
  8.         // If your ISP provided one or more IP addresses for stable
  9.         // nameservers, you probably want to use them as forwarders.
  10.         // Uncomment the following block, and insert the addresses replacing
  11.         // the all-0's placeholder.
  12.  
  13.          forwarders {
  14.                 8.8.8.8;
  15.          };
  16.  
  17.         //========================================================================
  18.         // If BIND logs error messages about the root key being expired,
  19.         // you will need to update your keys.  See https://www.isc.org/bind-keys
  20.         //========================================================================
  21.         dnssec-validation auto;
  22.  
  23.         auth-nxdomain no;    # conform to RFC1035
  24.         listen-on-v6 { any; };
  25. };
  26.  
  27. zone "zimbra.komkid.net" {
  28.         type master;
  29.         file "db.zimbra.komkid.net";
  30. };


3. สร้างไฟล์ /var/cache/bind/db.zimbra.komkid.net โดยให้ชื่อไฟล์ตรงกับบรรทัด file ใน zone ที่เราเพิ่งสร้าง
  1. nano /var/cache/bind/db.zimbra.komkid.net

ใส่ Code
  1. $ttl 38400
  2. @       IN      SOA     zimbra.komkid.net. zimbra.komkid.net. (
  3.                         2011091202
  4.                         10800
  5.                         3600
  6.                         604800
  7.                         38400 )
  8.         IN      NS      ns1.zimbra.komkid.net.
  9.         IN      NS      ns2.zimbra.komkid.net.
  10.         IN      A       192.168.2.111
  11.         IN      MX      10 zimbra.komkid.net.
  12.  
  13. @       A       192.168.2.111
  14. ns1     A       192.168.2.111
  15. ns2     A       192.168.2.111
  16. webmail A       192.168.2.111
  17.  


4. แก้ไขไฟล์ /etc/resolv.conf
  1. nano /etc/resolv.conf

ใส่ข้อมูล
  1. search  zimbra.komkid.net
  2. nameserver 127.0.0.1
  3.  
  4. ##ใส่เพื่อให้ออก Internet ได้
  5. nameserver 203.113.127.199
  6. nameserver 203.113.24.199
  7. nameserver 8.8.8.8
  8. nameserver 8.8.4.8


5. restart bind9
  1. sudo /etc/init.d/bind9 restart


6. ทดสอบด้วยการใช้คำสั่ง dig ซึ่งควรจะได้ผลลัพธ์กลับมาตามตัวอย่าง
  1. dig zimbra.komkid.net mx

จะต้องได้ผลแบบนี้
  1. ; <<>> DiG 9.9.5-3ubuntu0.7-Ubuntu <<>> zimbra.komkid.net mx
  2. ;; global options: +cmd
  3. ;; Got answer:
  4. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22673
  5. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 4
  6.  
  7. ;; OPT PSEUDOSECTION:
  8. ; EDNS: version: 0, flags:; udp: 4096
  9. ;; QUESTION SECTION:
  10. ;zimbra.komkid.net.     IN  MX
  11.  
  12. ;; ANSWER SECTION:
  13. zimbra.komkid.net.  38400   IN  MX  10 zimbra.komkid.net.
  14.  
  15. ;; AUTHORITY SECTION:
  16. zimbra.komkid.net.  38400   IN  NS  ns2.zimbra.komkid.net.
  17. zimbra.komkid.net.  38400   IN  NS  ns1.zimbra.komkid.net.
  18.  
  19. ;; ADDITIONAL SECTION:
  20. zimbra.komkid.net.  38400   IN  A   192.168.2.111
  21. ns1.zimbra.komkid.net.  38400   IN  A   192.168.2.111
  22. ns2.zimbra.komkid.net.  38400   IN  A   192.168.2.111
  23.  
  24. ;; Query time: 1 msec
  25. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  26. ;; WHEN: Thu Feb 04 10:56:53 ICT 2016
  27. ;; MSG SIZE  rcvd: 146
  28.  


เพิ่มเติม http://www.wingfoss.in.th/content/how-t ... -on-ubuntu (ไม่ผ่านตรงใส่ชื่อ domain ต้องใส่เต็ม)
ผ่าน ทำตามนี้ใส่ชื่อ Domain เต็ม http://tusar-work-experience-2013.blogs ... -post.html

เปลี่ยน IP Zimbra Server

เปลี่ยน IP Zimbra Server เช่นเปลี่ยนจาก 203.113.114.242 เป็น 192.168.2.111

1) su - zimbra
2) zmcontrol stop
3) Editing /etc/hosts
4) Editing
  1. nano /etc/network/interfaces
changing the old IP address to the new one in there.
  1. auto eth0
  2. iface eth0 inet static
  3.         address                 192.168.2.111
  4.         broadcast               192.168.2.255
  5.         network                 192.168.2.0
  6.         netmask                 255.255.255.0
  7.         gateway                 192.168.2.2
  8.  
  9.         dns-nameservers         203.113.127.199
  10.         dns-nameservers         203.113.24.199
  11.         dns-nameservers         8.8.8.8
  12.         dns-nameservers         8.8.4.4
  13.  
  14.         #address                203.113.114.242
  15.         #broadcast              203.113.114.247
  16.         #network                203.113.114.240
  17.         #netmask                255.255.255.248
  18.         #gateway                203.113.114.241

5) service network restart (no need to restart server i think)
*Some time service zmcontrol start automatic. Not do stap 6 - 7.
6) su - zimbra
7) zmcontrol start

https://community.zimbra.com/collaborat ... /t/1135082

เพิ่มเติมต้องเข้าไปแก้ IP ในหน้า Admin ด้วย โดย
1. เข้าไปที่ Admin ----> Configure ----> Servers คลิกขวา Edit ตามรูป
2. ไปที่ MTA ตรง ช่อง MTATrasted Network ให้แก้จาก IP เดิมเช่น จาก 203.113.114.242 เป็น 192.168.2.111