Add a setting for selecting SMTP mail encoding

Summary:
Fixes T5956. We changed the default mail encoding to `quoted-printable` to fix delivery via SendGrid via SMTP, but this broke multiple other mailers.

  - Change the default back to 8bit (which works everywhere except SendGrid).
  - Add a configuration setting for selecting `quoted-printable`.
  - Document this issue.
  - Discourage use of SendGrid in documentation.

(IMPORTANT) @klimek @nickz This reverts the `quoted-printable` fix for SendGrid. You will need to adjust your configurations (set `phpmailer.smtp-encoding` to `quoted-printable`) and restart your daemons or mail will get double newlines again.

Test Plan:
  - Sent mail via SendGrid with various `phpmailer.smtp-encoding` settings, saw mail arrive with specified encoding.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: klimek, nickz, epriestley

Maniphest Tasks: T5956

Differential Revision: https://secure.phabricator.com/D10397
Fix `bin/phd log` instructions

Summary: The command takes `--id` (since recently?), fix command prompt.

Test Plan: `bin/phd help log`

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10404
Populate results of DiffusionQueryCommitsConduitAPIMethod with DiffusionLowLevelCommitQuery

Summary:
Ref T2783.  This populates the following fields in DiffusionQueryCommitsConduitAPIMethod using DiffusionLowLevelCommitQuery when `bypassCache` is set to true:

  * `authorName`
  * `authorEmail`
  * `committerName`
  * `committerEmail`
  * `message`
  * `hashes`

The original outline called for `authorPHID` and `committerPHID` as well (but no `message` field).  As far as I can tell, the PHIDs aren't actual a property on `DiffusionCommitRef`, and since the intention of this is to be able to populate a `DiffusionCommitRef`, I haven't included them.  Let me know if we really do need the PHIDs here.

Test Plan: Tested using 3 Phabricator instances (one web, one taskmaster and one storage).  The web and taskmaster tiers are directed at the Conduit API of the storage tier.  Made a `diffusion.querycommits` from the Conduit app on the web tier instance and saw the data populated from the raw VCS data (located on the storage tier).

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T2783

Differential Revision: https://secure.phabricator.com/D10399
Maniphest - make custom fields always render last

Summary: Fixes T6029. We should append custom fields last so they show up after things like projects, tokens, etc that render via UI events.

Test Plan: viewed a task with custom fields and projects was last

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T6029

Differential Revision: https://secure.phabricator.com/D10407
Maniphest - always cc the user, including when creating from template

Summary: Ref T6031. I figure its totally cool to include the user creating the task as a subscriber, even if from the template case, so just do that there too. Code is written such that if the user wasn't already in the subscriber case they end up being the last person in the tokenizer. Theoretically this should make any users who didn't want to be automagically subscribed via the create from template case to remove themselves.

Test Plan: made a template from a task that didn't have me as a subscriber initially and observed i was a subscriber.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T6031

Differential Revision: https://secure.phabricator.com/D10408
Minor, add a missing space so this command gets marked up as code

Summary: This only has one space but should have two so it looks nice.
Daemons - handle daemons that can't be killed a bit better

Summary:
Ref T2374. Fixes T5988.

Keep track of what's been killed and not been killed, and surface that maybe you need sudo if things don't get killed with --force

...also basically make this force thing work. I managed to convinced myself stuff was getting killed with --force when it mostly wasn't. Make sure the --force parameter gets pushed as low as it needs to go to have things get killed.

Test Plan:
 - `sudo ./bin/phd restart`
 - `rm -rf /var/tmp/phd/pid/*`
 - `./bin/phd stop` --> get warning about rogue daemons
 - `./bin/phd stop X` --> get warning about no running daemons
 - `./bin/phd stop --force` --> get warning about not being able to kill daemons
 - `sudo ./bin/phd stop --force` --> kill daemons successfully

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T2374, T5988

Differential Revision: https://secure.phabricator.com/D10386
Diffusion / Herald - tweak "Accepted Differential Revision exists" Herald field

Summary: make it use the value of the revision before any post-commit magic has occurred. Fixes T4754

Test Plan: made a herald rule that said "if revision exists, and revision accept does not exists, block push". tried to push a commit that had a revision that wasn't accepted and I was blocked.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: mbishopim3, epriestley, Korvin

Maniphest Tasks: T4754, T4574

Differential Revision: https://secure.phabricator.com/D10393
Move column hide/show to the column context menu on workboards

Summary: Fixes T5993. Now that we have a context menu we can make some edit operations easier to access.

Test Plan: Toggled column visibility. Verified board state (columns shown/hidden, ordering) was retained.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5993

Differential Revision: https://secure.phabricator.com/D10417
When users scroll while dragging items, update item positions immediately

Summary:
Fixes T5979. When you drag a task and scroll using the mouse wheel, we don't move the task under your cursor until you move the mouse.

Instead, listen for `scroll` and move the task.

Test Plan:
  - Clicked and dragged a task.
  - While holding the task and not moving the cursor, used the mouse wheel to scroll.
  - The task followed the cursor (previously, it stayed in position until the mouse was moved again).

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5979

Differential Revision: https://secure.phabricator.com/D10416
Use %s, not %d, to encode a 64-bit integer for a query

Summary: Fixes T5982. Probably. I'm just guessing here but like 95% sure this will fix it and 99% sure it won't hurt/break anything.

Test Plan: Still works on my 64-bit install, for what little that's worth.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5982

Differential Revision: https://secure.phabricator.com/D10415
Allow Passphrase to store empty secrets

Summary: Fixes T6001. We currently don't allow empty secrets, but accounts with no password are occasionally used in the wild.

Test Plan:
  - Created a credential with an empty secret.
  - Revealed secret, saw empty message.
  - Edited it (no form changes), saw secret unchanged.
  - Changed it to a nonempty secret.
  - Revealed nonempty secret.
  - Edited it (no form changes), saw secret unchanged.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6001

Differential Revision: https://secure.phabricator.com/D10414
Add a configuration warning when `memory_limit` will limit file uploads

Summary: Fixes T6011. See that task for discussion. We can detect when `memory_limit` will be the limiting factor for drag-and-drop uploads and warn administrators about it.

Test Plan: Fiddled configuration values and hit, then resolved, the issue.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6011

Differential Revision: https://secure.phabricator.com/D10413
Bind file thumbnail visibility to the visibility of the original files

Summary:
Ref T6013. Currently, when we create a thumbnail, it gets its own (default) file visibility policy.

In particular, this causes the issue in T6013: thumbnails get "all users" visibility, which does not include logged-out users.

Instead, a thumbnail should just have the same visibility as the original file does. Enforce this:

  - When loading thumbnails, reject thumbnails with invisible originals.
  - When filtering thumbnails, permit thumbnails with visible originals.

Test Plan: As a logged-out user, thumbnails are now visible when the original files are attached to visible objects.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6013

Differential Revision: https://secure.phabricator.com/D10410
Fix old image macros and memes for logged out users

Summary:
Fixes T6013. Old image macros/memes never had the file edge written.

We also never wrote file edges for audio.

Finally, the meme controller didn't allow public access.

Write edges for images and audio, perform a migration to populate the historic ones, and make the Editor keep them up to date going forward.

Test Plan:
  - Updated image, saw new image attach and old image detach.
  - Updated audio, saw new audio attach and old audio detach.
  - Ran migration.
  - Viewed memes as a logged-out user.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6013

Differential Revision: https://secure.phabricator.com/D10411
Don't require an actor in `PhabricatorFile::attachToObject()`

Summary:
Ref T6013. A very long time ago, edges were less clearly low-level infrastructure, and some user-aware stuff got built around edge edits.

This was kind of a mess and I eventually removed it, during or prior to T5245. The big issue was that control flow was really hard to figure out as things went all the way down to the deepest level of infrastructure and then came back up the stack to events and transactions. The new stuff is more top-down and generally seems a lot easier and cleaner.

Consequently, actors are no longer required for edge edits. Remove the parameter.

Test Plan: Poked around; ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley, hach-que

Maniphest Tasks: T6013

Differential Revision: https://secure.phabricator.com/D10412
Phriction - fix edits with subscribers

Summary: pre-patch, these fatal, since we overwrite $content to be just a string so methods fail later in the code. Instead, write a $content_str to keep $content as the proper data.

Test Plan: editing a document and on save it showed me the view page! (as opposed to fataling and staying on the eidt page)

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10426
Fix two minor feedback document issues

Summary:
  - `#phabricator` links to the project now.
  - Provide contact address instead of personal addresses.

Test Plan: iiam

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10419
Make it easier to ignore setup issues

Summary:
Ref T4331. Ref T5968. Users sometimes have trouble figuring out how to ignore issues. The option is a bit hard to spot, especially if you aren't familiar with interfaces yet.
Make it a button on the issue page itself instead.

Test Plan:
Normal issue:

{F199225}

Ignored issue:

{F199226}

Fatal issue:

{F199227}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T4331, T5968

Differential Revision: https://secure.phabricator.com/D10420
Reword daemon configuration issue in response to user issues

Summary:
Ref T5968. Issues we've seen from users include:

  - Concern about severity ("... Need Restarting").
    - Reduce severity of explanatory text ("Different Config", "not severe").
    - Explain consequences in more detail.
    - In D10420, make "Ignore" easier to find.
    - Scope language for the multi-machine case ("at least one daemon").
  - Confusion about why daemons need restarting.
    - Unbury the lede ("Daemons and Web Have Different Config").
    - Make it clear that the root cause is a different checksum by showing the checksum. (This just hammers home that we're comparing checksums and this issue is about config checksums and we're not making it up, the checksums probably aren't that useful on their own.)
  - Difficulty understanding how to proceed when restarting does not resolve the issue:
    - Call out steps to take on the daemon console explicitly.
    - Walk through troubleshooting PHABRICATOR_ENV.
    - Walk through troubleshooting multiple `local.json`.

Test Plan: {F199245}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5968

Differential Revision: https://secure.phabricator.com/D10421