]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Update documentation links in source code
authorMichael M Slusarz <michael.slusarz@open-xchange.com>
Tue, 11 Feb 2025 11:19:48 +0000 (04:19 -0700)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:41:01 +0000 (12:41 +0200)
configure.ac
src/lib-login/login-client.c
src/lib-login/login-server.c
src/lib-storage/index/mbox/mbox-storage.c
src/lib-storage/mail-storage-service.c
src/lib/Makefile.am
src/lib/doc.h [new file with mode: 0644]
src/lib/eacces-error.c

index d01b02c16019c5f8e3da58ffb7b5b91ce3c76139..9c5468e532b93e5d4475908b93340b2ad79e2a74 100644 (file)
@@ -265,10 +265,12 @@ AS_IF([echo "$PACKAGE_VERSION" | grep '^[[0-9]]*\.[[0-9]]*\.[[0-9]]'], [
 AS_IF([test "$is_pro_build" = "yes"], [
   SET_PRO_DEFINES
   AC_SUBST(DOVECOT_ASSET_URL, "doc.dovecotpro.com")
+  AC_DEFINE(DOVECOT_DOC_URL, "https://doc.dovecotpro.com/", [Documentation URL])
   AC_SUBST(DOVECOT_PRO_BUILD, 1)
 ], [
   AC_DEFINE_UNQUOTED(DOVECOT_NAME, "$PACKAGE_NAME", [Dovecot name])
   AC_SUBST(DOVECOT_ASSET_URL, "doc.dovecot.org")
+  AC_DEFINE(DOVECOT_DOC_URL, "https://doc.dovecot.org/", [Documentation URL])
   AC_SUBST(DOVECOT_PRO_BUILD, 0)
 ])
 AC_DEFINE_UNQUOTED(DOVECOT_CONFIG_VERSION, "$DOVECOT_CONFIG_VERSION", [Dovecot configuration version])
index d801a7bb154ecc7076c2a9e196cf1ce15a37d52b..c49dbaf27cc8ca4f7266173ff14b84a2b43b4943 100644 (file)
@@ -9,6 +9,7 @@
 #include "time-util.h"
 #include "master-service-private.h"
 #include "login-client.h"
+#include "doc.h"
 
 #include <unistd.h>
 #include <sys/stat.h>
@@ -233,7 +234,7 @@ void login_client_request(struct login_client_list *list,
        if (conn->fd == -1) {
                e_error(conn->event, "net_connect_unix(%s) failed: %m%s",
                        conn->path, errno != EAGAIN ? "" :
-                       " - https://doc.dovecot.org/admin_manual/errors/socket_unavailable/");
+                       " - " DOC_LINK("core/admin/errors.html#unix-socket-resource-temporarily-unavailable"));
                login_connection_deinit(&conn);
                return;
        }
index f564e56629331b5783a6a866c014cb41e8157098..6dcebfcc9a55f61f0c46c637cd219d288f437019 100644 (file)
@@ -12,6 +12,7 @@
 #include "master-service-private.h"
 #include "login-server.h"
 #include "login-server-auth.h"
+#include "doc.h"
 
 #include <sys/stat.h>
 #include <unistd.h>
@@ -375,7 +376,7 @@ static int login_server_postlogin(struct login_server_request *request,
        if (fd == -1) {
                e_error(request->conn->event, "net_connect_unix(%s) failed: %m%s",
                           socket_path, errno != EAGAIN ? "" :
-                          " - https://doc.dovecot.org/admin_manual/errors/socket_unavailable/");
+                          " - " DOC_LINK("core/admin/errors.html#unix-socket-resource-temporarily-unavailable"));
                return -1;
        }
 
index e86c4f07dfbb233467292f4190b2707bf9c6bd78..47ce6ebe3d2821e6879f51a480797f1380eb9523 100644 (file)
@@ -15,6 +15,7 @@
 #include "istream-raw-mbox.h"
 #include "mail-copy.h"
 #include "index-mail.h"
+#include "doc.h"
 
 #include <sys/stat.h>
 
@@ -196,7 +197,7 @@ mbox_storage_create(struct mail_storage *_storage, struct mail_namespace *ns,
            !S_ISDIR(st.st_mode)) {
                *error_r = t_strdup_printf(
                        "mbox root directory can't be a file: %s "
-                       "(https://doc.dovecot.org/configuration_manual/mail_location/mbox/)",
+                       "(" DOC_LINK("core/config/mailbox/mail_location.html#mbox") ")",
                        ns->list->mail_set->mail_path);
                return -1;
        }
index df662e08d1fc9d4f728b53f839e5d274106cf029..4580b6cc8ba11a20f28d6b5aabc184d39bc6d090 100644 (file)
@@ -20,6 +20,7 @@
 #include "mail-namespace.h"
 #include "mail-storage.h"
 #include "mail-storage-service.h"
+#include "doc.h"
 
 #include <sys/stat.h>
 #include <time.h>
@@ -815,7 +816,7 @@ mail_storage_service_time_moved(const struct timeval *old_time,
        }
        diff = -diff;
 
-       const char *doc_ref = "https://doc.dovecot.org/admin_manual/errors/time_moved_backwards/";
+       const char *doc_ref = DOC_LINK("core/admin/errors.html#time-moved-backwards-error");
        if ((diff / 1000) > MAX_TIME_BACKWARDS_SLEEP_MSECS) {
                i_fatal("Time just moved backwards by %lld.%06lld seconds. "
                        "This might cause a lot of problems, "
index 4dbacee2072c9b4c8b363017e5512e5104deac11..2981499e4d3c5b00147b540cca369982383007be 100644 (file)
@@ -218,6 +218,7 @@ headers = \
        cpu-limit.h \
        crc32.h \
        data-stack.h \
+       doc.h \
        eacces-error.h \
        env-util.h \
        event-filter.h \
diff --git a/src/lib/doc.h b/src/lib/doc.h
new file mode 100644 (file)
index 0000000..0a864ed
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef DOC_H
+#define DOC_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#define DOC_LINK(page) DOVECOT_DOC_URL "latest/" page
+
+#endif
index e08be4922dee44e31a02c7bf9cf6557dae9e6981..7befe33ee2f9dc42f4262d21bf972db76b4a3adb 100644 (file)
@@ -6,6 +6,7 @@
 #include "ipwd.h"
 #include "restrict-access.h"
 #include "eacces-error.h"
+#include "doc.h"
 
 #include <sys/stat.h>
 #include <unistd.h>
@@ -312,7 +313,7 @@ const char *eperm_error_get_chgrp(const char *func, const char *path,
        if (gid_origin != NULL)
                str_printfa(errmsg, ", group based on %s", gid_origin);
        str_append(errmsg,
-                  " - see https://doc.dovecot.org/admin_manual/errors/chgrp_no_perm/)");
+                  " - see " DOC_LINK("core/admin/errors.html#change-group-operation-not-permitted") ")");
        errno = orig_errno;
        return str_c(errmsg);
 }