Commit Graph

48 Commits

Author SHA1 Message Date
Eklavya Sharma 94e4b39112 Replace python2.7 by python everywhere. 2016-05-29 05:03:08 -07:00
Eklavya Sharma 149938d468 Change shebangs from python2.7 to python. 2016-05-29 05:03:08 -07:00
Tim Abbott f3783fb4a1 Apply Python 3 futurize transform libfuturize.fixes.fix_print_with_import. 2015-11-01 09:26:16 -08:00
Tim Abbott 43abd83d1c Apply Python 3 futurize transform lib2to3.fixes.fix_ws_comma. 2015-11-01 09:26:14 -08:00
Tim Abbott 06f6ee6566 Apply Python 3 futurize transform lib2to3.fixes.fix_idioms. 2015-11-01 09:25:47 -08:00
Steven Oud d5435fad1d Consistently use /usr/bin/env python2.7 in shebangs and commands. 2015-10-21 22:58:21 +00:00
Tim Abbott 16e0f21687 Fix a bunch of Zulip Voyager related comments.
(imported from commit 176e875cbc310ba00d6137930ddb718bd68f1866)
2015-08-21 10:40:54 -07:00
David Roe 3f7cb34b00 enterprise => voyager
(imported from commit 04be792bb480d5e5db1c91d296d1000cf1682571)
2015-08-21 10:33:35 -07:00
Reid Barton ae0ae3dde8 Django 1.8: declare positional arguments in management commands
(imported from commit d9efca1376de92c8187d25f546c79fece8d2d8c6)
2015-08-20 23:35:40 -07:00
Jason Michalski 2a5ec20295 Add support for one time use email address
The one time use address are a unique token which maps to stored stated
in redis. We store the user_id, recipient_id, and subject. When an email
is received at this address it is sent to the stored recipient by the
stored user. Anyone with this address can send a single message as this
user.

(imported from commit 4219417bdc30c033a6cf7a0c7c0939f7d0308144)
2014-10-06 15:27:54 -07:00
Luke Faraone 0f96d2229e email-mirror: Also accept original recipient via argv
(imported from commit 9a29fe6906713e75ee208c924b67211575c011f2)
2014-01-31 15:33:15 -05:00
Tim Abbott 6d64427c46 Fix email mirror.
(imported from commit 73c109db6e821b139203f662023ed780fcee0f24)
2014-01-24 18:11:20 -05:00
Luke Faraone b1cf9c3e25 Rewrite email-mirror documentation.
(imported from commit 4af076b3063d7b82657765c12cf4dba0248cbf9f)
2014-01-15 16:07:19 -05:00
Luke Faraone 895b7dc9b1 Accept emails on stdin in email-mirror and queue for later processing
(imported from commit 7efccc294f87d3661e50f10962a80071b91e3879)
2014-01-15 16:07:18 -05:00
Luke Faraone 1005e2ae7c Use module docstring for usage information
(imported from commit 7c1cbf68eca4e3f31c75bfe13b50654e76be0df3)
2014-01-15 16:07:18 -05:00
Luke Faraone df4b2d9f85 Break out non-Twisted email mirror code into separate library
(imported from commit 45c3e70ba81cdb44f1e9db4f162e5f2d2fe5ead6)
2014-01-06 13:36:53 -05:00
Luke Faraone 266c0f4886 Remove duplicate validation in email_mirror
We already have a try-except earlier in the file about email_gateway_user, so we don't
need to check for it again.

(imported from commit 2d9fa357fab2605916c5c5cb61961c0a121b1211)
2014-01-06 13:36:53 -05:00
Luke Faraone 1b5c1ac021 Update style of client strings.
(imported from commit 1516461cf53b2715de68e01f16bb8a8cc33c48ad)
2013-12-09 11:47:52 -05:00
Tim Abbott e5be713103 Clean up EXTERNAL_API_HOST usage and defaults.
We now have 2 variablse:
EXTERNAL_API_PATH: e.g. staging.zulip.com/api
EXTERNAL_API_URI: e.g. https://staging.zulip.com/api

The former is primarily needed for certain integrations.

(imported from commit 3878b99a4d835c5fcc2a2c6001bc7eeeaf4c9363)
2013-12-04 15:10:54 -05:00
acrefoot f5199081d5 Add the deliver_email management command
This command should be run continuously via supervisor. It periodically
checks for new email messages to send, and then sends them. This is for
sending email that you've queued via the Email table, instead of mandrill
(as is the case for our localserver/development deploys).

(imported from commit a2295e97b70a54ba99d145d79333ec76b050b291)
2013-11-13 16:41:36 -05:00
Jessica McKellar f5fc59e3e0 email mirror: remove some TODOs enterprise users don't need to see.
These should live in tickets anyway.

(imported from commit 9c2a9445640278d251a99c68c0074c138b832c60)
2013-11-13 16:28:30 -05:00
Jessica McKellar 3b4303598a email mirror: use the correct API host locally.
In particular, EXTERNAL_HOST doesn't specify the protocol, which gets
coerced to HTTPS.

(imported from commit 53f2e8106cf33114dcdd2ad17e09b41609641e71)
2013-11-13 16:28:29 -05:00
Jessica McKellar 8382e074fe Move use of html2text to a subprocess call.
(imported from commit 36e8a6f030d75196c28fbdc0e58c6968952d95ff)
2013-11-13 16:28:29 -05:00
Leo Franchi d7b823f017 Point email mirror to staging for zulip.com in non-localserver, and prod otherwise
(imported from commit 3076df1e68e0200af06b79a8cdeb9822bbf4c10c)
2013-11-12 22:22:13 -05:00
Leo Franchi ca8187b8cf Email gateway bot variable name changed to EMAIL_GATEWAY_BOT
(imported from commit 01c430bd9b916c9bb152ee821214495333f1d37e)
2013-11-01 16:46:17 -04:00
Leo Franchi db6550e99a Make built-in bots come from settings.py, and allow localserver-specific ones
(imported from commit e21933e37487314ac986147562817a19227e8960)
2013-11-01 14:13:05 -04:00
Tim Abbott 901a5c342c Use os.path directly rather than sometimes importing it separately.
(imported from commit 48486c4ea64d02a15faeebb0f490d31e9b113d62)
2013-10-28 15:44:13 -04:00
Luke Faraone 52309b5789 Enable absolute imports for non-third-party code where it was omitted previously
(imported from commit 34856ac32c6b94b614273a6fe46c87a314058d9b)
2013-10-25 14:13:30 -04:00
Leo Franchi a9b9c0ec7b Add Email Mirror default settings and error out with readable warning if not configured
(imported from commit adac321d09561b51277ec1e314a1d480dc01e0c8)
2013-10-25 11:51:13 -04:00
Leo Franchi 2d276179d0 Refactor email-mirror to handle running on any machine
(imported from commit 2971449ceaacb564770e66874fc095f77e68d445)
2013-10-25 11:37:34 -04:00
Jessica McKellar 6afdfeb1dc Filter obvious footers from email mirror messages.
(imported from commit 7e22b6823b5d0a07f7f350e4af65be66728a8f88)
2013-10-02 14:39:22 -04:00
Jessica McKellar f0911f51a0 email mirror: ignore decoding errors.
Empirically, we only get these for malformed emails where the charset
specified in a message part header does not match the true encoding of
the part. I checked what the resulting Zulip looked like for the
original offender, and it looked find with ignoring errors.

(imported from commit ac6ba65b611cb22d4ec547b75a585abce6fc50b0)
2013-09-27 11:34:57 -04:00
Tim Abbott e4496521e9 Update logging path for email-mirror.
(imported from commit 75f36dbb963b2b77ecda7ba138023f0f774047e0)
2013-09-25 16:52:41 -04:00
Jessica McKellar d434bf4bb4 email mirror: use a message part's specific charset rather than the message charset.
The overall message charset may be null or not match the part's
charset. Even though it's unclear from the documentation,
experimentally using the charset for a message part seems to give you
the charset even for non-multipart emails.

(imported from commit 0e1d23073f4c53041f9760e66a6635f8a94893d1)
2013-09-24 16:19:53 -04:00
Jessica McKellar c2e704e4b6 Instead of erroring out, do our best to format HTML-only e-mails.
(imported from commit a58e65864ebb3ef539cf15902b59636cd3912b69)
2013-09-18 15:41:27 -04:00
Jessica McKellar 8ab3ae9da2 email mirror: handle non-ASCII message bodies.
(imported from commit 1a8e21b7ff5441c21147bab85f5a460a7567c5e3)
2013-09-18 15:41:27 -04:00
Jessica McKellar 28f80211ec email mirror: handle non-multipart e-mails when checking for attachments.
(imported from commit 2132d604bb353ef6e8ca2c371479b2b2146d8603)
2013-09-17 16:20:28 -04:00
Jessica McKellar 3db51fa17f Upload and display attachments sent through the email mirror.
(imported from commit b3ac24b71a2e7c354d69ecae9174316102ab8f84)
2013-09-17 10:00:01 -04:00
Jessica McKellar 2c0ba365ae email mirror: show more debugging information on errors.
(imported from commit 57f5b8b57062501443367953239526f1ec78eb7f)
2013-09-17 10:00:00 -04:00
acrefoot cf3e98d74a use staging for wdaher.com for the email script
(imported from commit fbad47386f5c48785f766886218370612db31c26)
2013-09-05 19:19:41 -04:00
Luke Faraone 085fdebc98 Use the X-Gm-Original-To header instead of iterating through To/Cc/Bcc
This will allow mail with an implicit destination (mailing lists, complex
forwarding) to be received by our system.

See http://support.google.com/a/bin/answer.py?hl=en&answer=2368151 for
documentation of Google's behaviour that adds this header.

(imported from commit f8fd500e3c27e12af5941c63c91d5c796a2cd24a)
2013-09-03 17:46:44 -04:00
Jessica McKellar acdfb6afa0 email mirror: make being one of many recipients okay.
Previously the email gateway had to be the only address in a recipient
field or we'd mis-parse the recipient.

This commit also makes the mirror correctly handle addresses of the
form "Jessica McKellar <jesstess@zulip.com>".

(imported from commit 7435f2b59b8f47dc599cc869f64597a730af7d12)
2013-08-29 18:13:21 -04:00
Jessica McKellar c4157ed2b6 Make email mirror testing easier by using a different mailbox locally.
The mirror will use INBOX when deployed and Test locally. Send an
e-mail to the Test mailbox by including the word "localhost" in the
subject; a GMail filter will place it in Test on receipt.

(imported from commit bacf9a9554c8c5e1f3ec8497761edf2c15d3745d)
2013-08-29 18:13:21 -04:00
Jessica McKellar f3a32d8382 Report email forwarding errors to our internal Zulip.
For now, just do this, and we'll reach out to realms having trouble
manually. We may eventually need to automatically reply to the e-mail,
reach out to a realm admin, etc.

(imported from commit 5c5ac354066f9e9be3fb928e1f8801613c22c1ac)
2013-08-16 16:09:18 -04:00
Jessica McKellar 557bdd2a6e email gateway: Make forwarding even "richly formatted" messages work.
(imported from commit b15f24fa6898eb2eaf7d27bf862e8bead76f544d)
2013-08-16 16:09:18 -04:00
Jessica McKellar 15afdf65eb email forwarder: encode stream names so they are safe in email addresses.
(imported from commit 6699d656e3cae58fad062a1403fb9923429fde89)
2013-08-13 14:28:47 -04:00
Jessica McKellar c4a0797413 Decode MIME-encoded emails before forwarding them to Zulip.
Otherwise you'll see garbage.

(imported from commit 07e68a5e209fdea4f54470396a67986dd9fa4016)
2013-08-13 14:28:47 -04:00
Jessica McKellar a228bb6671 Implement a v1 email-to-zulip forwarder.
(imported from commit 5f91fd69ee2075413d0d4aedf71b878bf98c640e)
2013-08-09 15:22:58 -04:00