Skip to content

Commit d2e3720

Browse files
committed
update mail config #258
1 parent 27c4c16 commit d2e3720

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

server/application-server/compose.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ services:
3838
restart: unless-stopped
3939
volumes:
4040
- ./postfix-config:/config # See https://github.com/ls1admin/postfix-container-tum-mailrelay/tree/main for details
41-
hostname: ${APP_HOSTNAME:localhost}
41+
hostname: ${APP_HOSTNAME:aet.cit.tum.de}
4242
networks:
43-
- app-network
43+
- app-network
4444

4545
networks:
4646
app-network:

server/application-server/src/main/java/de/tum/in/www1/hephaestus/notification/MailBuilder.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ public MailBuilder fillBadPracticePlaceholders(String badPractice, String placeh
9696
public void send(JavaMailSender mailSender) {
9797
List<User> toRecipients = new ArrayList<>();
9898

99+
/*
99100
for (User recipient : primaryRecipients) {
100101
if (!recipient.isNotificationsEnabled() || recipient.getEmail() == null || !recipient.getEmail().contains("@")) {
101102
continue;
102103
}
103104
toRecipients.add(recipient);
104-
}
105+
}*/
105106

106107
for (User recipient : toRecipients) {
107108
try {
@@ -110,7 +111,7 @@ public void send(JavaMailSender mailSender) {
110111
message.setFrom("Hephaestus <" + config.getSender().getAddress() + ">");
111112
message.setSender(config.getSender());
112113

113-
message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipient.getEmail()));
114+
message.addRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
114115

115116
Context templateContext = new Context();
116117
templateContext.setVariables(this.variables);

server/application-server/src/main/resources/application-prod.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spring:
1414
issuer-uri: ${KEYCLOAK_URL}/realms/${KEYCLOAK_REALM}
1515

1616
mail:
17-
host: ${POSTFIX_HOST:localhost}
17+
host: ${POSTFIX_HOST:postfix}
1818
port: ${POSTFIX_PORT:25}
1919
username: ${POSTFIX_USERNAME:}
2020
password: ${POSTFIX_PASSWORD:}
@@ -44,8 +44,8 @@ hephaestus:
4444
url: ${INTELLIGENCE_SERVICE_URL}
4545

4646
mail:
47-
enabled: ${MAIL_ENABLED:false}
48-
sender: ${MAIL_SENDER:}
47+
enabled: ${MAIL_ENABLED:true}
48+
sender: ${MAIL_SENDER:[email protected]}
4949
signature: ${MAIL_SIGNATURE:}
5050

5151
keycloak:

0 commit comments

Comments
 (0)