Commit Graph

144 Commits

Author SHA1 Message Date
Haroon Ahmed
db1ae8cbb4 remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
Abhay Nikam
fc12d224ae Add ActionMailbox install generator
Forward ActionMailbox install to install generator and hide the ActionMailbox install generator from generator list

Updated the Action Mailbox install task description
2019-12-23 22:21:55 +05:30
Rafael Mendonça França
9e70042081
Merge pull request #28499 from grosser/grosser/puma
unify puma types and remove blocks
2019-12-18 10:23:08 -03:00
Eileen M. Uchitelle
cad13033fc
Merge pull request #37847 from pwim/action-mailbox-mail-ext-tests
Test extensions to Mail gem
2019-12-12 10:15:07 -05:00
George Claghorn
7d0327bbbf Track Active Storage variants in the database 2019-12-06 13:26:51 -05:00
Paul McMahon
40d63cee31 Test extensions to Mail gem
The from_address method is added to Mail::Message, but is not used
internally to ActionMailbox, nor tested (even implicitly). As it is part
of the public API, it feels important to at least have a basic test of
it.

Similarly, the x_original_to_addresses was only implicitly tested via
the recipients_addresses method. Given other similar methods are
explicitly tested, it feels like an oversight not to test it as well.

As the test introduced from_address didn't align with the naming of
RecipientsTest, I renamed it to the more generic AddressesTest.
2019-12-03 06:51:41 +09:00
glaszig
de862deb29 Fix Action Mailbox ingress config example [ci skip] 2019-10-14 21:58:30 -04:00
Orien Madgwick
493edf044f Add bug tracker/documentation/mailing list URIs to the gemspecs 2019-10-11 20:47:19 -04:00
Takayuki Nakata
43081fae4c Fix typo a InboxMailbox -> an InboxMailbox [ci skip] 2019-10-03 14:27:35 +09:00
DmitryTsepelev
e7f798c3f5 Allow configure services for individual attachments 2019-10-01 21:24:05 +03:00
Takayuki Nakata
fffb2b2a11 Fix typo in ActionMailbox::InboundEmail::MessageId [ci skip]
- `a Active Storage` -> `an Active Storage`
- `which be uploaded` -> `which is uploaded`
2019-09-17 17:40:49 +09:00
Yasuo Honda
c5e3c537a4 Ignore SQLite3 database files generated by parallel testing
Rails 6.0 introduces parallel testing and the default degree of parallelism is configured based on the number of CPU.
refer https://github.com/rails/rails/pull/34735 https://github.com/rails/rails/pull/31900

When any minitest executed under the OS where 2 or more CPU available,
SQLite 3 database files are not git-ignored.

Also updated other files which ignores SQLite database files.

* Steps to reproduce

```
$ git clone https://github.com/yahonda/rep_ignore_sqlite3_databases.git
$ cd rep_ignore_sqlite3_databases/
$ bin/rails test
$ git status
```

* Expected behavior:

- No `Untracked files:`

* Actual behavior:

- SQLite 3 database files appeared

```
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	db/test.sqlite3-0
	db/test.sqlite3-1
	db/test.sqlite3-2
	db/test.sqlite3-3
	db/test.sqlite3-4
	db/test.sqlite3-5

nothing added to commit but untracked files present (use "git add" to track)
$
```
2019-08-27 11:42:04 +00:00
Abhay Nikam
76ed911a91 Correct the assertion argument order 2019-08-08 00:06:34 +05:30
George Claghorn
c2f197c775 Correct assertion argument order 2019-08-07 10:54:56 -04:00
Michael Herold
ab34ed8acc Allow testing multipart emails in Action Mailbox
Allow passing a block to the create_inbound_email_from_mail and
receive_inbound_email_from_mail test helper methods.

When you wanted to test a multipart email -- for example, an email that
has both a plaintext part and an HTML part -- there wasn't a way to
easily build one without a pre-made fixture. By allowing you to pass a
block to these methods, we unlock the power of Mail.new to easily
create a variety of emails, from multi-part emails, to emails with
attachments, and beyond.
2019-08-07 10:12:13 -04:00
Akira Matsuda
af2129b4c7 Use try only when we're unsure if the receiver would respond_to the method 2019-08-01 17:58:00 +09:00
Akira Matsuda
0d981a2b3d Let the generated initializers/backtrace_silencers.rb code use Regexp#match? 2019-07-29 14:21:30 +09:00
John Duff
09e5d6d004 Fix Bcc header missing with emails from conductor and test helpers 2019-07-26 13:04:16 -04:00
George Claghorn
72bc0806a7 Correct assertion argument order 2019-07-25 22:34:40 -04:00
Kyle Keesling
ce88f6bd25
Fix filenames of attachments created via the inbound email conductor
controller passed along attachment file paths instead of their filenames
2019-07-25 21:11:29 -04:00
yuuji.yaginuma
74e38da810 Test against all sent attributes 2019-06-23 10:33:29 +09:00
yuuji.yaginuma
aab9f6734d Include BCC in the mail that sent from the development page
The BCC should be included as we show input field for BCC in view.
bf625f7fec/actionmailbox/app/views/rails/conductor/action_mailbox/inbound_emails/new.html.erb (L21-L24)
2019-06-20 14:09:01 +09:00
Ryuta Kamizono
cc27e9988f Unify to use 4 spaces indentation in CHANGELOGs [ci skip]
Especially, somehow `CHANGELOG.md` in actiontext and activestorage in
master branch had used 3 spaces indentation.
2019-06-05 05:53:49 +09:00
yuuji.yaginuma
d380ffe216 Remove frozen_string_literal magic comment from template file
The other template files do not add `frozen_string_literal`, so should
behave the same.

Ref: #30342, #30348.
2019-05-29 08:00:59 +09:00
James Dabbs
937f7d582e Add CHANGELOG entry 2019-05-09 13:34:21 -07:00
James Dabbs
9ce8156c93 Delegate to the correct method in ActionMailbox.mailbox_for 2019-05-05 12:09:32 -07:00
James Dabbs
80af2c5831 Rename variable to represent type
per comments from CR
2019-05-05 10:29:31 -07:00
James Dabbs
9f96d094a3 Expose mailbox_for method
Currently, the only exposed entry point into the ApplicationMailbox's configured
routing system is to call `route`, which performs a lot of work to fully
`process` inbound email. It'd be nice to have a way (e.g. in test) of checking
which mailbox an email would route to without necessarily processing it yet.
2019-05-04 10:53:08 -07:00
Rafael Mendonça França
9834be6565
Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
George Claghorn
f480cfabcd
Remove the Amazon SES ingress
It's unusable and not ready to ship in Rails 6.0. We'll rewrite it for 6.1.
2019-04-14 12:15:54 -04:00
yuuji.yaginuma
1b2f1735e7 Fix loading ActionMailbox::BaseController when CSRF protection is disabled
When `default_protect_from_forgery` is false, `verify_authenticity_token`
callback does not define and `skip_forgery_protection` raise exception.

Fixes #34837.
2019-04-11 18:25:09 +09:00
Kyle Zhao
4a9f2a746e FIX: ActionMailbox test helper argument list
`receive_inbound_email_from_source` should accept an argument list
(`*args`) instead, to allow for the `source` argument in
`create_inbound_email_from_source`.

```ruby
receive_inbound_email_from_source(source, status: :processing)
```

Accepting a keyword argument list (`**kwargs`) results in an
`ArgumentError`

```text
ArgumentError: wrong number of arguments (given 1, expected 0)
```
2019-04-09 00:43:53 -04:00
Fumiaki MATSUSHIMA
61c4be4777 Output junit format test report 2019-04-04 14:34:46 +09:00
Ryuta Kamizono
b89a3e7e63 Tweaks CHANGELOGs and docs [ci skip]
* add leading `#` before `=>` since hash rocket is valid Ruby code
* add backticks
* remove trailing spaces
* and more
2019-03-31 08:38:37 +09:00
eileencodes
c932850ef2 Add secret token for action mailbox tests
We need to create a secret token in the application so that the travis
build doesn't error when trying to create a file in the tmp directory.

Fixes https://travis-ci.org/rails/rails/jobs/505908163#L6811
2019-03-13 16:35:24 -04:00
eileencodes
a2bd669ed2 v6.0.0.beta3 release
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEEvJkGf0BARV+D0L2ulxXUSC76N8FAlyJN4cACgkQulxXUSC7
 6N9ZXAf/Wx7edIct8kZzcC6irlROx4DzpNbrrH792sO1OAcnoFDE7DPkokllTEP/
 4kzC42lca/XG27MCl7E0dtVD8hIyAl89nxid6cwKFVZVTPIRVc1wjXkoiWy/cvd7
 6+9IjxhlgrzxGnw3aWZJG7H3iqz69yr55aoSDU/TbMqq5kQrqNF95vr2nc8LEUco
 SLQj0pO/tfJdHquSeX0JiXn3VSEHT+5TdLGQ3J/w0wFU6mkecH4MJMJvMwLFx/v4
 llnvF6HyfSLASWbrpdD3h6MQHpImDoee5vILXAHzPdSaEVcVa1cDFtMcPMYiu8Dw
 AGdCAaHQhZFFGoYK472+o6pur0dxEA==
 =5dET
 -----END PGP SIGNATURE-----

Merge tag 'v6.0.0.beta3'

v6.0.0.beta3 release
2019-03-13 13:11:10 -04:00
eileencodes
7c87fd5635 Prep release
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Ryuta Kamizono
b7fa01bb2f
Merge pull request #35529 from abhaynikam/35492-follow-up-to-updates-links-to-https
Updated links from http to https in guides, docs, etc
2019-03-09 20:49:27 +09:00
Abhay Nikam
476abd403b Updated links from http to https in guides, docs, etc 2019-03-09 16:43:47 +05:30
Sharang Dashputre
bf87dae202 Upgrade webpack-dev-server version in test apps 2019-03-09 03:35:22 +05:30
Sharang Dashputre
8eaffa1945 Use the latest stable release of webpacker 2019-03-09 00:14:17 +05:30
Rafael Mendonça França
5e6e505083
Preparing for 6.0.0.beta2 release 2019-02-25 17:45:04 -05:00
George Claghorn
ef602f8892 Fix preparing the configured Action Mailbox ingress in production
When reloading is disabled, after_initialize hooks run after to_prepare hooks have already run for the last time. Since to_prepare hooks always run after application initializers, we don't need need to use an after_initialize hook.
2019-02-18 11:50:50 -05:00
Ryuta Kamizono
da5843436b SQLite3: Implement add_foreign_key and remove_foreign_key
I implemented Foreign key create in `create_table` for SQLite3 at
#24743. This follows #24743 to implement `add_foreign_key` and
`remove_foreign_key`.
Unfortunately SQLite3 has one limitation that
`PRAGMA foreign_key_list(table-name)` doesn't have constraint name.
So we couldn't implement find/remove foreign key by name for now.

Fixes #35207.
Closes #31343.
2019-02-11 14:15:16 +09:00
Pratik
d0037daa37 Allow skipping incineration of processed emails 2019-02-06 19:28:49 -05:00
Ryuta Kamizono
1745e905a3 Allow changing text and blob size without giving the limit option
In MySQL, the text column size is 65,535 bytes by default (1 GiB in
PostgreSQL). It is sometimes too short when people want to use a text
column, so they sometimes change the text size to mediumtext (16 MiB) or
longtext (4 GiB) by giving the `limit` option.

Unlike MySQL, PostgreSQL doesn't allow the `limit` option for a text
column (raises ERROR: type modifier is not allowed for type "text").
So `limit: 4294967295` (longtext) couldn't be used in Action Text.

I've allowed changing text and blob size without giving the `limit`
option, it prevents that migration failure on PostgreSQL.
2019-01-29 06:49:32 +09:00
Ryuta Kamizono
b8baa15adb Revert "Apply t.timestamps changes in Action Text and Action Mailbox"
This reverts commit 30f666f87ab873258b797b39f29cf852f7621bea.
2019-01-29 06:37:42 +09:00
Ryuta Kamizono
30f666f87a Apply t.timestamps changes in Action Text and Action Mailbox
Follow up #34956.
2019-01-29 04:59:36 +09:00
Ryuta Kamizono
57015cdfa2 Make t.timestamps with precision by default 2019-01-26 22:49:14 +09:00
alkesh26
97909ddcf2 Changed webserver to web server. 2019-01-22 21:11:03 +05:30
alkesh26
b8e0333845 enclosing body tag in conductor layout. 2019-01-20 00:58:06 +05:30
George Claghorn
aac4d7f6ff Check all provided attributes of the message 2019-01-19 11:49:50 -05:00
Yuichi Takeuchi
88453093d5 Fix that adding attachments lose a body 2019-01-19 23:28:41 +09:00
Rafael Mendonça França
5a0230c67f
Preparing for 6.0.0.beta1 release 2019-01-18 15:42:12 -05:00
Ryuta Kamizono
db077e8090 Allow using Action Mailbox on MySQL 5.5
Active Record still support MySQL 5.5 which doesn't support datetime
with precision.

9e34df0003/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb (L99-L101)

So we should check `supports_datetime_with_precision?` on the
connection.
2019-01-18 07:04:08 +09:00
Pratik Naik
57cb8d7924 Use create_and_extract_message_id! to create an inbound email.
This makes sure the created email has checksum and message id columns set.
2019-01-17 14:19:37 -06:00
Pratik Naik
a823b7d56f Specify a name for [ message_id, message_checksum ] index to ensure the name does not exceed the limit.
Also, update test schema to reflect the recent changes.
2019-01-17 14:14:45 -06:00
Pratik Naik
5cd733a334 Ensure Action Mailbox processes an email only once when received multiple times
This also adds a new column, message_checksum, to the action_mailbox_inbound_emails table
for storing SHA1 digest of the email source. Additionally, it makes generating the missing
message id deterministic and adds a unique index on message_checksum and message_id to
detect duplicate emails.
2019-01-17 11:13:40 -06:00
colorbox
620ba4c12a Fix document formatting on ActionMailbox [ci skip]
Use `+` instead of backquote.
2019-01-17 01:10:21 +09:00
ikepon
6c156d4f6e Add 'null: false' to Action Mailbox table
created_at and updated_at columns in Action Mailbox table aren't intended nullable.
2019-01-16 15:40:15 +09:00
George Claghorn
512b5316dd
Add Exim and Qmail support to Action Mailbox 2019-01-12 21:38:26 -05:00
George Claghorn
9edc84cdfa Add Postmark to the ingress lists [ci skip] 2019-01-10 11:04:54 -05:00
George Claghorn
7aaf9b8076 Tweak Postmark ingress docs [ci skip] 2019-01-09 22:23:51 -05:00
George Claghorn
3c10edcfaf
Merge pull request #34908 from robzolkos/fix-actionmailbox-json
Bring in all of aws-sdk-sns if using Amazon ingress
2019-01-09 19:20:57 -05:00
Tomek Maszkowski
b77d2d9a03 Added Postmark ingress support 2019-01-09 18:00:27 -05:00
Rob Zolkos
fb5c07525f Bring in all of aws-sdk-sns if using Amazon ingress
Requiring _just_ the `Aws::SNS::MessageVerifier` does not work as it
references other classes in the AWS SDK that are not in this one class.

Bringing in the entire SNS SDK verifies the authenticity correctly.
2019-01-09 17:16:08 -05:00
Kevin Solorio
ce90ded4ca add new frameworks to tasks/release.rb
The Frameworks collection was missing actiontext and actionmailbox,
this would mean they are skipped when running any tasks that
iterated through this collection

changes include

Breaking up frameworks declaration into multiple lines and put
them in order. This should make adding to the list easier and
if you need to scan it, they will be in order you would expect

Add `package` task to both actiontext and actionmailbox
2019-01-08 10:36:33 -08:00
Lachlan Sylvester
0419bc3504 add attachments to the new inbound mail 2019-01-07 10:56:41 +11:00
bogdanvlviv
67a9a86b1d
Test actiontext on Rails 6.0
- config.load_defaults 6.0 in the dummy app and
  fix the test since by default rails 6.0 configured
  does not generate "utf8" hidden input, see #32125
- Use `ActiveRecord::Migration[6.0]` in the dummy app
  since actiontext will be since Rails 6.0
- Fix `CreateActiveStorageTables` migration in the dummy app.
  Add `t.foreign_key :active_storage_blobs, column: :blob_id`
  It was added in 2ae3a29508e.
- `rails/actiontext$ yarn install`
2019-01-05 15:24:27 +02:00
George Claghorn
d9630c4815 s/Active Mailbox/Action Mailbox/ [ci skip] 2019-01-01 16:43:07 -05:00
George Claghorn
5bb8f3ae67 Fix links in ingress docs [ci skip] 2019-01-01 08:16:38 -05:00
George Claghorn
9adc2aa303 Exclude ActionMailbox::Base#perform_processing and #finished_processing? from API docs 2019-01-01 07:34:20 -05:00
George Claghorn
1c2747ee22 Document ActionMailbox::Base#bounce_with [ci skip] 2019-01-01 07:33:15 -05:00
George Claghorn
5afceae886 Add load hook for ActionMailbox::TestCase 2018-12-31 23:35:53 -05:00
George Claghorn
b005c24f35 Add load hook for ActionMailbox::Base 2018-12-31 20:01:43 -05:00
George Claghorn
7bc307acf8
Merge pull request #34833 from bogdanvlviv/add-changelog-file-to-actionmailbox-specification
Add CHANGELOG.md to actionmailbox gem specification
2018-12-31 13:49:39 -05:00
Arun Agrawal
472a0d7e40
Merge pull request #34831 from arunagw/bump-year-to-2019
Bump license years for 2019
2018-12-31 23:08:43 +05:30
bogdanvlviv
cea3d6d1db
Add CHANGELOG.md to actionmailbox gem specification 2018-12-31 19:38:13 +02:00
George Claghorn
04d091209a Add load hook for ActionMailbox::InboundEmail 2018-12-31 10:05:13 -05:00
Arun Agrawal
50e3680768 Bump license years for 2019 2018-12-31 10:24:38 +07:00
George Claghorn
bf11c425a2
Merge pull request #34825 from bogdanvlviv/change-migration-version-of-actionmailbox
Use 6.0 version of `ActiveRecord::Migration` for Action Mailbox
2018-12-29 20:52:19 -05:00
George Claghorn
a1be11fcbf
Merge pull request #34812 from bogdanvlviv/action_mailbox-guides-docs
Add Action Mailbox to guides
2018-12-29 20:19:13 -05:00
bogdanvlviv
f9792fdd51
Use 6.0 version of ActiveRecord::Migration for Action Mailbox
Since Action Mailbox will be introduced in Rails 6.0,
it makes more sense to generate migration of that version.
Also I changed its test dummy app to use default 6.0 configs.
2018-12-30 03:10:16 +02:00
bogdanvlviv
1fe086d3c1
Move some actionmailbox/README.md content to Action Mailbox Basics guide [ci skip]
I added WIP label to that guide since we definitely
want to complement it.
2018-12-30 02:42:14 +02:00
George Claghorn
a4fe5c5b66 Require railties for all Action Mailbox dependencies 2018-12-28 21:29:44 -05:00
George Claghorn
837f602fa1 Remove frozen_string_literal pragma from Action Mailbox templates 2018-12-28 12:32:48 -05:00
yuuji.yaginuma
e4b6495fd1 Fix broken Mailbox generator test
Follow up to d082439cf7e577e266bfeb7b443569f323df1673
2018-12-28 17:29:40 +09:00
yuuji.yaginuma
d082439cf7 Add missing quotes on Mailbox test template 2018-12-28 16:56:45 +09:00
bogdanvlviv
3adb261985
Fix Ruby warnings in actionmailbox
```
rails/actionmailbox$ bundle exec rake tests
(snip)
...
rails/activerecord/lib/active_record/persistence.rb:48: warning: in `create!':
the last argument was passed as a single Hash
rails/actionmailbox/app/models/action_mailbox/inbound_email/message_id.rb:21:
warning: although a splat keyword arguments here
...
(snip)
```
2018-12-27 01:30:29 +02:00
bogdanvlviv
2ee75ae716
Improve actionmailbox's .gitignore and remove redundant files
Follow up #34786
2018-12-27 00:07:44 +02:00
George Claghorn
4198323b9d Nest ActionMailbox::Base in the API docs (missed in 6c168aa) 2018-12-26 16:27:28 -05:00
George Claghorn
6c168aaffb Nest Action Mailbox classes in the API docs 2018-12-26 16:18:42 -05:00
George Claghorn
612bb2bd9f Start an Action Mailbox changelog 2018-12-26 13:27:00 -05:00
George Claghorn
a5b2fff64c Import Action Mailbox 2018-12-25 21:32:35 -05:00