aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-09-15 09:06:18 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-09-15 09:10:11 +0100
commiteae86ba62dadecc8fc9ef7ae4fc5f3a8439496e9 (patch)
tree2bd2fbc6962f730cca20278c5cdcdb4b3e27e219 /tests/ftpserver.pl
parente9cca79dd1d38f94fdecf7af4b1a8a5512207913 (diff)
ftpserver.pl: Added support for SMTP HELO command
...and updated test902 as explicit HELO response is no longer required.
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index c1df82408..15d00f08f 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -623,6 +623,7 @@ sub protocolsetup {
elsif($proto eq 'smtp') {
%commandfunc = (
'DATA' => \&DATA_smtp,
+ 'HELO' => \&HELO_smtp,
'RCPT' => \&RCPT_smtp,
);
%displaytext = (
@@ -772,6 +773,20 @@ sub RCPT_smtp {
$smtp_rcpt = $args;
}
+sub HELO_smtp {
+ my ($client) = @_;
+
+ # TODO: Get the IP address of the client connection to use in the HELO
+ # response when the client doesn't specify one but for now use 127.0.0.1
+ if (!$client) {
+ $client = "[127.0.0.1]";
+ }
+
+ sendcontrol "250 SMTP pingpong test server Hello $client\r\n";
+
+ return 0;
+}
+
# What was deleted by IMAP STORE / POP3 DELE commands
my @deleted;