Command Line Tools
The MailDepot command tools perform operations such as disk addition/deletion which cannot be done through Administration Console and auxiliary operations such as addition of users into Administration Console and changing passwords, etc.. The md_diskadd and md_snapshot command must be executed by root user, but other command tools must be executed by the MailDepot super-user (default is maildepot).
Execute the following command to switch to the MailDepot super-user.
# su - maildepot
The MailDepot command tools are located in the /opt/maildepot2/bin directory, and the absolute path must be specified to execute command.
$ /opt/maildepot3/bin/md_useradd default maildepot
If the /opt/maildepot3/bin directory is included in the PATH environment variable, command tools can be executed by only the name.
$ export PATH=/opt/maildepot3/bin:$PATH
md_license
md_license manages the license information.
See License Management for more about MailDepot product license and optional licenses.
list mode
Show installed license information.
Usage
md_license list
Description
The following infomation is displayed by executing "md_license list" command.
$ md_license list organization : sra oss name : maildepot capacity limitation : 1024 GB domain limitation : 50 domains serial : XXXX-XXXX-XXXX-XXXX multi_domain_serial : XXXX-XXXX-XXXX-XXXX personal_search_serial : XXXX-XXXX-XXXX-XXXX
The meaning of each output is:
- organization
-
Show organization name registered at installion procedure
- name
-
Show username registered at installion procedure
- capacity limitation
-
Show the capacity limitation of mail archiving repository limited by product license.
- domain limitation
-
Show the maximun number of domain limited by optional license
This information is displayed only if Multi-Domain Option License is installed. - serial
-
Show srial number of MailDepot Product License
- multi_domain_serial
-
Show serial number of MailDepot Multi-Domain Option License if installed.
- personal_search_serial
-
Show serial number of Personal Search Option License if installed.
add / delete mode
Install/Uninstall software license.
Usage
md_license add SERIAL md_license delete SERIAL
Arguments
- SERIAL
-
License key (key format is XXXX-XXXX-XXXX-XXXX) to be installed/uninstalled.
Description
If you change the license, you have to restart Maildepot services.
md_domain
md_domain manages domains for Multi-Domain feature.
list / list-html mode
Show the information of existing domains. list-html command display the information as HTML format.
Usage
md_domain list [-h] md_domain list-html [-h]
Options
- -h, --human-readable
-
Show volume sizes in human readable format using KB, MB, GB, TB.
Description
Display following infomations.
$ md_domain list -h domain_name status service size limit ---------------------------------------------- tokyo online running 3.3GB * ohsaka online running 1.2GB 10GB nagoya online running 93.1MB 10GB test offline stopped 6.2MB 1GB -- Total size: limit 1024GB online 4.6GB total 5.5GB Number of domains: limit 50 online 3 total 4
The meaning of each output is:
- domain_name
-
Show registered domain name
- status
-
Show the online/offline status of domain. If the status is offline, the domain is inactivated. For inactivated (offlined) domains, mail archiving processes are always stopped, and the access to Administration Console is disabled.
- service
-
Show the running/stopped status of mail archiving process. If the status is stopped, no new mail is archived.
- size
-
Show the total size of archived mail messages for the domain.
- limit
-
Show the capacity limitation of mail archiving repository for the domain. If the value is "*", the limit is not set for the domain.
- Total size
-
Show the capacity limitation of mail archiving repository limited by product license, the volume usage for active (onlined) domains, and the volume usage for all registered domains.
- Number of domains
-
Show the maximun number of domains limited by optional license, the number of active (onlined) domains, the number of all registered domains.
add mode
Add new domain
Usage
md_domain add DOMAIN [-d DATABASE] [-s SIZE] [-o] [-m ADDRESS] [-n]
Arguments/Options
- DOMAIN
-
Specify the name of new domain to be added. You can use alphabetic, digit and underscore characters for the name of domain. The name of domain is not case-sensitive.
- -d, --dbname DATABASE
-
Specify the name of database for the domain. If not specified, the name of domain is used.
- -s, --size-limit SIZE
-
Specify the capacity limitation of mail archiving repository for the domain. To specify capacity size, you can use unit for number like K, M, G, T or KB, MB, GB, TB. If not specified, the value "*" is used, and the limitation is not set.
- -o, --offline
-
If this option is specified, add new domain as inactivated (offlined) domain.
- -m, --mail-address ADDRESS
-
Spedify the mail address for alert mail messages. If not specified, the following mail address is used.
maildepot@hostname_of_maildepot_server
- -n, --no-useradd
-
If specified, don't prompt to create the administrator account for Administration Console.
Description
When "md_admin add" command is executed, new domain is created and the administrator account for Administration Console is prompted to create. You can also create the administrator account for Administration Console by executing md_useradd command with "-g administrator" options.
$ md_domain add fukuoka Enter name of user to create: test Enter mail address for new user: test@example.com Enter password for new user: Enter it again:
delete mode
Remove the domain. If the mail archiving process of target domain is running, remove domain after the mail archiving process is stopped. If you want to inactivate domains, use offline mode instead of delete mode.
Usage
md_domain delete DOMAIN [-r]
Arguments/Options
- DOMAIN
-
Specify the name of domain to be removed.
- -r, --drop-database
-
If specified, remove the database which store archived mail messages and operations logs for specified domain.
online / offline mode
Change the online/offline status of domain. For inactivated (offlined) domains, mail archiving processes are always stopped, and the access to Administration Console is disabled.
Usage
md_domain online DOMAIN md_domain offline DOMAIN
Arguments
- DOMAIN
-
Specifyt the name of domain to be changed.
size mode
Change the capacity limitation.
Usage
md_domain size SIZE DOMAIN
Arguments
- SIZE
-
Specify the capacity limitation of mail archiving repository for the domain. To specify capacity size, you can use unit for number like K, M, G, T or KB, MB, GB, TB. If the specified value is "*", the limitation is not set.
md_domain size "*" DOMAIN
You have to use quote (") character to escape asterisk(*).
- DOMAIN
-
Specifyt the name of domain to be changed.
md_diskadd
Add the extra disk where the archived mail messages are stored.
This command can be executed only by root user.
Usage
md_diskadd [-f] DEVICE [LABEL [FILESYSTEM]]
md_diskadd [-f] -t DIRECTORY [LABEL]
Arguments
- -f
-
Add disk as fast disk storage. If this option is specified, fastdisk parameter in maildepot.conf will be set to this disk.
- DEVICE
Specify the device of the disk to be added.
- -t DIRECTORY
-
Specify the directory in mounted filesystem. This option is used to add storage area in mounted filesystem.
- LABEL
-
Specify the label for addtional disk. If device is added, this label is used as filesystem label and used as directory name for mounting filesystem. If not specified, the disk1, disk2, ... are automatically set.
- FILESYSTEM
-
Specify the filesystem to create. xfs (default), ext4, or, ext3 can be given.
Description
The md_diskadd command add specified directory or specified device as strorage area where the archived mail messages are stored. if device is added, this command creates the file system on specified device, mount it, and then changes the owner and group of mounted directory and changes access permissions so that the mail messages can be archived. Further, this command adds the file system entry in /etc/fstab so that additional disk can be automatically mounted when the OS starts.
# md_diskadd /dev/sda3 disk1
The disk added by md_diskadd is used to store mail messages by MailDepot.
Note All the files in the file system of specified disk will be deleted because the file system of specified disk is initialized by md_diskadd command.
md_diskdel
Delete the extra disk.
Usage
md_diskdel LABEL
Arguments
- LABEL
-
Specify the label of the disk to be deleted.
Description
The md_diskdel command moves the mail partitions (the storage areas of archived mail messages which are created for every month) from specified disk to other existing disks, and cleans the specified disk.
-
Display the list of mail partitions stored in the disk.
md_diskdel: disk labeled "disk1" contains following partitions: _2006_01 _2006_05 _2006_09 _2007_01 _2007_05 _2007_09 _2008_01
-
Specify the target disk where the mail partitions should be moved.
Need to move partitions to following disks: 0: cancel 1: disk2 2: disk3 3: disk4 4: pg_default Enter number of destination disk to move: 1
The disk named pg_default is created at installation procedure.
-
The mail partitions are moved to other existing disk, and the disk is deleted.
Table "attachments_2006_01" is done. Table "attachments_2006_05" is done. Table "attachments_2006_09" is done. : Index "messages_regdateidx_2007_05" is done. Index "messages_regdateidx_2007_09" is done. Index "messages_regdateidx_2008_01" is done.
Beside, the file system for the disk is not unmounted and the entry in /etc/fstab is not deleted automatically.
md_useradd
Add new account for Administration Console.
Usage
md_useradd DOMAIN [options]
Arguments
- DOMAIN
-
Specify the name of domain.
Options
- -U, --user=USERNAME
-
Specify the username for new account.
- -P, --password=PASSWORD
-
Specify the password for new account.
- -m, --mailaddress=MAILADDRESS
-
Specify the mail address for new account.
- -a, --external-auth
-
Enable external authentication for new account.
- -g, --group=GROUPNAME
-
Specify the group for new account. Select group from "administrator", "user", "operator", "monitor", "auditor", or "manager". If not specified, "user" is used as default group. The access privileges are controled by group of user, and the operations in Administration Control are restricted by group of user. See Access Permission for more.
Description
The md_useradd command prompts to enter username, password and mail address of new user to be added (if not specified by command option).
-
Enter the user name to be added.
Enter name of user : test
-
Enter the mail address.
Enter mail address for new user: test@example.com
-
Enter the password.
Enter password for new user:
Enter it again:
You can also add new account at User Management screen in Administration Console. If new account is created through Administration Console, an auto-generated password is sent to the specified mail address.
md_passwd
Change the password of existing account in Administration Console.
Usage
md_passwd DOMAIN USERNAME
Arguments
- DOMAIN
-
Specify the name of domain.
- USERNAME
-
Specify the username whose password will be changed.
Description
The md_passwd command prompt to enter the username (if not specified by command option), and new password.
-
Enter the username whose password will be changed (if not specified by command option).
Enter name of user : test
-
Enter new password.
Enter new password for user "test":
Enter it again:
You can change your own password at Personal Settings screen in Administration Console.
md_backupall
Perform backup of the database and configuration files.
Usage
md_backupall DOMAIN
Arguments
- DOMAIN
-
Specify the name of domain of backup target.
Description
The md_backupall command makes a backup file of the database and all configuration files in the backup directory for earch domain.
The backup directory is set as follows by default, and you can change it in Administration Console.
/opt/maildepot3/domain/name_of_domain/backups
Further more, the backup file created by md_backupall command is named as follows.
maildepot_all-20110330151744.tar.gz
The underline part of the filename "20110328185602" is depend on timestamp (YYMMDDHHSS).
The md_backupall commands displays following messages.
$ md_backupall DOMAINN Partition "_2010_04" is done. Partition "_2010_05" is done. Partition "_2010_06" is done. Partition "_2010_07" is done. Partition "_2010_08" is done. Partition "_2010_09" is done. Partition "_2010_10" is done. Partition "_2010_11" is done. Partition "_2010_12" is done. Partition "_2011_01" is done. Partition "_2011_02" is done. md_backupall: creating backup file: /opt/maildepot3/domain/DOMAIN/backups/maildepot_all-20110330151744.tar.gz
The backup file contains the following files.
- globals.sql
-
Dump file for global objects (Database role and table space)
- settings.sql
-
Dump file for the setup infomation of Administration Console
- backup_YYYY_MM.sql
-
Dump file for mail partitions (storage areas where the mails messages for every month is saved)
The "YYYY_MM" in the filename shows the year and month when the mail messages are archived. These file are created for each mail partitions. - maildepot.conf 1
-
system configuration file for MailDepot
- md_license.conf
-
license configuration file for MailDepot
- md_authenticity.conf
-
authenticity configuration file for MailDepot used for non-falsification checking
- postgresql.conf
-
system configuration file for PostgreSQL database
- pg_hba.conf
-
client authentication file for PostgreSQL
- pg_ident.conf
-
identity authentication file for PostgreSQL
How to restore
This section describes the procedure to restore the backup file into another MailDepot server (the backup files was created on other MailDepot server). This procedure assumes that you will restore just after MailDepot installation is completed. In case of hardware trouble, you can apply this procedure to restore into re-installed MailDepot server on same hardware.
-
Add new domain where backup file will be restored.
You can spicify other domain name than the domain name of backup file. You can skip this step if you want to restore into the default domain created by installation procedure.
$ /opt/maildepot3/bin/md_domain add NEW_DOMAIN
The target domain is "NEW_DOMAIN" in above example.
-
Remove the database of target domain to initialize the mail archiveing repository.
$ /opt/maildepot3/bin/dropdb NEW_DOMAIN $ /opt/maildepot3/bin/psql -l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges ------------+-----------+----------+-----------+-------+------------------------- default | maildepot | UTF8 | C | C | postgres | maildepot | UTF8 | C | C | template0 | maildepot | UTF8 | C | C | =c/maildepot + | | | | | maildepot=CTc/maildepot template1 | maildepot | UTF8 | C | C | =c/maildepot + | | | | | maildepot=CTc/maildepot (4 rows) -
Create new database for target domain where backup file will be restored.
$ /opt/maildepot3/bin/createdb NEW_DOMAIN $ /opt/maildepot3/bin/psql -l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges ------------+-----------+----------+-----------+-------+------------------------- default | maildepot | UTF8 | C | C | postgres | maildepot | UTF8 | C | C | NEW_DOMAIN | maildepot | UTF8 | C | C | template0 | maildepot | UTF8 | C | C | =c/maildepot + | | | | | maildepot=CTc/maildepot template1 | maildepot | UTF8 | C | C | =c/maildepot + | | | | | maildepot=CTc/maildepot (5 rows) -
Extract all files from backup file.
$ tar -xzf maildepot_all-20110328185602.tar.gz $ cd maildepot_all-20110328185602 $ ls backup_2010_04.sql backup_2010_09.sql backup_2011_02.sql pg_ident.conf backup_2010_05.sql backup_2010_10.sql globals.sql postgresql.conf backup_2010_06.sql backup_2010_11.sql maildepot.conf settings.sql backup_2010_07.sql backup_2010_12.sql md_authenticity.conf backup_2010_08.sql backup_2011_01.sql pg_hba.conf
-
Copy "md_authenticity.conf" file in backup file into in following location to replace the configuretion file named "md_authenticity.conf" for target domain.
/opt/maildepot3/domain/NEW_DOMAIN/etc/md_authenticity.conf
The md_authenticity.conf file holds the important information which is used for non-falsification checking feature. So, non-falsification checking will be allways failed if you forget to restore md_authenticity.conf file. -
Merge maildepot.conf
The maildepot.conf file is used for system configuretion for each domain, and placed in following location.
/opt/maildepot3/domain/NEW_DOMAIN/etc/maildepot.conf
You have to merge the necessary parameters from the backuped file. You don't need to modify some parameters like "superuser" and database parameters like "db_datadir", and "db_hostname". See Configuration Files for more about parameters in maildepot.conf. -
Resore global objects
$ /opt/maildepot3/bin/psql -f globals.sql postgres SET SET SET psql:globals.sql:15: ERROR: role "maildepot" already exists ALTER ROLE CREATE TABLESPACE
The following error message can be ingored.
ERROR: role "maildepot" already exists
This error message is harmless because it is displayed when trying to create existing account for super-user in the database. -
Create functions in database
$ /opt/maildepot3/bin/psql -f /opt/maildepot3/share/postgresql/contrib/textsearch_ja.sql NEW_DOMAIN $ /opt/maildepot3/bin/psql -f /opt/maildepot3/share/maildepot/functions.sql NEW_DOMAIN
-
Restore setting information
$ /opt/maildepot3/bin/psql -f settings.sql NEW_DOMAIN SET SET SET : ALTER TABLE ALTER TABLE ALTER TABLE
-
Resotore mail partisions
This step takes much time that is two or three times longer than the time elapsed in backup procedure. You can save time by restoring only essential mail partisions.
- To restore all mail partitions:
-
$ cat backup_*.sql | /opt/maildepot3/bin/psql NEW_DOMAIN SET SET SET : ALTER TABLE ALTER TABLE ALTER TABLE
- To restore only essential mail partitions:
-
$ /opt/maildepot3/bin/psql -f backup_2010_05.sql NEW_DOMAIN SET SET SET : ALTER TABLE ALTER TABLE ALTER TABLE
You have to specify the filename of mail partitions to be restored for psql command by "-f" option. The filename of mail partitions contains the year and month when the mail messages are archived. The above file named "backup_2010_05.sql" hold the mail messages archived on May 2010.
Notice (1) If you want to restore the mail partition for current month, you must restore the mail partition for current month before mail archiving process is started and new mail messages are imported. If you don't restore the mail partition for current month, mail archiving process create mail partition for current month automatically.
Notice (2) For the mail partitions which are not necessary to be restored, you have to remove these mail partitions manually at Backup screen in Administration Console.
-
Check the status of target domain by "md_domain list" command.
$ /opt/maildepot3/bin/md_domain list
You can access to Administration Console for target domain if the status is onlined.
md_backup_day
Perform day-wise backup, deletion and restoration of the data (mail messages) for a specified date.
Usage
md_backup_day DOMAIN backup [-d] [-o FILENAME] YYYYMMDD md_backup_day DOMAIN delete YYYYMMDD md_backup_day DOMAIN restore [-f] FILENAME
Arguments
- DOMAIN
-
Specify the name of domain.
- YYYYMMDD
-
Specify the date for which the backup or deletion will be done.
- FILENAME
-
Specify the the backup file to be restored
- -d, --delete
-
Delete data after the backup is successfully completed.
- -o, --output=FILENAME
-
Specify the filename of backup file.
(The default filename is ./maildepot_YYYY_MM_DD.tar.gz) - -f, --force
-
If not specified, don't restore data if archived mail messages are already exist for target date. If specified, force to restore data even if archived mail messages are already exist for target date.
- -?, --help
-
Display help messages.
- -V, --version
-
Display version information.
Description
- The archive format of the backup file is .tar.gz.
- This will work only when the mail archiving process is stopped.
- Data which has already been restored cannot be added.
Notice
If you reinstall the MailDepot system, and then restore the data which has been backed up (before the reinstallation) on a daily basis, you must restore md_authenticity.conf files before restoring data. If you forget to resotre this configuration file, non-falsification checking will be allways failed for restored data.
md_partition
This command provides same operations as Backup screen in Administration Console.
The following operations are provided (The 'Mail partition' indicates the archived mail messages for each month).
- Change the status of Mail partition
- Upgrade Mail partition
- Backup Mail partition
- Delete Mail partition
- Restore Mail partition
- Display the backup filename of Mail partition
- Display the status of Mail partition
Usage
md_partition DOMAIN list [MAILPARTITION] md_partition DOMAIN offline MAILPARTITION md_partition DOMAIN online MAILPARTITION md_partition DOMAIN upgrade MAILPARTITION md_partition DOMAIN backup [-d] MAILPARTITION md_partition DOMAIN delete MAILPARTITION md_partition DOMAIN restore MAILPARTITION md_partition DOMAIN path [MAILPARTITION]
Arguments
Arguments take Mode and Mail partition.
Mode
- list
-
Display the status of the specified mail partition.
If you do not specify the mail partition, the list of status for all mail partitions is displayed. To understand the meaning of status, refer to the "List of status" given below. The displayed informations are as follows.Partition Size Backup status Partition status Disk
- offline
-
Make the specified mail partition from the out of search targets.
- online
-
Make the specified mail partition Online.
- update
-
Upgrade the specified mail partition. If you restore mail partitions from the backup data created by old versioned MailDepot, you have to upgrade restored mail partition by this command.
- upgrade
-
Upgrade the specified mail partition. If you restore mail partitions from the backup data created by old versioned MailDepot, you have to upgrade restored mail partition by this command.
If target partions are alread upgraded, you will see followin messages.
$ /opt/maildepot3/bin/md_partition upgrade default md_partition: All partitions already upgraded. $ /opt/maildepot3/bin/md_partition upgrade default 201501 md_partition: Partition 201501 is already upgraded.
- backup
-
Take a backup of the specified mail partition.
If you use the -d option together with this, the specified mail partition is deleted after the backup is taken. - delete
-
Delete the specified mail partition.
- restore
-
Restore the specified mail partition.
The partition's backup file must be in the backup directory. - path
-
Display the path of the backup file for the specified mail partition.
If you do not specify the mail partition, the directory path where the backup file is put is displayed.
Mail partition
- MAILPARTITION
-
The format is YYYYMM
Common options
- -?, --help
-
Display help
- -v, --version
-
Display version information
Description
List of status
- Backup status
-
OST Outstanding CMP Completed HLD On hold FAL Failed PRG In progress
- Partition status
-
PRG Mail archive in progress ONL Online DEL Deleted OST Offline
Termination code
Returns 0 on success or 1 on failure, 2 if another process is running in background.
md_export_oplog
On a daily basis, export the operations log into a comma delimited file.
Usage
md_export_oplog DOMAIN [-h] [-l LINES] [-o FILENAME] [-e ENCODING] [YYYY[MM[DD]]]
Arguments
- [YYYY[MM[DD]]]
-
Specify the year, month and date for performing export
If you do not specify the date, the entire operations log is exported - -l LINES
-
Number of lines to divide the file into (The default is 65,535 lines)
If you specify the number of lines as 0, no division is done - -o FILENAME
-
Export to the specified file
(The default file name is ./maildepot_oplog_YYYY_MM_DD.csv) - -e ENCODING
-
Select charset encodoing (sjis/utf8/eucjp) for output file
(The default file name is sjis) - -?
-
Display help
- -V
-
Display version information
Description
- Default character encoding for a file is Shift_JIS, and the line feed code is \r\n .
- Output a header to show the column names in the first line of the file.
- Whenever a field value contains any delimiter (,), quote ("), carriage return character (\r) or a line feed character (\n), it is enclosed in quotes.
md_snapshot
This command provides the backup/restore for whole archive data (include mail messages, operation logs, statistics reports, etc..) stored in Maildepot.
The md_snapshot command backup all data stored in MailDepot data direcoty (default is /opt/maildepot3/data) fast and efficiently than md_backupall command by copying files on filesystem with delta-transfer algorithm. Instead of this feature, you cannot backup part of archive data with md_snapshot command like md_partition and md_backup_day commands.
This command can be executed only by root user.
Usage
md_snapshot backup [--ignore-checksum] md_snapshot restore [--ignore-checksum] md_snapshot show
backup mode
Backup whole archive data.
Save snapshot backup for whole archive data into /opt/maildepot3/snapshots directory. It is recommentded to use another disk storage device for snapshot directory than that for archive data directory (default is /opt/maildepot3/data) in order to preserve data in an event of system crash. You can change the location of snapshots directory with snapshot_dest parameter in maildepot.conf.
This command keeps two generations of backup data, and remove old generations of backup data before crearing new backup data. So, md_snapshot command may require disk space twice as much as volume of archive data. In most case, md_snapshot command require less disk space than two times volume of archive data because only differential data is stored between generations.
-
Invoke md_snapshot with backup mode.
# /opt/maildepot3/bin/md_snapshot backup Backup started
-
Backup will be completed.
Backup completed
The following directories are created under the snapshot directory.
/opt/maildepot3/snapshots |-- cur/ 1st generation of snapshot | |-- backupinfo backup information | |-- datadir/ data files | |-- tablespaces/ data files in tablespace | |-- archivelog/ archive logs | `-- config/ configuration files | |-- system/ system settings | `-- domain/ domain settings | |-- DOMAIN/ | : `-- old/ 2nd generation of snapshot
When you do backup with --ignore-checksum option, rsync command in the backup will identify a file by its size and timestamp rather than its checksum.
restore mode
Restore whole archive data from snapshot backup.
Restore whole archive data from last saved snapshot backup. The archive data after last backup will be lost.
-
Invoke md_snapshot command with restore mode.
# /opt/maildepot3/bin/md_snapshot restore Recovery started
-
Ask to stop maildpeot service if service is running. If you enter "n", restore operation will be aborted.
Are you sure you want to stop Maildepot Service? [y/n] (default: y) Maildepot Service stopping... Maildepot Service stopped
-
Ask to preserve current archive data before starting restore operation.
Do you want to backup DATADIR and TABLESPACE folders before recovery? [y/n] (default: y)
If you enter "y", current archive data will be moved to ohter location. If you enter "n", current archive data will be removed.
-
Start restore operation. After restore operation is completed successfully, ask to start maildpeot service.
Do you want to start Maildepot Service? [y/n] (default: y)If you enter "y", maildepot service will be started.
Maildepot Service starting... Maildepot Service startted
If you enter "n", you have to start MailDpeot Service manually after all restore operation has been completed. If you need to restore configuration files, you have to enter "n" at this point, then you have to start MailDpeot Service manually after you have resotred configuration files.
-
Ask to remove preserved archive data. If you enter "y", preserved archive data will be deleted.
Do you want to delete backuped DATADIR and TABLESPACE (.restore) folders? [y/n] y
-
Restore will be completed.
Restore completed
If you need to restore configuration files, you have to copy configuration files manually as following.
# cp -r /opt/maildepot3/snapshots/cur/config/system/* /opt/maildepot3/etc # cp -r /opt/maildepot3/snapshots/cur/config/domain/domain-name/* /opt/maildepot3/domain/domain-name/etc
When you do restore with --ignore-checksum option, rsync command in the restore will identify a file by its size and timestamp rather than its checksum.
show mode
Display the status of snapshot backup
# /opt/maildepot3/bin/md_snapshot show ID TOTAL BACKUP_START_TIME ELAPSED_TIME =================================================== cur 75.1MB 2012-12-17 15:12:38 3s old 43.1MB 2012-12-17 14:50:34 2s
"cur" for tha last generation of snapshot, and "old" for old generation of snapshot. The "TOTAL" field show the volume of backup data, and "BACKUP_START_TIME" field show the starting time of backup, "ELAPSED_TIME" field show the total time spent for backup.
md_download
Export mail messages saved in MailDepot with EML format.
Usage
md_download DOMAIN [options]
Argument
- DOMAIN
-
Specify the name of domain.
- -v, --verbose
-
Display progress messages.
- -c, --check
-
check whether the exported message has been tampered with.
- -z, --zip [NAME]
-
Save mail messages into specified ZIP file. The default filename is set to YYYY-MM-DD-HH:MM-PID.zip.
- -d directory
-
Save mail messages into specified directory. The default directory is set to /opt/maildepot3/DOMAIN-NAME/var/download.
- -f YYYY-MM-DD
-
Specify the start date when the mail meessages are imported.
- -t YYYY-MM-DD
-
Specify the end date when the mail meessages are imported.
- -s ADDRESS
-
Specify mail address for sender.
- -r ADDRESS
-
Specify mail address for recipients.
- --from ADDRESS
-
Specify mail address in From header.
- --to ADDRESS
-
Specify mail address in To header.
- --cc ADDRESS
-
Specify mail address in Cc header.
- --csv FILE
-
Specify the filename of CSV file created from search results in Administration Console.
- DOMAIN
-
Specify the name of domain.
- ID
-
Specify the "ID Number" to be removed.
- -V, --version
- Show version number.
- -f, --force
- Delete messages without showing confirmation.
- DOMAIN
Specify the name of target domain.
- -q, --quiet
Supress verbose messages.
Description
md_download command export mail messages from MailDepot with specified condition.
The exported mail messages are saved into /opt/maildepot3/DOMAIN-NAME/var/download directory with following filename by default.
YYYY-MM-DD/HEADERID_YYYYMMDD_HHMM_DIGEST.eml
With --csv option, you can export mail messages by using CSV file created with CSV Download from search results in Administration Console.
md_delete
Remove selected archived mail in MailDepot.
Usage
md_delete DOMAIN [option] ID ...
Arguments
Description
The md_delete command remove selected archived mail by "ID Number" in MailDepot.
You need to specify the "ID Number" in command line. You can see "ID Number" in "Show Mail" page from search results page. You can see "ID Number" in CSV file downloaded from search results page.
md_ldap_sync
Import user accounts from LDAP server into MailDepot.
Usage
md_ldap_sync DOMAIN [options]
Arguments
Description
md_ldap_sync command imports user acounts from LDAP server into MailDepot. You can also import user accounts in Active Directory server that support LDAP protocol. If account informations are changed on LDAP server, md_ldap_sync command updates user accounts in MailDepot. This comand enable external authentication for new account to authenticate password by ldap server.
To use md_ldap_sync command, you have to set some parameters about ldap server in following configuration file.
/opt/maildepot3/etc/md_ldap.conf
You have to set following parameters.
| Parameter Name | Description |
|---|---|
| ldap_url | (required) URL for LDAP server. |
| ldap_bind_dn | (required) Username for LDAP server. |
| ldap_bind_pw | (required) Password for LDAP server. |
| ldap_base_dn | (required) LDAP search base for user accounts. |
| ldap_filter | (required) LDAP filter for user accounts. |
| ldap_pagesize | (optional) If this parameter is set, the LDAPv3 extended protocol will be used to retrieve all search results in the specified pagesize. If the LDAP server limits the number of search results, you need to specify this parameter to retrieve all search results. This parameter should be a number that is smaller than search limit on the LDAP server. |
An example configuration is shown below.
ldap_url = ldap://ldap-server-name/ ldap_bind_dn = admin@ldap-domain.tld ldap_bind_pw = ******** ldap_base_dn = "cn=Users, dc=ldap-domain, dc=tld" ldap_filter = (mail=*) ldap_pagesize = 1000