What I want to do is use the samba password tool (smbpasswd) in remote mode (-r) to change user passwords in another domain (mail) from a flat file. It works if I manualy type the user's passwords in on the command line but not if I do it via expect. Either I am using expect wrong or there is something I need to alter to make expect work as it should.
Don't ask me why I thought of this. But if you get tired of trying to get Expect to work, you could instead create a chroot environment for smbpasswd where /dev/tty is a pipe or a link to /dev/fd/0 or some other thing that will let you put stuff there for it to read. (: