From:
[email protected]
--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Package: ssmtp
Version: 2.60.12
Severity: wishlist
Tags: patch
Needing to try and debug a problem somewhere in the mail system of an application, I needed a log of the SMTP transaction generated by ssmtp. The
-d option is useful, but I couldn't set that easily (auto-generated call to /usr/sbin/sendmail). Instead, I've hacked ssmtp to provide a Debug config
file option.
It works for me so far -- I've found the problem I was trying to solve, so
it's paid for itself already. <grin>
I'd appreciate it if you would apply it to the next release of ssmtp, or let
me know what's wrong with it. Licence is GPL.
- Matt
--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="debug_option.patch" Content-Transfer-Encoding: quoted-printable
diff -urN ssmtp-2.60.12.orig/ssmtp.c ssmtp-2.60.12.0mpalmer1/ssmtp.c
--- ssmtp-2.60.12.orig/ssmtp.c 2004-07-23 15:58:48.000000000 +1000
+++ ssmtp-2.60.12.0mpalmer1/ssmtp.c 2004-08-18 09:53:21.000000000 +1000
@@ -964,6 +964,17 @@
log_event(LOG_INFO, "Set AuthMethod=\"%s\"\n", auth_method);
}
}
+ else if (strcasecmp(p, "Debug") == 0)
+ {
+ if (strcasecmp(q, "YES") == 0)
+ {
+ log_level = 1;
+ }
+ else
+ {
+ log_level = 0;
+ }
+ }
else {
log_event(LOG_INFO, "Unable to set %s=\"%s\"\n", p, q);
}
diff -urN ssmtp-2.60.12.orig/ssmtp.conf ssmtp-2.60.12.0mpalmer1/ssmtp.conf
--- ssmtp-2.60.12.orig/ssmtp.conf 2004-07-23 15:58:48.000000000 +1000
+++ ssmtp-2.60.12.0mpalmer1/ssmtp.conf 2004-08-18 09:51:52.000000000 +1000
@@ -36,3 +36,8 @@
# Use this RSA certificate.
#TLSCert=/etc/ssl/certs/ssmtp.pem
+
+# Get enhanced (*really* enhanced) debugging information in the logs
+# If you want to have debugging of the config file parsing, move this option +# to the top of the config file and uncomment
+#De