nicm / fdm

fdm source code
269 stars 50 forks source link

fdm doesn't exit with error code #141

Open rickysarraf opened 7 months ago

rickysarraf commented 7 months ago

I looked for the obvious answers but couldn't find one. Neither does the man page says anything about error.

Version of fdm installed is:

fdm:
  Installed: 1.9+git20181219-1.1
  Candidate: 1.9+git20181219-1.1
  Version table:
     1.9+git20181219-1.1+b1 500
        500 http://deb.debian.org/debian unstable/main amd64 Packages
 *** 1.9+git20181219-1.1 990
        990 http://deb.debian.org/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status
     1.9+git20181219-1+b2 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
     1.9+git20181219-1+b1 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages
     1.9+git20181219-1 500
        500 http://deb.debian.org/debian buster/main amd64 Packages

When run, fdm never errors out with an error exit code.

fdm -m -a priya fetch || echo "Error"
priya: Name or service not known
priya: fetching error. aborted
priya: 0 messages processed in 0.001 seconds
sambaccessnow commented 1 month ago

same,

I have a configuration where I change the password to test if fdm failure. My surprise when I see FDM failing, but the exit code is zero

root@host::~# sudo -u fdm /usr/bin/fdm -f /etc/fdm.conf fetch -q
emailtest@mydomain.org: unexpected data: 2 NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)
emailtest@mydomain.org: fetching error. aborted

root@host::~# echo $?
0

FDM is not processing the log failure, is it possible to sue the correct exit code ?