Skip to content

Commit 9c3e0c0

Browse files
committed
Fix #1 - Add new ENVS
1 parent fa1599c commit 9c3e0c0

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This image uses:
66
- Nginx as a web server with PHP-FPM
77

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

1212
## TODO
1313

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

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

@@ -64,6 +67,10 @@ services:
6467
IMAP_USER: $DMARC_SRG_IMAP_USER
6568
IMAP_PASSWORD: $DMARC_SRG_IMAP_PASSWORD
6669
UI_PASSWORD: $DMARC_SRG_UI_PASSWORD
70+
# Use "." or "/" to use sub-folders
71+
MAILBOX_NAME: DMARC
72+
MAILBOXES_WHEN_DONE_MOVE_TO: DMARC-PROCESSED.Aggregate
73+
MAILBOXES_WHEN_FAILED_MOVE_TO: DMARC-PROCESSED.Invalid
6774
ports:
6875
- ${DMARC_SRG_HTTP_ADDRESS:-8082}:80
6976
restart: on-failure:2

docker-compose-latest.test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@ services:
3838
IMAP_USER: $DMARC_SRG_IMAP_USER
3939
IMAP_PASSWORD: $DMARC_SRG_IMAP_PASSWORD
4040
UI_PASSWORD: public
41+
MAILBOX_NAME: DMARC
42+
MAILBOXES_WHEN_DONE_MOVE_TO: DMARC-PROCESSED.Aggregate
43+
MAILBOXES_WHEN_FAILED_MOVE_TO: DMARC-PROCESSED.Invalid
44+
# Directories are not enabled
45+
#DIRECTORIES_WHEN_DONE_MOVE_TO: DMARC-PROCESSED.Aggregate
46+
#DIRECTORIES_WHEN_FAILED_MOVE_TO: DMARC-PROCESSED.Invalid
4147
restart: on-failure:2

docker/config.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
// Mailbox password.
4545
'password' => getenv('IMAP_PASSWORD'),
4646
// Mailbox name
47-
'mailbox' => 'DMARC',
47+
'mailbox' => getenv('MAILBOX_NAME'),
4848
// IMAP authorization methods to be excluded.
4949
// For example: 'auth_exclude' => [ 'GSSAPI', 'NTLM' ]
5050
'auth_exclude' => []
@@ -89,14 +89,14 @@
8989
* 'when_done' => [ 'mark_seen', 'move_to:done' ],
9090
* The default value is 'mark_seen'.
9191
*/
92-
'when_done' => 'move_to:DMARC-PROCESSED.Aggregate',
92+
'when_done' => 'move_to:' . getenv('MAILBOXES_WHEN_DONE_MOVE_TO'),
9393

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

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

0 commit comments

Comments
 (0)