IMAP Access failed with encryption problems - self-hosted

Hi,
I have the following problem not using gmail:

I am implementing a IMAP-Piece while defining the connection I get the following error in Logs of active-pieces container:
If I don’t use TLS - I get an GreetingTimeout

If I am using TLS - I get an Internal Connection Error
image

In Logs I see:

What KEY_LENTGH active pieces want’s to have?

I am using Traefik as reverse proxy. But there ports are not shown in traefik.log, so it seems to be the communication from outside mail-server.

2024/06/18 01:56PM 30 pid=8 hostname=d78280f5825b reqId=req-eu req={“method”:“POST”,“url”:“/v1/app-connections”,“hostname”:“ap.cloudservice.gmbh”,“remoteAddress”:“127.0.0.1”,“remotePort”:43714} msg=incoming request
2024/06/18 01:56PM 30 pid=8 hostname=d78280f5825b msg=sandbox, command: cd /usr/src/app/dist/packages/server/api/sandbox/0 && cross-env-shell AP_CODE_SANDBOX_TYPE=NO_OP AP_PIECES_SOURCE=CLOUD_AND_DB NODE_OPTIONS=–enable-source-maps “/usr/local/bin/node” main.js EXECUTE_VALIDATE_AUTH
2024/06/18 01:56PM 50 pid=8 hostname=d78280f5825b msg=[errorHandler]: {“code”:“ERR_CRYPTO_INVALID_KEYLEN”}
2024/06/18 01:56PM 50 pid=8 hostname=d78280f5825b err={“type”:“RangeError”,“message”:“Invalid key length”,“stack”:“RangeError: Invalid key length\n at Cipheriv.createCipherBase (node:internal/crypto/cipher:122:19)\n at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:141:3)\n at new Cipheriv (node:internal/crypto/cipher:249:3)\n at Object.createCipheriv (node:crypto:141:10)\n at E (/usr/src/app/dist/packages/server/api/main.js:1:163792)\n at t.encryptObject (/usr/src/app/dist/packages/server/api/main.js:1:163953)\n at Object. (/usr/src/app/dist/packages/server/api/main.js:1:855046)\n at Generator.next ()\n at fulfilled (/usr/src/app/dist/packages/server/api/node_modules/tslib/tslib.js:166:62)”,“code”:“ERR_CRYPTO_INVALID_KEYLEN”} msg=Invalid key length
2024/06/18 01:56PM 50 pid=8 hostname=d78280f5825b reqId=req-eu req={“method”:“POST”,“url”:“/v1/app-connections”,“hostname”:“ap.cloudservice.gmbh”,“remoteAddress”:“127.0.0.1”,“remotePort”:43714} res={“statusCode”:500} err={“type”:“RangeError”,“message”:“Invalid key length”,“stack”:“RangeError: Invalid key length\n at Cipheriv.createCipherBase (node:internal/crypto/cipher:122:19)\n at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:141:3)\n at new Cipheriv (node:internal/crypto/cipher:249:3)\n at Object.createCipheriv (node:crypto:141:10)\n at E (/usr/src/app/dist/packages/server/api/main.js:1:163792)\n at t.encryptObject (/usr/src/app/dist/packages/server/api/main.js:1:163953)\n at Object. (/usr/src/app/dist/packages/server/api/main.js:1:855046)\n at Generator.next ()\n at fulfilled (/usr/src/app/dist/packages/server/api/node_modules/tslib/tslib.js:166:62)”,“code”:“ERR_CRYPTO_INVALID_KEYLEN”} msg=Invalid key length
2024/06/18 01:56PM 30 pid=8 hostname=d78280f5825b reqId=req-eu res={“statusCode”:500} responseTime=2931.3345909118652 msg=request completed

If I am doing this on activepieces.com - It works fine
Greetings Bastian

OK - I did try to get the newest 0.27 version @ ghcr.io
After that - I did build via dockerbuild

After that - I did setup activepieces on a totally different machine.

Same problem

Hi @b.g.epting

Do you have AP_ENCRYPTION key defined in the environment variable?

Yes - I did define AP_ENCRYPTION, but with a wrong lentgh (more than 32 HEX Numbers)
Changing to 32 Hex Numbers solved the problem.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.