This patch is not final, it needs some pointers/input.
So I found myself wanting to have an ACL run on every single exit of an
SMTP connection for whatever reason so that I could use it to figure out
if a host was being nice and using quit or just dropping the connection,
and finding that information out sooner rather than later.
I have delved into the code and tried to produce something that wont
blow up any old configurations and should work to fill pretty much
everyone's wishes. It's a little bit ugly, but I can work on that if
this is deemed to not be a complete waste of everyone's time.
It has a few limitations due to the number of ways that a connection can
fail and the complexity of some of exit functions that I was not game to
touch for fear of really screwing something up. I should revisit
smtp_handle_acl_fail in smtp_in.c and see if I can more closely tie in
the exit acl instead of its present implementation where the user_msg
and log_msg are not used.
When the connection is terminated due to a local configuration or system
problem, the exit acl is also not called as it makes a pair already
cyclic function calls into a self calling triple.
A variable $smtp_notquit_reason is available to the acl for the user to
figure out what went wrong.
command-timeout - exim timed out waiting for next SMTP command
sigterm - got sigterm while in initial conversation
acl-drop - an ACL in the conversation returned "drop"
tls-failed - TLS failed to start
connection-lost - connection was lost at any stage
synchronization-error - sync error
bad-commands - too many SMTP commands in a row, or too many non mail
logging-error - one of the log errors I could handle
data-timeout - no data in DATA section in a long time
config-eror - something went boom in your config
signal-exit - got sigterm or sigint while receiving message body
I did not make a new ACL for sync errors as, I thought it was a bad
idea. If people really want it I can probably add it in a matter of
minutes now that I know how this section of the exim code works.
I want to blacklist the "delay" term from being used in the acl as it's
completely useless and may screw things over as this acl is called
during a number of signal handlers. From what I understand of how the
signals have been setup in an exim receiving process, this isn't really
that big an issue as the signal is left disabled during the processing
of the signal, but it still leaves an opening for people to be stupid.
What little I tried to this front ended up not working in the slightest.
I guess now the question is, what do I need to do to this make it good
enough to be accepted or should I just /dev/null it?
I also added the QUIT ACL being called in one extra place where I
thought it should be, just for completeness. There was another place I
wanted to add it but I can't find it right at this very moment.
Ted.
--
The Exim Manual
http://www.exim.org/docs.html
http://www.exim.org/exim-html-current/doc/html/spec_html/index.html
So I found myself wanting to have an ACL run on every single exit of an
SMTP connection for whatever reason so that I could use it to figure out
if a host was being nice and using quit or just dropping the connection,
and finding that information out sooner rather than later.
I have delved into the code and tried to produce something that wont
blow up any old configurations and should work to fill pretty much
everyone's wishes. It's a little bit ugly, but I can work on that if
this is deemed to not be a complete waste of everyone's time.
It has a few limitations due to the number of ways that a connection can
fail and the complexity of some of exit functions that I was not game to
touch for fear of really screwing something up. I should revisit
smtp_handle_acl_fail in smtp_in.c and see if I can more closely tie in
the exit acl instead of its present implementation where the user_msg
and log_msg are not used.
When the connection is terminated due to a local configuration or system
problem, the exit acl is also not called as it makes a pair already
cyclic function calls into a self calling triple.
A variable $smtp_notquit_reason is available to the acl for the user to
figure out what went wrong.
command-timeout - exim timed out waiting for next SMTP command
sigterm - got sigterm while in initial conversation
acl-drop - an ACL in the conversation returned "drop"
tls-failed - TLS failed to start
connection-lost - connection was lost at any stage
synchronization-error - sync error
bad-commands - too many SMTP commands in a row, or too many non mail
logging-error - one of the log errors I could handle
data-timeout - no data in DATA section in a long time
config-eror - something went boom in your config
signal-exit - got sigterm or sigint while receiving message body
I did not make a new ACL for sync errors as, I thought it was a bad
idea. If people really want it I can probably add it in a matter of
minutes now that I know how this section of the exim code works.
I want to blacklist the "delay" term from being used in the acl as it's
completely useless and may screw things over as this acl is called
during a number of signal handlers. From what I understand of how the
signals have been setup in an exim receiving process, this isn't really
that big an issue as the signal is left disabled during the processing
of the signal, but it still leaves an opening for people to be stupid.
What little I tried to this front ended up not working in the slightest.
I guess now the question is, what do I need to do to this make it good
enough to be accepted or should I just /dev/null it?
I also added the QUIT ACL being called in one extra place where I
thought it should be, just for completeness. There was another place I
wanted to add it but I can't find it right at this very moment.
Ted.
--
The Exim Manual
http://www.exim.org/docs.html
http://www.exim.org/exim-html-current/doc/html/spec_html/index.html