Skip to content
Snippets Groups Projects
Unverified Commit d766ac1c authored by Fabian Arrotin's avatar Fabian Arrotin Committed by GitHub
Browse files

Revert "nc option -i/-d is unnecessary"

parent 50c71fd7
No related branches found
No related tags found
No related merge requests found
......@@ -7,14 +7,22 @@ t_Log "Running $0 - adding imaptest local user account + attempting IMAP login"
{ userdel -rf imaptest; useradd imaptest && echo imaptest | passwd --stdin imaptest; } &>/dev/null
# creating maildir in HOME, else test will fail at first try
mkdir -m 700 -p /home/imaptest/mail/.imap/INBOX
mkdir -m 700 -p /home/imaptest/mail/.imap/INBOX
chown -R imaptest:imaptest /home/imaptest/mail
ret_val=1
t_Log "Dovecot IMAP login test"
echo -e "01 LOGIN imaptest imaptest\n" | nc -w 5 localhost 143 | grep -q "Logged in."
# EL7 comes with nmap-nc , different from nc so different options to use
if [ "$centos_ver" -ge 7 ];then
nc_options="-d 3 -w 5"
else
nc_options="-i 3 -w 5"
fi
echo -e "01 LOGIN imaptest imaptest\n" | nc ${nc_options} localhost 143 | grep -q "Logged in."
ret_val=$?
......
......@@ -7,12 +7,20 @@ t_Log "Running $0 - adding pop3test local user account + attempting POP3 login"
{ userdel -rf pop3test; useradd pop3test && echo pop3test | passwd --stdin pop3test; } &>/dev/null
# creating maildir in HOME, else test will fail at first try
mkdir -m 700 -p /home/pop3test/mail/.imap/INBOX
mkdir -m 700 -p /home/pop3test/mail/.imap/INBOX
chown -R pop3test:pop3test /home/pop3test/mail/.imap/INBOX
t_Log "Dovecot POP3 login test"
# EL7 comes with nmap-nc , different from nc so different options to use
echo -e "user pop3test\npass pop3test\n" | nc -w 5 localhost 110 | grep -q "+OK Logged in."
if [ "$centos_ver" -ge 7 ];then
nc_options="-d 3 -w 5"
else
nc_options="-i 3 -w 5"
fi
echo -e "user pop3test\npass pop3test\n" | nc ${nc_options} localhost 110 | grep -q "+OK Logged in."
t_CheckExitStatus $?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment