-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Timo Sirainen wrote:
| On Aug 1, 2008, at 1:39 AM, Patrick Nagel wrote:
|
|> | mailboxes=printf "1 list "" *\n" | dovecot --exec-mail imap | perl |> magic
|>
|> Ok, looks easy. But I can't find information anywhere on how to
|> specify the
|> user. I tried with 'USER=username' in front of the dovecot call, and
|> dovecot
|> then said 'Logged in as username' instead of 'Logged in as root', but
|> a list
|> command doesn't show the mailboxes, so I think it's not accessing the
|> maildir
|> of that user.
|> I guess it's because the users are not system users, and dovecot needs to
|> retrieve info from the LDAP directory first. But how do I tell it to
|> do that?
|
| You can't do that with --exec-mail. It expects to be running using the
| correct UID, GID, $USER and $HOME.
|
|> Logging in via netcat / telnet works, but then I don't know how to
|> proceed...
|
| With v1.2 code you could use the same printf .. | nc localhost 143, but
| unfortunately this doesn't work with older versions since the input
| buffer is reset after login.
|
I see. So now we're back to "I don't know how to react to dovecot's responses" ;)
To sum up: It's currently (with version 1.1) not possible to script IMAP operations with shell script when using virtual users. With perl or some other scripting language, using an IMAP module, it should be no problem though.
Version 1.2 will make it easier for scripts to interface via IMAP, because you can pipe a batch of commands into dovecot, and it won't just ignore everything after the login command.
Thanks for the clarification!
Patrick.
STAR Software (Shanghai) Co., Ltd. http://www.star-group.net/ Phone: +86 (21) 3462 7688 x 826 Fax: +86 (21) 3462 7779
PGP key: https://stshacom1.star-china.net/keys/patrick_nagel.asc Fingerprint: E09A D65E 855F B334 E5C3 5386 EF23 20FC E883 A005 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFIl8Er7yMg/OiDoAURAt4aAKCmYomljxapIJ1H/jS/YoOt0ygDiQCeK+kE 4r3nLKZ/cELZZX0eIg1xbEc= =g2dM -----END PGP SIGNATURE-----