MAIL_FWX: Filesystem plugin for Total Commander.
Purpose: Working with mail accounts.
Version: 1.0a3 (12.12.2007)
Author: Pavel Dubrovsky aka Antikiller.D1P (UIN 215168320)

Description:
The plugin is intended to work with mail accounts via POP3/SMTP directly under Total Commander.

In the current version following features supported:
- Viewing information about the messages (in the user columns) without messages delivery (download only headers -> reduction of traffic).
- Removing messages from the server (DEL).
- Messages delivery with removing from the server (F6) and without removing (F5).
- Viewing size of a mail box without uploading messages.
- All messages are kept in *.eml format (see below).
- Message viewer.
- Message editor/sender.
- GMail support (OpenSSL libraries needed).

Known restrictions (it all will be fixed... sometime):
- There is no confirmation on any operations, include existing files rewriting.
- The plugin is not able to work through a proxy.
- Time of last access for mailboxes showed as current (because there is no way to receive the true value).
- Messages encoding in plugin isn't processed in any way (i.e. messages with non-latin symbols can be viewed and saved incorrectly).
- May be problems under Win 9x (isn't tested).
- Some problems with mail sending (built in SMTP mechanism isn't tested enough).

Plans for future:
- Add IMAP4 support (work with mail directly on the server).
- Add support of work through a proxy.
- Add address book, etc.
- Fix all bugs. :)

---

Plugin installation:

Use autoinstall function in Total Commander or install plugin manually in Total Commander configuration.

Plugin setup:
Go to Network neighborhood in Total Commander and select MAIL directory. Press Alt+Enter on them, plugin options window will be shown. Default plugin language is English, but you can select any of distributed localizations on "Plugin options" tab. Additional localization files (*.mpl) can be added via simply copying into plugin directory.
It is necessary to add one mailbox for work with the plugin. Press "Add" button, and enter new mailbox name. Created mailbox will be selected in the mailbox list, now you must specify its parameters:

Mail receiving: POP3 options
POP3 server[port]: specify your POP3 server and port, pop.server.net:110 for example.
User: specify username (login) for this mailbox.
Password: specify password for this mailbox.
POP3 authentification: POP3-authentification method. Next methods are supported:
- UserPass: send login/password to server as plaintext.
- APOP: protected method. It prefer, if server support it.
SASL authentification isn't supported at this moment, but it can be added later.

-
Mail sending: SMTP options.
SMTP server[port]: specify your SMTP server and port, smtp.server.net:25 for example.
SMTP authentification: SMTP authentification method. Supported methods at this moment:
- Disabled: authentification not required (approach for the most of public and private servers, all checks are made on the server side).
- POP before SMTP: SMTP authentication not required, but server require POP3 authentification to confirm user authenticity.
- Use POP3 settings: SMTP authentication use same login and password as POP3.
- Own settings: SMTP authentication use own login and password.
User: specify username (login) for this mailbox (used with own SMTP authentification settings).
: specify password for this mailbox (used with own SMTP authentification settings).

-

Note:
All passwords are stored in the ciphered kind, but can be deciphered at the certain efforts. So, if you are afraid about your passwords safety, DO NOT save any passwords in this plugin! Just leave password field blank, and it will be requested each time, at you tried get access to this mailbox.

-

Connection
Secure connection (TLS\SSL): secure connection protocol. Come secured servers used that connection method, gmail.com are most known of them. This connection method requires OpenSSL libraries (distributed with plugin), copied to Total Commander main directory.
-
From information: common information, included to all messages, which will be sent from this box.
From Name: sender name.
E-mail: sender mailbox adress.
Organization: sender organization.
-
Use this mailbox by default: if this checkbox enabled, selected mailbox will be used to mail sending by default. If no mailbox is selected, then first mailbox from the list will be used.

After all parameters will be specified, press "Apply" button to save changes. Now you can close this window, or add one more mailbox in the same way.

Hint: you can use these hotkeys shortcuts for mailbox editing (mailbox list should be focused):
Insert: add mailbox.
Delete: remove selected mailbox.
F2, Shift+F6 or double click: rename selected mailbox.
F5: copy selected mailbox.

Plugin options:

Interface language: list of accessible localizations.

Use Blat for mail sending: use Blat mailer (http://www.blat.net) instead built-in mailer. This feature can be useful, if you get troubles with built-in mailer, or debugging purposes.
Path to blat.exe: specify blat.exe path.
Additional Blat commandline parameters: 
If necessary its possible to specify additional Blat commandline options, for example log all messages to file (-log "filename"), that can be useful for debugging. See Blat documentation for more information.

On copy files to plugin filesystem: behaviour of a plugin at copying files into its FS.
On *.eml-files: if eml-files copied (assumed, that is previously saved message).
- Do nothing: ignore copying.
- Open message as draft: copied message will be opened in built-in editor as draft.
- Open message to answer: copied message will be opened in built-in editor to answer.
- Try to send message: copied message will be sent from default mailbox to recipient (must be specified in mail header).

On other files:
- Do nothing: ignore copying.
- Create new mail with this files attached: copied files will be attached to new message, which will be open in built-in editor.
- Create new mail with this files attached and send to used mailbox: copied files will be attached to new message, which will be sent to used mailbox.

Connection timeout (sec): POP3 connection timeout.

On Enter start:
- Internal viewer (read message): message will be opened in built-in viewer.
- Internal editor (answer to message): message will be opened in built-in editor to answer.
- External program, associated with *.eml: external program, associated with eml-files, will be executed and message will be opened in it.

On Alt+Enter start:
- Internal viewer (read message): message will be opened in built-in viewer.
- Internal editor (answer to message): message will be opened in built-in editor to answer.

Clear headers cache on disconnect: for work acceleration and traffic economy, plugin cached all received message headers. Cache updates each time at you open mailbox, so any out-of-date headers will not be used. If this option enabled, all cached messages will be deleted after "Disconnect" button pressed. In any case, this headers isn't used by plugin after disconnect, so you can save it only for your own needs.
Cached headers can be found at the following path: plugin_dir\cache\mailbox_name\. You can see headers via Lister, or use Lister with wlx_eml plugin.

Cache received messages: if enabled, then all downloaded messages cached like a headers. In result there is an acceleration of repeated access to message, and traffic economy.
Messages don't cached on moving (F6) from server (because any operation with this message on the server are impossible) and on view via external application (because it is WFX API restriction). Cache cleared each time on plugin startup (in other cases you can receive "out-of-dated" messages from cache).

Viewer\Editor options

Tabs position in viewer window: viewer\editor tabs position.
Show attachments as: attachments view mode in viewer\editor.
Default directory to save attachments: directory to save messages attachments by default.
Close editor after message sending: close editor after successful message sending.
Close progress window after message sending: close progress window after successful message sending.
Editor always on top: "Always on top" mode for viewer\editor window by default.
Remember editor window & position: if enabled, then viewer\editor window position will be restored each time it executed.
Show RFC 822 headers: show raw message headers in viewer\editor window.
Button bar options: various button bar options.
Gradient fill: color and gradient for button bar background.
Flat buttons: switch flat\3D button bar interface.
Button captions: button captions display mode.
Button size: button bar buttons size.

After one or more mailboxes added, enter plugin file system. List of mailboxes will be accessible as directories. If you use TC 7.0 + the user columns mode (see further) will be used by default.
Further the following operations are possible:
Alt+Enter on the directory: editing of parameters of a mailbox.
Space on the catalogue: a calculation of the size occupied on a mailbox. This operation demands connection to the server, however transfer of messages does not occur.
F7 (MkDir): create new mailbox.
F8, Del: delete selected mailbox.
F2: rename selected mailbox.

Enter to the directory, and messages headers will be downloaded. You can see all possible information about messages (sender, size, date, etc). You can work with messages like with simple files - copy, move, view with Lister and delete operations are supported. Also you can copy files to plugin filesystem, in this case he will behave how is specified in options.

Note: 
If operation require connection to the server, the corresponding parameters specified for this mailbox are used. If password wasn't saved in mailbox parameters, then it will be requested at first connection attempt.
You can check "Save password" option in request dialogue, and password will be saved in mailbox parameters (like as you enter it in options window). If this option will not checked, the password will be kept in memory up to the end of session (until you press "Disconnect" button).

Work with the user columns:
The plugin supports user columns. This function required Total Commander 7.0 or higher.
Default set of columns is automatically applied at the first start of a plugin. So, it is possible to create own set of columns from the following:

Attachment encoding: identifies the default encoding mechanism used for message parts.
Recipients: carbon copy recipients for the message.
Attachment MIME: identifies the MIME media type for the message.
Flags: flags of the message in format AFDXSR. It means: A) Answered - a reply has been sent for the message; F) Flagged - the watch flag has been set for a message or thread; D) Deleted - message has been deleted in the Mailbox; X) Draft - message is a draft and has not been sent; S) Seen - message has not been retrieved and read by the mail client; R) Recent - message has been added to the mailbox since the last time it was accessed.
From: identifies the original author of the message.
Organization: identifies the organizational affiliation for the message author.
Priority: identifies the message priority.
ReplyTo: identifies the delivery address for message replies.
Sender: identifies the sender of the message.
Subject: identifies the subject for the message. Two subcolumns there: Encoded (subject in plugin-determined encoding) and Original (subject in original encoding).
UID: message unique identifier.
MsgID: message identifier.
Cached: message cache status.

Messages editor:
The plugin have a message editor, also used for mail sending. Its interface, I hope, it be intuitively clear, therefore I just give the list of hotkey shortcuts:
Esc: close window (viewer/editor).
Alt+O: load message (viewer/editor).
Shift+Ctrl+O: load message to answer (editor).
Alt+S: save message (viewer/editor).
Alt+T: toggle always on top mode (viewer/editor).
Alt+A: add attachment (editor).
Alt+Enter: open viewed message in editor (to answer) (viewer).
Ctrl+Enter: send message (editor).
Alt+H: toggle headers view mode.

You can use built-in editor as the independent application. Just run TCMAIL.exe from plugin directory.
TCMAIL support next commandline parameters:

TCMAIL.exe "path\file.eml" [v] [a]

where:
path\file.eml - opened file path;
v - open in viewer mode (can be passed to open in editor mode);
 - create answer to opened file (can be passed to open file as previous saved).

Example of the TC toolbar button, which create answer to the message file under cursor:

TOTALCMD#BAR#DATA
C:\PLUGIN_PATH\TCMAIL.exe
"%p%n" a
C:\PLUGIN_PATH\TCMAIL.exe
TCMAIL
C:\PLUGIN_PATH

-1

---

Working with *.eml:
All messages in a plugin are submitted in a eml format. Eml is a simple text format, which can be looked through lister without any plugins installed (but you can't understand anything :))
The next ways possible to work with eml-messages:
1) Use internal viewer (Enter or Alt+Enter on selected message, depends on plugin options). This tool allow to see messages and work with attachments.
2) Press Enter on the message (in file system of a plugin (if corresponding option enabled), or on a eml-file in local file system). If some application (usually it is default e-mail client) is associated with this file extension, this application will be started and open this file.
3) Install wlx_eml plugin from Ivan aka Atlanoff. This plugin allows to look eml in a "readable" kind, and extract attachments from eml.
4) Use cm_Encode command on the eml-file. Total Commander will "unpack" the message, including all attachments. There we have some inconvenience - it is impossible to use the command inside plugin virtual file system, and it is impossible to apply the command on many files at once.

---

GMail HOWTO:

GMail (Google Mail) - it is mail service from Google corporation. The basic feature of this service in that more 2 Gb of disk space to each account is given out (and this space increases constantly).
The plugin allows to work with GMail-accounts as with a usual mail box, but some adjustments are  necessary:
1) You must enable POP3 message delivery in GMail-account properties (via web-interface).
2) You must copy libeay32.dll and ssleay32.dll files to Total Commander main directory.
3) You must specify following parameters to your GMail-account in plugin:
Mail receiving server: pop.gmail.com
Port: 995
Username: your_gmail_acc_name@gmail.com
Password: your_password
mail sending server: smtp.gmail.com
Port: 465

Also, it is necessary to enable "Secure connection (TLS\SSL)" option.

---

Mail monitoring:

In plugin archive you can find a utility named Monitor.exe. It is a tool for background mailbox monitoring.
At this moment tool at alpha-development stage, and proper documentation not ready yet.

---

History:

v. 1.0a3 (12.12.2007)
* A lot of small changes and fixes.
+ Mail monitoring utility.
! This is unstable version only for tests!

v. 1.0a2 (20.02.2007)
* Messages time now displayed correctly.
* Fixes in messages headers generation routine.
* Other fixes.
+ Simple address book.

v. 1.0a (07.02.2007)
* Changed behavior, if default mailbox isn't selected.
* A lot of bugfixes.
* Readme-files rewritten.
+ Mail sending via Blat (www.blat.net) (optional).
+ F2 on mailbox name in plugin filesystem renames mailbox.
+ Copying files to plugin filesystem (behavior can be adjusted).

v. 0.99b6 (05.02.2007)
* Previously saved message always opened as answer.
* In some cases incorrect editor window position used.
+ "Clear headers cache on disconnect" option. If enabled, all cached messages will be deleted after "Disconnect" button pressed. In any case, this headers isn't used by plugin after disconnect, so you can save it only for your own needs.

v. 0.99b5 (03.02.2007)
* Some interface elements was invisible on enabled XP themes.
* Incorrect header From field generation.
* Some other fixes.
+ Save editor window size and position option.

v. 0.99b4 (02.02.2007)
* Some editor keyboard shortcuts are changed (because it conflicted with standard shortcuts)
* Fixed: messages with """ char in subject hasn't been accessed.
* Fixed: error with language file, which contains empty string.
* Fixed: errors with incorrect attachments generation.
* Fixed: incorrect header generation in some cases.
* More correct in message body generation.
* External mailer mode fixes.
* SMTP-authentification tested. It works =)
+ POP3-authentification: APOP-authentification added.
+ Message header viewing in editor (Alt+H to toggle).
+ Ctrl+Mouse Wheel changes font size in editor/viewer.
+ Ctrl+Gray+/Gray- changes font size in editor/viewer.
+ Main icons set changed to new, based on Opera browser Marina theme.
+ Toolbar buttons size and captions mode can be selected.
+ Toolbar gradient fill (optional).
+ Always on top mode for editor can be set by default.
+ Some other fixes and additions.

v. 0.99b3 (18.01.2007)
* Fixed: messages with "?" char in subject hasn't been accessed.
* SMTP-authentification bugfixes (but it still untested).
* Viewer icons removed (will be changed to new in next versions).
* Partial non US-ASCII charset support in message subjects. Now, if used charset not indicated, then plugin tried convert subject to system charset. It tested with KOI8-R, UTF8, UTF16 and seems to work fine.
+ Experimental SSL/TLS support (only POP3): GMail support.
+ Passwords encryption: Warning: all previous saved passwords MUST be reentered. 
+ Drag'n'Drop files to attachments list.
! Many known bugs still unfixed.

v. 0.99b2 (14.01.2007)
* Interface bugfixes.
* Attachment list bugfixes.
* It was impossible to send message if default mailbox hasn't been chosen.
* TC 6.x. compability (some TC bugs has bavoided). 
+ %commander_path% and %commander_drive% support in attachment default savepath.
+ User columns changes: "Date" column removed (because standard datetime column show same info), "Charset" column added.
+ SMTP-authentification (isn't tested yet).
+ "Close after message sending" option added.
+ Del in edited message attachment list deletes selected items.
+ Built-in editor can be executed as external application (via TCMAIL.exe).
! First public beta.

v. 0.99b1 (13.01.2007)
* Some interface fixes.
+ Connection timeout option.
+ Problems diagnostic (POP3: output to TC FTP panel; SMTP: output to own dialog);
+ Message sending progress dialog.

v. 0.991a (12.01.2007)
* Pressing Esc in editor window cause error sometimes.
* Some fields in editor will be black under some XP themes.
* Messages caching error still unfixed.

v. 0.99a (12.01.2007)
* User interfase fixes.
+ Message editor added.
+ Mail sender (SMTP support).
! Caution! This version is still very early alpha-version, for testing only. Dont use it for usual job.

v. 0.92a (09.01.2007)
+ Unsaved changes indicator in mailbox options added.
+ New user columns: UID (message unique identifier) and MsgID (message identifier).
+ New user column: Cached. It displays message cache status (in cache or not). Sometimes cache status displayed incorrectly (because caching operation is done slower than TC refresh message list).
+ Language files: slovak.mpl (from Jozef Kundlak), polish.mpl (from Dariusz J. Kawecki), german.mpl (from Alexandre Mayor), danish.mpl (from Peter H. S. Madsen).
* Serious changes and bugfixes in caching mechanism.

v. 0.91a (08.01.2007)
* Fixed list index out of bounds bug on options saving.
* Fixed bug with directory selection dialog.
* Messages caching bugfixes.
* Some interface bugfixes.
* Internal viewer bugfixes.
* Some other bugfixes.

v. 0.9a (07.01.2007)
* "Apply" button in mailbox options become activated only after modifications.
* Sorting on all user columns works.
* Language files extension changed to *.mpl (to avoid problems with user columns translation).
* SMTP options unlocked (though do nothing).
+ XP style support.
+ Mailbox copying (via F5 or context menu).
+ Make directory in plugin filesystem makes a new mailbox.
+ Removing directory in plugin filesystem removes a selected mailbox.
+ Messages caching (optional): all downloaded messages cached like a headers -> mail access acceleration and traffic economy.
+ Progress displayed at an entering to mailbox. Operation can be cancelled, thus work with already received letters will be possible (very useful for slow and unstable connections).
+ Message viewer added.
+ Viewing and saving attachments in internal viewer added.
+ Plugin behaviour on messages opening (Enter) and on properties viewing (Alt+Enter) can be adjusted.

v. 0.7b (05.01.2007)
* Empty mailbox list showed correctly.
* Options window changed, and Alt+Tab window loss bug fixed.
* Now possible to add additional info (like "about author") in localization file.
* All standart input dialogs changed to self-written.
* Shift+F6 shortcut added to rename mailbox.
* Default user columns view changed.

v. 0.7a (05.01.2007)
+ POP3 support.
+ Work with unlimited mailboxes amount.
+ Password request, if it is not stored.
+ Uploading progress showed.
+ Show some info in TC log panel.
+ Viewing the information on messages in  columns (TC 7.0 +).
+ Message headers caching.
+ Localization via .lng files.

---

Wishes and bug reports are accepted on ICQ UIN 215168320.
or on russian Total Commander support forum (ru): http://forum.wincmd.ru/viewtopic.php?t=7169
and on official Total Commander forum: http://www.ghisler.ch/board/viewtopic.php?t=13583