| 1 | <?php |
| 2 | // Set 1 to enable debug messages |
| 3 | $debug = 0; |
| 4 | |
| 5 | // Settings for assessing the database in which reports will be saved |
| 6 | $database = [ |
| 7 | 'host' => '127.0.0.1', // You can use a domain name here |
| 8 | 'type' => 'mysql', |
| 9 | 'name' => 'dmarc', |
| 10 | 'user' => 'dmarc_user', |
| 11 | 'password' => 'password', |
| 12 | /** |
| 13 | * This parameter can be useful if the database is shared with other applications |
| 14 | * to avoid conflicting table names. You do not need to specify this parameter |
| 15 | * if you use a dedicated database. |
| 16 | * Example value: dmarc_ |
| 17 | * Caution! Do not use an empty string as the table prefix value if you share the database with |
| 18 | * other applications. |
| 19 | * Caution! Do not change this parameter if you have already created the tables in the database |
| 20 | * because the tables will not be renamed automatically. |
| 21 | */ |
| 22 | 'table_prefix' => '' |
| 23 | ]; |
| 24 | |
| 25 | /** |
| 26 | * It is only required if you want to get reports from a mailbox automatically. |
| 27 | * In order to collect reports from several mailboxes, you should put each |
| 28 | * mailbox settings in an array. |
| 29 | */ |
| 30 | $mailboxes = [ |
| 31 | // Just for displaying in the web-admin and utilities. Not necessary. |
| 32 | 'name' => 'Dmarc-Rua', |
| 33 | // Host of the email server. You can specify a port separated by a colon. |
| 34 | 'host' => 'yourdomain.net', |
| 35 | // Connection encryption method. The valid values are: |
| 36 | // 'none' - without encryption (strongly not recommend). |
| 37 | // 'ssl' - SSL/TLS on a separate port, for IMAP it is usually port 993. Default value. |
| 38 | // 'starttls' - STARTTLS method, usually on the standard IMAP port 143. |
| 39 | 'encryption' => 'ssl', |
| 40 | // Set true if you want to connect to the IMAP server without certificate validation |
| 41 | 'novalidate-cert' => false, |
| 42 | // Mailbox user name. |
| 43 | 'username' => '[email protected]', |
| 44 | // Mailbox password or OAuth token when the authentication method is 'oauth'. |
| 45 | 'password' => 'password', |
| 46 | // Authentication method. The valid values are: |
| 47 | // 'plain' - authentication with username and password. Default value. |
| 48 | // 'oauth' - OAuth authentication. Pass the token as the password. |
| 49 | // Only available with the imap-engine library (see the fetcher->library setting). |
| 50 | 'authentication' => 'plain', |
| 51 | // Mailbox name |
| 52 | 'mailbox' => 'INBOX', |
| 53 | // IMAP authentication methods to be excluded. |
| 54 | // For example: 'auth_exclude' => [ 'GSSAPI', 'NTLM' ] |
| 55 | 'auth_exclude' => [] |
| 56 | ]; |
| 57 | |
| 58 | /** |
| 59 | * This option is NOT INTENDED for direct access to MAILBOX directories. |
| 60 | * It is only required if you want to get reports files (xml, zip, gz) from a server directory. |
| 61 | * In order to collect reports from several directories, you should put each |
| 62 | * directory settings in an array. Processing of the directories is not recursive. |
| 63 | * It is recommended to use atomic methods for adding files to these directories. |
| 64 | * Attention! All successfully processed files will be deleted from the directories |
| 65 | * and all others will be moved to subdirectory `failed`, that will be created |
| 66 | * automatically if it does not exist. You can change this behavior under fetcher->directories. |
| 67 | */ |
| 68 | //$directories = [ |
| 69 | // // Just for displaying in the web-admin and utilities. Not necessary. |
| 70 | // 'name' => 'Rua-Dir', |
| 71 | // // The directory location |
| 72 | // 'location' => '/var/spool/dmarc-srg/rua' |
| 73 | //]; |
| 74 | |
| 75 | /** |
| 76 | * It is only required if you want to get reports from a remote filesystem. |
| 77 | * In order to collect reports from several filesystems, you should put each |
| 78 | * filesystem settings in an array. Processing of remote filesystems is not recursive. |
| 79 | * It uses the flysystem library to access remote file systems. Make sure this library is installed. |
| 80 | */ |
| 81 | //$remote_filesystems = [ |
| 82 | // // Just for displaying in the web-admin and utilities. Not necessary. |
| 83 | // 'name' => 'AWS-S3', |
| 84 | // |
| 85 | // /** |
| 86 | // * Type of remote filesystem. Required. Only 's3' is supported at this time. |
| 87 | // * Before using the S3 filesystem, you will need to install the Flysystem S3 package |
| 88 | // * via the Composer package manager or your OS package manager. |
| 89 | // * For the Composer package manager run: |
| 90 | // * composer require league/flysystem-aws-s3-v3 |
| 91 | // */ |
| 92 | // 'type' => 's3', |
| 93 | // |
| 94 | // // Bucket name. Required. |
| 95 | // 'bucket' => 'your-bucket-name', |
| 96 | // |
| 97 | // // Path where the reports are located. Required. |
| 98 | // 'path' => '/', |
| 99 | // |
| 100 | // /** |
| 101 | // * They do not recommend to add AWS access keys directly to configuration files. Use credentials provider or |
| 102 | // * environment variables for that. However, you can list your credentials in the following options instead. |
| 103 | // */ |
| 104 | // //'key' => 'YEpoT...', |
| 105 | // //'secret' => 'uyASUDf...', |
| 106 | // //'token' => '...', |
| 107 | // |
| 108 | // // The full URI of the webservice. This is only required when connecting to a custom endpoint. |
| 109 | // //'endpoint' => 'http://localhost:9000', |
| 110 | // |
| 111 | // // Region to connect to. Required. |
| 112 | // // See http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of available regions. |
| 113 | // 'region' => 'us-east-1' |
| 114 | //]; |
| 115 | |
| 116 | $admin = [ |
| 117 | // Set this value to null or remove this parameter to disable authentication |
| 118 | // Note: The authentication always fails with an empty string password. Change it if you want to use the web UI. |
| 119 | 'password' => '' |
| 120 | ]; |
| 121 | |
| 122 | $users = [ |
| 123 | // Enables the use of multiple users in the web interface. The authentication dialog will ask for a username and |
| 124 | // password. Use `admin` as the username for the above password. To add new users, use Administration -> Users. |
| 125 | // The default value is false. |
| 126 | 'user_management' => false, |
| 127 | |
| 128 | /** |
| 129 | * Domain ownership verification method for users who are authorized to add domains. |
| 130 | * This option has no effect on the admin. The valid values are: |
| 131 | * 'none' - There is no verification. |
| 132 | * 'dns' - Verification by adding DNS TXT record like dmarcsrg-verification=... |
| 133 | * The default value is 'none'. |
| 134 | */ |
| 135 | 'domain_verification' => 'none' |
| 136 | ]; |
| 137 | |
| 138 | // |
| 139 | $fetcher = [ |
| 140 | 'mailboxes' => [ |
| 141 | // How many messages will be fetched at once maximum. 0 to disable any limiting. |
| 142 | 'messages_maximum' => 10, |
| 143 | |
| 144 | /** |
| 145 | * What to do with the email message when a report from it has been successfully processed |
| 146 | * and saved to the database. The following actions are available: |
| 147 | * 'mark_seen' - Mark the email message as seen. |
| 148 | * 'delete' - Delete email message from the mailbox. |
| 149 | * 'move_to:dir' - Move the email message to child mailbox with name 'dir'. |
| 150 | * The child mailbox will be created it doesn't exist. |
| 151 | * Note: You can specify multiple actions by putting them in an array. For example: |
| 152 | * 'when_done' => [ 'mark_seen', 'move_to:done' ], |
| 153 | * The default value is 'mark_seen'. |
| 154 | */ |
| 155 | 'when_done' => 'mark_seen', |
| 156 | |
| 157 | /** |
| 158 | * What to do with the email message when a report from it has been rejected. |
| 159 | * The same actions are available as for the when_done. |
| 160 | * The default value is 'move_to:failed'. |
| 161 | */ |
| 162 | 'when_failed' => 'move_to:failed', |
| 163 | |
| 164 | /** |
| 165 | * Library for connecting to a mailbox via IMAP. |
| 166 | * The following values are available: |
| 167 | * 'imap-engine' - use the PHP library ImapEngine. You can install it with composer. |
| 168 | * 'php-extension' - use the built-in PHP IMAP extension. Warning! This extension is DEPRECATED. |
| 169 | * 'auto' - use ImapEngine, if it is not installed then try to use the PHP IMAP extension. |
| 170 | * The default value is 'auto'. |
| 171 | */ |
| 172 | 'library' => 'auto' |
| 173 | ], |
| 174 | 'directories' => [ |
| 175 | // How many report files will be processed at once maximum. 0 to disable any limiting. |
| 176 | 'files_maximum' => 50, |
| 177 | |
| 178 | /** |
| 179 | * What to do with the report file when it has been successfully processed. |
| 180 | * The following actions are available: 'delete', 'move_to'. See the when_done for mailboxes |
| 181 | * for detailed description. |
| 182 | * The default value is 'delete'. |
| 183 | */ |
| 184 | 'when_done' => 'delete', |
| 185 | |
| 186 | /** |
| 187 | * What to do with the report file when it has been rejected. |
| 188 | * The same actions are available as for the when_done. |
| 189 | * The default value is 'move_to:failed'. |
| 190 | * |
| 191 | */ |
| 192 | 'when_failed' => 'move_to:failed' |
| 193 | ], |
| 194 | 'remote_filesystems' => [ |
| 195 | // See directories/files_maximum |
| 196 | 'files_maximum' => 50, |
| 197 | |
| 198 | // See directories/when_done |
| 199 | 'when_done' => 'delete', |
| 200 | |
| 201 | // See directories/when_failed |
| 202 | 'when_failed' => 'move_to:failed' |
| 203 | ], |
| 204 | /** |
| 205 | * Domains matching this regular expression will be automatically added to the database from processed |
| 206 | * reports. This option does not affect domains that have already been added to the database. |
| 207 | * It is not necessary to use this option in most cases. The option can be useful if you have many domains |
| 208 | * or subdomains and do not want to add them manually in the GUI. An empty string or null doesn't match any domain. |
| 209 | * Note: The first domain from the first report will be automatically added anyway. |
| 210 | * Some examples: |
| 211 | * '.+\\.example\\.net$' - Matches any subdomain of the domain example.net |
| 212 | * '^mymail[0-9]+\\.net$' - Matches the domains mymail01.net, mymail02.net, mymail99999.net, etc. |
| 213 | */ |
| 214 | 'allowed_domains' => '' |
| 215 | ]; |
| 216 | |
| 217 | // Settings for sending summary reports if it is necessary. |
| 218 | // It uses in utils/summary_report.php |
| 219 | $mailer = [ |
| 220 | /** |
| 221 | * The library used to send e-mails. The following values are currently supported: |
| 222 | * 'internal' - use the PHP internal functions. Default value. |
| 223 | * 'phpmailer' - use the PHPMailer library. You can install it with composer. |
| 224 | */ |
| 225 | 'library' => 'internal', |
| 226 | |
| 227 | /** |
| 228 | * The method used to send email. Note: The 'smtp' method requires the PHPMailer library. Make sure it is installed. |
| 229 | * 'mail' - use the standard PHP mail() function. Default value. |
| 230 | * 'smtp' - sent via SMTP. This method required the PHPMailer library. See below for required parameters. |
| 231 | */ |
| 232 | 'method' => 'mail', |
| 233 | |
| 234 | /** |
| 235 | * Sender's e-mail address |
| 236 | */ |
| 237 | 'from' => '[email protected]', |
| 238 | |
| 239 | /** |
| 240 | * Recepient's default e-mail address |
| 241 | */ |
| 242 | 'default' => '[email protected]', |
| 243 | |
| 244 | /* |
| 245 | * For method 'smtp' the following parameters must be specified: |
| 246 | */ |
| 247 | |
| 248 | /** |
| 249 | * SMTP host to connect to. |
| 250 | */ |
| 251 | //'host' => 'mailhost.net', |
| 252 | |
| 253 | /** |
| 254 | * TCP port to connect to. |
| 255 | * Typically it is 465 for SSL/TLS, 587 for STARTTLS, or 25. |
| 256 | */ |
| 257 | //'port' => 465, |
| 258 | |
| 259 | /** |
| 260 | * Connection encryption method. The valid values are: |
| 261 | * 'none' - without encryption (strongly not recommend). |
| 262 | * 'ssl' - SSL/TLS on a separate port, for SMTP it is usually port 465. Default value. |
| 263 | * 'starttls' - STARTTLS method, usually on the standard SMTP port 587. |
| 264 | */ |
| 265 | //'encryption' => 'ssl', |
| 266 | |
| 267 | /** |
| 268 | * Set true if you want to connect to the SMTP server without certificate validation |
| 269 | */ |
| 270 | //'novalidate-cert' => false, |
| 271 | |
| 272 | /** |
| 273 | * User name. Specify an empty string if authentication is not required. |
| 274 | */ |
| 275 | //'username' => 'someusername', |
| 276 | |
| 277 | /** |
| 278 | * User password. Specify an empty string if authentication is not required. |
| 279 | */ |
| 280 | //'password' => 'somepasword' |
| 281 | ]; |
| 282 | |
| 283 | // |
| 284 | $cleaner = [ |
| 285 | // It is used in utils/mailbox_cleaner.php |
| 286 | 'mailboxes' => [ |
| 287 | // Will remove messages older than (days) |
| 288 | 'days_old' => 30, |
| 289 | |
| 290 | // How many messages will be removed at once maximum. |
| 291 | 'delete_maximum' => 50, |
| 292 | |
| 293 | // How many messages must be leave in the mailbox minimum. |
| 294 | 'leave_minimum' => 100, |
| 295 | |
| 296 | /** |
| 297 | * Status of emails to be deleted for mailboxes where successfully processed emails and rejected emails |
| 298 | * are located. If it is the same mailbox, then the more forgiving criteria of the two will be used. |
| 299 | * The valid values are: |
| 300 | * 'none' - no action with it. The default value for rejected mail messages. |
| 301 | * 'seen' - only seen messages will be removed. The default value for successfully processed mail messages. |
| 302 | * 'any' - all messages will be removed. |
| 303 | * Note: In the mailbox, where letters with incoming DMARC reports initially come in, unseen messages |
| 304 | * will not be deleted in any case. |
| 305 | */ |
| 306 | 'done' => 'seen', |
| 307 | 'failed' => 'none' |
| 308 | ], |
| 309 | |
| 310 | // It is used in utils/reports_cleaner.php |
| 311 | 'reports' => [ |
| 312 | 'days_old' => 30, |
| 313 | 'delete_maximum' => 50, |
| 314 | 'leave_minimum' => 100 |
| 315 | ], |
| 316 | |
| 317 | // It is used in utils/reportlog_cleaner.php |
| 318 | 'reportlog' => [ |
| 319 | 'days_old' => 30, |
| 320 | 'delete_maximum' => 50, |
| 321 | 'leave_minimum' => 100 |
| 322 | ] |
| 323 | ]; |
| 324 | |
| 325 | /** |
| 326 | * Path to a custom CSS file to add it to the HTML header in order to use custom styles. |
| 327 | * The file must be a regular CSS file and its name must end with ".css". |
| 328 | */ |
| 329 | //$custom_css = 'css/custom.css'; |