#1115940 fdm exits with unclean exit code

Package:
fdm
Source:
fdm
Description:
fetching, filtering and delivering emails
Submitter:
Ritesh Raj Sarraf
Date:
2025-11-19 13:01:01 UTC
Severity:
normal
#1115940#5
Date:
2025-09-22 08:08:23 UTC
From:
To:
Dear Maintainer,

This new version upload now has introduced a regression. It always gives
an unclean exit code on program completion.


A similar issue was reported upstream around a year ago, but with
inverted symptoms. Looks like upstream made some changes, which now
result in this regression.

https://github.com/nicm/fdm/issues/141

```
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 systemd-desktop-notify@fdm-researchut.service - Desktop Notification of fdm-researchut.
Sep 22 12:50:41 priyasi systemd-desktop-notify.sh[112458]: Wait timeout expired
```

#1115940#10
Date:
2025-09-22 08:31:54 UTC
From:
To:
Reverting back to fdm 1.9 and the issue is not seen

```
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)
```

#1115940#15
Date:
2025-11-19 12:17:18 UTC
From:
To:
Raising severity to grave as this bug breaks the core functionality of
this tool. fdm is a mail fetch and delivery tool; as such, not being to
perform those tasks makes the tool unusable.


Here's a working log from fdm 1.9:

```
version is: fdm 1.9, started at: Wed Nov 19 17:33:07 2025
running on: Linux 6.17.8+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.17.8-1 (2025-11-15) x
86_64
host is: priyasi priyasi 192.168.31.5
home is: /home/rrs
loading configuration from /home/rrs/.fdm.conf
added macro "$base": "%h/.fdm"
added macro "%max_age": 90
added macro "$com_sed": "sed"
added macro "$com_awk": "awk"
added macro "$com_perl": "perl"
added macro "$path": "%h/Maildir"
added action "inbox": deliver=0:maildir "%h/Maildir"
added action "junk": deliver=0:maildir "%h/Maildir/.spam"
added action "researchut": deliver=0:maildir "%h/Maildir/.ARESEARCHUT"

... snipped ...

added rule 53: matches=all actions="inbox"
configuration loaded
locking using: dotlock
options are: maximum-size=134217728, timeout=60, default-user="rrs", command-user="rrs", f
ile-umask=077, queue-high=5, queue-low=3, lock-file="/home/rrs/.fdm/lock", strip-character
s="\<>$%^&*|{}[]"'`;"
using tmp directory: /tmp
parent: started, pid is 128334
parent: 0 children, 0 dead children
parent: child 128335 (researchut) started
researchut: fetch started, pid 128335
researchut: user is 1000
researchut: started processing
researchut: fetching
researchut: fetch loop start
researchut: calling fetch state (0x560636d15590, flags 0x02)
researchut: fetch, again
researchut: fetch loop start
researchut: calling fetch state (0x560636d206c0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d219a0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d21c00, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d21c00, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d21cc0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d21cc0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d21d70, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d21d70, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d22e80, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x560636d22e80, flags 0x02)
researchut: fetch, exit
researchut: 0 messages processed in 2.453 seconds
researchut: finished processing. exiting
researchut: sending exit message to parent
researchut: waiting for exit message from parent
parent: got message type 1, id 0 from child 128335
parent: sending exit message to child 128335
parent: 1 children, 0 dead children
parent: 1 children, 0 dead children
parent: child 128335 socket error
parent: 1 children, 0 dead children
parent: waiting for children
parent: child 128335 returned 0
parent: waiting for children
parent: waiting for children
parent: finished, total time 2.454 seconds
```

whereas, with fdm 2.2, I get:

```
version is: fdm 2.2, started at: Wed Nov 19 17:34:30 2025
running on: Linux 6.17.8+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.17.8-1 (2025-11-15)
x86_64
host is: priyasi priyasi 192.168.31.5
home is: /home/rrs
loading configuration from /home/rrs/.fdm.conf
added macro "$base": "%h/.fdm"
added macro "%max_age": 90
added macro "$com_sed": "sed"
added macro "$com_awk": "awk"
added macro "$com_perl": "perl"
added macro "$path": "%h/Maildir"
added action "inbox": deliver=0:maildir "%h/Maildir"
added action "junk": deliver=0:maildir "%h/Maildir/.spam"
added action "researchut": deliver=0:maildir "%h/Maildir/.ARESEARCHUT"

... snipped ...

added rule 53: matches=all actions="inbox"
configuration loaded
locking using: dotlock
options are: 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-charact
ers="\<>$%^&*|{}[]"'`;"
using tmp directory: /tmp
parent: started, pid is 128883
parent: 0 children, 0 dead children
parent: child 128884 (researchut) started
researchut: fetch started, pid 128884
researchut: user is 1000
researchut: started processing
researchut: fetching
researchut: fetch loop start
researchut: calling fetch state (0x5558d48cc330, flags 0x02)
researchut: fetch, again
researchut: fetch loop start
researchut: calling fetch state (0x5558d48d8420, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x5558d48d97e0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x5558d48d96a0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: fetch loop start
researchut: calling fetch state (0x5558d48d96a0, flags 0x02)
researchut: fetch, block
researchut: queued 0; blocked 0; flags 0x02
researchut: polling: 2, timeout=60000
researchut: connection closed
researchut: fetching error. aborted
researchut: 0 messages processed in 0.682 seconds
researchut: finished processing. exiting
researchut: sending exit message to parent
researchut: waiting for exit message from parent
parent: got message type 1, id 0 from child 128884
parent: sending exit message to child 128884
parent: 1 children, 0 dead children
parent: waiting for children
parent: child 128884 returned 1
parent: waiting for children
parent: waiting for children
parent: finished, total time 0.683 seconds
parent: exit code 1
```

There's also a report filed upstream but not much activity there either.
https://github.com/nicm/fdm/issues/141

If there is extra information I can provide with, please ask.