Git Product home page Git Product logo

matrix-email-bot's People

Contributors

dependabot[bot] avatar greenkeeper[bot] avatar rubo77 avatar turt2live avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

matrix-email-bot's Issues

whole message posted

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)

post_message.js: Configuration property "web.port" is not defined

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

Plaintext support

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.

Add IMAP/POP3 receiver

Still maintain the own mailserver support, and external push support. This would just be a built-in receiver method.

An in-range update of matrix-js-sdk is breaking the build 🚨

Version 0.7.8 of matrix-js-sdk just got published.

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 πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v0.7.8

Full Changelog

  • No changes
Commits

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

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Plaintext message needs to be more intelligent

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

Banner in web view to show (configurable) information

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.

split messages in separate posts

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

Target node 7.x and npm@5

  • Update .travis.yml
  • Set up jenkins build for node 7.x on master
  • Set up jenkins build for node 7.x on develop

Handle spam scores in messages

Spam messages shouldn't be sent to rooms.

Should we notify the room admins of the spam? Config flag? Option to approve message?

Allow to use email aliases / indentities for mailbox

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

Add ability to subscribe to mailing lists easier

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.

Some emails coming through with headers in content, leading to parse failures

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:
image

Full .eml available in private location.

Bot ignores CC/BCC headers

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)

BCC doesn't work for some (all?) mailing lists

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?

Process Attachments

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).

Trigger as LDA/Alias, instead of SMTP

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:

  • Postfix alias piped into executable
  • Postfix entry in master.cf, as a "local delivery agent"
  • Maildrop/Procmail filter hands off to executable

... 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...

Bot occasionally posts the body twice when postReplies is enabled

This appears in the server log:
WARN MatrixHandler Could not find format for message type 'Symbol(FRAGMENT)', using fragmentFormat

The result is something like this:
image

The subject was 'test' and the body was also 'test'. The last 'test' is a different message.

Attachments are not posted and are not visible in 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

Malformed Email kills service

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

Support custom target addresses

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.

Bot crashes if no room config is found

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.