We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 775684e + 7ab60ea commit 38b9304Copy full SHA for 38b9304
intelmq/bots/outputs/smtp_batch/output.py
@@ -167,8 +167,12 @@ def cli_run(self):
167
sys.exit(0)
168
elif i == "all":
169
count = 0
170
+ exit_code = 0
171
for mail in mails:
- if self.build_mail(mail, send=True):
172
+ succ = self.build_mail(mail, send=True)
173
+ if not succ:
174
+ exit_code = 1
175
+ else:
176
count += 1
177
print(f"{mail.to} ", end="", flush=True)
178
try:
@@ -183,7 +187,7 @@ def cli_run(self):
183
187
if mail.path:
184
188
os.unlink(mail.path)
185
189
print(f"\n{count}× mail sent.\n")
186
- sys.exit(0)
190
+ sys.exit(exit_code)
191
elif i == "clear":
192
193
self.cache.redis.delete(mail.key)
0 commit comments