ix-ai / smtp

This is a SMTP docker container for sending emails. You can also relay emails to gmail and amazon SES.
MIT License
92 stars 14 forks source link

Better verbosity control #38

Closed kabalin closed 5 months ago

kabalin commented 5 months ago

Hi, thanks for this relay image. I have lots of unnecessary info for each SES email, VERBOSE setting is not set in env. One line log entry would be enough for most cases.

mailrelay-1    |   286   SMTP<< 250 Ok
mailrelay-1    |   286   SMTP>> DATA
mailrelay-1    |   286   SMTP<< 354 End data with <CR><LF>.<CR><LF>
mailrelay-1    |   286   SMTP>> (writing message)
mailrelay-1    |   286   SMTP>> .
mailrelay-1    |   286   SMTP<< 250 Ok ...
mailrelay-1    |   286   SMTP+> QUIT
mailrelay-1    |   286   SMTP(TLS shutdown)>>
mailrelay-1    |   286   SMTP(shutdown)>>
mailrelay-1    |   286   SMTP<< 221 Bye
mailrelay-1    |   286 LOG: MAIN
mailrelay-1    |   286   SMTP(drain 40 bytes)<< 
mailrelay-1    |   286 0x17
mailrelay-1    |   286 0x03
tlex commented 5 months ago

Thanks for the request. I'll look into it

tlex commented 5 months ago

After going through all the https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html documentation, I can say it's configuration hell what Exim does.

TL;DR: What produces the output is the -v option when starting Exim.

The solution: there isn't any.

So, basically now we have the minimum verbose logs, short of not displaying any logs at all.

I will not build a different image for this, because it can be overridden when starting the container:

docker run --rm -it ixdotai/smtp exim -bdf -q15m

You can also add some debug info, however I couldn't find anything to just work as you expect it:

docker run -it --publish 25:25 -it ixdotai/smtp:latest exim -bdf -q15m -d-all+process_info
using non-split configuration scheme from /etc/exim4/exim4.conf.template
Exim version 4.96 uid=0 gid=0 pid=1 D=100000
Support for: crypteq iconv() IPv6 GnuTLS TLS_resume move_frozen_messages DANE DKIM DNSSEC Event I18N OCSP PIPECONNECT PRDR Queue_Ramp SOCKS SRS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 external plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
Compiler: GCC [12.2.0]
Library version: Glibc: Compile: 2.36
                        Runtime: 2.36
Library version: BDB: Compile: Berkeley DB 5.3.28: (September  9, 2013)
                      Runtime: Berkeley DB 5.3.28: (September  9, 2013)
Library version: GnuTLS: Compile: 3.7.9
                         Runtime: 3.7.9
Library version: IDN2: Compile: 2.3.3
                       Runtime: 2.3.3
Library version: Stringprep: Compile: 1.41
                             Runtime: 1.41
Library version: PCRE2: Compile: 10.42
                        Runtime: 10.42 2022-12-11
[... rest is cut ...]
kabalin commented 5 months ago

Thanks for investigating, I ended up using alternative postfix-based image...