Extracting list of handled mail domains from Mailwasher

Support forum for MailWasher Enterprise Server
User avatar
CorporateBackup
Student Sheep
Posts: 15
Joined: Fri Oct 17, 2014 2:55 pm

Extracting list of handled mail domains from Mailwasher

Postby CorporateBackup Fri Oct 17, 2014 3:47 pm

I'm wondering if there is any way from the command line to get a list of domains MailWasher Pro is currently handling? Either an actual command, or looking in a config file, or anything of that nature.

Essentially, I'm after the same information which is displayed in the Mailwasher web portal when clicking "Settings" and then "Domains", ie http://localhost:4044/Domains.srv
WGET is of course a possibility, but there's the issue of having to log on through the interface first.

Ideally, I'm looking to pull the list into a Perl script and compare it against a master list.
-Steve
Corporate Backup
User avatar
rusticdog
Firetrust Monkey
Posts: 13160
Joined: Mon Jun 13, 2005 6:27 pm
Contact:

Re: Extracting list of handled mail domains from Mailwasher

Postby rusticdog Fri Oct 17, 2014 4:58 pm

Hi Steve

No idea myself, but will ask the guys.
User avatar
nick.bolton
The Big Cheese
Posts: 1627
Joined: Thu Aug 28, 2008 4:02 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby nick.bolton Fri Oct 17, 2014 5:42 pm

Hi Steve

Does this help?

See version history for version 2.8.1.0 at http://www.firetrust.com/en/products/ma ... on-history

set in mwes.conf/windows registry (HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Firetrust Limited\mwes) by default this is set to zero.
use_remote_action=1

examples.
get/post

Login
-----

Use either servlet to login
http://localhost:4044/SystemConfig.srv? ... =admin&p...
http://localhost:4044/Domains.srv?remot ... n&passwo...
{"remoteActionResponse":"success"}

Note. When successfully logged in will use session id

configure table request/response
--------------------------------

http://localhost:4044/SystemConfig.srv? ... a_hostname
{"remoteActionResponse":"get", "mta_hostname":"mail.firetrust.com"}

http://localhost:4044/SystemConfig.srv? ... _hostnam...
{"remoteActionResponse":"success"}

Domain table request/response
-----------------------------

http://localhost:4044/Domains.srv?remot ... rust.co.nz
{"remoteActionResponse":"success"}

query no wild card(*) required.
http://localhost:4044/Domains.srv?remot ... =firetrust
{"remoteActionResponse":"success", "domains":["firetrust.com", "firetrust.co.nz"]}

http://localhost:4044/Domains.srv?remot ... etrust.c...
{"remoteActionResponse":"success"}

A user made this based on the remote actions we enabled.

https://github.com/xallen/plesk-mwes-connector
User avatar
CorporateBackup
Student Sheep
Posts: 15
Joined: Fri Oct 17, 2014 2:55 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby CorporateBackup Fri Oct 17, 2014 9:53 pm

Potentially, although I'll admit I have zero experience in the use of servlets. Putting the URL into IE gives the expected {"remoteActionResponse":"success"} if I use http://localhost:4044/Domains.srv?remot ... HEPASSWORD, and then the information I want if I follow it up with http://localhost:4044/Domains.srv?remoteAction=query, but I was hoping to be able to do this with WGET or something similar.

Currently, attemping to plug Domains.srv?remoteAction-login&etcetc into wget gives me:
'userid' is not recognized as an internal or external command, operable program or batch file.
'password' is not recognized as an internal or external command, operable program or batch file.

It'd be nice if the domains were in a flat file, or even in the registry - I know how to pull them out of there! I guess I could install a sniffer and see what the page is that gets sent when MWES is logged into via the web console, and then see if I could replicate that in wget, but I'm holding out hope that there's an easier way.
-Steve
Corporate Backup
User avatar
nick.bolton
The Big Cheese
Posts: 1627
Joined: Thu Aug 28, 2008 4:02 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby nick.bolton Fri Oct 17, 2014 11:36 pm

Ok, let me ask the programmers but I won't get an answer until Monday
User avatar
nick.bolton
The Big Cheese
Posts: 1627
Joined: Thu Aug 28, 2008 4:02 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby nick.bolton Mon Oct 20, 2014 2:12 pm

Can you try this instead. Go to http://www.sqliteexpert.com/download.html and download the Professional Trial version (it's fully featured for 30 days)

Then load the database in from c:\Program Files\MailWasher Enterprise Server\data\mwes.db

Go to the domains table


To export data from a grid to a text file, follow the next steps:

1. Select Export to text file from the grid pop-up menu.

2. The 'Export text file' dialogs pops up. This allows you to choose the destination file name and the delimiter. The following delimiters are supported: comma, semicolon and tab.

3. Choose the destination file and the delimiter.

4. Click the 'Start' button to start the export process.
User avatar
CorporateBackup
Student Sheep
Posts: 15
Joined: Fri Oct 17, 2014 2:55 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby CorporateBackup Mon Oct 20, 2014 10:34 pm

That's fair enough, but I'll need to be able to extract the list quite often, and beyond the 30-day trial limit of the third-party program.

I'm having a modicum of success extracting the list of domains from the raw db file in Powershell - I'm up to about 80%. A command-line SQL tool would be useful here; I'll see if I can scrape one up.
-Steve
Corporate Backup
User avatar
CorporateBackup
Student Sheep
Posts: 15
Joined: Fri Oct 17, 2014 2:55 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby CorporateBackup Tue Oct 21, 2014 8:33 pm

(Update for Googlebait: sqlite3 seems to do the trick quite well. Use "SELECT * FROM domains" to spit out the list of domains in the mwes.db file.)
-Steve
Corporate Backup
User avatar
nick.bolton
The Big Cheese
Posts: 1627
Joined: Thu Aug 28, 2008 4:02 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby nick.bolton Tue Oct 21, 2014 8:42 pm

Good to hear, yes a simple select query should do it.
User avatar
CorporateBackup
Student Sheep
Posts: 15
Joined: Fri Oct 17, 2014 2:55 pm

Re: Extracting list of handled mail domains from Mailwasher

Postby CorporateBackup Thu Nov 06, 2014 3:32 pm

For future reference and forum searches, the following line in a CMD shell in the same directory as the sqlite3.exe file appears to do the job:

Code: Select all

for /F "delims=^| tokens=2 usebackq" %a in (`sqlite3.exe "c:\Program Files\MailWasher Enterprise Server\data\mwes.db" "select * from domains;"`) do @echo %a


To run it silently from any directory, and have the output sorted, use the following syntax:

Code: Select all

@(for /F "delims=^| tokens=2 usebackq" %a in (`\full_path_to_exe_file\sqlite3.exe "c:\Program Files\MailWasher Enterprise Server\data\mwes.db" "select * from domains;"`) do @echo %a)|sort
-Steve
Corporate Backup

Return to “MailWasher Enterprise Server”

Who is online

Users browsing this forum: No registered users and 1 guest