modoboa / modoboa-dmarc

A set of tools to use DMARC through Modoboa.
MIT License
15 stars 11 forks source link

Problem with the import_aggregated_report method in the DMARC module #43

Closed nsabatelli closed 3 years ago

nsabatelli commented 4 years ago

Hello, using the command

_/bin/python3 /var/www/html/modoboa_ct/manage.py import_aggregatedreport --imap --host xxxx --ssl

i get the following error

_Traceback (most recent call last): File "/var/www/html/modoboa_ct/manage.py", line 21, in main () File "/var/www/html/modoboa_ct/manage.py", line 17, in main execute_from_command_line (sys.argv) File "/usr/lib/python3.6/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute () File "/usr/lib/python3.6/site-packages/django/core/management/init.py", line 375, in execute self.fetch_command (subcommand) .run_from_argv (self.argv) File "/usr/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute (* args, * cmd_options) File "/usr/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute output = self.handle ( args, ** options) File "/usr/lib/python3.6/site-packages/modoboa_dmarc/management/commands/import_aggregated_report.py", line 38, in handle lib.import_from_imap (options) File "/usr/lib/python3.6/site-packages/modoboa_dmarc/lib.py", line 184, in import_from_imap username = raw_input ("Username:") NameError: name 'rawinput' is not defined

in fact the _rawinput() method is no longer available in python3 and has been replaced by the input() method. So, replacing line 184 of the _/usr/lib/python3.6/site-packages/modoboadmarc/lib.py library the command

_username = rawinput("Username:") with username = input("Username:")

the _import_aggregatedreport procedure of the DMARC module returns to work correctly.

Hope this helps fix the bug.

Nicola