On Mon, 24 Sep 2001, Eric S. Raymond wrote:
That's probably true. You're not likely to get a useful return code of
any kind if there is more than one site in your .fetchmailrc file. But
the IMAP client code can unambiguously report an authentication-failure
condition.
Sorry, it was only a problem with my local configuration. Fetchmail
status handling works ok. But "$?" was always 0 in my Bash because of
the prompt:
PS1=$'\\[\\033]0;\\u(_at_)\\h:\\w\\007\\] [$(date +%H:%M)] [\\u(_at_)\\h:\\w] $
'
(There is an 'date' command which has an exit code)
[21:31] [bv(_at_)chemnitz:~] $ fetchmail -f .fetchmailrc-smtp-b4-smtp
...
fetchmail: Query status=4 (PROTOCOL)
[21:31] [bv(_at_)chemnitz:~] $ echo $?
0
[21:31] [bv(_at_)chemnitz:~] $ unset PS1
[21:31] [bv(_at_)chemnitz:~] $ fetchmail -f .fetchmailrc-smtp-b4-smtp
...
fetchmail: Query status=4 (PROTOCOL)
[21:31] [bv(_at_)chemnitz:~] $ echo $?
4
It works:-)
Björn
--
Björn Voigt <bjoern(_at_)cs(_dot_)tu-berlin(_dot_)de>
WWW: http://user.cs.tu-berlin.de/~bjoern/