241 Commits

Author SHA1 Message Date
Dima Panov
c22ac8b92c mail/dovecot: unbreak build with lua54
Reported by:	poudriere failure
Approved by:	portmgr blanket (fix build)
MFH:		2021Q1
2021-01-29 09:30:02 +00:00
Kurt Jaeger
a7c5ce311f mail/dovecot: update 2.3.11.3 -> 2.3.13, fix CVE in non-default config
mail/dovecot-pigeonhole: update 0.5.11 -> 0.5.13

- please note: option VPOPMAIl was removed from upstream

PR:		252415
Submitted by:	Evilham <contact@evilham.com>
Reviewed by:	fluffy
Approved by:	ler (maintainer)
MFH:		2021Q1
Relnotes:	https://dovecot.org/pipermail/dovecot-news/2021-January/000448.html
		https://dovecot.org/pipermail/dovecot-news/2021-January/000449.html
Security:	CVE-2020-24386, CVE-2020-25275
2021-01-06 14:58:35 +00:00
Jan Beich
6d5d6429d5 devel/icu: update to 68.1
Changes:	http://site.icu-project.org/download/68
ABI:		https://abi-laboratory.pro/tracker/timeline/icu4c/
Reported by:	GitHub (watch releases)
2020-11-03 00:56:26 +00:00
Larry Rosenman
2d4e56cc62 mail/dovecot, mail/dovecot-pigeonhole: upgrade to 2.3.11.3 and 0.5.11, repectively.
dovecot changelog:
* CVE-2020-12100: Parsing mails with a large number of MIME parts could
  have resulted in excessive CPU usage or a crash due to running out of
  stack memory.
* CVE-2020-12673: Dovecot's NTLM implementation does not correctly check
  message buffer size, which leads to reading past allocation which can
  lead to crash.
* CVE-2020-10967: lmtp/submission: Issuing the RCPT command with an
  address that has the empty quoted string as local-part causes the lmtp
  service to crash.
* CVE-2020-12674: Dovecot's RPA mechanism implementation accepts
  zero-length message, which leads to assert-crash later on.
* Events: Fix inconsistency in events. See event documentation in
  https://doc.dovecot.org.
* imap_command_finished event's cmd_name field now contains "unknown"
  for unknown commands. A new "cmd_input_name" field contains the
  command name exactly as it was sent.
* lib-index: Renamed mail_cache_compress_* settings to mail_cache_purge_*.
  Note that these settings are mainly intended for testing and usually
  shouldn't be changed.
* events: Renamed "index" event category to "mail-index".
* events: service:<name> category is now using the name from
  configuration file.
* dns-client: service dns_client was renamed to dns-client.
* log: Prefixes generally use the service name from configuration file.
  For example dict-async service will now use
  "dict-async(pid): " log prefix instead of "dict(pid): "
* *-login: Changed logging done by proxying to use a consistent prefix
  containing the IP address and port.
* *-login: Changed disconnection log messages to be slightly clearer.
+ dict: Add events for dictionaries.
+ lib-index: Finish logging with events.
+ oauth2: Support local validation of JWT tokens.
+ stats: Add support for dynamic histograms and grouping. See
  https://doc.dovecot.org/configuration_manual/stats/.
+ imap: Implement RFC 8514: IMAP SAVEDATE
+ lib-index: If a long-running transaction (e.g. SORT/FETCH on a huge
  folder) adds a lot of data to dovecot.index.cache file, commit those
  changes periodically to make them visible to other concurrent sessions
  as well.
+ stats: Add OpenMetrics exporter for statistics. See
  https://doc.dovecot.org/configuration_manual/stats/openmetrics/.
+ stats: Support disabling stats-writer socket by setting
  stats_writer_socket_path="".
- auth-worker: Process keeps slowly increasing its memory usage and
  eventually dies with "out of memory" due to reaching vsz_limit.
- auth: Prevent potential timing attacks in authentication secret
  comparisons: OAUTH2 JWT-token HMAC, imap-urlauth token, crypt() result.
- auth: Several auth-mechanisms allowed input to be truncated by NUL
  which can potentially lead to unintentional issues or even successful
  logins which should have failed.
- auth: When auth policy returned a delay, auth_request_finished event
  had policy_result=ok field instead of policy_result=delayed.
- auth: auth process crash when auth_policy_server_url is set to an
  invalid URL.
- auth: Lua passdb/userdb leaks stack elements per call, eventually
  causing the stack to become too deep and crashing the auth or
  auth-worker process.
- dict-ldap: Crash occurs if var_expand template expansion fails.
- dict: If dict client disconnected while iteration was still running,
  dict process could have started using 100% CPU, although it was still
  handling clients.
- doveadm: Running doveadm commands via proxying may hang, especially
  when doveadm is printing a lot of output.
- imap: "MOVE * destfolder" goes to a loop copying the last mail to the
  destination until the imap process dies due to running out of memory.
- imap: Running "UID MOVE 1:* Trash" on an empty folder goes to infinite
  loop.
- imap: SEARCH doesn't support $.
- lib-compress: Buffer over-read in zlib stream read.
- lib-dns: If DNS lookup times out, lib-dns can cause crash in calling
  process.
- lib-index: Fixed several bugs in dovecot.index.cache handling that
  could have caused cached data to be lost.
- lib-index: Writing to >=1 GB dovecot.index.cache files may cause
  assert-crashes:
  Panic: file mail-index-util.c: line 37 (mail_index_uint32_to_offset):
  assertion failed: (offset < 0x40000000)
- lib-mail: v2.3.11 regression: MIME parts not returned correctly by
  Dovecot MIME parser.
- lib-ssl-iostream: Fix buggy OpenSSL error handling without
  assert-crashing. If there is no error available, log it as an error
  instead of crashing:
  Panic: file iostream-openssl.c: line 599 (openssl_iostream_handle_error):
  assertion failed: (errno != 0)
- lib-ssl-iostream: ssl_key_password setting did not work.
- pop3-login: Login didn't handle commands in multiple IP packets properly.
  This mainly affected large XCLIENT commands or a large SASL initial
  response parameter in the AUTH command.
- pop3: pop3_deleted_flag setting was broken, causing:
  Panic: file seq-range-array.c: line 472 (seq_range_array_invert):
  assertion failed: (range[count-1].seq2 <= max_seq)
- pop3-login: Login would fail with "Input buffer full" if the initial
  response for SASL was too long.
- submission: A segfault crash may occur when the client or server
  disconnects while a non-transaction command like NOOP or VRFY is still
  being processed.
- virtual: Copying/moving mails with IMAP into a virtual folder
assert-crashes:
  Panic: file cmd-copy.c: line 152 (fetch_and_copy): assertion failed:
  (copy_ctx->copy_count == seq_range_count(&copy_ctx->saved_uids))

pigeonhole changelog:
* managesieve: managesieve_max_line_length setting is now a "size" type
  instead of just number of bytes. This allows using e.g. "64k" as the
  value.
- lib-sieve: When folding white space is used in the Message-ID header,
  it is not stripped away correctly before the message ID value is used,
  causing e.g. garbled log lines at delivery.

PR:		248640
PR:		248644
Submitted by:	juraj@lutter.sk
Reported by:	juraj@lutter.sk
MFH:		2020Q3
Security:	87a07de1-e55e-4d51-bb64-8d117829a26a
Security:	CVE-2020-12100
Security:	CVE-2020-12673
Security:	CVE-2020-10967
Security:	CVE-2020-12674
2020-08-14 00:27:43 +00:00
Larry Rosenman
0e63d030ac mail/dovecot: fix example config *.conf.ext REINPLACE missed in r537587.
PR:		246963
Submitted by:	kfv@irbug.org
MFH:		2020Q2
2020-06-03 19:35:21 +00:00
Larry Rosenman
9ddfdc9db4 mail/dovecot: restore the REINPLACE_CMD for the example config.
Overzealous removal.

PR:		246947
Submitted by:	gwbr0601@yahoo.de
Pointy Hat To:	ler
2020-06-03 02:16:30 +00:00
Larry Rosenman
6acbbd56d3 mail/dovecot: Upgrade to 2.3.10.1, fixing multiple vulnerabilities.
- CVE-2020-10957: lmtp/submission: A client can crash the server by
  sending a NOOP command with an invalid string parameter. This occurs
  particularly for a parameter that doesn't start with a double quote.
  This applies to all SMTP services, including submission-login, which
  makes it possible to crash the submission service without
  authentication.
- CVE-2020-10958: lmtp/submission: Sending many invalid or unknown
  commands can cause the server to access freed memory, which can lead
  to a server crash. This happens when the server closes the connection
  with a "421 Too many invalid commands" error. The bad command limit
  depends on the service (lmtp or submission) and varies between 10 to
  20 bad commands.
- CVE-2020-10967: lmtp/submission: Issuing the RCPT command with an
  address that has the empty quoted string as local-part causes the
  lmtp service to crash.

Clean up some REINPLACE warnings whilst we're here.

MFH:		2020Q2
Security:	37d106a8-15a4-483e-8247-fcb68b16eaf8
Security:	CVE-2020-10957
Security:	CVE-2020-10958
Security:	CVE-2020-10967
2020-05-18 19:28:52 +00:00
Jan Beich
ffb8eb82e5 devel/icu: update to 67.1
Changes:	http://site.icu-project.org/download/67
ABI:		https://abi-laboratory.pro/tracker/timeline/icu4c/
Reported by:	GitHub (watch releases)
2020-04-23 20:14:49 +00:00
Larry Rosenman
52a7893593 mail/dovecot: use libexttextcat for lucene.
PR:		244932
Submitted by:	igorz@yandex.ru
2020-03-23 22:07:58 +00:00
Jan Beich
f821cdc347 devel/icu: update to 66.1
Changes:	http://site.icu-project.org/download/66
ABI:		https://abi-laboratory.pro/tracker/timeline/icu4c/
2020-03-13 09:47:16 +00:00
Larry Rosenman
6a9f85e649 mail/dovecot: update to 2.3.10.
ChangeLog:
* Disable retpoline migitations by default. These can cause severe
  performance regressions, so they should be only enabled when
  applicable.
* IMAP MOVE now commits transactions in batches of 1000 mails. This
  helps especially with lazy_expunge when moving a lot of mails. It
  mainly avoids situations where multiple IMAP sessions are running the
  same MOVE command and duplicating the mails in the lazy_expunge folder.
  With this change there can still be some duplication, but the MOVE
  always progresses forward. Also if the MOVE fails at some point, the
  changes up to the last 1000 mails are still committed instead of
  rolled back. Note that the COPY command behavior hasn't changed,
  because it is required by IMAP standard to be an atomic operation.
* IMAP EXPUNGE and CLOSE now expunges mails in batches of 1000 mails.
  This helps especially with lazy_expunge when expunging a lot of mails
  (e.g. millions) to make sure that the progress always moves forward
  even if the process is killed.
* Autoexpunging now expunges mails in batches of 1000 mails. This helps
  especially with lazy_expunge when expunging a lot of mails
  (e.g. millions) to make sure that the progress always moves forward
  even if the process is killed.
+ Add tool for generating sysreport called dovecot-sysreport.
  This generates a bundle of information usually needed for support
  requests.
+ Add support for the new IMAP \Important SPECIAL-USE flag (RFC 8457).
+ Add metric { group_by } setting. This allows automatically creating
  new metrics based on the fields you want to group statistics by.
  NOTE: This feature is considered experimental and syntax is subject
  to change in future release.
+ auth: Support SCRAM-SHA-256 authentication mechanism.
+ imap: Support the new IMAP STATUS=SIZE extension.
+ Use TCP_QUICKACK to reduce latency for some TCP connections.
+ quota-status: Made the service more robust against erroneous use with
  Postfix ACL policies other than smtpd_recipient_restrictions.
+ Add "revision" field support to imap_id_send setting. Using
  "revision *" will send in IMAP ID command response the short commit
  hash of the Dovecot git source tree HEAD (same as in dovecot --version).
+ IMAP ENVELOPE includes now all addresses when there are multiple
  headers (From, To, Cc, etc.) The standard way of having multiple
  addresses is to just list them all in a single header. It's
  non-standard to have multiple headers. However, since MTAs allow these
  mails to pass through and different software may handle them in
  different ways, it's better from security point of view to show all
  the addresses.
+ Event filters now support using "field_name=" to match a field that
  doesn't exist or has an empty value. For example use "error=" to match
  only events that didn't fail.
- acl: INBOX ACLs shouldn't apply for IMAP GETMETADATA/SETMETADATA
  commands.
- cassandra: CASS_ERROR_SERVER_WRITE_FAILURE error should also be
  treated as "uncertain write failure".
- dict-redis: Using quota_clone configured with dict-redis could have
  crashed when Redis responded slowly.
- imap-hibernate: Communication trouble with imap-master leads to
  segfault.
- imap-hibernate: Unhibernation retrying wasn't working.
- imap: Fixed auth lookup privilege problem when imap process was reused
  and user was being un-hibernated.
- Fix potential crash when copying/moving mails within the same folder.
  This happened only when there were a lot of fields in dovecot.index.cache.
- lib-index: Recreating dovecot.index.cache file could have crashed when
  merging bitmask fields.
- lib-index: Using public/shared folders with INDEXPVT configured to use
  private \Seen flags, trying to search seen/unseen in an empty folder
  crashes with segfault.
- lib-mail: Large base64-encoded mails weren't decoded properly.
  This could have affected searching/indexing mails and message snippet
  generation.
- lib-mail: Message with only quoted text could have caused message
  snippet to ignore its 200 character limit and return the entire
  message. This was added also to dovecot.index.cache file, which
  increased disk space and memory usage unnecessarily.
  v2.3.9.2 regression (previous versions cached the quoted snippet as
  empty). In a large mail quoted text could have become wrongly added
  to the snippet, possibly mixed together with non-quoted text.
- lib-smtp: client could have assert-crashed if STARTTLS handshake
  finished earlier than usually.
- lib-ssl-iostream: remove -static flag for lib-ssl-iostream linking to
  prevent a compile issue.
- lib-storage: Mailbox synchronization may have assert-crashed in some
  rare situations.
- lib-storage: mdbox didn't preserve date.saved with dsync.
- lib: Don't require EAI_{ADDRFAMILY,NODATA}, breaks FreeBSD
- master: Some services could respawn unthrottled if they crash during
  startup.
- push-notification: Do not send push_notification_finished event if
  nothing was done. This happens when mail transaction is started and
  ended with no changes.
- quota-status: Addresses with special characters in the local part caused
  problems in the interaction between Postfix and Dovecot. Postfix sent
  its own internal representation in the recipient field, while Dovecot
  expected a valid RFC5321 mailbox address.
- submission-login: SESSION was not correctly encoded field for the
  XCLIENT command. Particularly, a '+' character introduced by the
  session ID's Base64 encoding causes problems.
- submission: Fix submission_max_mail_size to work correctly on 32-bit
  systems.
- submission: Trusted connections crashed in second connection's EHLO
  if submission-login { service_count } is something else than 1 (which
  is the default).
- submission: XCLIENT command was never used in the protocol exchange
  with the relay MTA when submission_backend_capabilities is configured,
  even when the relay MTA was properly configured to accept the XCLIENT
  command.
- fts-solr: The XML response parser fails to parse large/chunked responses
  correctly. This leads to spurious parse errors, most notably:
  "Error: fts_solr: received invalid uid '0'".

Bumping PORTREVISION on dovecot-pigeonhole (explicitly ignoring 0.5.10, as
there are compile/configure/hang issues), and dovecot-fts-xapian.
2020-03-06 19:16:54 +00:00
Larry Rosenman
8f79574ba0 mail/dovecot: upgrade to 2.3.9.3
Changelog:
    * CVE-2020-7046: Truncated UTF-8 can be used to DoS
      submission-login and lmtp processes.
    * CVE-2020-7957: Specially crafted mail can crash snippet generation.

MFH:		2020Q1
Security:	CVE-2020-7046
Security:	CVE-2020-7957
Security:	74db0d02-b140-4c32-aac6-1f1e81e1ad30
2020-02-13 00:47:39 +00:00
Larry Rosenman
38be96ca81 mail/dovecot: upgrade to 2.3.9.2,
* CVE-2019-19722: Mails with group addresses in From or To fields caused
crash in push notification drivers.
- additional fix for blank headers

PORTREVISION bump for mail/dovecot-pigeonhole, mail/dovecot-fts-xapian
*NOT* requesting MFH as 2.3.9 is not in 2019Q4.

Security:	b7dc4dde-2e48-43f9-967a-c68461537cf2
Security:	CVS-2019-19722
2019-12-13 15:02:25 +00:00
Larry Rosenman
0e8254517a mail/dovecot, mail/dovecot-pigeonhole: upgrade to 2.3.9, 0.5.9 respectively.
Bump PORTREVISION of mail/dovecot-fts-xapian for version change of dovecot.

Changelog:
Dovecot:
* Changed several event field names for consistency and to avoid
  conflicts in parent-child event relationships:
   * SMTP server command events: Renamed "name" to "cmd_name"
   * Events inheriting from a mailbox: Renamed "name" to "mailbox"
   * Server connection events have only "remote_ip", "remote_port",
     "local_ip" and "local_port".
   * Removed duplicate "client_ip", "ip" and "port".
   * Mail storage events: Removed "service" field.
     Use "service:<name>" category instead.
   * HTTP client connection events: Renamed "host" to "dest_host" and
     "port" to "dest_port"
* auth: Drop Postfix socketmap support. It hasn't been working
  with recent Postfix versions for a while now.
* push-notification-lua: The "subject" field is now decoded to UTF8
  instead of kept as MIME-encoded.
+ push-notification-lua: Added new "from_address", "from_display_name",
  "to_address" and "to_display_name" fields. The display names are
  decoded to UTF8.
+ Added various new fields to existing events.
  See http://doc.dovecot.net/admin_manual/list_of_events.html
+ Add lmtp_add_received_header setting. It can be used to prevent LMTP
  from adding "Received:" headers.
+ doveadm: Support SSL/STARTTLS for proxied doveadm connections based on
  doveadm_ssl setting and proxy ssl/tls settings.
+ Log filters support now "service:<name>", which matches all events for
  the given service. It can also be used as a category.
+ lib: Use libunwind to get abort backtraces with function names
  where available.
+ lmtp: When the LMTP proxy changes the username (from passdb lookup)
  add an appropriate ORCPT parameter.
- lmtp: Add lmtp_client_workarounds setting to implement workarounds for
  clients that send MAIL and RCPT commands with additional spaces before
  the path and for clients that omit <> brackets around the path.
  See example-config/conf.d/20-lmtp.conf.
- lda/lmtp: Invalid MAIL FROM addresses were rejcted too aggressively.
  Now mails from addresses with unicode characters are delivered, but
  their Return-Path header will be <> instead of the given MAIL FROM
  address.
- lmtp: The lmtp_hdr_delivery_address setting is ignored.
- imap: imap_command_finished event's "args" and "human_args" parameters
  were always empty.
- mbox: Seeking in zlib and bzip2 compressed input streams didn't work
  correctly.
- imap-hibernate: Process crashed when client got destroyed while it was
  attempted to be unhibernated, and the unhibernation fails.
- *-login: Proxying may have crashed if SSL handshake to the backend
  failed immediately. This was unlikely to happen in normal operation.
- *-login: If TLS handshake to upstream server failed during proxying,
  login process could crash due to invalid memory access.
- *-login: v2.3 regression: Using SASL authentication without initial
  response may have caused SSL connections to hang. This happened often
  at least with PHP's IMAP library.
- *-login: When login processes are flooded with authentication attempts
  it starts logging errors about "Authentication server sent unknown id".
  This is still expected. However, it also caused the login process to
  disconnect from auth server and potentially log some user's password
  in the error message.
- dict-sql: SQL prepared statements were not shared between sessions.
  This resulted in creating a lot of prepared statements, which was
  especially inefficient when using Cassandra backend with a lot of
  Cassandra nodes.
- auth: auth_request_finished event didn't have success=yes parameter
  set for successful authentications.
- auth: userdb dict - Trying to list users crashed.
- submission: Service could be configured to allow anonymous
  authentication mechanism and anonymous user access.
- LAYOUT=index: Corrupted dovecot.list.index caused folder creation to
  panic.
- doveadm: HTTP server crashes if request target starts with double "/".
- dsync: Remote dsync started hanging if the initial doveadm
  "dsync-server" command was sent in the same TCP packet as the
  following dsync handshake. v2.3.8 regression.
- lib: Several "input streams" had a bug that in some rare situations
  might cause it to access freed memory. This could lead to crashes or
  corruption.
  The only currently known effect of this is that using zlib plugin with
  external mail attachments (mail_attachment_dir) could cause fetching
  the mail to return a few bytes of garbage data at the beginning of the
  header. Note that the mail wasn't saved corrupted, but fetching it
  caused corrupted mail to be sent to the client.
- lib-storage: If a mail only has quoted content, use the quoted text
  for generating message snippet (IMAP PREVIEW) instead of returning
  empty snippet.
- lib-storage: When vsize header was rebuilt, newly calculated message
  sizes were added to dovecot.index.cache instead of being directly
  saved into vsize records in dovecot.index.
- lib: JSON generator was escaping UTF-8 characters unnecessarily.

Pigeonhole:
+ Added events for Sieve and ManageSieve, see
  https://doc.dovecot.org/admin_manual/list_of_events/#pigeonhole
+ Pigeonhole: Implement the Sieve "special-use" extension described in
  RFC 8579.
- duplicate: Test only compared the handles which would cause
  different values to be cached as the same duplicate test. Fix to also
  compare the actual hashes.
- imap_sieve_filter: IMAP FILTER Command had various bugs in error
  handling. Errors may have been duplicated for each email, errors
  may have been missing entirely, command tag and ERRORS/WARNINGS
  parameters were swapped.
2019-12-04 17:59:41 +00:00
Larry Rosenman
b0fb975578 mail/dovecot: include mention of security.bsd.hardlink_check_{g,u}id in pkg-message.
PR:		242223
Submitted by:	tphilipp@potion-studios.com
2019-11-26 01:52:57 +00:00
Larry Rosenman
81fc1d3d05 mail/dovecot: revert removing patch that is still needed.
PR:		240607
2019-10-16 16:25:07 +00:00
Baptiste Daroussin
df50252ad1 Revert changes that crept in by accident
Reported by:	fluffy
Pointy hat:	bapt
2019-10-10 08:18:26 +00:00
Larry Rosenman
0510a1fdbc mail/dovecot: really fix LUA=off.
Pointy Hat To: ler
2019-10-09 15:44:56 +00:00
Larry Rosenman
5c38738326 mail/dovecot: fix breakage when LUA is NOT selected.
PR:		241144
Submitted by:	matthias.pfaller@familie-pfaller.de
Reported by:	many
Pointy Hat To: ler
2019-10-09 14:38:32 +00:00
Baptiste Daroussin
0be2ce42f1 Drop the ipv6 virtual category for m* category as it is not relevant anymore 2019-10-09 12:06:22 +00:00
Baptiste Daroussin
85176da363 dovecot-fts-xapian: Bump portrevision after dovecot upgrade
Add a note to the dovecot port about the requirement to bump the portrevision
each time dovecot is updated

PR:		241147
Reported by:	Matthias Pfaller <matthias.pfaller@familie-pfaller.de>
2019-10-09 09:30:16 +00:00
Larry Rosenman
f86b5247b0 mail/dovecot, mail/dovecot-pigeonhole: upgrade to 2.3.8 and 0.5.8 respectively.
release notes:
dovecot:
Changes

+ Added mail_delivery_started and mail_delivery_finished events, see
https://doc.dovecot.org/admin_manual/list_of_events/ for details.
+ dsync-replication: Don't replicate users who have "noreplicate" extra
field in userdb.
+ doveadm service status: Show total number of processes created.
+ When logging to syslog, use instance_name setting's value for the
ident. This commonly is added as a log prefix.
+ Base64 encoding/decoding code was rewritten with additional features.
It shouldn't cause any user visible changes.
- v2.3.7 regression: If a folder only receives new mails without any
other mail access, dovecot.index.log keeps growing forever and
dovecot.index keeps being rewritten for every mail delivery.
- dsync-replication may lose keywords after syncing mails restored from
another replica. This only happened if the mail only had keywords and no
system flags.
- event filters: Non-textual event fields could not be filtered using
wildcards.
- auth: Scope parameter was missing from OAuth password grant request.
- doveadm client-server communication may hang in some situations. It is
also using unnecessarily small TCP/IP packet sizes.
- doveadm who and kick did not flush protocol output correctly.
- imap: SETMETADATA with literal value would delete the metadata value
instead of updating it.
- imap: When client issues FETCH PREVIEW (LAZY=FUZZY) command, the
caching decisions should be updated so that newly saved mails will have
the preview cached.
- With mail_nfs_index=yes and/or mail_nfs_storage=yes setuid/setgid
permission bits in some files may have become dropped with some NFS
servers. Changed NFS flushing to now use chmod() instead of chown().
- quota: warnings did not work if quota root was noenforcing
- acl: Global ACL file ignored the last line if it didn't end with LF.
- doveadm stats dump: With JSON formatter output numbers using the
number type instead of as strings
- lmtp_proxy: Ensure that real_* variables are correctly set when using
lmtp_proxy.
- event exporter: http-post driver had hardcoded timeout and did not
support DNS lookups or TLS connections.
- auth: Fix user iteration to work with userdb passwd with glibc v2.28.
- auth: auth service can crash if auth-policy JSON response is invalid
or returned too fast.
- In some rare situations "ps" output could have shown a lot of "?"
characters after Dovecot process titles.
- When dovecot.index.pvt is empty, an unnecessary error is logged:
  Error: .../dovecot.index.pvt reset, view is now inconsistent
- SMTP address encoder duplicated initial double quote character when
the localpart of an address ended in '..'. For example
"user+..@example.com" became ""user+.."@example.com in a
  sieve redirect.

pigeonhole:
Changes

- Sieve may leak resources in rare cases when a redirect, vacation or
report action fails to send the message. This mainly applies when Sieve
is executed in IMAP context; i.e., for the IMAPSIEVE or FILTER=SIEVE
capabilities.
2019-10-08 21:56:51 +00:00
Jan Beich
4bbb4133b2 devel/icu: update to 65.1
Changes:	http://site.icu-project.org/download/65
ABI:		https://abi-laboratory.pro/tracker/timeline/icu4c/
2019-10-03 20:35:29 +00:00
Larry Rosenman
ae697c8f1e mail/dovecot: remove no longer needed patch file.
PR:		240607
Submitted by:	paul.le.gauret@gmail.com
2019-09-16 01:24:37 +00:00
Larry Rosenman
3d824592bd mail/dovecot,mail/dovecot-pigeonhole: fix CVE-2019-11500
Changes
-------
* CVE-2019-11500: IMAP protocol parser does not properly handle NUL byte
  when scanning data in quoted strings, leading to out of bounds heap
  memory writes. Found by Nick Roessler and Rafi Rubin.

MFH:		2019Q3
Security:	CVE-2019-11500
2019-08-28 15:59:59 +00:00
Mathieu Arnold
558224994b onvert to UCL & cleanup pkg-message (categories l-m) 2019-08-13 22:29:42 +00:00
Larry Rosenman
bec604d835 mail/dovecot, mail/dovecot-pigeonhole: upgrade to 2.3.7.1 and 0.5.7.1 respectively.
These releases fix the reported regressions in v2.3.7 & v0.5.7.

Dovecot core:
        - Fix TCP_NODELAY errors being logged on non-Linux OSes
        - lmtp proxy: Fix assert-crash when client uses BODY=8BITMIME
        - Remove wrongly added checks in namespace prefix checking

Pigeonhole:
        - dsync: Sieve script syncing failed if mailbox attributes weren't
          enabled.
2019-07-23 14:26:56 +00:00
Larry Rosenman
bbfb58d14f mail/dovecot: [PATCH] lib-storage: Namespace prefix shouldn't be included in all
mailbox name validity checks

Obtained from:	upstream github.
2019-07-22 23:17:54 +00:00
Larry Rosenman
35ca9f2f90 mail/dovecot: One should actually TEST their patches.
Fix previous commit.

Pointy Hat To: ler
2019-07-17 20:19:19 +00:00
Larry Rosenman
454dfccf4e mail/dovecot: stop whining about TCP_NODELAY errors.
[PATCH] lib: ostream-file: Don't log any errors when setting
 TCP_NODELAY

It's likely never useful to log the error, and it seems more and more
unexpected errors just keep popping up.

Obtained from:	upstream git.
2019-07-17 19:22:24 +00:00
Larry Rosenman
a9892b4b7b mail/dovecot: stop spamming the log with EINVAL.
PR:		239172
Submitted by:	zillion1@o2.pl
Obtained from:	dovecot mailing list.
2019-07-12 19:22:09 +00:00
Larry Rosenman
d41e1e5999 mail/dovecot, mail/dovecot-pigeonhole: Update to 2.3.7 and 0.5.7 respectively.
dovecot changelog:
* fts-solr: Removed break-imap-search parameter
+ Added more events for the new statistics, see
  https://doc.dovecot.org/admin_manual/list_of_events/
+ mail-lua: Add IMAP metadata accessors, see
  https://doc.dovecot.org/admin_manual/lua/
+ Add event exporters that allow exporting raw events to log files and
  external systems, see
  https://doc.dovecot.org/configuration_manual/event_export/
+ SNIPPET is now PREVIEW and size has been increased to 200 characters.
+ Add body option to fts_enforced. This triggers building FTS index only
  on body search, and an error using FTS index fails the search rather
  than reads through all the mails.
- Submission/LMTP: Fixed crash when domain argument is invalid in a
  second EHLO/LHLO command.
- Copying/moving mails using Maildir format loses IMAP keywords in the
  destination if the mail also has no system flags.
- mail_attachment_detection_options=add-flags-on-save caused email body
  to be unnecessarily opened when FETCHing mail headers that were
  already cached.
- mail attachment detection keywords not saved with maildir.
- dovecot.index.cache may have grown excessively large in some
  situations. This happened especially when using autoexpunging with
  lazy_expunge folders. Also with mdbox format in general the cache file
  wasn't recreated as often as it should have.
- Autoexpunged mails weren't immediately deleted from the disk. Instead,
  the deletion from disk happened the next time the folder was opened.
  This could have caused unnecessary delays if the opening was done by
  an interactive IMAP session.
- Dovecot's TCP connections sometimes add extra 40ms latency due to not
  enabling TCP_NODELAY. HTTP and SMTP/LMTP connections weren't
  affected, but everything else was. This delay wasn't always visible -
  only in some situations with some message/packet sizes.
- imapc: Fix various crash conditions
- Dovecot builds were not always reproducible.
- login-proxy: With shutdown_clients=no after config reload the
  existing connections could no longer be listed or kicked with doveadm.
- "doveadm proxy kick" with -f parameter caused a crash in some
  situations.
- Auth policy can cause segmentation fault crash during auth process
  shutdown if all auth requests have not been finished.
- Fix various minor bugs leading into incorrect behaviour in mailbox
  list index handling. These rarely caused noticeable problems.
- LDAP auth: Iteration accesses freed memory, possibly crashing
  auth-worker
- local_name { .. } filter in dovecot.conf does not correctly support
  multiple names and wildcards were matched incorrectly.
- replicator: dsync assert-crashes if it can't connect to remote TCP
  server.
- config: Memory leak in config process when ssl_dh setting wasn't
  set and there was no ssl-parameters.dat file.
  This caused config process to die once in a while
  with "out of memory".

pigeonhole changelog:
+ vacation: Made the subject for the automatic response message produced
  by the Sieve vacation action configurable. Both the default subject
  (if the script defines none) and the subject template (e.g. used to
  add a subject prefix) can be configured.
- dsync: dsync-replication does not synchronize Sieve scripts.
- imap_sieve_filter: Reduce FILTER=SIEVE verbosity over IMAP connection.
- testsuite: Pigeonhole testsuite segfaulted if it was compiled with
  GCC 9
2019-07-12 13:20:29 +00:00
Larry Rosenman
368ab2c722 mail/dovecot: remove obsolete patch.
no PORTREVISION bump, as it doesn't change the package.

Reported by:	herbert@gojira.at
2019-05-01 14:38:59 +00:00
Larry Rosenman
15dd243379 mail/dovecot, mail/dovecot-pigeonhole: upgrade to 2.3.6, 0.5.6 respectively.
Dovecot changelog:
* CVE-2019-11494: Submission-login crashed with signal 11 due to null pointer access when authentication was aborted by disconnecting.
* CVE-2019-11499: Submission-login crashed when authentication was started over TLS secured channel and invalid authentication message was sent.
* auth: Support password grant with passdb oauth2.
+ Use system default CAs for outbound TLS connections.
+ Simplify array handling with new helper macros.
+ fts_solr: Enable configuring batch_size and soft_commit features.
- lmtp/submission: Fixed various bugs in XCLIENT handling, including a hang when XCLIENT commands were sent infinitely to the remote server.
- lmtp/submission: Forwarded multi-line replies were erroneously sent as two replies to the client.
- lib-smtp: client: Message was not guaranteed to contain CRLF consistently when CHUNKING was used.
- fts_solr: Plugin was no longer compatible with Solr 7.
- Make it possible to disable certificate checking without setting ssl_client_ca_* settings.
- pop3c: SSL support was broken.
- mysql: Closing connection twice lead to crash on some systems.
- auth: Multiple oauth2 passdbs crashed auth process on deinit.
- HTTP client connection errors infrequently triggered a segmentation fault when the connection was idle and not used for a particular client instance.

Pigeonhole changelog:
+ sieve: Redirect loop prevention is sometimes ineffective. Improve existing loop detection by also recognizing the
  X-Sieve-Redirected-From header in incoming messages and dropping redirect actions when it points to
  the sending account. This header is already added by the redirect action, so this improvement only adds an additional use of this header.
- sieve: Prevent execution of implicit keep upon temporary failure occurring at runtime.

MFH:		2019Q2
Security:	CVE-2019-11494
Security:	CVE-2019-11499
2019-04-30 21:33:30 +00:00
Larry Rosenman
8d7569cded mail/dovecot: upgrade to 2.3.5.2
* CVE-2019-10691: Trying to login with 8bit username containing
      invalid UTF8 input causes auth process to crash if auth policy is
      enabled. This could be used rather easily to cause a DoS. Similar
      crash also happens during mail delivery when using invalid UTF8 in
      From or Subject header when OX push notification driver is used.

MFH:		2019Q2
Security:	CVE-2019-10691
2019-04-18 15:22:06 +00:00
Larry Rosenman
0c2a225328 mail/dovecot: upgrade to 2.3.5.1.
* CVE-2019-7524: Missing input buffer size validation leads into
      arbitrary buffer overflow when reading fts or pop3 uidl header
      from Dovecot index. Exploiting this requires direct write access to
      the index files.

MFH:		2019Q1
Security:	CVE-2019-7524
2019-03-28 12:24:41 +00:00
Jan Beich
480c577baa devel/icu: update to 64.1
Changes:	http://site.icu-project.org/download/64
ABI:		https://abi-laboratory.pro/tracker/timeline/icu4c/
PR:		236325
Exp-run by:	antoine
Differential Revision:	https://reviews.freebsd.org/D19479
2019-03-27 21:11:08 +00:00
Larry Rosenman
df81cb1b9c mail/dovecot and mail/dovecot-pigeonhole upgrade to 2.3.5 and 0.5.5 respectively
dovecot changelog:
+ Lua push notification driver: mail keywords and flags are provided in MessageNew and MessageAppend events.
+ submission: Implement support for plugins.
+ auth: When auth_policy_log_only=yes, only log what the policy server response would do without actually doing it.
+ auth: Always log policy server decisions with auth_verbose=yes
- v2.3.[34]: doveadm log errors: Output was missing user/session
- lda: Debug log lines could have shown slightly corrupted
- login proxy: Login processes may have crashed in various ways when login_proxy_max_disconnect_delay was set.
- imap: Fix crash with Maildir+zlib if client disconnects during APPEND
- lmtp proxy: Fix potential assert-crash
- lmtp/submission: Fix crash when SMTP client transaction times out
- submission: Split large XCLIENT commands to 512 bytes per command, so Postfix accepts them.
- submission: Fix crash when client sends invalid BURL command
- submission: relay backend: VRFY command: Avoid forwarding 500 and 502 replies back to client.
- lib-http: Fix potential assert-crash when DNS lookup fails
- lib-fts: Fix search query generation when one language ignores a token (e.g. via stopwords).

pigeonhole changelog:
+ IMAPSieve: Add new plugin/imapsieve_expunge_discarded setting which causes messages discarded by an IMAPSieve script to be expunged immediately, rather than only being marked as "\Deleted" (which is still the default behavior).
- IMAPSieve: Fix panic crash occurring when a COPY command copies
messages from a virtual mailbox where the source messages originate from more than a single real mailbox.
- imap4flags extension: Fix deleting all keywords. When the action
resulted in all keywords being removed, no changes were actually
applied.
- variables extension: Fix truncation of UTF-8 variable content. The maximum size of Sieve variables was enforced by truncating the
variable string content bluntly at the limit, but this does not
consider UTF-8 code point boundaries. This resulted in broken UTF-8 strings. This problem also surfaced for variable modifiers, such as the ":encodeurl" modifier provided by the Sieve "enotify" extension. In that case, the resulting URI escaping could also be truncated inappropriately.
- IMAPSieve, IMAP FILTER=SIEVE: Fix replacing a modified message. Sieve scripts running in IMAPSIEVE or IMAP FILTER=SIEVE context that modify the message, stored the message a second time, rather than replacing the originally stored unmodified message.
- Fix segmentation fault occurring when both the sieve_extprograms
plugin (for the Sieve interpreter) and the imap_filter_sieve plugin (for IMAP) are loaded at the same time. A symbol was defined by both plugins, causing a clash when both were loaded.
2019-03-05 23:34:12 +00:00
Larry Rosenman
a434efa6bf mail/dovecot: upgrade to 2.3.4.1
* CVE-2019-3814: If imap/pop3/managesieve/submission client has
      trusted certificate with missing username field
      (ssl_cert_username_field), under some configurations Dovecot
      mistakenly trusts the username provided via authentication instead
      of failing.
    * ssl_cert_username_field setting was ignored with external SMTP AUTH,
      because none of the MTAs (Postfix, Exim) currently send the
      cert_username field. This may have allowed users with trusted
      certificate to specify any username in the authentication. This bug
      didn't affect Dovecot's Submission service.

PR:		235523
Submitted by:	pascal.christen@hostpoint.ch
MFH:		2019Q1
Security:	1340fcc1-2953-11e9-bc44-a4badb296695
Security:	CVE-2019-3814
2019-02-05 14:50:38 +00:00
Larry Rosenman
d39a167fe8 mail/dovecot: Fix previous commit.
I missed a character typing the patch.

Pointy Hat: ler
2019-01-06 17:55:58 +00:00
Larry Rosenman
a6885ac1ef mail/dovecot: Pick up mailing list patch for imap-preauth vs. stats-writer.
see the dovecot mailing list thread on imap-preauth and stats-writer between
Stephan Bosch and a FreeBSD user

Obtained from:	upstream mailing list.
2019-01-06 17:46:53 +00:00
Larry Rosenman
fab5b969f8 mail/dovecot: Pick up a mailinglist patch for solr/tika separation.
solr and tika currently use the same http client connection.  Upstream
made the attached patches in response to my (ler@) bug report.

Obtained from:	upstream mailing list.
2019-01-02 22:30:55 +00:00
Larry Rosenman
7c09023980 mail/dovecot: Add upstream patch to fix a double free in MySQL.
Obtained from:	3c5101ffdd.patch
2018-12-04 17:53:58 +00:00
Larry Rosenman
15513b1966 mail/dovecot: add option to support libsodium
- libsodium option to support security/libsodium based crypts
- pet portlint
- fix LUA option pkg-plist issues
2018-12-04 11:33:06 +00:00
Larry Rosenman
3f50049b45 mail/dovecot: pick up patch from upstream to quiet format warnings.
Obtained from:	de42b54aaf
2018-11-23 18:22:16 +00:00
Larry Rosenman
218e60f065 mail/dovecot update to 2.3.4, mail/dovecot-pigeonhole to 0.5.4
dovecot change log:
* The default postmaster_address is now "postmaster@<user domain or
   server hostname>". If username contains the @domain part, that's
   used. If not, then the server's hostname is used.
* "doveadm stats dump" now returns two decimals for the "avg" field.

+ Added push notification driver that uses a Lua script
+ Added new SQL, DNS and connection events.
   See https://wiki2.dovecot.org/Events
+ Added "doveadm mailbox cache purge" command.
+ Added events API support for Lua scripts
+ doveadm force-resync -f parameter performs "index fsck" while opening
   the index. This may be useful to fix some types of broken index files.
   This may become the default behavior in a later version.
- director: Kicking a user crashes if login process is very slow
- pop3_no_flag_updates=no: Don't expunge DELEted and RETRed messages
   unless QUIT is sent.
- auth: Fix crypt() segfault with glibc-2.28+
- imap: Running UID FILTER script with errors assert-crashes
- dsync, pop3-migration: POP3 UIDLs weren't added to
   dovecot.index.cache while mails were saved.
- dict clients may have been using 100% CPU while waiting for dict
   server to finish commands.
- doveadm user: Fixed user listing via HTTP API
- All levels of Cassandra log messages were logged as Dovecot errors.
- http/smtp client may have crashed after SSL handshake
- Lua auth converted strings that looked like numbers into numbers.

pigeonhole change log:
  * Adjustments to several changes in Dovecot v2.3.4 make this Pigeonhole
    release dependent on that Dovecot release; it will not compile against
    older Dovecot versions. And, conversely, you need to upgrade
    Pigeonhole when upgrading Dovecot to v2.3.4.
  * The changes regarding the default postmaster_address in Dovecot v2.3.4
    mainly apply to Pigeonhole. The new default should work for all
    existing installations, thereby fixing several reported v2.3/v0.5
    migration problems.

  - IMAP FILTER=SIEVE capability: Fix assert crash occurring when running
    UID FILTER on a Sieve script with errors.
2018-11-23 15:12:44 +00:00
Larry Rosenman
f32efe0e56 mail/dovcecot: fix thinko in previous update. Don't print config always
PR:		232803
Submitted by:	oleg@pcbtech.ru
2018-10-30 14:04:21 +00:00
Larry Rosenman
d3bf037d52 mail/dovecot: give better error message(s) when there are configuration errors.
PR:		232785
Submitted by:	prj@rootwyrm.com
2018-10-29 23:28:26 +00:00
Jan Beich
91f9922c6f devel/icu: update to 63.1
Changes:	http://site.icu-project.org/download/63
ABI:		https://abi-laboratory.pro/tracker/timeline/icu4c/
PR:		232300
Exp-run by:	antoine
2018-10-23 11:35:03 +00:00
Larry Rosenman
fe8ee0a8b2 mail/dovecot: don't pick up libsodium if installed.
PR:		232236
Submitted by:	d8zNeCFG@aon.at
2018-10-14 13:30:39 +00:00