 |
Index for Section 1 |
|
 |
Alphabetical listing for M |
|
 |
Bottom of page |
|
mailcv(1)
NAME
mailcv - Converts mail folders or directories
SYNOPSIS
mailcv [-dnv] -f input output
mailcv [-adnv] -A in_dir out_dir
mailcv [-evd] -H [-f input] [subfolder]
mailcv [-evd] -I [-t] [-f input] [subfolder]
mailcv [-evd] -M [-t] [-f input] [subfolder]
mailcv [-vd] -Q [-f input] [output]
mailcv [-v] -U [-f input] [output]
OPTIONS
-a Abort. Aborts conversion of a folder if a corrupt message is found.
Only used with the -A option, the -a option overrides the -n option.
A message is corrupt if it is missing one of the primary RFC 822
headers: From, Date, or Reply-To. If the mailcv utility finds a corrupt
message and you are using the -a option, an error message indicates the
number and folder name of the corrupt message. No further messages are
converted from the folder containing the corrupt message, and the
mailcv utility continues to convert any remaining folders in the
hierarchy.
-d Delete. Deletes folders and messages that have been converted. This
option should be used with caution, as explained in the DESCRIPTION
section.
-e Exclude. When converting to an IMAP folder, the -e option suppresses
conversion of duplicate messages. This option can be used only when you
are converting to IMAP folders with the -H, -I, or -M options.
-f File. Specifies the mail folder to be converted.
If used in the form mailcv -f input output, specifies a dxmail/MH
folder input to convert to a UNIX From-style folder output.
If used with the -H, -I, -M, -Q, or -U options, the input and output
specifications are described in the OPERANDS section.
-n No force. Skips any corrupted message and continues to convert the
folder. A warning message is displayed.
The -a option overrides the -n option.
-t Tree. Use the -t option with the -I or -M options if input is the top
of a directory hierarchy.
If -t is specified with any other options, it is ignored.
-v Verbose. Writes each folder and message number being converted to
standard output.
OPERANDS
-f input output
Converts a dxmail/MH folder input to a UNIX From-style folder output.
-A in_dir out_dir
Converts a dxmail/MH folder hierarchy starting at in_dir to UNIX From-
style folders in a directory hierarchy starting at out_dir.
To convert your entire dxmail/MH default directory, use $HOME/Mail for
in_dir.
-H [-f input] [subfolder]
Converts an MH/POP folder input to an IMAP folder. The default output
is your IMAP inbox.
· If -f input is not specified, the default is
/usr/spool/mail/POP/userid.
· If you use the optional subfolder argument, input is converted to
the userid.subfolder subfolder under your IMAP inbox.
-I [-t] [-f input] [subfolder]
Converts a UNIX From-style folder input to an IMAP folder. Your IMAP
inbox is the default output.
· Use the optional -t option if input is the top of a directory
hierarchy.
· If -f input is not specified, the default is
/usr/spool/mail/userid.
· If you use the optional subfolder argument, input is converted to
the userid.subfolder subfolder under your IMAP inbox.
-M [-t] [-f input] [subfolder]
Converts a dxmail/MH folder input to an IMAP folder. Your IMAP inbox is
the default output.
· Use the optional -t option if input is the top of a directory
hierarchy.
· If -f input is not specified, the default is
/usr/spool/mail/userid.
· If you use the optional subfolder argument, input is converted to
the userid.subfolder subfolder under your IMAP inbox.
-Q [-f input] [output]
Converts an MH/POP folder input to a UNIX QPOP folder.
· If -f input is not specified, the default is
/usr/spool/mail/POP/userid.
· If output is not specified, the default is /usr/spool/mail/userid.
-U [-f input] [output]
Converts an IMAP folder to a UNIX From-style folder.
· If -f input is not specified, your default IMAP directory is the
default. This is usually /usr/spool/imap/user/userid, but it can
be configured differently in the /etc/imapd.conf file.
· If output is specified but does not exist, the mailcv utility
creates it.
· If output is not specified, the default is /usr/spool/mail/userid.
If you use the default output, the converted mail messages are
appended to your spool mail drop.
You cannot use the -d option with the -U option. To delete messages
from an IMAP folder, use the IMAP cyradm utility to explicitly remove
the folder.
DESCRIPTION
The mailcv utility converts mail folders or directories in the following
formats:
__________________________________________________________________
From To
__________________________________________________________________
default dxmail/MH folder
UNIX From-style folder
or subfolder
-A
dxmail/MH mail directory
hierarchy
UNIX From-style folders
and directories
-H MH/POP folder IMAP folder or subfolder
-I UNIX From-style folder IMAP folder or subfolder
-M dxmail/MH folder IMAP folder or subfolder
-Q MH/POP folder UNIX QPOP folder
-U IMAP folder UNIX From-style folder
__________________________________________________________________
Conversion
In a UNIX From-style folder, mail messages are separated with a line
starting with From at the beginning of each message. The /var/spool/mail
directory contains UNIX From-style folders for each user.
When you are converting to or from UNIX From-style folders, the following
conditions apply:
· If the output cannot be locked, an error is reported and you are told
to try again later.
· If you use the form mailcv -f input output, only the input folder is
converted. The messages in that folder are converted to a UNIX From-
style folder. Subfolders within input are not converted.
· If you use the -A option, the mailcv utility first reads all the
message files in in_dir and its subdirectories. It then converts the
messages to UNIX From-style folders and creates a new top level
directory out_dir, with subdirectories corresponding to the original
dxmail/MH folder structure.
-- When you convert a directory containing a folder that includes
subfolders, that directory is converted to a subdirectory under
out_dir. The input subfolders are converted to UNIX From-style
folders under the output subdirectory.
-- If the converted folder foldername also contained messages, a
UNIX From-style folder foldername.mbe is created. All folders
created with mailcv -A have the .mbe suffix.
When you are converting to IMAP folders or subfolders, the following
conditions apply:
· You must be the IMAP user who owns the IMAP folders or subfolders.
· You must have an IMAP inbox with permissions to create subfolders.
This can be set up by your Mail Administrator.
· The mailcv utility prompts for your password and uses it to create the
appropriate IMAP subfolders.
· If the -t option is specified with the -I or -M options, the input is
understood to be a directory hierarchy.
· If you are converting to an IMAP subfolder, use the optional subfolder
argument. The mailcv utility names the subfolder userid.subfolder.
· If input includes a period (.), it is changed to an underscore (_) in
the file name. For example, mailfile.mbe is converted to mailfile_mbe.
· If input includes an ampersand (&), a dash is added to the ampersand
(&-) in the file name. For example, r&d is converted to r&-d. However,
the dash does not appear in your IMAP mail reader.
Corruption
If a message in an input dxmail/MH folder is missing any of the standard
mail message header specified in RFC 822 (From:, Date:, or Reply-To:) it is
considered corrupt. You can convert all messages including any that are
corrupt, or you can convert only the correctly created mail messages.
· By default, all messages in the input dxmail/MH folder (including
corrupt messages) are copied into the new From-style folder. The -n
and -a options override this default.
· If a corrupt message is found during the conversion and neither the -n
nor the -a option is specified, the message is converted and the
missing headers are populated with the From field set to USER@UNKNOWN
and the Date field set to Mon, 01 Jan 1976 09:00:00 -000.
The -a option aborts the conversion of a folder if a corrupt message is
found. The -n option converts only messages with correct mail message
headers and skips any corrupt messages. You should use the -v option with
either the -n or -a options to record which messages get converted.
Deletion
The -d option deletes mail messages and folders. If the folder has other
files besides MH-style messages, the folder will not be deleted. The -d
option can complicate the conversion process and is not recommended.
· When the -d option is used with the -a option and the process is
aborted in the middle of a mail folder, only the messages that were
copied into the new mail folder are deleted.
· When the -d option is used with the -n option and a problem is found
with a message in a folder, that message is skipped, not converted,
and not deleted from the folder. The nonempty folder cannot be
deleted.
It is safer to run the mailcv utility without the -d option and later use
the rm command to remove the MH folders and messages.
EXIT STATUS
The mailcv utility returns the following exit values:
0 The folder was converted successfully.
>0 The folder was not converted successfully. This can occur if you do not
have file open permissions or if mailcv cannot open or lock the input
or output file.
EXAMPLES
In these examples, your user ID is me.
dxmail/MH to UNIX From-Style
Convert all the messages found in your mail directory $HOME/Mail to the
UNIX From-style format in the directory $HOME/NewMail.
mailcv -A $HOME/Mail $HOME/NewMail
UNIX From-Style to IMAP
Convert your UNIX From-style folder /users/me/NewMail/mymail and place all
the messages into your IMAP inbox.
mailcv -I -f /users/me/NewMail/mymail
dxmail/MH to IMAP
Convert your dxmail/MH folder /users/me/NewMail/mymail and place it in a
subfolder me.mymail under your IMAP inbox.
mailcv -M -f /users/me/NewMail/mymail mymail
FILES
/usr/dt/bin/mailcv
Executable file.
/etc/passwd
Contains user information.
/users/spool/mail/userid
User default mail folder.
/usr/spool/mail/userid.lock
Mail directory lock file, created if lockf is used for locking.
/etc/imapd.conf
IMAP configuration file.
SEE ALSO
Commands: cyradm(1), deliver(8), dtmail(1), login(1), mh(1), sh(1)
System Calls: lockf(3)
File Formats: imapd.conf(4)
CDE Companion
Network Administration: Services
 |
Index for Section 1 |
|
 |
Alphabetical listing for M |
|
 |
Top of page |
|