hMSqlPad

Use this forum if you want to discuss a problem or ask a question related to a hMailServer beta release.
Post Reply
User avatar
Dravion
Senior user
Senior user
Posts: 2071
Joined: 2015-09-26 11:50
Location: Germany
Contact:

hMSqlPad

Post by Dravion » 2017-08-22 14:32

I wrote a little hMailServer DB-Utility which is able to execute Insert/Update/Delete SQL-Queries against hMailServers
internal COM-API. This can be usefull if you need to process some batch operations (for example, delete all Mails
by a specific Sender, Recipient, Textstring, Date, Time, by accountid ect. It supports any SQL-DB hMailServer
does supports by itself.

Limitations:
Its not able to operate with return values, so you need a diffrent tool to handcraft your SQL-Queries/Scripts
in the first place or simply use the allready avaiable SQL-Scripts from other hMailServer users.

Update:
The above SQL-Query is builtin, so you can diretly modify it as you need. I noticed if this SQL-Query is executed,
hMailServer automatically deletes all its depending *.eml Messages files from hMailServer\Data\xxxx\*.eml
Folder by itself. There should no orphaned Message Fragments remain after SQL-Query execution.

Screenshot
hMSSqlPad.png
Explanation:
The above SQL-Script will delete all Messages from the hMailServer Database for Messagesender with the Email-Address: test01@incubator.net.projects

C# VS2017 - Sourcecode:
https://github.com/Dravion/hMSSqlPad/tr ... Sql/hMSSql

Program Download:
https://github.com/Dravion/hMSSqlPad/re ... hMSSql.exe

User avatar
Dravion
Senior user
Senior user
Posts: 2071
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: hMSqlPad

Post by Dravion » 2017-08-23 12:01

Update:
Its not possible to operate with return values but you will be informed if the Sql query was executed successfull or produced an error with detailed problem explanation.

The Program hooks into hMailServers own SQL-Database Connection and doesnt cause trouble with hMailServers Cachingsystem, so there is no need to restart the hMailServer Service after usage. It works with all Databases hMailServer supports by itself.

Sql Events like deletetion of dependent *.eml files to db records will be done by hMailServer itself.You also can load your own SQL-Scripts by clicking the "Load Script" button.Its possible to run multiple Queries while hMailServer is running and Clients are connected.For example: If a Inbox-Message is moved from one folder to another by SQL-Script, its directly shown in the Email Program Folder structures as it was moved by COM API call or Drag and Dropped manually by the Email-Client User.

Post Reply