[Dovecot] 'Doveadm user' could use better error codes
dovecot
dovecot at vosslamber.nl
Tue Dec 28 16:23:16 EET 2010
On 28-12-10 14:39, Thomas Leuxner wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> - -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> The error codes for' doveadm user' should be improved to avoid error handling workarounds when scripting commands:
>
> $ doveadm user
> doveadm user [-a<userdb socket path>] [-x<auth info>]<user mask> […]
> $ echo $?
> 1
> $ doveadm user foo
> userdb lookup: user foo doesn't exist
> $ echo $?
> 0
>
> Please compare to ID output:
>
> $ id foo
> id: foo: No such user
> $ echo $?
> 1
>
> Regards
> Thomas
>
> - -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
>
> iEYEARECAAYFAk0Z6FkACgkQ+meF/S97aXgxnQCfWk1ECdMoCewbr1O6lAkdksoH
> 324AoLCTg0dFmFhumEkM936irpcG7YF5
> =wuwz
> - -----END PGP SIGNATURE-----
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
>
> iEYEARECAAYFAk0Z6HQACgkQ+meF/S97aXgGdACfawa02hZxk71CjIsj64sW0xXv
> CW8AoJRQZLFi4QwbvcDg6rzqzUv/3mE8
> =Rt1O
> -----END PGP SIGNATURE-----
>
It behaves just as 'man doveadm' promisses.....
EXIT STATUS
doveadm will exit with one of the following values:
0 Selected command was executed successful.
>0 Command failed in some way.
So, this seems to be correct!
More information about the dovecot
mailing list