1 From 59b5bfb6e2095c62925b31e087571506edae7956 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Amadeusz=20Piotr=20=C5=BBo=C5=82nowski?=
4 Date: Sun, 7 Jul 2019 11:33:09 +0100
5 Subject: [PATCH] Use loopback IP address rather than name
8 test/smtp-dummy.c | 8 ++++----
9 test/test-lib.sh | 2 +-
10 2 files changed, 5 insertions(+), 5 deletions(-)
12 diff --git a/test/smtp-dummy.c b/test/smtp-dummy.c
13 index a7c1fe4f..822a986a 100644
14 --- a/test/smtp-dummy.c
15 +++ b/test/smtp-dummy.c
16 @@ -76,7 +76,7 @@ process_command (FILE *peer, FILE *output, const char *command)
17 fprintf (peer, "502 not implemented\r\n");
19 } else if (STRNCMP_LITERAL (command, "HELO ") == 0) {
20 - fprintf (peer, "250 localhost\r\n");
21 + fprintf (peer, "250 127.0.0.1\r\n");
23 } else if (STRNCMP_LITERAL (command, "MAIL FROM:") == 0 ||
24 STRNCMP_LITERAL (command, "RCPT TO:") == 0) {
25 @@ -105,7 +105,7 @@ do_smtp_to_file (FILE *peer, FILE *output)
29 - fprintf (peer, "220 localhost smtp-dummy\r\n");
30 + fprintf (peer, "220 127.0.0.1 smtp-dummy\r\n");
33 while ((line_len = getline (&line, &line_size, peer)) != -1) {
34 @@ -183,9 +183,9 @@ main (int argc, char *argv[])
38 - hostinfo = gethostbyname ("localhost");
39 + hostinfo = gethostbyname ("127.0.0.1");
40 if (hostinfo == NULL) {
41 - fprintf (stderr, "Unknown host: localhost\n");
42 + fprintf (stderr, "Unknown host: 127.0.0.1\n");
46 diff --git a/test/test-lib.sh b/test/test-lib.sh
47 index 616cb674..dd887773 100644
48 --- a/test/test-lib.sh
49 +++ b/test/test-lib.sh
50 @@ -336,7 +336,7 @@ emacs_deliver_message ()
52 "(let ((message-send-mail-function 'message-smtpmail-send-it)
53 (mail-host-address \"example.com\")
54 - (smtpmail-smtp-server \"localhost\")
55 + (smtpmail-smtp-server \"127.0.0.1\")
56 (smtpmail-smtp-service \"${smtp_dummy_port}\"))