Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachments are not posted and are not visible in browser message #56

Closed
vmario89 opened this issue Dec 29, 2019 · 6 comments
Closed

Attachments are not posted and are not visible in browser message #56

vmario89 opened this issue Dec 29, 2019 · 6 comments

Comments

@vmario89
Copy link

Hi,
as the title says the attachments are not in place. They are not posted to the Matrix room and are not downloadable from browser. But they are saved under /db/attachments/*.attachment

i tried to modify the views with *.pug extension and rerun npm install. this did not change a thing. then i tried to modify WebHandler.js but i dont know what to do here :-(

regards, Mario

@turt2live
Copy link
Member

Attachments need to be configured:
https://github.com/turt2live/matrix-email-bot/blob/b86fb4b0574a4a77b5854fac94c5eb6fff53fdac/config/default.yaml#L82-L111

They do not show up in the web interface.

@vmario89
Copy link
Author

hi. i know. they are enabled in my configuration:
grafik

so that wont fix the issue :-/

@turt2live
Copy link
Member

Is there anything in the logs?

@vmario89
Copy link
Author

hi. thats the full log for one single mail pushing into mail bot. i guess maybe it stucks posting the attachments into room because it crashes before parsing the body of the mail.

matrix-email-bot.sh[628]: {"level":"info","message":"[WebHandler] _apiPostMessage - POST new message"}
matrix-email-bot.sh[628]: {"level":"info","message":"[WebHandler] _apiPostMessage - Message processed"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] checkMessageNotExists - found message <945461E1CE94090A.1468ae86-4833-49ca-9566-fde94d4f9720@mail.asd.com>? false"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Processing message from [email protected] (sent to 1 targets)"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfigsForTarget - Start lookup for [email protected] source: to"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfig - Lookup !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfigsForTarget - Found 1 configurations"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfigsForTarget - Checking cc, bcc, and to for [email protected]"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfigForTarget - Sender allowed, returning 1 configs"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Processing room config for room: !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Performing antispam checks"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Spam score is within threshold: undefined < -1"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] DKIM check passed (enabled = false)"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] SPF check passed (enabled = false)"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Message passed room's antispam measures"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Room is set to allow mail from anyone: !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Found 1 valid attachments"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] prepareMessage - creating for message ID <945461E1CE94090A.1468ae86-4833-49ca-9566-fde94d4f9720@mail.asd.com>"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] writeMessage - Starting write for <945461E1CE94090A.1468ae86-4833-49ca-9566-fde94d4f9720@mail.asd.com>"}
matrix-email-bot.sh[628]: {"level":"info","message":"[MatrixHandler] Posting attachment 'undefined' to room !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfig - Lookup !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[MatrixHandler] Uploading attachment 'undefined' to room !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: Returning the raw JSON from uploadContent(). Future versions of the js-sdk will change this default, to return the parsed object. Set opts.rawResponse=false to change this behaviour now.
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] writeMessage - Message written (true): 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5 (<945461E1CE94090A.1468ae86-4833-49ca-9566-fde94d4f9720@mail.asd.com>)"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] getMessage - Fetch 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] getMessage - Found 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5? true"}
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Message saved. Id = 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[628]: {"level":"info","message":"[utils] getRoomConfig - Lookup !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[MatrixHandler] Preparing HTML message for room !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: {"level":"info","message":"[MatrixHandler] Sending message to room !XXXXredacted:matrix.REDACTED.de"}
matrix-email-bot.sh[628]: sendEvent of type m.room.message in !XXXXredacted:matrix.REDACTED.de with txnId m1577664341725.0
matrix-email-bot.sh[628]: {"level":"info","message":"[EmailHandler] Linking undefined to message 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] saveAttachment - Starting write for undefined"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] saveAttachment - Attachment written to file: db/attachments/67dfd81f-f8e3-483d-85d8-9f6e833d123c.attachment"}
matrix-email-bot.sh[628]: {"level":"info","message":"[DataStore] saveAttachment - Attachment saved to DB (true: 67dfd81f-f8e3-483d-85d8-9f6e833d123c to message 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[628]: {"level":"info","message":"[MatrixHandler] Got MXC URL for 'undefined': {\"content_uri\":\"mxc://matrix.REDACTED.de/ShjXKewFOYyYKDPsYtzZEOrN\"}"}
matrix-email-bot.sh[628]: {"level":"info","message":"[MatrixHandler] Posting attachment 'undefined' to room !XXXXredacted:matrix.REDACTED.de as event type m.file"}
matrix-email-bot.sh[628]: sendEvent of type m.room.message in !XXXXredacted:matrix.REDACTED.de with txnId m1577664341792.1
matrix-email-bot.sh[628]: setting pendingEvent status to queued in !XXXXredacted:matrix.REDACTED.de
matrix-email-bot.sh[628]: Event sent to !XXXXredacted:matrix.REDACTED.de with event id $3vZN8mrns09-FLzVmAjQRRqinwivEYcNme4Um8Gcs-o
matrix-email-bot.sh[628]: setting pendingEvent status to sending in !XXXXredacted:matrix.REDACTED.de
matrix-email-bot.sh[628]: setting pendingEvent status to sent in !XXXXredacted:matrix.REDACTED.de
matrix-email-bot.sh[628]: Error sending event { [M_UNKNOWN: 'body' not in content]
matrix-email-bot.sh[628]:   errcode: 'M_UNKNOWN',
matrix-email-bot.sh[628]:   name: 'M_UNKNOWN',
matrix-email-bot.sh[628]:   message: '\'body\' not in content',
matrix-email-bot.sh[628]:   data: { errcode: 'M_UNKNOWN', error: '\'body\' not in content' },
matrix-email-bot.sh[628]:   httpStatus: 400 }
matrix-email-bot.sh[628]: setting pendingEvent status to not_sent in !XXXXredacted:matrix.REDACTED.de
matrix-email-bot.sh[628]: [ERROR] { [M_UNKNOWN: 'body' not in content]
matrix-email-bot.sh[628]:   errcode: 'M_UNKNOWN',
matrix-email-bot.sh[628]:   name: 'M_UNKNOWN',
matrix-email-bot.sh[628]:   message: '\'body\' not in content',
matrix-email-bot.sh[628]:   data: { errcode: 'M_UNKNOWN', error: '\'body\' not in content' },
matrix-email-bot.sh[628]:   httpStatus: 400,
matrix-email-bot.sh[628]:   event:
matrix-email-bot.sh[628]:    MatrixEvent {
matrix-email-bot.sh[628]:      event:
matrix-email-bot.sh[628]:       { event_id:
matrix-email-bot.sh[628]:          '~!XXXXredacted:matrix.REDACTED.de:m1577664341792.1',
matrix-email-bot.sh[628]:         user_id: '@mailbot:matrix.REDACTED.de',
matrix-email-bot.sh[628]:         room_id: '!XXXXredacted:matrix.REDACTED.de',
matrix-email-bot.sh[628]:         type: 'm.room.message',
matrix-email-bot.sh[628]:         origin_server_ts: 1577664341792,
matrix-email-bot.sh[628]:         content: [Object] },
matrix-email-bot.sh[628]:      sender:
matrix-email-bot.sh[628]:       RoomMember {
matrix-email-bot.sh[628]:         roomId: '!XXXXredacted:matrix.REDACTED.de',
matrix-email-bot.sh[628]:         userId: '@mailbot:matrix.REDACTED.de',
matrix-email-bot.sh[628]:         typing: false,
matrix-email-bot.sh[628]:         name: '@mailbot:matrix.REDACTED.de',
matrix-email-bot.sh[628]:         rawDisplayName: '@mailbot:matrix.REDACTED.de',
matrix-email-bot.sh[628]:         powerLevel: 0,
matrix-email-bot.sh[628]:         powerLevelNorm: 0,
matrix-email-bot.sh[628]:         user: null,
matrix-email-bot.sh[628]:         membership: 'join',
matrix-email-bot.sh[628]:         events: [Object],
matrix-email-bot.sh[628]:         _isOutOfBand: false,
matrix-email-bot.sh[628]:         _modified: 1577635427595 },
matrix-email-bot.sh[628]:      target: null,
matrix-email-bot.sh[628]:      status: 'not_sent',
matrix-email-bot.sh[628]:      error: [Circular],
matrix-email-bot.sh[628]:      forwardLooking: true,
matrix-email-bot.sh[628]:      _pushActions: null,
matrix-email-bot.sh[628]:      _replacingEvent: null,
matrix-email-bot.sh[628]:      _clearEvent: {},
matrix-email-bot.sh[628]:      _senderCurve25519Key: null,
matrix-email-bot.sh[628]:      _claimedEd25519Key: null,
matrix-email-bot.sh[628]:      _forwardingCurve25519KeyChain: [],
matrix-email-bot.sh[628]:      _decryptionPromise: null,
matrix-email-bot.sh[628]:      _retryDecryption: false,
matrix-email-bot.sh[628]:      _txnId: 'm1577664341792.1' } }
snoopy[28943]: [uid:991 sid:28943 tty:(none) cwd:/opt/matrix-bridges/matrix-email-bot filename:/opt/matrix-bridges/matrix-email-bot/matrix-email-bot.sh]: /opt/matrix-bridges/matrix-email-bot/matrix-email-bot.sh stop
snoopy[28944]: [uid:991 sid:28943 tty:(none) cwd:/opt/matrix-bridges/matrix-email-bot filename:/usr/bin/lsof]: lsof -i tcp:1802
snoopy[28946]: [uid:991 sid:28943 tty:(none) cwd:/opt/matrix-bridges/matrix-email-bot filename:/usr/bin/xargs]: xargs kill -9
snoopy[28945]: [uid:991 sid:28943 tty:(none) cwd:/opt/matrix-bridges/matrix-email-bot filename:/usr/bin/awk]: awk NR!=1 {print $2}
snoopy[28950]: [uid:991 sid:28950 tty:(none) cwd:/opt/matrix-bridges/matrix-email-bot filename:/opt/matrix-bridges/matrix-email-bot/matrix-email-bot.sh]: /opt/matrix-bridges/matrix-email-bot/matrix-email-bot.sh start
snoopy[28951]: [uid:991 sid:28950 tty:(none) cwd:/opt/matrix-bridges/matrix-email-bot filename:/usr/bin/node]: node index.js
matrix-email-bot.sh[28950]: {"level":"info","message":"[index] Creating and preparing database"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] Starting migration"}
matrix-email-bot.sh[28950]: [INFO] No migrations to run
matrix-email-bot.sh[28950]: [INFO] Done
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] Migrated up"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[index] Starting matrix handler"}
matrix-email-bot.sh[28950]: Getting saved sync token...
matrix-email-bot.sh[28950]: Getting push rules...
matrix-email-bot.sh[28950]: {"level":"info","message":"[index] Starting email handler"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[index] Starting web handler"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[WebHandler] Listening on 0.0.0.0:1802"}
matrix-email-bot.sh[28950]: Got saved sync token
matrix-email-bot.sh[28950]: Getting saved sync...
matrix-email-bot.sh[28950]: Got reply from saved sync, exists? false
matrix-email-bot.sh[28950]: Got push rules
matrix-email-bot.sh[28950]: Checking lazy load status...
matrix-email-bot.sh[28950]: Checking whether lazy loading has changed in store...
matrix-email-bot.sh[28950]: Storing client options...
matrix-email-bot.sh[28950]: Stored client options
matrix-email-bot.sh[28950]: Getting filter...
matrix-email-bot.sh[28950]: Sending first sync request...
matrix-email-bot.sh[28950]: Waiting for saved sync before starting sync processing...
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Updating room list"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Currently in 1 rooms"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Updating room list"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Currently in 2 rooms"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Updating room list"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Currently in 3 rooms"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Updating room list"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Currently in 4 rooms"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Updating room list"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[MatrixHandler - _updateRoomList] Currently in 4 rooms"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[WebHandler] _renderMessage - Get 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] getMessage - Fetch 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[WebHandler] _renderMessage - Get 71d2bd25-d71a-4e82-8ae5-50fbef71a19c"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] getMessage - Fetch 71d2bd25-d71a-4e82-8ae5-50fbef71a19c"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] getMessage - Found 71d2bd25-d71a-4e82-8ae5-50fbef71a19c? false"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] getMessage - Found 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5? true"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[WebHandler] _renderMessage - Get 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] getMessage - Fetch 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5"}
Dez 30 01:05:54 h2606131.stratoserver.net matrix-email-bot.sh[28950]: {"level":"info","message":"[DataStore] getMessage - Found 544d2db9-fa08-40ea-b3b1-25eaa3dbc2f5? true"}


@turt2live
Copy link
Member

Yea, it's crashing before it can send anything. Looks like it might be #54 of sorts?

@vmario89
Copy link
Author

hi, yes indeed. so its fine that you closed this issue due to duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants