Horde Groupware ActiveSync가 포함된 Dovecot IMAP 서버 - IMAP 서버가 변경된 상태를 보고하지 않음

Horde Groupware ActiveSync가 포함된 Dovecot IMAP 서버 - IMAP 서버가 변경된 상태를 보고하지 않음

Debian Linux에서 Dovecot IMAP 서버를 실행하는 Horde Groupware를 실행하고 있습니다.

Horde의 웹 UI를 사용하면 잘 되는데, ActiveSync를 사용하는데 문제가 있습니다.

Android에서 BlueMail과 같은 클라이언트 앱을 사용할 때 INBOX에 최신 이메일 메시지가 표시되지 않습니다.

ActiveSync 로그에 다음과 같이 기록되어 있습니다.

[163168][2022-11-11T15:08:44+00:00] >>>: INBOX IMAP PREVIOUS MODSEQ: 190086

이 행은 INBOX가 마지막으로 동기화되었을 때 MODSEQ 값이 190086임을 보여줍니다. IMAP 서버에서 보고된 modseq 값은 메일함에 메시지가 추가될 때마다 증가해야 합니다.

[163168][2022-11-11T15:08:44+00:00] >>>: IMAP status: a:4:{s:8:"messages";i:6874;s:7:"uidnext";i:157933;s:11:"uidvalidity";i:1291740963;s:13:"highestmodseq";i:190086;}

이 줄은 IMAP 서버에서 보고한 CURRENT MODSEQ를 보여줍니다.서버가 변경된 상태를 보고하지 않음을 나타냅니다.

그게 어떻게 가능할까요? 받은 편지함에 새 이메일이 도착했는데 앱에 표시되지 않습니다.

Thunderbird를 통해 IMAP 서버에 직접 액세스하면 모든 새 이메일이 표시됩니다.

이전에는 FreeBSD의 Dovecot 서버에서 작동했지만 Dovecot을 Debian Linux로 마이그레이션했습니다.

내 Dovecot 구성에 어떤 문제가 있을 수 있는지 아시나요?

저는 주로 Dovecot의 표준 구성, 특히 IMAP 설정을 사용하고 있습니다.

내 imap 특정 구성은 다음과 같습니다.

##
## IMAP specific settings
##

# If nothing happens for this long while client is IDLEing, move the connection
# to imap-hibernate process and close the old imap process. This saves memory,
# because connections use very little memory in imap-hibernate process. The
# downside is that recreating the imap process back uses some resources.
#imap_hibernate_timeout = 0

# Maximum IMAP command line length. Some clients generate very long command
# lines with huge mailboxes, so you may need to raise this if you get
# "Too long argument" or "IMAP command line too large" errors often.
#imap_max_line_length = 64k

# IMAP logout format string:
#  %i - total number of bytes read from client
#  %o - total number of bytes sent to client
#  %{fetch_hdr_count} - Number of mails with mail header data sent to client
#  %{fetch_hdr_bytes} - Number of bytes with mail header data sent to client
#  %{fetch_body_count} - Number of mails with mail body data sent to client
#  %{fetch_body_bytes} - Number of bytes with mail body data sent to client
#  %{deleted} - Number of mails where client added \Deleted flag
#  %{expunged} - Number of mails that client expunged, which does not
#                include automatically expunged mails
#  %{autoexpunged} - Number of mails that were automatically expunged after
#                    client disconnected
#  %{trashed} - Number of mails that client copied/moved to the
#               special_use=\Trash mailbox.
#  %{appended} - Number of mails saved during the session
#imap_logout_format = in=%i out=%o deleted=%{deleted} expunged=%{expunged} \
#  trashed=%{trashed} hdr_count=%{fetch_hdr_count} \
#  hdr_bytes=%{fetch_hdr_bytes} body_count=%{fetch_body_count} \
#  body_bytes=%{fetch_body_bytes}

# Override the IMAP CAPABILITY response. If the value begins with '+',
# add the given capabilities on top of the defaults (e.g. +XFOO XBAR).
#imap_capability =

# How long to wait between "OK Still here" notifications when client is
# IDLEing.
#imap_idle_notify_interval = 2 mins

# ID field names and values to send to clients. Using * as the value makes
# Dovecot use the default value. The following fields have default values
# currently: name, version, os, os-version, support-url, support-email,
# revision.
#imap_id_send =

# ID fields sent by client to log. * means everything.
#imap_id_log =

# Workarounds for various client bugs:
#   delay-newmail:
#     Send EXISTS/RECENT new mail notifications only when replying to NOOP
#     and CHECK commands. Some clients ignore them otherwise, for example OSX
#     Mail (<v2.1). Outlook Express breaks more badly though, without this it
#     may show user "Message no longer in server" errors. Note that OE6 still
#     breaks even with this workaround if synchronization is set to
#     "Headers Only".
#   tb-extra-mailbox-sep:
#     Thunderbird gets somehow confused with LAYOUT=fs (mbox and dbox) and
#     adds extra '/' suffixes to mailbox names. This option causes Dovecot to
#     ignore the extra '/' instead of treating it as invalid mailbox name.
#   tb-lsub-flags:
#     Show \Noselect flags for LSUB replies with LAYOUT=fs (e.g. mbox).
#     This makes Thunderbird realize they aren't selectable and show them
#     greyed out, instead of only later giving "not selectable" popup error.
#
# The list is space-separated.
#imap_client_workarounds =

# Host allowed in URLAUTH URLs sent by client. "*" allows all.
#imap_urlauth_host =

# Enable IMAP LITERAL- extension (replaces LITERAL+)
#imap_literal_minus = no

# What happens when FETCH fails due to some internal error:
#   disconnect-immediately:
#     The FETCH is aborted immediately and the IMAP client is disconnected.
#   disconnect-after:
#     The FETCH runs for all the requested mails returning as much data as
#     possible. The client is finally disconnected without a tagged reply.
#   no-after:
#     Same as disconnect-after, but tagged NO reply is sent instead of
#     disconnecting the client. If the client attempts to FETCH the same failed
#     mail more than once, the client is disconnected. This is to avoid clients
#     from going into infinite loops trying to FETCH a broken mail.
#imap_fetch_failure = disconnect-immediately

protocol imap {
  # Space separated list of plugins to load (default is global mail_plugins).
  #mail_plugins = $mail_plugins

  # Maximum number of IMAP connections allowed for a user from each IP address.
  # NOTE: The username is compared case-sensitively.
  #mail_max_userip_connections = 10

내 maildir 특정 설정:


##
## Maildir-specific settings
##

# By default LIST command returns all entries in maildir beginning with a dot.
# Enabling this option makes Dovecot return only entries which are directories.
# This is done by stat()ing each entry, so it causes more disk I/O.
# (For systems setting struct dirent->d_type, this check is free and it's
# done always regardless of this setting)
#maildir_stat_dirs = no

# When copying a message, do it with hard links whenever possible. This makes
# the performance much better, and it's unlikely to have any side effects.
#maildir_copy_with_hardlinks = yes

# Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only
# when its mtime changes unexpectedly or when we can't find the mail otherwise.
maildir_very_dirty_syncs = no

# If enabled, Dovecot doesn't use the S=<size> in the Maildir filenames for
# getting the mail's physical size, except when recalculating Maildir++ quota.
# This can be useful in systems where a lot of the Maildir filenames have a
# broken size. The performance hit for enabling this is very small.
#maildir_broken_filename_sizes = no

# Always move mails from new/ directory to cur/, even when the \Recent flags
# aren't being reset.
#maildir_empty_new = no

MODSEQ가 업데이트되지 않는 이유를 아는 사람이 있습니까?

비둘기장 -n:

# 2.3.13 (89f716dc2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.13 (cdd19fe3)
# OS: Linux 5.10.0-19-amd64 x86_64 Debian 11.5
# Hostname: mail01.public.forberger-online.de
auth_mechanisms = plain login
mail_location = maildir:~/.maildir
mail_privileged_group = mail
mailbox_list_index_include_inbox = yes
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
protocols = " imap"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service imap-login {
  client_limit = 256
  inet_listener imap {
    address = 192.168.108.1, 127.0.0.1, [::1]
    port = 143
  }
  inet_listener imaps {
    address = 192.168.108.1, 127.0.0.1, [::1]
    port = 993
    ssl = yes
  }
  process_min_avail = 6
}
ssl_ca = </etc/letsencrypt/live/mail.forberger-online.de/chain.pem
ssl_cert = </etc/letsencrypt/live/mail.forberger-online.de/cert.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
ssl_min_protocol = TLSv1.2
userdb {
  driver = passwd
}

중요: INBOX 폴더의 MODSEQ는 증가하지 않습니다.

* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot (Debian) ready.
A login REDACTED REDACTED
A OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY SPECIAL-USE] Logged in
A status INBOX (messages)
* STATUS INBOX (MESSAGES 7247)
A OK Status completed (0.001 + 0.000 secs).
1 SELECT Inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent Junk NonJunk $label4 $label1 $label2 $label3 $label5 Old $Forwarded NOTJUNK $has_cal)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent Junk NonJunk $label4 $label1 $label2 $label3 $label5 Old $Forwarded NOTJUNK $has_cal \*)] Flags permitted.
* 7247 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1291740963] UIDs valid
* OK [UIDNEXT 158406] Predicted next UID
* OK [HIGHESTMODSEQ 190086] Highest
1 OK [READ-WRITE] Select completed (0.010 + 0.000 + 0.009 secs).

보시다시피 HIGHESTMODSEQ는 190086에 있습니다. 하지만 새 이메일을 많이 받았습니다.

HIGHESTMODSEQ가 증가하지 않는 이유는 무엇입니까?

답변1

MODSEQ가 증가하는 경우 IMAP 서버를 테스트할 수 있는 방법을 알고 계십니까?

다음 논리적 단계는 수동으로 연결하고

  1. (예상 및 광고된) CONDSTORE 기능을 사용할 수 없을 때 오류를 생성해야 하는 명령을 고수하십시오.
  2. 테스트된 작업 전후에 반복적으로 요청할 때 어떤 작업(메시지 수신, Thunderbird drag'n'drop을 사용하여 폴더 간에 메시지 이동, , , .. 실행 doveadm index) 이 수행되고 Dovecot에서 보고된 doveadm force-resync값을 증가시키지 않는지 확인하십시오.HIGHESTMODSEQSELECT

이와 같이:

# openssl s_client -quiet -crlf -connect [::1]:993
* OK [CAPABILITY IMAP4rev1  .. AUTH=LOGIN ..] Dovecot (Debian) ready.
A LOGIN [email protected] password
A OK [CAPABILITY IMAP4rev1  .. CONDSTORE QRESYNC ..] Logged in
A ENABLE CONDSTORE QRESYNC
* OK [HIGHESTMODSEQ 1337] Highest
* ENABLED CONDSTORE QRESYNC
A OK ENABLED (..).
A SELECT INBOX (CONDSTORE)
...
* OK [HIGHESTMODSEQ 1338] Highest
A OK [READ-WRITE] SELECT completed (..).
A SELECT INBOX (CONDSTORE)
...
* OK [HIGHESTMODSEQ 1400] Highest
A OK [READ-WRITE] SELECT completed (..).

IMAP 수준에서 문제가 이미 존재하는지 확인한 후 해당 수준에서 계속할 수 있습니다. 아니면 숫자 190086이 정확히 어디서 왔는지 조사해 보세요. Dovecot이 더 이상 액세스할 수 없기 때문에 업데이트할 수 없는 항목을 참조하는 숫자를 잘못 보고하는 극단적인 경우를 생각하고 있습니다. 다음을 통해 인덱스 파일의 텍스트 표현을 읽으면 해당 메시지를 가리킬 수 있습니다. 해당 메시지에 IMAP 플래그를 추가하면 트리거됩니다.doveadm mailbox status -u [email protected] all NewlyCreatedFolderdoveadm dump -t index /file/path/to/mailbox/dovecot.index | grep -B 10 -A 100 "modseq.*190086"일부결과를 통해 문제의 성격을 알 수 있습니다.

답변2

이제 다시 작동합니다. 나는 메시지를 사용하여 maildir(하나만 있음)을 다시 만들고 maildirmake메시지를 다시 옮겼습니다. 모든 도움에 감사드립니다.

관련 정보