t2bot / matrix-email-bot Goto Github PK
View Code? Open in Web Editor NEWA bot that posts messages to rooms when an email is received.
License: Apache License 2.0
A bot that posts messages to rooms when an email is received.
License: Apache License 2.0
Eg: $id $id $id
ends up being 1234 $id $id
The whole email message should be just posted in the room and not logged on the bot-server.
This should be default and maybe add an option to store the emails on the bot server instead and just post a link there in the room (like now)
Using post_message.js from a postfix mailserver via pipe produces the following error:
WARNING: No configurations found in configuration directory:/etc/postfix/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
post_message Using stdin as email source
/opt/email-bot/node_modules/config/lib/config.js:182
throw new Error('Configuration property "' + property + '" is not defined');
^
Error: Configuration property "web.port" is not defined
at Config.get (/opt/email-bot/node_modules/config/lib/config.js:182:11)
at postMessage (/opt/email-bot/post_message.js:40:43)
at Socket.<anonymous> (/opt/email-bot/post_message.js:23:9)
at Socket.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
I tried hardcoding process.env.NODE_ENV = 'production';
which did not help (no idea how to set the env variable via postfix).
Postfix is configured as in https://serverfault.com/a/258491/209089 and in /etc/postfix/master.cf
:
matrixemailbot unix - n n - - pipe
flags=FR user=email-bot argv=/usr/bin/node /opt/email-bot/post_message.js
Some emails may be plaintext only (mailman, etc). Receiving an HTML email would represent some bad behaviour.
Possible option per-room to set "plain text only" - disregard any HTML email.
Still maintain the own mailserver support, and external push support. This would just be a built-in receiver method.
Branch | Build failing π¨ |
---|---|
Dependency | matrix-js-sdk |
Current Version | 0.7.7 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
matrix-js-sdk is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
The new version differs by 31 commits.
3c81c29
v0.7.8
56dfa0c
Prepare changelog for v0.7.8
8c37d9a
v0.7.8-rc.1
e40b846
Prepare changelog for v0.7.8-rc.1
a3f45b4
Merge pull request #438 from matrix-org/rav/release_signing
672ad68
release.sh: download the tarball from git to verify it
4ccec13
Fix build: move uglifyjs dep to uglify-js
92cfbf6
Merge pull request #427 from t3chguy/electron_media_select
fbef701
Merge pull request #434 from t3chguy/t3chguy/screen_share_firefox
0415b9c
make screen sharing call FF friendly :D
cb9a9e8
Implement API for username availability (#432)
6021c1c
Merge pull request #431 from matrix-org/rav/fix_device_list_yet_again
655be2f
Fix race in device list updates
98491a6
ability to specify webrtc audio/video inputs for the lib to request
acd7f15
Merge pull request #424 from matrix-org/rob/nocam
There are 31 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Possibly by using the matrix-bot-sdk
For masking. Do something like matrix? ie: some...@one...
In case there are confidential Information in the email it would be welcome to have a delete buton there once you have read the email
Only appears to apply when using $text_body
in an HTML message
For rooms bridged to IRC, 'Click here to view' is not very helpful. Possibly some heuristic to determine if the text should be a link instead? Or just a 'plain text' message format for the message
Now that we track the target room ID, we should give the option of displaying a banner with information (and #5's delete button).
Example:
banner_options: {
show_from: true,
show_subject: true,
show_timestamp: true,
show_delete: true
}
... and probably other options.
A better view system is probably needed to accomplish this task.
It would help if the main mail is in a separate post than the quoted part and separate from an email-footer
this way you could tidy up the matrix room with the redact buttons from duplicate quoted texts and footers if needed
.travis.yml
Spam messages shouldn't be sent to rooms.
Should we notify the room admins of the spam? Config flag? Option to approve message?
Hi, i installed this as service and it works now as i want - but at the moment only for one mailbox.
i try to setup more mail feeds using more mailboxes (to pipe different feed sources to different rooms - each having an email notifier user).
for having a cleaner mailbox system i thought about using a central feeding mailbox and some aliases for different use (feeds) to avoid creating completely new mailbox for each feed. instead i just like to use one mailbox with those aliases and some sub folders (and some sieve filters).
i checked this out really hard but it seems that this is just not supported. matrix-email-bot ignores them in configuration. is there any config switch to enable this or could this be a useful enhancement maybe?
regards, Mario
This is related to #1.
Currently mailing lists require manual intervention (and a postfix server) to subscribe. It would be nice if people could subscribe on their own without having to go through the server administrator.
Note: There is a gotcha to having this: Mailing lists tend to lowercase the email. So an email for the room !AAAbbbbCCC:domain.com
could come back to [email protected]
instead of [email protected]
- a custom mapping can be set up to combat this, however. The bot should check for duplicate targets for the rare case of room IDs colliding when using lowercase versions.
Emails and names redacted for privacy.
[ Fragment {
_content: '',
_isHidden: true,
_isSignature: false,
_isQuoted: false },
Fragment {
_content: 'From: Tom <tom@redacted>\nSubject: Re: [LIST] Subject line\nDate: Tue, 11 Jul 2017 21:43:36 GMT\nTo: Mailing List <list@redacted>\n\nwut\n',
_isHidden: true,
_isSignature: false,
_isQuoted: true },
Fragment {
_content: 'On Tue, Jul 11, 2017 at 11:43 PM, Tom <tom@redacted> wrote:\n\n> always be knolling!\n>\n> On Tue, Jul 11, 2017 at 11:40 PM, Fred <\n> list@redacted> wrote:\n>\n>> _______________________________________________\n>> LIST mailing list\n>> list@redacted\n>> https://link/to/list\n>>\n>>\n>> ---------- Forwarded message ----------\n>> From: Fred <list@elsewhere>\n>> To: Mailing List <list@redacted>\n>> Cc:\n>> Bcc:\n>> Date: Tue, 11 Jul 2017 23:41:52 +0200\n>> Subject: Subject line\n>>\n>> We had some e-mail issues lately, mostly due to misconfiguration.\n>>\n>> If any list email lands in your spam folder, please report it.\n>>\n>> Thanks.\n>>\n>>\n>',
_isHidden: true,
_isSignature: false,
_isQuoted: true },
Fragment {
_content: '',
_isHidden: true,
_isSignature: false,
_isQuoted: false },
Fragment {
_content: '_______________________________________________\n LIST mailing list\nlist@redacted\nhttps://link/to/list\n',
_isHidden: true,
_isSignature: true,
_isQuoted: false } ]
Here's what the email bot got:
Full .eml available in private location.
Email forwarding doesn't always reset the to
header, so the bot receives it from some random address. Should check to see if there is another header we can use to parse the room name.
Also should probably have this option behind a config flag: allow_forwards
/redirects
The bot doesn't read the CC/BCC headers to determine if the email should still be posted. Mailman (and similar applications) use these headers to ensure that people end up replying to the thread instead of no where, so we should optionally check these fields as well.
Add room settings (with defaults):
check_cc
true/false (default true)check_bcc
true/false (default true)There isn't enough information in the email to process the message. This might require some weird calculation to determine the source and map that to a room somehow. Case observed was a To
of the sender's email address and a From
of the sender's other address. Might be a forwarding issue?
Automatically download and save attachments.
If skip_db
is enabled, don't download attachments unless send_attachments_to_room
is enabled. If skip_db
is disabled and send_attachments_to_room
is disabled, only store file names.
Attachments should be accessible in the web banner described in #6 (add option for show_attachments
).
this should be configurable in the config file in case allow all is set
Hi,
Very interesting project!
Was wondering if you had considered making it load via a shell, providing some sort of executable that would get the email on stdin... If you're already running a mail server, it might make it far easier to set up than the current model of listening on port 25.
I can think of several ways this might be used:
... this last bit would be most interesting, then you could set up a Sieve rule to forward to a Matrix room based on the email contents...
An email was sent to 3 rooms via 3 email addresses, and only one of the rooms received the message. This may be related to #19, although instead of 1 address for 3 rooms, it was 3 addresses for 3 rooms.
Hi,
pushing emails without html body like "echo -e "ok" | mail -s "[email protected]" [email protected]" are going to be empty in Matrix
As you can see the content is not the plaintext, instead it's just "zero" - both on chat and on the browser message
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
Hi, i checked different email feedings now and one of them killed the bridge because its html is malformed. I think the bridge should handle to overlook html rendering issues to be stable enough
REDACTED-email-bot.sh[8036]: Error sending event { [M_UNKNOWN: 'body' not in content]
REDACTED-email-bot.sh[8036]: errcode: 'M_UNKNOWN',
REDACTED-email-bot.sh[8036]: name: 'M_UNKNOWN',
REDACTED-email-bot.sh[8036]: message: '\'body\' not in content',
REDACTED-email-bot.sh[8036]: data: { errcode: 'M_UNKNOWN', error: '\'body\' not in content' },
REDACTED-email-bot.sh[8036]: httpStatus: 400 }
REDACTED-email-bot.sh[8036]: setting pendingEvent status to not_sent in !REDACTED:REDACTED.REDACTED.de
REDACTED-email-bot.sh[8036]: [ERROR] { [M_UNKNOWN: 'body' not in content]
REDACTED-email-bot.sh[8036]: errcode: 'M_UNKNOWN',
REDACTED-email-bot.sh[8036]: name: 'M_UNKNOWN',
REDACTED-email-bot.sh[8036]: message: '\'body\' not in content',
REDACTED-email-bot.sh[8036]: data: { errcode: 'M_UNKNOWN', error: '\'body\' not in content' },
REDACTED-email-bot.sh[8036]: httpStatus: 400,
REDACTED-email-bot.sh[8036]: event:
REDACTED-email-bot.sh[8036]: REDACTEDEvent {
REDACTED-email-bot.sh[8036]: event:
REDACTED-email-bot.sh[8036]: { event_id:
REDACTED-email-bot.sh[8036]: '~!REDACTED:REDACTED.REDACTED.de:m1577622812018.39',
REDACTED-email-bot.sh[8036]: user_id: '@REDACTED:REDACTED.REDACTED.de',
REDACTED-email-bot.sh[8036]: room_id: '!REDACTED:REDACTED.REDACTED.de',
REDACTED-email-bot.sh[8036]: type: 'm.room.message',
REDACTED-email-bot.sh[8036]: origin_server_ts: 1577622812018,
REDACTED-email-bot.sh[8036]: content: [Object] },
REDACTED-email-bot.sh[8036]: sender:
REDACTED-email-bot.sh[8036]: RoomMember {
REDACTED-email-bot.sh[8036]: roomId: '!REDACTED:REDACTED.REDACTED.de',
REDACTED-email-bot.sh[8036]: userId: '@REDACTED:REDACTED.REDACTED.de',
REDACTED-email-bot.sh[8036]: typing: false,
REDACTED-email-bot.sh[8036]: name: 'Email Notifier',
REDACTED-email-bot.sh[8036]: rawDisplayName: 'Email Notifier',
REDACTED-email-bot.sh[8036]: powerLevel: 0,
REDACTED-email-bot.sh[8036]: powerLevelNorm: 0,
REDACTED-email-bot.sh[8036]: user: null,
REDACTED-email-bot.sh[8036]: membership: 'join',
REDACTED-email-bot.sh[8036]: events: [Object],
REDACTED-email-bot.sh[8036]: _isOutOfBand: false,
REDACTED-email-bot.sh[8036]: _modified: 1577620157349 },
REDACTED-email-bot.sh[8036]: target: null,
REDACTED-email-bot.sh[8036]: status: 'not_sent',
REDACTED-email-bot.sh[8036]: error: [Circular],
REDACTED-email-bot.sh[8036]: forwardLooking: true,
REDACTED-email-bot.sh[8036]: _pushActions: null,
REDACTED-email-bot.sh[8036]: _replacingEvent: null,
REDACTED-email-bot.sh[8036]: _clearEvent: {},
REDACTED-email-bot.sh[8036]: _senderCurve25519Key: null,
REDACTED-email-bot.sh[8036]: _claimedEd25519Key: null,
REDACTED-email-bot.sh[8036]: _forwardingCurve25519KeyChain: [],
REDACTED-email-bot.sh[8036]: _decryptionPromise: null,
REDACTED-email-bot.sh[8036]: _retryDecryption: false,
REDACTED-email-bot.sh[8036]: _txnId: 'm1577622812018.39' } }
regards, Mario
In addition to supporting the room target, we should also allow custom email addresses for each room. This is for mailing list mirrors that use redirects - they don't provide any information we can parse out to find a room ID.
For example, I should be able to bind [email protected]
to !roomid:domain.com
. If the bot receives email targeted for [email protected]
, it should post in the mapped room.
Currently the owner of the bot needs to configure the allow_from for each room. Ideally, this would be done by the people in the room instead of the service provider.
http to https for example
Some senders lowercase the email address, making it impossible to find a room config (without a custom mapping). Util.getRoomConfig
returns null
in this case, which the config finding code happily treats as a config, which then accesses properties on a null object, and the bot crashes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.