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.
Extracting list of handled mail domains from Mailwasher
- CorporateBackup
- Student Sheep
- rusticdog
- Firetrust Monkey
Post
Re: Extracting list of handled mail domains from Mailwasher
Hi Steve
No idea myself, but will ask the guys.
No idea myself, but will ask the guys.
- nick.bolton
- The Big Cheese
Post
Re: Extracting list of handled mail domains from Mailwasher
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? ... id=admin&p...
http://localhost:4044/Domains.srv?remot ... min&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? ... ta_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 ... iretrust.c...
{"remoteActionResponse":"success"}
A user made this based on the remote actions we enabled.
https://github.com/xallen/plesk-mwes-connector
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? ... id=admin&p...
http://localhost:4044/Domains.srv?remot ... min&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? ... ta_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 ... iretrust.c...
{"remoteActionResponse":"success"}
A user made this based on the remote actions we enabled.
https://github.com/xallen/plesk-mwes-connector
- CorporateBackup
- Student Sheep
Post
Re: Extracting list of handled mail domains from Mailwasher
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.
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
Corporate Backup
- nick.bolton
- The Big Cheese
Post
Re: Extracting list of handled mail domains from Mailwasher
Ok, let me ask the programmers but I won't get an answer until Monday
- nick.bolton
- The Big Cheese
Post
Re: Extracting list of handled mail domains from Mailwasher
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.
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.
- CorporateBackup
- Student Sheep
Post
Re: Extracting list of handled mail domains from Mailwasher
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.
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
Corporate Backup
- CorporateBackup
- Student Sheep
Post
Re: Extracting list of handled mail domains from Mailwasher
(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
Corporate Backup
- nick.bolton
- The Big Cheese
Post
Re: Extracting list of handled mail domains from Mailwasher
Good to hear, yes a simple select query should do it.
- CorporateBackup
- Student Sheep
Post
Re: Extracting list of handled mail domains from Mailwasher
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:
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 (`sqlite3.exe "c:\Program Files\MailWasher Enterprise Server\data\mwes.db" "select * from domains;"`) do @echo %a
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
Corporate Backup