Domain Mailbox Size setting?

Hi,

Is there anywhere I can set the “Limit Total Mailbox Size to” for all accounts?

At the moment; I can only see this on a per account basis.

Hello Norlig,

Domain default’s settings could be edit via WebAdmin > Domains & Accounts > Manage domains > Edit domain > Account defaults .

For your specific question you should continue to Quotas And Restriction section.

HTH,
Ioan

Thank you, thats what I was looking for :slight_smile:

Hello,

Additionally to the Domain defaults settings you could increase the granularity of your setup by having different settings via Account Classes.

Have a nice day,
ioan

Hi,

Currently we run a script for initial configuration, it was not made by me, and the person who made it no longer works for us, but I have modified it some before.

Example of some lines we run:


cli.goto_root_context()
cli.update_domain(domainName)
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET services (smtpIncoming smtpOutgoing webmail)’))

(code, text, resp) = cli.parse_resp(cli.cmdr(‘CONFIG accountDefaultLimits’))
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET welcomeMessageEnabled no’))
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET webmailAttSize 15360’))
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET webmailMessageSize 15360’))
cli.done()

(code, text, resp) = cli.parse_resp(cli.cmdr(‘CONFIG accountDefaultQuotas’))
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET totalMessageSize 30720000’))
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET quotaSendMessageThreshold 99’))
cli.done()
cli.commit()
print ‘Domain %s configured’ % (domainName)


There are more lines in there, but just for example.

Do you know if its possible to set the Mailbox Size, with a Python script?
Like for example:
(code, text, resp) = cli.parse_resp(cli.cmdr(‘SET totalMailboxSize %ByteValueFor30GB%’))

(“totalMailboxSize” pulled from air)

thanks!

Hello Petter,

The command you have mentioned ( SET totalMessageSize 30720000 ) that was issued in the accountDefaultQuotas context is setting 30 GB limit for all accounts from that domain.

In case you like to update a specific account with a different value than you have to “update” the account, go to “quotas” context and set the same parameter (totalMessageSize - the value is in kB).

My recommendation is to get use with the CLI commands by connecting to the Axigen CLI interface like below.

:information_source: Any time you could run help[ so you get a list of the commands available into the current context.

[root@test-001 /tmp]# telnet 127.0.0.1 7000
Welcome to AXIGEN's Command Line Interface
You must login first. For a list of available commands, type HELP
<login> user admin
<password> my-admin-password
For a list of available commands, type HELP
+OK: Authentication successful

<#> update domain be-02
+OK: command successful

<domain#> show
general parameters for the domain: be-02:
appenderText = ""
assignedIP = 0.0.0.0
brandingName = ""
catchAllAccountName = "(none)"
catchAllFolderName = "(none)"
catchAllType = disabled
createUsersFromLdap = no
customerReference = ""
defaultLanguage = "en"
defaultTimeZone = "GMT"
disposableMetadataQuotaThreshold = 25
enableAppender = no
enableGravatar = yes
enableLDAPSync = no
ldapSyncConnectorName = "(none)"
name = "be-02"
publishRcptContacts = yes
services = (smtpIncoming smtpOutgoing pop3 imap webmail)
sharedFoldersNamespace = "Other users' folders"
showWebmailLogin = no

Catch-All Account Status: Disabled
LDAPSync Status: Disabled
LDAPSync L2A Processing Status: Stopped
LDAPSync A2L Processing Status: Stopped
brandingElements = ()

+OK: command successful

HTH,
Ioan

Oh, so we were already doing that…

Got a complaint it wasn’t set on one installation, which was why I started the thread.

But if that’s the setting for the mailbox size, then I’d need to go through some logs or test again in our lab if it’s working as intended.

Thanks

Which way would you suggest for automatic the Axigen Cli configuration?

I want to move away from Python to something simpler :wink:

Hello Peter,

That’s a good question - thanks for bringing this up.

My advice is to use any programming language you / your team are most familiarized with as all you need is to open a “text over TCP” connection to one Axigen CLI listener. Having opened a CLI session you just have to send text commands and parse the generated output.

Beside Python (with cli2.py and run-cli.py examples from here) we have also the PHP CLI API (download from here, docs from here) that it is used by some of our customers for provisioning purposes.

HTH,
Ioan

Seems continue to using Python is our best bet.
I got a basic understanding of how this particular script work now, after running the commands manually in telnet.

Would love some help though.

We modify the Mailbox size with the following commands:

import os,sys
import cli2

if len(sys.argv) < 6:
  print 'Usage: ' + os.path.basename(sys.argv[0]) + ' <axigen_server> <axigen_port> <axigen_admin_password> <domainName> <postmaster_password>'
  sys.exit(99)

axi_server        = sys.argv[1]
axi_cli_port      = int(sys.argv[2])
axi_admin_pass    = sys.argv[3]
axi_admin_user    = 'admin'
domainName        = sys.argv[4]
postmasterPasswd  = sys.argv[5]

try:
  cli = cli2.CLI(axi_server, axi_cli_port)

  cli.auth(axi_admin_pass, axi_admin_user)

# Configure domain
  cli.goto_root_context()
  cli.update_domain(domainName)
  (code, text, resp) = cli.parse_resp(cli.cmdr('CONFIG accountDefaultQuotas'))
  (code, text, resp) = cli.parse_resp(cli.cmdr('SET totalMessageSize 30720000'))
  cli.done()
  cli.commit()
  (code, text, resp) = cli.parse_resp(cli.cmdr('save config'))
  print 'Domain %s configured' % (domainName)

except Exception as e:
  print 'An exception occurred: ' + str(e)

However, I get the following error:
An exception occurred: DONE command failed. Server response: Invalid command

I tried changing:

cli.done()
cli.commit()

for

(code, text, resp) = cli.parse_resp(cli.cmdr('done'))
(code, text, resp) = cli.parse_resp(cli.cmdr('commit'))

but get the same error,

If I type these commands one by one in Telnet, it works.

Telnet 127.0.0.1 7000
<login> user admin
<password> our_password 
                    For a list of available commands, type HELP
                    +OK: Authentication successful
<#> update domain our_domain.com
                    +OK: command successful
<domain#> CONFIG accountDefaultQuotas
                    +OK: command successful
<domain-accountDefaultQuotas#> SET totalMessageSize 30720000
                    +OK: command successful
<domain-accountDefaultQuotas#> done
                    saving changes (if applicable) and switching back to previous context.
                    +OK: command successful
<domain#> commit
                    committing changes and switching back to previous context.

Please advice :slight_smile:

Hello,

The first debugging step should be to set Log level for CLI service to Protocol communication so you could see exactly how the script is running.

Now, I have tested your script (copy & paste from above code box) and did not received any errors (also checked and the intended parameter was updated as desired).

Thus, please re-check again, this time looking into the CLI logs as well.

HTH,
Ioan

PS: +1 for sticking to Python :wink:

I changed the order of when the configuration is done, so that it updates to the latest (tested) version the customer has approved, Before it runs the configuration script.
(previously it installed the base installer, then configured, then updated)

Not sure if it had an impact, but I am not getting any “Invalid command” any more.

The configuration is set now as well, tested changing the value higher and lower and rerunning the script.
So it works again.

Customer will need to do UAT now (Customer Acceptance test)

Thanks for your help

# created by AXIGEN version 10.2.2.75 (Windows/x64)
2020-03-25 12:47:49 +0000 08 V9995Srv1 CLI:0000001B: [127.0.0.1:7000] connection accepted from [127.0.0.1:49504]
2020-03-25 12:47:49 +0000 16 V9995Srv1 CLI:0000001B: >> Welcome to AXIGEN's Command Line Interface
2020-03-25 12:47:49 +0000 16 V9995Srv1 CLI:0000001B: >> You must login first. For a list of available commands, type HELP
2020-03-25 12:47:51 +0000 16 V9995Srv1 CLI:0000001B: << <#> user admin
2020-03-25 12:47:53 +0000 16 V9995Srv1 CLI:0000001B: << PASS ******
2020-03-25 12:47:53 +0000 08 V9995Srv1 CLI:0000001B: Login successful: admin-user 'admin'(id=0x00000000) from 127.0.0.1:49504
2020-03-25 12:47:53 +0000 16 V9995Srv1 CLI:0000001B: >> For a list of available commands, type HELP
2020-03-25 12:47:53 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: Authentication successful
2020-03-25 12:48:02 +0000 16 V9995Srv1 CLI:0000001B: << <#>  update domain our_domain.com
2020-03-25 12:48:02 +0000 02 V9995Srv1 CLI:0000001B: -ERR: the domain with that name/alias does not exist
2020-03-25 12:48:02 +0000 16 V9995Srv1 CLI:0000001B: >> -ERR: the domain with that name/alias does not exist
2020-03-25 12:48:47 +0000 16 V9995Srv1 CLI:0000001B: << <#> update domain our_domain.com
2020-03-25 12:48:47 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: command successful
2020-03-25 12:48:58 +0000 16 V9995Srv1 CLI:0000001B: << <domain#> CONFIG accountDefaultQuotas
2020-03-25 12:48:58 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: command successful
2020-03-25 12:49:03 +0000 16 V9995Srv1 CLI:0000001B: << <domain-accountDefaultQuotas#> SET totalMessageSize 30720000
2020-03-25 12:49:03 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: command successful
2020-03-25 12:49:07 +0000 16 V9995Srv1 CLI:0000001B: << <domain-accountDefaultQuotas#> done
2020-03-25 12:49:07 +0000 16 V9995Srv1 CLI:0000001B: >> saving changes (if applicable) and switching back to previous context.
2020-03-25 12:49:07 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: command successful
2020-03-25 12:49:09 +0000 16 V9995Srv1 CLI:0000001B: << <domain#> commiutt
2020-03-25 12:49:09 +0000 02 V9995Srv1 CLI:0000001B: -ERR: Invalid command
2020-03-25 12:49:09 +0000 16 V9995Srv1 CLI:0000001B: >> -ERR: Invalid command
2020-03-25 12:49:11 +0000 16 V9995Srv1 CLI:0000001B: << <domain#> commit
2020-03-25 12:49:11 +0000 16 V9995Srv1 CLI:0000001B: >> committing changes and switching back to previous context.
2020-03-25 12:49:11 +0000 16 V9995Srv1 CLI:0000001B: >> This operation might take some time. Please wait....
2020-03-25 12:49:11 +0000 08 V9995Srv1 CLI:0000001B: Success: update configuration for domain 'our_domain.com'
2020-03-25 12:49:11 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: command successful
2020-03-25 12:49:16 +0000 16 V9995Srv1 CLI:0000001B: << <#> save config
2020-03-25 12:49:16 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: command successful
2020-03-25 12:49:19 +0000 16 V9995Srv1 CLI:0000001B: << <#> quit
2020-03-25 12:49:19 +0000 16 V9995Srv1 CLI:0000001B: >> WARNING: all changes made and not committed are lost
2020-03-25 12:49:19 +0000 16 V9995Srv1 CLI:0000001B: >> connection to AXIGEN closing.
2020-03-25 12:49:19 +0000 16 V9995Srv1 CLI:0000001B: >> +OK: have a nice day
2020-03-25 12:49:19 +0000 08 V9995Srv1 CLI:0000001B: closing session from [127.0.0.1:49504]
2020-03-25 12:49:19 +0000 08 V9995Srv1 CLI:0000001B: Logout successful : admin-user 'admin'(id=0x00000000) from 127.0.0.1:49504

Above = Manually typing commands
Below = Python script

2020-03-25 12:51:40 +0000 08 V9995Srv1 CLI:0000001C: [127.0.0.1:7000] connection accepted from [127.0.0.1:49554]
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> Welcome to AXIGEN's Command Line Interface
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> You must login first. For a list of available commands, type HELP
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <#> GET VERSION
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> 10.2.2.75 (Windows/x64)
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <#> USER admin
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << PASS ******
2020-03-25 12:51:40 +0000 08 V9995Srv1 CLI:0000001C: Login successful: admin-user 'admin'(id=0x00000000) from 127.0.0.1:49554
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> For a list of available commands, type HELP
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: Authentication successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <#> UPDATE DOMAIN NAME our_domain.com
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <domain#> CONFIG accountDefaultQuotas
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <domain-accountDefaultQuotas#> SET totalMessageSize 30720000
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <domain-accountDefaultQuotas#> DONE
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> saving changes (if applicable) and switching back to previous context.
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <domain#> COMMIT
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> committing changes and switching back to previous context.
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> This operation might take some time. Please wait....
2020-03-25 12:51:40 +0000 08 V9995Srv1 CLI:0000001C: Success: update configuration for domain 'our_domain.com'
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: << <#> save config
2020-03-25 12:51:40 +0000 16 V9995Srv1 CLI:0000001C: >> +OK: command successful
2020-03-25 12:51:41 +0000 08 V9995Srv1 CLI:0000001C: closing session from [127.0.0.1:49554]
2020-03-25 12:51:41 +0000 08 V9995Srv1 CLI:0000001C: Session terminated : admin-user 'admin'(id=0x00000000) from 127.0.0.1:49554

Hello,

Excellent news - in case there are any problems using CLI for provisioning tasks please let us know.

All the best,
Ioan