fdm icon indicating copy to clipboard operation
fdm copied to clipboard

fdm doesn't exit with error code

Open rickysarraf opened this issue 1 year ago • 3 comments

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

rickysarraf avatar Apr 16 '24 08:04 rickysarraf

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
[email protected]: unexpected data: 2 NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)
[email protected]: fetching error. aborted

root@host::~# echo $?
0

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

sambaccessnow avatar Oct 21 '24 13:10 sambaccessnow

Now, with fdm 2.2, it just plain errors out (with an error code). Essentially, upon execution, it just makes a clean exit.

Sep 22 12:50:24 priyasi fdm[112422]: added rule 53: matches=all actions="inbox"
Sep 22 12:50:24 priyasi fdm[112422]: configuration loaded
Sep 22 12:50:24 priyasi fdm[112422]: locking using: dotlock
Sep 22 12:50:24 priyasi fdm[112422]: options are: allow-multiple, maximum-size=134217728, timeout=60, default-user="rrs", command-user="rrs", file-umask=077, queue-high=5, queue-low=3, lock-file="/home/rrs/.fdm/lock", strip-characters="\<>$%^&*|{}[]"'`;"
Sep 22 12:50:24 priyasi fdm[112422]: using tmp directory: /tmp
Sep 22 12:50:24 priyasi fdm[112422]: parent: started, pid is 112422
Sep 22 12:50:24 priyasi fdm[112422]: parent: 0 children, 0 dead children
Sep 22 12:50:24 priyasi fdm[112422]: parent: child 112423 (researchut) started
Sep 22 12:50:24 priyasi fdm[112423]: researchut: fetch started, pid 112423
Sep 22 12:50:24 priyasi fdm[112423]: researchut: user is 1000
Sep 22 12:50:24 priyasi fdm[112423]: researchut: started processing
Sep 22 12:50:24 priyasi fdm[112423]: researchut: fetching
Sep 22 12:50:24 priyasi fdm[112423]: researchut: connection closed
Sep 22 12:50:24 priyasi fdm[112423]: researchut: fetching error. aborted
Sep 22 12:50:24 priyasi fdm[112423]: researchut: 0 messages processed in 0.669 seconds
Sep 22 12:50:24 priyasi fdm[112423]: researchut: finished processing. exiting
Sep 22 12:50:24 priyasi fdm[112422]: parent: sending exit message to child 112423
Sep 22 12:50:24 priyasi fdm[112422]: parent: 1 children, 0 dead children
Sep 22 12:50:24 priyasi fdm[112422]: parent: child 112423 returned 1
Sep 22 12:50:24 priyasi fdm[112422]: parent: finished, total time 0.672 seconds
Sep 22 12:50:24 priyasi fdm[112422]: parent: exit code 1
Sep 22 12:50:40 priyasi systemd[4646]: Started fdm-researchut.service - Fetch RESEARCHUT mail through fdm.
Sep 22 12:50:41 priyasi fdm[112453]: researchut: connection closed
Sep 22 12:50:41 priyasi fdm[112453]: researchut: fetching error. aborted
Sep 22 12:50:41 priyasi fdm[112453]: researchut: 0 messages processed in 0.647 seconds
Sep 22 12:50:41 priyasi systemd[4646]: fdm-researchut.service: Main process exited, code=exited, status=1/FAILURE
Sep 22 12:50:41 priyasi systemd[4646]: fdm-researchut.service: Failed with result 'exit-code'.
Sep 22 12:50:41 priyasi systemd[4646]: fdm-researchut.service: Triggering OnFailure= dependencies.
Sep 22 12:50:41 priyasi systemd[4646]: Started [email protected] - Desktop Notification of fdm-researchut.
Sep 22 12:50:41 priyasi systemd-desktop-notify.sh[112458]: Wait timeout expired

There should be no error though. Even fdm above, isn't giving a reason of the error.

Reverting back to fdm 1.9 proves the point.

Sep 22 13:57:09 priyasi fdm[124959]: version is: fdm 1.9, started at: Mon Sep 22 13:57:09 2025
Sep 22 13:57:13 priyasi fdm[124960]: researchut: got message 1 of 3: size 36306, body 5693
Sep 22 13:57:13 priyasi fdm[124960]: researchut: message 1 delivered (rule 50, maildir) in 0.015 seconds
Sep 22 13:57:13 priyasi fdm[124960]: researchut: deleting message 1
Sep 22 13:57:13 priyasi fdm[124960]: researchut: got message 2 of 3: size 5563, body 4557
Sep 22 13:57:13 priyasi fdm[124960]: researchut: message 2 delivered (rule 25, maildir) in 0.013 seconds
Sep 22 13:57:13 priyasi fdm[124960]: researchut: deleting message 2
Sep 22 13:57:14 priyasi fdm[124960]: researchut: got message 3 of 3: size 12348, body 8456
Sep 22 13:57:14 priyasi fdm[124960]: researchut: message 3 delivered (rule 25, maildir) in 0.014 seconds
Sep 22 13:57:14 priyasi fdm[124960]: researchut: deleting message 3
Sep 22 13:57:15 priyasi fdm[124960]: researchut: 3 messages processed (0 kept) in 6.219 seconds (average 2.073)

rickysarraf avatar Sep 22 '25 08:09 rickysarraf

Relevant Debian Bug Report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115940

rickysarraf avatar Sep 22 '25 11:09 rickysarraf