+ # work on headers only
+
+ # get the Date and X-Original-Date
+ X_ORIGINAL_DATE=`sed -n '/^X-Original-Date:/,/^[^\t]/p' "$HEADERS" | head -n -1 | cut -d ':' -f 2-`
+ DATE=`sed -n '/^Date:/,/^[^\t]/p' "$HEADERS" | head -n -1 | cut -d ':' -f 2-`
+
+ # work on headers, minus Date and X-Original-Date
+ test -n "$X_ORIGINAL_DATE" && \
+ sed -i '/^X-Original-Date:/,/^[^\t]/d' "$HEADERS"
+ test -n "$DATE" && \
+ sed -i '/^Date:/,/^[^\t]/d' "$HEADERS"
+
+ # found a replacement date in Fetchinfo headers
+ FETCH_DATE=`grep -im1 'X-FETCH-TIME: ' "$HEADERS" | cut -d ' ' -f 2-`
+
+ # or in Received: headers ..
+ test $STRICT -eq 1 && \
+ REGEXP="$DATE_REGEXP" || \
+ REGEXP="$DATE_REGEXP_STRICT"
+ RECEIVED_DATE=`sed -n '/^Received:/,/^[^\t]/p' "$HEADERS" | head -n -1 | grep -Eoim 1 "$REGEXP"`
+
+ # .. or from FS
+ FILE_DATE=`LC_ALL=POSIX LANG=POSIX ls -l --time-style="+%a, %d %b %Y %X %z" "$1" | tr -s ' ' | cut -d ' ' -f 6-11`
+ # we could also use the system date as a possible replacement
+ SYSTEM_DATE="`date -R`"
+
+ # determine which replacement date to use
+ if [ -z "$FETCH_DATE" ]