Skip to content

fix: Exchange support, file age calculation and safe arg quoting#102

Open
stephdl wants to merge 1 commit into
mainfrom
sdl-fixTimeStamp
Open

fix: Exchange support, file age calculation and safe arg quoting#102
stephdl wants to merge 1 commit into
mainfrom
sdl-fixTimeStamp

Conversation

@stephdl
Copy link
Copy Markdown
Collaborator

@stephdl stephdl commented May 22, 2026

This PR fixes a connection issue observed with Exchange servers hosted at OVH, where imapsync was refusing to connect. Adding --addheader and --automap resolved the issue.

  • Exchange compatibility: add --addheader and --automap to imapsync arguments. --addheader improves message deduplication by tagging already-synced messages; --automap handles folder name mapping differences common with Exchange servers (e.g. Sent Items vs Sent).
  • File age calculation: read the previous folder sync value only when the timestamp file exists, avoiding silent failures in ash with set -e when the file was removed by a prior stop.
  • Optional arg quoting: optional arguments (DELETE_LOCAL, DELETEFOLDERS, DELETE_REMOTE, EXPUNGE_REMOTE, SECURITY) now use the ${VAR:+"${VAR}"} pattern — the argument is passed quoted when the variable is set and non-empty, and omitted entirely when empty. This is POSIX/ash compatible and avoids passing empty strings to imapsync.

see https://community.nethserver.org/t/imapsync-exchange-anyone-else-fighting-with-this/27326

@stephdl stephdl force-pushed the sdl-fixTimeStamp branch from 38fdd8b to 278cb82 Compare May 26, 2026 17:32
@stephdl stephdl changed the title Improve file age calculation logic Fix file age calculation, Exchange compatibility and optional arg quoting May 26, 2026
@stephdl stephdl changed the title Fix file age calculation, Exchange compatibility and optional arg quoting fix: Exchange support, file age calculation and safe arg quoting May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant