Skip to content

Commit

Permalink
BC-5907-fix problem with blocking the sending of specific e-mail doma…
Browse files Browse the repository at this point in the history
…in parts
  • Loading branch information
sszafGCA authored Dec 15, 2023
1 parent 1f6ddc8 commit e72dd50
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/server/src/infra/mail/interfaces/mail-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface MailConfig {
ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS: string[];
BLOCKLIST_OF_EMAIL_DOMAINS: string[];
}
2 changes: 1 addition & 1 deletion apps/server/src/infra/mail/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class MailService {
@Inject('MAIL_SERVICE_OPTIONS') private readonly options: MailServiceOptions,
private readonly configService: ConfigService<MailConfig, true>
) {
this.domainBlacklist = this.configService.get<string[]>('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS');
this.domainBlacklist = this.configService.get<string[]>('BLOCKLIST_OF_EMAIL_DOMAINS');
}

public async send(data: Mail): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/modules/server/server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const config: ServerConfig = {
ADMIN_API__ALLOWED_API_KEYS: (Configuration.get('ADMIN_API__ALLOWED_API_KEYS') as string)
.split(',')
.map((apiKey) => apiKey.trim()),
ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS: (Configuration.get('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS') as string)
BLOCKLIST_OF_EMAIL_DOMAINS: (Configuration.get('BLOCKLIST_OF_EMAIL_DOMAINS') as string)
.split(',')
.map((domain) => domain.trim()),
};
Expand Down
5 changes: 5 additions & 0 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@
"default": "",
"description": "Add custom domain to the list of blocked domains (comma separated list)."
},
"BLOCKLIST_OF_EMAIL_DOMAINS":{
"type": "string",
"default": "",
"description": "Add custom domain to the list of blocked domains (comma separated list)."
},
"FEATURE_TSP_AUTO_CONSENT_ENABLED": {
"type": "boolean",
"default": false,
Expand Down

0 comments on commit e72dd50

Please sign in to comment.