Thanks, I've just added the lines:
to the email_swap() function. I then moved ftp_pass_swap above email_swap so that it would work.Code:#the dovecot passwd file uses the same format as the ftp.passwd file. ftp_pass_swap $1 $2 /etc/virtual/$i/passwd
John
John, thank you.
Just one more little "bugfix": it also doesn't update sshd_config regarding SSH access ("AllowUsers oldusername" -> "AllowUsers newusername").