diff -pruN 3.24-1/debian/changelog 3.24-1ubuntu4/debian/changelog
--- 3.24-1/debian/changelog	2023-01-05 21:35:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/changelog	2025-09-22 09:01:22.000000000 +0000
@@ -1,3 +1,36 @@
+procmail (3.24-1ubuntu4) questing; urgency=medium
+
+  * Fix FTBFS with GCC-15 (LP: #2125339), thanks to Santiago Vila.
+    - Fix src/autoconf for gcc-15.
+      + d/p/autoconf-fix-for-gcc-15.patch
+      + d/p/skip-const-probe.patch
+    - Do not "fix" prototype for uname().
+      + d/p/do-not-fix-uname.patch
+    - d/rules: Build using C17 standard with GNU extensions.
+
+ -- Lukas Märdian <slyon@ubuntu.com>  Mon, 22 Sep 2025 11:01:22 +0200
+
+procmail (3.24-1ubuntu3) oracular; urgency=medium
+
+  * d/p/fix-gcc-14-build.patch: Fix build with gcc-14.
+    Forward-port of ftbfs fix from 3.24+really3.22-3 to 3.24.
+    (LP: #2078301)
+
+ -- Bryce Harrington <bryce@canonical.com>  Fri, 30 Aug 2024 12:03:04 -0700
+
+procmail (3.24-1ubuntu2) noble; urgency=high
+
+  * No change rebuild for 64-bit time_t and frame pointers.
+
+ -- Julian Andres Klode <juliank@ubuntu.com>  Mon, 08 Apr 2024 18:16:20 +0200
+
+procmail (3.24-1ubuntu1) noble; urgency=medium
+
+  * d/t/basic: Add basic DEP8 packaging/integration test cases.
+    (LP: #1679365)
+
+ -- Bryce Harrington <bryce@canonical.com>  Thu, 07 Dec 2023 09:18:34 -0800
+
 procmail (3.24-1) unstable; urgency=medium
 
   * New upstream release, now hosted on github. Closes: #1006633.
diff -pruN 3.24-1/debian/control 3.24-1ubuntu4/debian/control
--- 3.24-1/debian/control	2023-01-05 20:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/control	2025-09-22 07:48:24.000000000 +0000
@@ -1,7 +1,8 @@
 Source: procmail
 Section: mail
 Priority: optional
-Maintainer: Santiago Vila <sanvila@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Santiago Vila <sanvila@debian.org>
 Build-Depends: debhelper-compat (= 13)
 Rules-Requires-Root: binary-targets
 Standards-Version: 4.6.2
diff -pruN 3.24-1/debian/patches/autoconf-fix-for-gcc-15.patch 3.24-1ubuntu4/debian/patches/autoconf-fix-for-gcc-15.patch
--- 3.24-1/debian/patches/autoconf-fix-for-gcc-15.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/patches/autoconf-fix-for-gcc-15.patch	2025-09-22 09:01:22.000000000 +0000
@@ -0,0 +1,45 @@
+From: Santiago Vila <sanvila@debian.org>
+Subject: Fixes for gcc-15
+Bug-Debian: https://bugs.debian.org/1097653
+X-Debian-version: 3.24+really3.22-5
+
+--- a/src/autoconf
++++ b/src/autoconf
+@@ -422,12 +422,12 @@
+ int sfdlock(int fd);
+ int fdunlock();
+ 
+-void stimeout()
++void stimeout(int sig)
+ { timeout=1;close(fdcollect);killchildren();
+ }
+ 
+-void Terminate()
+-{ stimeout();exit(1);
++void Terminate(int sig)
++{ stimeout(sig);exit(1);
+ }
+ 
+ static unsigned long seed;
+@@ -1039,8 +1039,8 @@
+ #ifndef NO_COMSAT
+ #include "network.h"
+ #endif
+-int setrgid();
+-int setresgid();
++int setrgid(int dummy);
++int setresgid(int dummy1, int dummy2, int dummy3);
+ int main(){char a[2];
+  endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0");
+  strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0");
+@@ -1200,8 +1200,8 @@
+ #ifdef BENCHSIZE
+ #undef strstr						  /* from includes.h */
+ #undef free						     /* from shell.h */
+-unsigned long dobench(strstr,iter,haystack)char*(*const strstr)();
+- unsigned long iter;const char*const haystack;
++unsigned long dobench(char* (*const strstr)(const char*, const char*),
++ unsigned long iter, const char* const haystack)
+ { unsigned long to;
+   to=(unsigned long)clock();
+   do (*strstr)(haystack,FROM_EXPR);
diff -pruN 3.24-1/debian/patches/do-not-fix-uname.patch 3.24-1ubuntu4/debian/patches/do-not-fix-uname.patch
--- 3.24-1/debian/patches/do-not-fix-uname.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/patches/do-not-fix-uname.patch	2025-09-22 09:01:22.000000000 +0000
@@ -0,0 +1,16 @@
+From: Santiago Vila <sanvila@debian.org>
+Subject: Do not "fix" prototype for uname()
+Bug-Debian: https://bugs.debian.org/1097653
+X-Debian-version: 3.24+really3.22-5
+
+--- procmail-3.24+really3.22.orig/src/includes.h
++++ procmail-3.24+really3.22/src/includes.h
+@@ -331,7 +331,7 @@ extern int errno;
+ 
+ #ifndef NOuname
+ #ifndef P		  /* SINIX V5.23 has the wrong prototype for uname() */
+-extern int uname();					 /* so we fix it :-) */
++/* extern int uname();					 /* so we fix it :-) */
+ #define Uname(name)		((int(*)(struct utsname*))uname)(name)
+ #else
+ #define Uname(name)		uname(name)		    /* no fix needed */
diff -pruN 3.24-1/debian/patches/fix-gcc-14-build.patch 3.24-1ubuntu4/debian/patches/fix-gcc-14-build.patch
--- 3.24-1/debian/patches/fix-gcc-14-build.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/patches/fix-gcc-14-build.patch	2025-09-22 07:48:24.000000000 +0000
@@ -0,0 +1,129 @@
+Description: Fix build with gcc-14
+ Forward-port of FTBFS fix from Debian 3.24+really3.22-3
+Author: Santiago Vila <sanvila@debian.org>
+Origin: backport, https://snapshot.debian.org/package/procmail/3.24%2Breally3.22-3/
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/procmail/+bug/2078301
+Bug-Debian: https://bugs.debian.org/1075398
+
+
+--- a/initmake
++++ b/initmake
+@@ -124,7 +124,7 @@
+ fi
+ 
+ cat >_autotst.c <<HERE
+-main()
++int main()
+ { return 0;
+ }
+ HERE
+@@ -200,7 +200,7 @@
+ #include <sys/types.h>
+ #include <stdio.h>
+ #include <sys/stat.h>
+-main()
++int main()
+ { struct stat buf;return!&buf;
+ }
+ HERE
+--- a/src/autoconf
++++ b/src/autoconf
+@@ -416,6 +416,12 @@
+ int dolock,child[NR_of_forks],timeout,fdcollect;
+ char dirlocktest[]="_locktest";
+ 
++#include <stdlib.h>
++int killchildren();
++int fdlock(int fd);
++int sfdlock(int fd);
++int fdunlock();
++
+ void stimeout()
+ { timeout=1;close(fdcollect);killchildren();
+ }
+@@ -437,7 +443,7 @@
+   return pid;
+ }
+ 
+-int main(argc,argv)char*argv[];
++int main(int argc,char*argv[])
+ { int goodlock,testlock,i,pip[2],pipw[2];time_t otimet;unsigned dtimet;
+   static char filename[]="_locktst.l0";
+   close(0);goodlock=0;testlock=FIRST_lock;signal(SIGPIPE,SIG_DFL);
+@@ -587,13 +593,13 @@
+   return 0;
+ }
+ 
+-int sfdlock(fd)
++int sfdlock(int fd)
+ { int i;unsigned gobble[GOBBLE>>2];
+   for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
+   return fdlock(fd);
+ }
+ 
+-static oldfdlock;
++static int oldfdlock;
+ #ifdef F_SETLKW
+ static struct flock flck;		/* why can't it be a local variable? */
+ #endif
+@@ -601,7 +607,7 @@
+ static off_t oldlockoffset;
+ #endif
+ 
+-int fdlock(fd)
++int fdlock(int fd)
+ { int i;unsigned gobble[GOBBLE>>2];
+   for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
+   oldfdlock=fd;fd=0;
+@@ -997,11 +1003,11 @@
+  i+=WIFEXITED(i);
+  i+=WIFSTOPPED(i);
+  i+=WEXITSTATUS(i);
+- i+=WSIGTERM(i);
++ i+=WTERMSIG(i);
+  return i;}
+ HERE
+ 
+-echo 'Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WSIGTERM()'
++echo 'Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WTERMSIG()'
+ if $MAKE _autotst.$O >_autotst.rrr 2>&1
+ then
+    $FGREP -v include/ <_autotst.rrr >_autotst.$O
+@@ -1033,6 +1039,8 @@
+ #ifndef NO_COMSAT
+ #include "network.h"
+ #endif
++int setrgid();
++int setresgid();
+ int main(){char a[2];
+  endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0");
+  strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0");
+@@ -1059,7 +1067,7 @@
+ echo '	rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,'
+ echo '	ftruncate, strtod, strncasecmp, strerror, strlcat,'
+ echo '	memset, bzero, and _exit'
+-if $MAKE _autotst.$O >$DEVNULL 2>&1
++if $MAKE _autotst.$O >_autotst.rrr 2>&1
+ then
+ :
+ else
+@@ -1201,7 +1209,7 @@
+   return (unsigned long)clock()-to;
+ }
+ #endif
+-int main(argc,argv)int argc;const char*argv[];
++int main(int argc,const char*argv[])
+ { if(argc==1)
+    { char*haystack;
+ #ifdef BENCHSIZE
+--- a/src/mailfold.c
++++ b/src/mailfold.c
+@@ -373,7 +373,7 @@
+    }
+ }
+ 
+-int readmail(rhead,tobesent)int rhead;const long tobesent;
++int readmail(int rhead,const long tobesent)
+ { char*chp,*pastend;static size_t contlengthoffset;
+   ;{ long dfilled;
+      if(rhead==2)		  /* already read, just examine what we have */
diff -pruN 3.24-1/debian/patches/series 3.24-1ubuntu4/debian/patches/series
--- 3.24-1/debian/patches/series	2023-01-05 20:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/patches/series	2025-09-22 09:01:22.000000000 +0000
@@ -8,3 +8,7 @@ define-default-path.patch
 define-defaultdotlock-to-follow-locking-policy.patch
 do-not-search-for-var-mail.patch
 hardcode-things-for-biff.patch
+fix-gcc-14-build.patch
+autoconf-fix-for-gcc-15.patch
+skip-const-probe.patch
+do-not-fix-uname.patch
diff -pruN 3.24-1/debian/patches/skip-const-probe.patch 3.24-1ubuntu4/debian/patches/skip-const-probe.patch
--- 3.24-1/debian/patches/skip-const-probe.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/patches/skip-const-probe.patch	2025-09-22 09:01:22.000000000 +0000
@@ -0,0 +1,63 @@
+From: Santiago Vila <sanvila@debian.org>
+Subject: Skip probe for const
+Bug-Debian: https://bugs.debian.org/1097653
+X-Debian-version: 3.24+really3.22-5
+
+--- a/src/autoconf
++++ b/src/autoconf
+@@ -703,55 +703,6 @@
+ 
+ 
+ cat >_autotst.c <<HERE
+-#include "$ACONF"
+-#ifndef UNISTD_H_MISSING
+-#include <unistd.h>		/* execvp() */
+-#endif
+-int a(b)const int b[];
+-{ return *++b;				  /* watcom 10.6 on QNX refuses this */
+-}
+-int main()
+-{ char r[]="",*const*p;char*q="";const char*s="";
+-  static const char*const nullp=0,*const*d= &nullp;	/* AIX 3.2.3 failure */
+-  static struct{const int a;int b;}c[2]={{0,0},{0,0}};/* IRIX 7.3.1 compiler */
+-			    /* requires initializers on static const objects */
+-  --(c+1)->b;				 /* AIX 3.1.5 machines can't do this */
+-  p= &q;
+-  ;{ int pip[2];
+-     pipe(pip);
+-     if(fork())		       /* this should hide core dumps from the shell */
+-      { close(pip[1]);				    /* close the writing end */
+-	return 1==read(pip[0],r,1)?0:1;		   /* wait for the rendevouz */
+-      }
+-     close(pip[0]);				    /* close the writing end */
+-     if(!*d&&c[1].b)		      /* some magic to confuse the optimiser */
+-	d=(const char*const*)p;		     /* core dumps Ultrix 4.3 ANSI C */
+-     else /* so that it can't complain about the uselessness of this program */
+-	execvp(q,p);   /* IRIX 4.0.1 system-includes are wrong on this point */
+-     if(write(pip[1],r,1)!=1)		      /* notify mam that we survived */
+-	return 1;				   /* oops, lost mam somehow */
+-   }
+-  return r==s;		    /* Domain/OS warns here, not about "r==s" though */
+-}
+-HERE
+-
+-echo 'Testing for const'
+-if $MAKE _autotst.$O 2>&1 | $FGREP -v include/ >_autotst.rrr
+-  test -f _autotst.$O && $MAKE _autotst >$DEVNULL 2>&1 && _autotst
+-then
+-  grepfor const '#define NO_const'
+-else
+-  echo '#define NO_const' >>$ACONF
+-  set dummy *core*
+-  if test -f $2 -a $nocore = yes
+-  then
+-     echo "Removing core file (bogus readonly segment)"
+-     $RM *core*
+-  fi
+-fi
+-$RM _autotst.$O _autotst
+-
+-cat >_autotst.c <<HERE
+ int main(){volatile int i;return (i=0);}
+ HERE
+ 
diff -pruN 3.24-1/debian/rules 3.24-1ubuntu4/debian/rules
--- 3.24-1/debian/rules	2023-01-05 20:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/rules	2025-09-22 09:01:22.000000000 +0000
@@ -3,7 +3,7 @@
 	dh $@
 
 CC = gcc
-CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $$(getconf LFS_CFLAGS)
+CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $$(getconf LFS_CFLAGS) -std=gnu17
 LDFLAGS := `dpkg-buildflags --get LDFLAGS`
 CPPFLAGS := `dpkg-buildflags --get CPPFLAGS`
 SEARCHLIBS = -lm
diff -pruN 3.24-1/debian/tests/basic 3.24-1ubuntu4/debian/tests/basic
--- 3.24-1/debian/tests/basic	1970-01-01 00:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/tests/basic	2025-09-22 07:48:24.000000000 +0000
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+set -efu
+
+#############
+### Setup ###
+#############
+echo "[0]"
+rcfile=$(mktemp /tmp/procmailrc-XXXX)
+[ -f "${rcfile}" ]
+trap "rm -f '${rcfile}'" EXIT
+
+mbox=$(mktemp /tmp/mbox-XXXX)
+[ -f "${mbox}" ]
+trap "rm -f '${mbox}'" EXIT
+
+maildir=$(mktemp -d /tmp/Mail-XXXX)
+[ -d "${maildir}" ]
+trap "rm -rf '${maildir}'" EXIT
+
+
+####################################
+### Test basic copying of emails ###
+####################################
+echo "[1]"
+rm -f "${maildir}/*"
+cat > "${rcfile}" <<EOF
+LOGFILE=/tmp/procmail.log
+VERBOSE=on
+MAILDIR=${maildir}
+
+:0 c
+backup
+
+:0
+inbox
+EOF
+
+procmail -m "${rcfile}" <<EOF
+From xyz at test.org  Tue Jan 08 01:02:03 2024
+From: xyz at test.org
+Date: Mon, 01 Jan 2024 01:02:03 -0700
+Subject: Test email
+
+Body text
+
+EOF
+echo $?
+
+ls -l "${maildir}"
+grep "Subject: Test email" "${maildir}/backup"
+grep "Subject: Test email" "${maildir}/inbox"
+echo
+
+
+######################################
+### Test basic filtering of emails ###
+######################################
+echo "[2]"
+rm -f "${maildir}/*"
+cat > "${rcfile}" <<EOF
+LOGFILE=/tmp/procmail.log
+VERBOSE=on
+MAILDIR=${maildir}
+
+:0:
+* ^X-Spam-Flag: YES
+spam
+
+:0
+ham
+EOF
+
+cat <<EOF | procmail -m "${rcfile}"
+From xyz at test.org  Tue Jan 08 01:02:03 2024
+From: xyz at test.org
+Date: Mon, 01 Jan 2024 01:02:03 -0700
+Subject: Test email 1
+
+Body text
+EOF
+
+cat <<EOF | procmail -m "${rcfile}"
+From xyz at test.org  Tue Jan 08 01:02:03 2024
+From: xyz at test.org
+Date: Mon, 01 Jan 2024 01:02:03 -0700
+X-Spam-Flag: YES
+Subject: spam message
+
+Foobar
+EOF
+
+ls -l "${maildir}"
+grep "Subject: Test email 1" "${maildir}/ham"
+grep -v "Subject: spam message" "${maildir}/ham"
+grep "Subject: spam message" "${maildir}/spam"
+echo
+
+
+###############################
+### Test fixing up subjects ###
+###############################
+echo "[3]"
+rm -f "${maildir}/*"
+echo "[3.1]"
+cat > "${rcfile}" <<EOF
+LOGFILE=/tmp/procmail.log
+VERBOSE=on
+MAILDIR=${maildir}
+
+:0
+* Subject: .*email
+{
+  NEW_SUBJECT=\`formail -zx "Subject:" | expand | sed -e 's/email/message/'\`
+
+  :0 fwh
+  | formail -I "Subject: \$NEW_SUBJECT"
+}
+
+:0
+inbox
+EOF
+echo
+cat ${rcfile}
+echo
+
+echo "[3.2]"
+procmail -m "${rcfile}" <<EOF
+From xyz at test.org  Tue Jan 08 01:02:03 2024
+From: xyz at test.org
+Date: Mon, 01 Jan 2024 01:02:03 -0700
+Subject: Test email
+
+Body text
+EOF
+echo $?
+echo "[3.3]"
+
+ls -l "${maildir}"
+grep -v "Subject: Test email" "${maildir}/inbox"
+grep "Subject: Test message" "${maildir}/inbox"
+echo
diff -pruN 3.24-1/debian/tests/control 3.24-1ubuntu4/debian/tests/control
--- 3.24-1/debian/tests/control	1970-01-01 00:00:00.000000000 +0000
+++ 3.24-1ubuntu4/debian/tests/control	2025-09-22 07:48:24.000000000 +0000
@@ -0,0 +1,2 @@
+Tests: basic
+Restrictions: isolation-container, needs-root
