Skip to content

Commit

Permalink
Fix #1 - Add new ENVS
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jan 28, 2024
1 parent fa1599c commit 9c3e0c0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This image uses:
- Nginx as a web server with PHP-FPM

Tables will be prefixed with: `dmarc-srg_` by default.
And require a `DMARC` IMAP folder with unread reports.
That will be moved to `DMARC-PROCESSED.Aggregate` or `DMARC-PROCESSED.Invalid`.
And require a `${MAILBOX_NAME}` IMAP folder with unread reports.
That will be moved to `${MAILBOXES_WHEN_DONE_MOVE_TO}` or `${MAILBOXES_WHEN_FAILED_MOVE_TO}`.

## TODO

Expand All @@ -23,6 +23,9 @@ That will be moved to `DMARC-PROCESSED.Aggregate` or `DMARC-PROCESSED.Invalid`.
- `IMAP_USER` (The IMAP user)
- `IMAP_PASSWORD` (The IMAP password)
- `UI_PASSWORD` (The web UI password)
- `MAILBOX_NAME` (The mailbox folder name where reports are stored to be ingested)
- `MAILBOXES_WHEN_DONE_MOVE_TO` (The mailbox folder name where reports are stored when they passed ingestion)
- `MAILBOXES_WHEN_FAILED_MOVE_TO` (The mailbox folder name where reports are stored when they failed ingestion)

#### For `utils/summary_report.php`

Expand Down Expand Up @@ -64,6 +67,10 @@ services:
IMAP_USER: $DMARC_SRG_IMAP_USER
IMAP_PASSWORD: $DMARC_SRG_IMAP_PASSWORD
UI_PASSWORD: $DMARC_SRG_UI_PASSWORD
# Use "." or "/" to use sub-folders
MAILBOX_NAME: DMARC
MAILBOXES_WHEN_DONE_MOVE_TO: DMARC-PROCESSED.Aggregate
MAILBOXES_WHEN_FAILED_MOVE_TO: DMARC-PROCESSED.Invalid
ports:
- ${DMARC_SRG_HTTP_ADDRESS:-8082}:80
restart: on-failure:2
Expand Down
6 changes: 6 additions & 0 deletions docker-compose-latest.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ services:
IMAP_USER: $DMARC_SRG_IMAP_USER
IMAP_PASSWORD: $DMARC_SRG_IMAP_PASSWORD
UI_PASSWORD: public
MAILBOX_NAME: DMARC
MAILBOXES_WHEN_DONE_MOVE_TO: DMARC-PROCESSED.Aggregate
MAILBOXES_WHEN_FAILED_MOVE_TO: DMARC-PROCESSED.Invalid
# Directories are not enabled
#DIRECTORIES_WHEN_DONE_MOVE_TO: DMARC-PROCESSED.Aggregate
#DIRECTORIES_WHEN_FAILED_MOVE_TO: DMARC-PROCESSED.Invalid
restart: on-failure:2
10 changes: 5 additions & 5 deletions docker/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// Mailbox password.
'password' => getenv('IMAP_PASSWORD'),
// Mailbox name
'mailbox' => 'DMARC',
'mailbox' => getenv('MAILBOX_NAME'),
// IMAP authorization methods to be excluded.
// For example: 'auth_exclude' => [ 'GSSAPI', 'NTLM' ]
'auth_exclude' => []
Expand Down Expand Up @@ -89,14 +89,14 @@
* 'when_done' => [ 'mark_seen', 'move_to:done' ],
* The default value is 'mark_seen'.
*/
'when_done' => 'move_to:DMARC-PROCESSED.Aggregate',
'when_done' => 'move_to:' . getenv('MAILBOXES_WHEN_DONE_MOVE_TO'),

/**
* What to do with the email message when a report from it has been rejected.
* The same actions are available as for the when_done.
* The default value is 'move_to:failed'.
*/
'when_failed' => 'move_to:DMARC-PROCESSED.Invalid'
'when_failed' => 'move_to:' . getenv('MAILBOXES_WHEN_FAILED_MOVE_TO'),
],
'directories' => [
// How many report files will be processed at once maximum. 0 to disable any limiting.
Expand All @@ -108,15 +108,15 @@
* for detailed description.
* The default value is 'delete'.
*/
'when_done' => 'move_to:DMARC-PROCESSED.Aggregate',
'when_done' => 'move_to:' . getenv('DIRECTORIES_WHEN_DONE_MOVE_TO'),

/**
* What to do with the report file when it has been rejected.
* The same actions are available as for the when_done.
* The default value is 'move_to:failed'.
*
*/
'when_failed' => 'move_to:DMARC-PROCESSED.Invalid'
'when_failed' => 'move_to:' . getenv('DIRECTORIES_WHEN_FAILED_MOVE_TO'),
],
/**
* Domains matching this regular expression will be automatically added to the database from processed
Expand Down

0 comments on commit 9c3e0c0

Please sign in to comment.