On 4 Feb 2014, at 14:38, Urs Grützner wrote:
> Thanks a lot for this elaborate and helpful answer
I rarely avoid "elaborate" and am always glad to find that I've managed
"helpful" as well.
> If I understand correctly: when I do the Telnet from may laptop,
> after I was connecting with
> my mail program, my temporarily IP number is detected as client, so I
> do not get a waiting time.
Right. You can tell what class of SMTP client CGP sees you as (normal,
banned, or client) by reading the text of the initial SMTP prompt. That
is useful when diagnosing problems that may only exist for non-clients:
if you see " glad to see you!" then CGP is treating you as a client.
> However the prompt delay was and is set to 0 sec.
>
> I am still wondering where this 27 sec delay is coming from? It seems
> to be constantly 27 sec, no random variation. The delay prompt for
> non-clients seems not to be the culprit.
Which conflicts with the functional tests:
1. When seen by CGP as connecting from a client IP, you got an instant
220 prompt.
2. When seen by CGP as a normal unknown client IP, I got an
idiosyncratic "477" reply that I don't believe CGP ever sends unless it
has intentionally delayed the prompt.
I have 2 theories that could explain this:
1. You are using the "Detect Clients by DNS Name" feature and there is
something wrong with your DNS configuration on the CGP host that is
causing the DNS lookups needed to determine client status to take a long
time. A common cause of DNS lookups having fixed delays is if you have
multiple DNS servers configured for the system's resolver but the first
one (or more) are not actually answering your queries. This will result
in normal queries always taking a fixed long time as the system resolver
tries the configured DNS servers in order with a timeout for each
unresponsive server. Because there's a system default timeout and
programs like CGP can specify their own timeouts on each query, it isn't
unusual in such cases to see unwavering unusual values for the DNS
delay. The same sort of problem can also occur with less visibility if
you are using a DNS server that is configured to forward queries to
other DNS servers, but in that case you will usually not see the problem
persistently because such DNS servers usually only exist for their
caching (i.e. a second connection soon after a delayed one the same IP
won't get delayed because the DNS records are cached.) If this is the
correct explanation, it indicates that the "477" reply I got CGP to send
is NOT only sent in conjunction with intentional delays, but also is
sent when CGP is waiting on DNS to figure out which prompt text to send.
2. The "Delay Prompt For Non-Clients" feature is actually set but it was
somehow set to 27 seconds, a value that CGP doesn't include in the web
admin menu for that setting. This is possible because settings can also
be changed via the CGP CLI (port 106) or by manually editing the config
files. This would raise the question of who did such a thing, since you
are not aware of it, but it is easily checked:
/var/CommuniGate/Settings/SMTP.settings is a plain text file with
settings in an easily-read format and DelayPrompt is the setting name.
To fix this without restarting CGP or using the CLI, you could just set
the delay to some non-zero value in the web admin interface. I recommend
5 seconds (even though my boss likes 10...) because my experience with
mail servers where the timing of "fast talker" violations is measured
tells me >99% of the bots that get caught for that do so in under 5
seconds, ~95% in under 1 second.
> Another question: Isn't it possible to see in the log the
> "knock-knock" of a incoming connection. I only see the answer of our
> server and the connection closed py peer entry, so I cannot verify the
> waiting time here (and may be the reason for it)
I'm not sure, since the log settings have evolved over time and I have
not used 5.1.x, but you might be able to see the details you need by
setting the log levels for SMTP and server internals (Settings->General
page) to "Low Level" temporarily. You might need "All Info" to find the
hard evidence, but I doubt it. Another option would be to find an IP
that you can test this from (or that sends you mail regularly) and put
it into the list at Settings->Network->Debug IPs to capture everything
related to that IP in the log. Normally the depth of logging from "All
Info" or "Debug IPs" inclusion is more than you need or want (and may
trigger privacy concerns) but sometimes using those temporarily is the
only way to know what CGP is doing.