Commit Graph

293 Commits

Author SHA1 Message Date
Daniel Stenberg a5ab72d5ed
test677: IMAP CONNECT_ONLY, custom command and then exit
Adjusted ftpserver.pl to add support for the IMAP IDLE command

Adjusted test 660 to sync with the fix
2021-06-24 09:07:40 +02:00
Daniel Stenberg bd738bef12
ftpserver: only load the preprocessed test file
We always preprocess and tests are no longer sensible to load "raw"

Closes #6738
2021-03-19 15:57:27 +01:00
Daniel Stenberg 4d2f800677
curl.se: new home
Closes #6172
2020-11-04 23:59:47 +01:00
Daniel Stenberg 4a4c724599
ftp: make a 552 response return CURLE_REMOTE_DISK_FULL
Added test 348 to verify. Added a 'STOR' command to the test FTP
server to enable test 348. Documented the command in FILEFORMAT.md

Reported-by: Duncan Wilcox
Fixes #6016
Closes #6017
2020-09-26 13:37:15 +02:00
Daniel Stenberg 424092e70f
runtests: support dynamicly base64 encoded sections in tests
This allows us to make test cases to use base64 at run-time and still
use and verify information determined at run-time, such as the IMAP test
server's port number in test 842.

This change makes 12 tests run again that basically never ran since we
moved to dynamic port numbers.

ftpserver.pl is adjusted to load test instructions and test number from
the preprocessed test file.

FILEFORMAT.md now documents the new base64 encoding syntax.

Reported-by: Marcel Raad
Fixes #5761
Closes #5775
2020-08-04 18:12:42 +02:00
Daniel Stenberg 1535363e72
ftpserver: don't verify SMTP MAIL FROM names
Rely on tests asking the names to get refused instead - test servers
should be as dumb as possible. Edited test 914, 955 and 959 accordingly.

Closes #5639
2020-07-03 10:10:30 +02:00
Daniel Stenberg 7e359bccd2
tests: move pingpong server to dynamic listening port
FTP, IMAP, POP3, SMTP and their IPv6 versions are now all on dynamic
ports

Test 842-845 are unfortunately a bit hard to move over to this concept
right now and require "default port" still...
2020-04-18 23:57:22 +02:00
Marc Hoersken 2a93021750
tests: add Windows compatible pidwait like pidkill and pidterm
Related to #5188
2020-04-11 23:46:00 +02:00
Marc Hoersken 7208a989b7
ftpserver.pl: log before and after data connection is closed 2020-04-02 18:31:02 +02:00
Viktor Szakats af07875c0d
cleanup: fix some text/comment typos
Closes #5087
2020-03-12 14:28:17 +01:00
Marc Hoersken 9aaca09044
tests: try to make sleeping portable by avoiding select
select does not support just waiting on Windows:
https://perldoc.perl.org/perlport.html#select

Reviewed-By: Daniel Stenberg
Closes #5035
2020-03-04 15:31:42 +01:00
Steve Holme efce3ea5a8
smtp: Support the SMTPUTF8 extension in the VRFY command 2020-02-26 14:54:51 +00:00
Steve Holme 483edeb8dd
smtp: Support the SMTPUTF8 extension in the RCPT TO command
Note: The RCPT TO command isn't required to advertise to the server that
it contains UTF-8 characters, instead the server is told that a mail may
contain UTF-8 in any envelope command via the MAIL command.
2020-02-26 14:54:51 +00:00
Steve Holme aba1bf630f
smtp: Support the SMTPUTF8 extension in the MAIL command
Support the SMTPUTF8 extension when sending mailbox information in the
MAIL command (FROM and AUTH parameters). Non-ASCII domain names will
be ACE encoded, if IDN is supported, whilst non-ASCII characters in
the local address part are passed to the server.

Reported-by: ygthien on github
Fixes #4828
2020-02-26 14:49:40 +00:00
Steve Holme 2aa6c1735a
smtp: Support UTF-8 based host names in the VRFY command 2020-02-26 11:02:38 +00:00
Steve Holme 6995b77a52
ftpserver: Updated VRFY_smtp() so the response isn't necessary in the test case 2020-02-24 23:01:05 +00:00
Steve Holme 80ccc26415
ftpserver: Corrected the e-mail address regex in MAIL_smtp() and RCTP_smtp()
The dot character between the host and the tld was not being escaped,
which meant it specified a match of 'any' character rather than an
explicit dot separator.

Additionally removed the dot character from the host name as it allowed
the following to be specified as a valid address in our test cases:

<bad@example......com>

Both are typos from 98f7ca7 and 8880f84 :(

I can't remember whether my intention was to allow sub-domains to be
specified in the host or not with these additional dots, but by placing
it outside of the host means it can only be specified once per domain
and by placing a + after the new grouping support for sub-domains is
kept.

Closes #4912
2020-02-24 22:59:08 +00:00
Marc Hoersken 9819984fbb tests: make it possible to set executable extensions
This enables the use of Windows Subsystem for Linux (WSL) to run the
testsuite against Windows binaries while using Linux servers.

This commit introduces the following environment variables:
- CURL_TEST_EXE_EXT: set the executable extension for all components
- CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only
- CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only

Later testcurl.pl could be adjusted to make use of those variables.
- CURL_TEST_EXE_EXT_SRV: set it for the test servers only

(This is one of several commits to support use of WSL for the tests.)

Closes https://github.com/curl/curl/pull/3899
2019-12-09 19:32:41 -05:00
Nicklas Avén 6987fcef65
imap: change from "FETCH" to "UID FETCH"
... and add "MAILINDEX".

As described in #2789, this is a suggested solution.  Changing UID=xx to
actually get mail with UID xx and add "MAILINDEX" to get a mail with a
special index in the mail box (old behavior).  So MAILINDEX=1 gives the
first non deleted mail in the mail box.

Fixes #2789
Closes #2815
2018-09-06 10:57:48 +02:00
Viktor Szakats 7e35eb7729 spelling fixes
Detected using the `codespell` tool.

Also contains one URL protocol upgrade.

Closes https://github.com/curl/curl/pull/2334
2018-02-23 23:29:01 +00:00
Patrick Monnerat 62cf2d180e smtp: fix processing of initial dot in data
RFC 5321 4.1.1.4 specifies the CRLF terminating the DATA command
should be taken into account when chasing the <CRLF>.<CRLF> end marker.
Thus a leading dot character in data is also subject to escaping.

Tests 911 and test server are adapted to this situation.
New tests 951 and 952 check proper handling of initial dot in data.

Closes #2304
2018-02-12 16:43:15 +01:00
Daniel Stenberg 615edc1f73
sasl_getmesssage: make sure we have a long enough string to pass
For pop3/imap/smtp, added test 891 to somewhat verify the pop3
case.

For this, I enhanced the pingpong test server to be able to send back
responses with LF-only instead of always using CRLF.

Closes #2150
2017-12-05 17:05:44 +01:00
Daniel Stenberg b20df57326
ftpserver: support case insensitive commands 2017-10-10 23:00:52 +02:00
Patrick Monnerat eb04636d68 ftpserver: properly reset $ftptargetdir. 2017-10-08 19:29:44 +01:00
Daniel Stenberg a4db3f7046
tests: make the imap server not verify user+password
... as the test cases themselves do that and it makes it easier to add
crazy test cases.

Test 800 updated to use user name + password that need quoting.

Test 856 updated to trigger an auth fail differently.

Ref: #1902
2017-09-22 14:43:33 +02:00
Daniel Stenberg 27302abb94 s/cURL/curl
We're mostly saying just "curl" in lower case these days so here's a big
cleanup to adapt to this reality. A few instances are left as the
project could still formally be considered called cURL.
2016-11-07 10:36:23 +01:00
Daniel Stenberg 4af40b3646 URLs: change all http:// URLs to https:// 2016-02-03 00:19:02 +01:00
Steve Holme acefed139f ftpserver.pl: Extended the full text reply regular expression
Extended the regex to include other valid characters such as those used
in the reply text of Test 836.
2014-03-30 22:00:04 +01:00
Steve Holme 54ef196db8 ftpserver.pl: Removed some unused variables 2014-03-30 10:37:45 +01:00
Steve Holme 5b773658a8 ftpserver.pl: Reworked some variable names to be more meaningful 2014-03-30 00:12:38 +00:00
Steve Holme f559611aa1 ftpserver.pl: Corrected some indentation in senddata() 2014-03-29 23:17:16 +00:00
Steve Holme 2baf38f7c3 ftpserver.pl: Added fallback to <data> support when using multiple URLs
Added support for falling back to <data> when <data1>, <data2>, etc...
don't exist in the <reply> section of a unit test.
2014-03-29 20:50:27 +00:00
Steve Holme 8293691b88 ftpserver.pl: Updated email based get reply data code to use new method 2014-03-29 17:30:19 +00:00
Steve Holme fdb13d885a ftpserver.pl: Fixed syntax error from commit 3a29ee41 2014-03-29 12:32:03 +00:00
Steve Holme 8541f2d39d ftpserver.pl: Updated argument code in STATUS_imap() to be more meaningful 2014-03-29 11:15:19 +00:00
Steve Holme 3a29ee41ef ftpserver.pl: Introduced common method for getting a test's reply data 2014-03-29 10:29:17 +00:00
Marc Hoersken ca9ab24ed5 ftpserver.pl: directory LISTings use [CR][LF] for ASCII transfer
According to section 2.2 of RFC959 the End-of-Line is defined as:
 The end-of-line sequence defines the separation of printing
 lines.  The sequence is Carriage Return, followed by Line Feed.

Verified by sniffing traffic between a Windows FTP client (FileZilla)
and Unix-hosted FTP server (ProFTPD).
2014-01-31 20:05:14 +01:00
Dan Fandrich 821094ba72 Fixed some XML syntax issues in the test data
Also, make the ftp server return a canned response that doesn't
cause XML verification problems.  Although the test file format
isn't technically XML, it's still handy to be able to use XML
tools to verify and manipulate them.
2014-01-17 00:32:02 +01:00
Daniel Stenberg 5c0eae136b ftp tests: provide LIST responses in the test file itself
Previously LIST always returned a fixed hardcoded list that the ftp
server code knew about, mostly since the server didn't get any test case
number in the LIST scenario. Starting now, doing a CWD to a directory
named test-[number] will make the test server remember that number and
consider it a test case so that a subsequent LIST command will send the
<data> section of that test case back.

It allows LIST tests to be made more similar to how all other tests
work.

Test 100 was updated to provide its own directory listing.
2014-01-04 23:39:30 +01:00
Steve Holme 95b5036a59 ftpserver.pl: Fixed compilation error
Unmatched right curly bracket at line 758, at end of line
2013-12-27 20:14:06 +00:00
Steve Holme 263616202b ftpserver.pl: Reworked SMTP verified server detection
Following the addition of informational commands to the SMTP protocol,
the test server is no longer required to return the verified server
information in responses that curl only outputs in verbose mode.

Instead, a similar detection mechanism to that used by FTP, IMAP and
POP3 can now be used.
2013-12-27 18:15:04 +00:00
Steve Holme 6f2d5f0562 pop3: Fixed APOP being determined by CAPA response rather than by timestamp
This commit replaces that of 9f260b5d66 because according to RFC-2449,
section 6, there is no APOP capability "...even though APOP is an
optional command in [POP3].  Clients discover server support of APOP by
the presence in the greeting banner of an initial challenge enclosed in
angle brackets."
2013-12-24 16:34:55 +00:00
Steve Holme 82bf8edff3 tests: Removed APOP timestamp from default server greeting 2013-12-24 15:07:32 +00:00
Steve Holme 50aac1a37d ftpserver.pl: Updated custom full text REPLY regex
SASL downgrade tests: 833, 835, 879, 881, 935 and 937 would fail as
they contained a minus sign in their authentication mechanism and this
would be missed by the custom reply parser.
2013-12-23 12:24:06 +00:00
Steve Holme 3db1f3dd81 ftpserver.pl: Fixed runtime warning from commit 7da9c95bcf
Use of uninitialized value $FTPARG in concatenation (.) or string at
line 3255.
2013-12-22 21:59:13 +00:00
Steve Holme 7da9c95bcf ftpserver.pl: Added the ability to send custom full text replies 2013-12-22 19:36:07 +00:00
Steve Holme 95ae389e17 ftpserver.pl: Added the ability to specify custom full text replies 2013-12-22 17:16:46 +00:00
Steve Holme 91735102ac ftpserver.pl: Renamed commandreply variable from customreply 2013-12-22 16:09:33 +00:00
Steve Holme 23fabf8dea ftpserver.pl: Reworked fix from commit 7a36b2abc0 2013-11-23 22:14:34 +00:00
Steve Holme 7a36b2abc0 ftpserver.pl: Fixed unknown IMAP command "*" 2013-11-23 19:19:12 +00:00