Data source rotation
Procedures for changing a running data source without losing reports.
Rotating the mailbox password
- Change the password at the mailbox provider.
- In Drillmark, open Settings, select the source, and update the password field.
- Save. The frontend re-encrypts with the current
ENCRYPTION_KEYand writes the new ciphertext todata_sources.encrypted_password. - The next incoming-queue run uses the new credential. Previous run’s parsed records are unaffected.
If the source polls between step 1 and step 3, the run marks the source failed. It retries on the next scheduled fire with the new credential; no reports are lost because they are still sitting in the inbox folder.
Rotating the OAuth refresh token
Same flow as password rotation, against the oauth-refresh-token field on the source.
Rotating ENCRYPTION_KEY
There is no online primitive. Changing ENCRYPTION_KEY invalidates every encrypted_password and oauth_refresh_token_enc row:
- Take a database backup (see Backups).
- Disable every source from Settings. Disabled sources are skipped by the incoming-queue job.
- Stop the api, change the env var, restart.
- For each source, re-enter the IMAP password (and OAuth refresh token if used). The new value is encrypted under the new key.
- Re-enable each source.
There is no scheduled rotation requirement today; rotate only on compromise or a documented policy cycle.
Moving a source between organizations
- Open Settings, select the source.
- Change the organization dropdown.
- Save.
Parsed records keep their original organization attribution. Only new reports after the save land under the new organization. If you want historical records to follow, that is a database operation; back up first and reassign on the data_sources.organization_id column.
Retiring a source cleanly
- Disable the source. The incoming-queue job stops polling it; existing records remain visible.
- Observe for one cycle to confirm no new reports arrive in the mailbox (e.g. the DMARC publishing DNS record no longer names this mailbox).
- Delete the source from Settings. Parsed records remain in the database; the raw blob retention policy applies.
Deleting a source does not cascade to the parsed records. Dashboards continue to show the historical data; the sender attribution is unaffected.
Replacing a source with a new credential provider
When moving a mailbox from password auth to OAuth (or between OAuth providers):
- Add a new data source with the new credential. Configure its folders to the same
inbox/processed/failed/duplicatenames as the old source. - Verify the new source polls successfully (one incoming-queue run).
- Disable the old source.
- After a cycle, delete the old source.
This avoids a window where neither source is polling the mailbox.