OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.8 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../dovecot-antispam/antispam-plugin.h.patch
  5. # Copyright (C) 2009 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. X-Git-Url: http://git.sipsolutions.net/gitweb.cgi?p=dovecot-antispam.git;a=blobdiff_plain;f=antispam-plugin.h;h=493fd1eb0f6b4643e059e660b25aee81dd1336ba;hp=df59e88e10ce68bc4f6a2ea012487d566f6f3e14;hb=af0f8f8de27901e2efb9560a1fc66c7af3cd810b;hpb=8f7c08bc8a39c22b3cca1e306cf454d64b405b8c
  17. diff --git a/antispam-plugin.h b/antispam-plugin.h
  18. index df59e88..493fd1e 100644
  19. --- a/antispam-plugin.h
  20. +++ b/antispam-plugin.h
  21. @@ -113,11 +113,24 @@ o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED)
  22. return o_stream_create_fd(fd, 0, TRUE);
  23. }
  24. +#if DOVECOT_VERSION_CODE(1, 2) == DOVECOT_VERSION
  25. +static inline struct dict *
  26. +string_dict_init(const char *uri, const char *username)
  27. +{
  28. + const char *base_dir;
  29. +
  30. + base_dir = getenv("BASE_DIR");
  31. + if (base_dir == NULL)
  32. + base_dir = "/var/run/dovecot";
  33. + return dict_init(uri, DICT_DATA_TYPE_STRING, username, base_dir);
  34. +}
  35. +#else /* 1.1 */
  36. static inline struct dict *
  37. string_dict_init(const char *uri, const char *username)
  38. {
  39. return dict_init(uri, DICT_DATA_TYPE_STRING, username);
  40. }
  41. +#endif
  42. #elif DOVECOT_VERSION_CODE(1, 0) == DOVECOT_VERSION
  43. #define ME(err)
  44. #define PLUGIN_ID