sendmail: make it possible to pause after connection helper is started
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 7 Sep 2016 11:16:33 +0000 (13:16 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 7 Sep 2016 11:16:33 +0000 (13:16 +0200)
commitb9f56e82da9a0821011e1e0924acd1d781643070
treee6a5edcae1b4fb9365431690c80a892870f6735d
parentd42cdc2222d08fcc5ad8251ecf7a00454cb0c419
sendmail: make it possible to pause after connection helper is started

If a non-starttls helper is in use, initial 220 response is processed by us,
not by helper.
Some servers consider us to be a spammer if we don't wait for it.

It is not in protocol, but it is a real-life problem.

The workaround in this patch is a magic envvar, $SMTP_ANTISPAM_DELAY:

...
-H 'PROG ARGS' Run connection helper. Examples:
openssl s_client -quiet -tls1 -starttls smtp -connect smtp.gmail.com:25
openssl s_client -quiet -tls1 -connect smtp.gmail.com:465
$SMTP_ANTISPAM_DELAY: seconds to wait after helper connect
...

By using it, people can tweak sendmail behavior even if sendmail invocation
is buried in some scripts.

function                                             old     new   delta
packed_usage                                       30464   30497     +33
sendmail_main                                       1185    1206     +21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 54/0)               Total: 54 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
mailutils/sendmail.c