Commit 9cb7b69
committed
fix: stop forwarding PhpMailer SMTP handshake to the logger
Sentry issue PHP-SYMFONY-2B accumulated 1034 events, each containing
the full PhpMailer SMTP debug dump: base64-encoded auth password,
recipient addresses and the message body. This happened because when
SMTP_DEBUG_LEVEL > 0, PhpMailer's Debugoutput callback was wired into
the Symfony logger, which then forwarded everything to Sentry at notice
level.
Fix: remove the Debugoutput -> logger wiring and the in-memory sendLog
buffer entirely. SMTPDebug still works for local debugging — PhpMailer
prints to stdout / error_log by default. Replace it with a single
info-level "Email sent" log carrying only recipient and subject.
Leaves the monolog Sentry handler threshold untouched.1 parent a29c31b commit 9cb7b69
1 file changed
Lines changed: 5 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 27 | + | |
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
| |||
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
47 | | - | |
48 | 42 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 43 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
65 | 48 | | |
66 | 49 | | |
0 commit comments