How to Adjust the Zimbra Maximum Message and Upload Size via CLI

This article show you how to check and adjust the maximum message size and upload size to an email via the Zimbra MTA (Postfix). The default Postfix message_size_limit was 10MB (10240000 bytes) and the message_size_limit postconf parameter is configured globally for all zimbra MTAs.

Q. How to Adjust the Zimbra Maximum Message and Upload Size via command line interface (CLI) ?

A. This is how to check and adjust the Maximum Message Size and upload size. All the below command shall be runa s zimbra user :

zimbraMtaMaxMessageSize = Refer to message size of the email.
zimbraFileUploadMaxSize = refer to file uploads include attachments to messages, appointments, tasks and etc.
zimbraMailContentMaxSize = Refer to the overall message size
ms = modifyServer
mcf = modifyConfig
gcf = getConfig

1. Run as zimbra user :

# su - zimbra

2. Check the default message_size_limit parameter :

$ postconf | grep message_size_limit

Example and Result:

$ postconf | grep message_size_limit
message_size_limit = 10240000

3. Check the default global size for zimbraMtaMaxMessageSize, zimbraFileUploadMaxSize and zimbraMailContentMaxSize :

$ zmprov gcf zimbraMtaMaxMessageSize
zimbraMtaMaxMessageSize: 10240000
$ zmprov gcf zimbraFileUploadMaxSize
zimbraFileUploadMaxSize: 10240000
$ zmprov gcf zimbraMailContentMaxSize
zimbraMailContentMaxSize: 10240000

4. Change zimbraMtaMaxMessageSize and zimbraFileUploadMaxSizeto 40MB (40960000 bytes) globally.

$ zmprov modifyConfig zimbraMtaMaxMessageSize 40960000
$ zmprov modifyConfig zimbraFileUploadMaxSize 40960000

5. Usually overall message size will be bigger because each message may consist multiple upload files or attachment. In this case we will configure zimbraMailContentMaxSize parameter to 100MB :

$ zmprov modifyConfig zimbraMailContentMaxSize 102400000

6. Check the result of above command :

$ postconf | grep message_size_limit
message_size_limit = 40960000

7. How to set the Maximum Message and Upload Size to 40MB per server and overall message size to 100MB per server :

$ zmprov ms `zmhostname` zimbraFileUploadMaxSize 40960000
$ zmprov ms `zmhostname` zimbraMtaMaxMessageSize 40960000
$ zmprov ms `zmhostname` zimbraMailContentMaxSize 102400000

or

$ zmprov modifyServer mail1.ehowstuff.local zimbraFileUploadMaxSize 40960000
$ zmprov modifyServer mail1.ehowstuff.local zimbraMtaMaxMessageSize 40960000
$ zmprov modifyServer mail1.ehowstuff.local zimbraMailContentMaxSize 102400000

7. In most of the cases, all of above command will take effect automatically. But if the change does not happen after a short period of time, most likely we will need to do postfix reload or full zmcontrol restart :

$ postfix reload
$ zmcontrol restart

Note : Server settings override global setting

How to Copy or Move Files Based on Date Modified on Linux

Q. How to copy or Move the files and folder based on date modified on linux ?

A. Follow this steps :

1. Check the files modified date :

# ls -lrt

Output :

drwxr-xr-x  2       507 root           4096 Mar  3 21:00 ioncube
-rw-r--r--  1 root      root        5641209 Mar  3 21:04 ioncube_loaders_lin_x86-64.tar.gz
-rw-r--r--  1 root      root         635678 Mar  8 11:28 facilemanager-complete-1.3.1.tar.gz
-rw-r--r--  1 root      root              0 May 12 00:08 file1
-rw-r--r--  1 root      root              0 May 12 00:08 file2
-rw-r--r--  1 root      root              0 May 12 00:08 file3
-rw-r--r--  1 root      root              0 May 12 00:08 file4
-rw-r--r--  1 root      root              0 May 12 00:08 file5

2. Create May directory under tmp, where the destination of the listed files :

# mkdir -p /tmp/May

3. Run the following command to display the files for date “May 12” and Move it to /tmp/May folder :

# for i in `ls -lrt | grep "May 12" | awk '{print $9}' `; do mv $i* /tmp/May; done

or

4. Run the following command to display the files for date “May 12” and copy it to /tmp/May folder :

# for i in `ls -lrt | grep "May 12" | awk '{print $9}' `; do cp -p $i* /tmp/May; done

How to Check and Verify the Version of Python on CentOS 6 / CentOS 7

Python is a popular programming language, which is widely used, high-level programming languages ??and has a design philosophy that emphasizes code readability. It is considered as a programming language that is easy to learn and master because of its focus on readability. Python syntax allows programmers to express concepts in fewer lines of code as possible in languages ??other programming such as C ++ or Java. This article show you how to check and verify the version of Python on CentOS 6, CentOS 7, RHEL 6 and RHEL 7.

1. Check Python version :

[root@vps ~]# python --version
Python 2.7.5

2. Enter python command line :

[root@vps ~]# python
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

3. To exit, run the following command :

>>> quit()

Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

Rescan SCSI bus

When you need to add a hard disk or network interface cards on the new VMware virtual machine on the production server, but you are not allowed to shutdown the server or you have several related issues as below. The following quick article shows how to rescan SCSI Bus to add or remove a SCSI Devices on Linux.

This steps may work on CentOS 5/6/7 and RHEL 5/6/7.

Other related Issues

  • Is it possible to add or remove a SCSI device without rebooting a running system?
  • Can you scan a SCSI bus for new or missing SCSI devices without rebooting?
  • How can I make newly connected SCSI storage devices available without rebooting?
  • What is the Linux equivalent to the Solaris command devfsadm to add or remove storage devices?
  • I am trying to add a LUN to a live system but it is not recognized
  • I am trying to add a tape drive to a live system but it is not recognized
  • I am trying to add a disk drive to a live system but it is not recognized
  • How can I force a rescan of my SAN to find newly associated LUNs?
  • What to do if a newly allocated LUN on my SAN is not available?
  • Unable to probe for a newly allocated LUN
  • Some nodes can’t see my new storage device, how can I make it available?
  • After SAN maintenance activity, not all devices returned – devices in multipath missing or remain in failed state.
  • After SAN failover testing completed, not all devices returned to running state as expected – devices in multipath missing or remain in failed state.
  • What is the best way to remove a SCSI disk from the system

After Red Hat Enterprise Linux 5.0 (RHEL 5) and above (RHEL 6 and RHEL 7), it is possible to make changes to the SCSI I/O subsystem without rebooting.

How to Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

1. Identify host bus number :

# ls /sys/class/scsi_host/
host0  host1  host2

2. Rescan the SCSI Bus to Add a SCSI Devices :

# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan

Reference :