Blame tests/p_dovecot/dovecot_pop3_login.sh

Karanbir Singh 2dd0be
#!/bin/bash
Karanbir Singh 0b5bb2
# Author: Athmane Madjoudj <athmanem@gmail.com>
Christoph Galuschka 0e2392
#         Christoph Galuschka <christoph.galuschka@chello.at>
Karanbir Singh 0b5bb2
Karanbir Singh 2dd0be
t_Log "Running $0 - adding pop3test local user account + attempting POP3 login"
Karanbir Singh 0b5bb2
Christoph Galuschka 0e2392
{ userdel -rf pop3test; useradd pop3test && echo pop3test | passwd --stdin pop3test; } &>/dev/null
Karanbir Singh 2dd0be
Christoph Galuschka 0e2392
# creating maildir in HOME, else test will fail at first try
Christoph Galuschka 0e2392
mkdir -m 700 -p /home/pop3test/mail/.imap/INBOX 
Christoph Galuschka 0e2392
chown -R pop3test:pop3test /home/pop3test/mail/.imap/INBOX
Karanbir Singh 2dd0be
Christoph Galuschka 0e2392
t_Log "Dovecot POP3 login test"
Athmane Madjoudj 87c52a
echo -e "user pop3test\npass pop3test\n" | nc -w 5 localhost 110 | grep -q "+OK Logged in."
Athmane Madjoudj 3a45f5
Steve Barnes 464547
t_CheckExitStatus $?
Athmane Madjoudj 31ca2c
Athmane Madjoudj 31ca2c
userdel -rf pop3test