[GH-ISSUE #1642] Unable to run check_mx and generate_postfix_maps #1293

Closed
opened 2026-02-27 11:16:21 +03:00 by kerem · 4 comments
Owner

Originally created by @CTDragon on GitHub (Dec 28, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1642

Impacted versions

  • Modoboa: 1.13.0
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

Upgraded from 1.11.0
check_mx was not working
running manually: python /srv/modoboa/instance/manage.py modo check_mx
produces error: Value too long for type character varying(50)
image

Found this.. not sure if it helps
https://stackoverflow.com/questions/9036102/databaseerror-value-too-long-for-type-character-varying100

tried to run optional upgrade step python manage.py generate_postfix_maps --destdir
permissions issues with modoboa
image

ran as root instead
Exits with error: Cannot upgrade 'sql-domains.cf' map because it has been modified.
image

ran as root again
Exits with error: ValueError: too many values to unpack
image

(TRACKED THIS DOWN)
Remedied the offending value from /etc/postfix/modoboa-postfix-maps.chk
image

ran as root again
Same 2 errors. Stuck in a loop trying to run this

Current behavior

Can't run the following two commands without errors
python /srv/modoboa/instance/manage.py modo check_mx
python manage.py generate_postfix_maps --destdir

Expected behavior

Video/Screenshot link (optional)

image

Originally created by @CTDragon on GitHub (Dec 28, 2018). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1642 # Impacted versions * Modoboa: 1.13.0 * installer used: Yes * Webserver: Nginx # Steps to reproduce Upgraded from 1.11.0 check_mx was not working running manually: python /srv/modoboa/instance/manage.py modo check_mx produces error: Value too long for type character varying(50) ![image](https://user-images.githubusercontent.com/5723697/50503133-80f9ae00-0a32-11e9-8214-af908686611c.png) Found this.. not sure if it helps https://stackoverflow.com/questions/9036102/databaseerror-value-too-long-for-type-character-varying100 tried to run optional upgrade step python manage.py generate_postfix_maps --destdir <directory> permissions issues with modoboa ![image](https://user-images.githubusercontent.com/5723697/50503143-94a51480-0a32-11e9-99c8-52c727125722.png) ran as root instead Exits with error: Cannot upgrade 'sql-domains.cf' map because it has been modified. ![image](https://user-images.githubusercontent.com/5723697/50503157-b2727980-0a32-11e9-8b4f-9b5e2b66e2e6.png) ran as root again Exits with error: ValueError: too many values to unpack ![image](https://user-images.githubusercontent.com/5723697/50503172-e6e63580-0a32-11e9-865c-cc14e81ac4a8.png) (TRACKED THIS DOWN) Remedied the offending value from /etc/postfix/modoboa-postfix-maps.chk ![image](https://user-images.githubusercontent.com/5723697/50503077-26605200-0a32-11e9-8312-3cc6eeab6a9f.png) ran as root again Same 2 errors. Stuck in a loop trying to run this # Current behavior Can't run the following two commands without errors python /srv/modoboa/instance/manage.py modo check_mx python manage.py generate_postfix_maps --destdir <directory> # Expected behavior # Video/Screenshot link (optional) ![image](https://user-images.githubusercontent.com/5723697/50503077-26605200-0a32-11e9-8312-3cc6eeab6a9f.png)
kerem 2026-02-27 11:16:21 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@CTDragon commented on GitHub (Dec 28, 2018):

As for the check dns issue... could this be because I have 4096 key length and that's too long for the parameter? It seemed to get all the way to dkim on the first one it checked

image

<!-- gh-comment-id:450290837 --> @CTDragon commented on GitHub (Dec 28, 2018): As for the check dns issue... could this be because I have 4096 key length and that's too long for the parameter? It seemed to get all the way to dkim on the first one it checked ![image](https://user-images.githubusercontent.com/5723697/50503333-54469600-0a34-11e9-9633-98c8a73ede0b.png)
Author
Owner

@tonioo commented on GitHub (Jan 2, 2019):

@CTDragon Looks like one of the database fields is too short, I need to find which one.
About map files, have you tried to delete the .chk file and add the --force option to the command line?

<!-- gh-comment-id:450803219 --> @tonioo commented on GitHub (Jan 2, 2019): @CTDragon Looks like one of the database fields is too short, I need to find which one. About map files, have you tried to delete the .chk file and add the --force option to the command line?
Author
Owner

@ghost commented on GitHub (Jan 4, 2019):

@tonioo fyi the problem is the field error in dnstools_dnsrecord
the error that you try to store (can?) have the complete record as content, so in case of dkim the error can be something like
"Invalid tag p=MIICIjA.......[rest of the key]"

<!-- gh-comment-id:451415137 --> @ghost commented on GitHub (Jan 4, 2019): @tonioo fyi the problem is the field error in dnstools_dnsrecord the error that you try to store (can?) have the complete record as content, so in case of dkim the error can be something like "Invalid tag p=MIICIjA.......[rest of the key]"
Author
Owner

@ghost commented on GitHub (Jan 4, 2019):

@tonioo The other problem (which causes the Invalid tag error in the dkim check) is in the check if the dkim key is valid.
in modoboa/dnstools/lib.py:203
You split the key value pair on '=' and check if you have 2 parts.. But the dkim key is base64 encoded and ends with == (so the check fails)

(I'm sorry, at the moment it's not possible for me to create a patch for these problems)

<!-- gh-comment-id:451437518 --> @ghost commented on GitHub (Jan 4, 2019): @tonioo The other problem (which causes the Invalid tag error in the dkim check) is in the check if the dkim key is valid. in modoboa/dnstools/lib.py:203 You split the key value pair on '=' and check if you have 2 parts.. But the dkim key is base64 encoded and ends with == (so the check fails) (I'm sorry, at the moment it's not possible for me to create a patch for these problems)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1293
No description provided.