Giter Site home page Giter Site logo

derjd / python-mailcow Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 3.0 62 KB

Python wrapper interacting with MailCow API

Home Page: https://der-jd.de/python-mailcow/intro/

License: GNU General Public License v3.0

Python 98.92% Makefile 1.08%
api mailcow python

python-mailcow's People

Contributors

derjd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-mailcow's Issues

Howto: I want to get aplain list with all domain names

Ubuntu: 20.04
Python: 3.8
Version: fresh git+https://github.com./derJD/python-mailcow.git (python-mailcow-1.0.5.dev4+g802abec)

Imho I was trying:
mailcow domain get --all --fields 'domain_name'
expecting to receive a list with all domain names only.
The result is :

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/prettytable/prettytable.py", line 353, in _validate_field_name
    assert (val in self._field_names) or (val is None)
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/sbin/mailcow", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/mailcow/cli.py", line 86, in main
    print(table.get_string(fields=fields))
  File "/usr/local/lib/python3.8/dist-packages/prettytable/prettytable.py", line 1130, in get_string
    options = self._get_options(kwargs)
  File "/usr/local/lib/python3.8/dist-packages/prettytable/prettytable.py", line 846, in _get_options
    self._validate_option(option, kwargs[option])
  File "/usr/local/lib/python3.8/dist-packages/prettytable/prettytable.py", line 246, in _validate_option
    self._validate_all_field_names(option, val)
  File "/usr/local/lib/python3.8/dist-packages/prettytable/prettytable.py", line 360, in _validate_all_field_names
    self._validate_field_name(name, x)
  File "/usr/local/lib/python3.8/dist-packages/prettytable/prettytable.py", line 355, in _validate_field_name
    raise Exception("Invalid field name: %s!" % val)
Exception: Invalid field name: d!

What is the expectation of the --fields parameter?

AttributeError: 'bytes' object has no attribute 'keys'

mailcow alias get --all
Traceback (most recent call last):
File "/home/phil/mailcowpython/bin/mailcow", line 8, in
sys.exit(main())
File "/home/phil/mailcowpython/lib/python3.9/site-packages/mailcow/cli.py", line 78, in main
tables = moo.as_table(vertical=args.vertical)
File "/home/phil/mailcowpython/lib/python3.9/site-packages/mailcow/init.py", line 251, in as_table
table.field_names = data.keys()
AttributeError: 'bytes' object has no attribute 'keys'

Commandline arguments for syncjob add parsed correctly?

Hello,

Are the commandline arguments for the "syncjob add" parsed correctly from API?
See below the arguments.

Shoudn't there be something like: user1, passwort1? or how can I define creds for source mailbox? and target mailbox should be "--username" and not "--parameters".

was mache ich da falsch?

thanks

mfg
Thomas


mailcow syncjob add --help
usage: mailcow syncjob add [-h] [--parameters PARAMETERS] [--host1 HOST1]
                           [--port1 PORT1] [--password PASSWORD] [--enc1 ENC1]
                           [--mins_internal MINS_INTERNAL]
                           [--subfolder2 SUBFOLDER2] [--maxage MAXAGE]
                           [--maxbytespersecond MAXBYTESPERSECOND]
                           [--timeout1 TIMEOUT1] [--timeout2 TIMEOUT2]
                           [--exclude EXCLUDE] [--custom_params CUSTOM_PARAMS]
                           [--delete2duplicates] [--delete1] [--delete2]
                           [--automap] [--skipcrossduplicates]
                           [--subscribeall] [--active]

optional arguments:
  -h, --help            show this help message and exit
  --parameters PARAMETERS
                        your local mailcow mailbox
  --host1 HOST1         the smtp server where mails should be synced from
  --port1 PORT1         the smtp port of the target mail server
  --password PASSWORD   the password of the mailbox
  --enc1 ENC1           the encryption method used to connect to the
                        mailserver
  --mins_internal MINS_INTERNAL
                        the interval in which messages should be syned
  --subfolder2 SUBFOLDER2
                        sync into subfolder on destination (empty = do not use
                        subfolder)
  --maxage MAXAGE       only sync messages up to this age in days
  --maxbytespersecond MAXBYTESPERSECOND
                        max speed transfer limit for the sync
  --timeout1 TIMEOUT1   timeout for connection to remote host
  --timeout2 TIMEOUT2   timeout for connection to local host
  --exclude EXCLUDE     exclude objects (regex)
  --custom_params CUSTOM_PARAMS
                        custom parameters
  --delete2duplicates, --no-delete2duplicates
                        delete duplicates on destination (--delete2duplicates)
  --delete1, --no-delete1
                        delete from source when completed (--delete1)
  --delete2, --no-delete2
                        delete messages on destination that are not on source
                        (--delete2)
  --automap, --no-automap
                        try to automap folders ("Sent items", "Sent" => "Sent"
                        etc.) (--automap)
  --skipcrossduplicates, --no-skipcrossduplicates
                        skip duplicate messages across folders (first come,
                        first serve) (--skipcrossduplicates)
  --subscribeall, --no-subscribeall
                        subscribe all folders (--subscribeall)
  --active, --no-active
                        enables or disables the sync job


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.