michael@204: Index: configure michael@204: diff -Nau configure.orig configure michael@204: --- configure.orig 2009-05-18 03:39:51.000000000 +0200 michael@204: +++ configure 2009-05-27 14:29:11.972121045 +0200 michael@204: @@ -28482,14 +28482,14 @@ michael@204: michael@204: if test $want_pgsql != no; then michael@204: # based on code from PHP michael@204: - for i in /usr /usr/local /usr/local/pgsql; do michael@204: - for j in include include/pgsql include/postgres include/postgresql ""; do michael@204: + for i in @l_prefix@; do michael@204: + for j in include/postgresql; do michael@204: if test -r "$i/$j/libpq-fe.h"; then michael@204: PGSQL_INCLUDE=$i/$j michael@204: fi michael@204: done michael@204: - for lib in lib lib64; do michael@204: - for j in $lib $lib/pgsql $lib/postgres $lib/postgresql ""; do michael@204: + for lib in lib; do michael@204: + for j in $lib; do michael@204: if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then michael@204: PGSQL_LIBDIR=$i/$j michael@204: fi michael@148: Index: configure.in michael@204: diff -Nau configure.in.orig configure.in michael@204: --- configure.in.orig 2009-05-18 03:39:35.000000000 +0200 michael@204: +++ configure.in 2009-05-27 14:29:11.926298334 +0200 michael@148: @@ -1962,14 +1962,14 @@ michael@148: michael@148: if test $want_pgsql != no; then michael@148: # based on code from PHP michael@148: - for i in /usr /usr/local /usr/local/pgsql; do michael@148: - for j in include include/pgsql include/postgres include/postgresql ""; do michael@148: + for i in @l_prefix@; do michael@148: + for j in include/postgresql; do michael@148: if test -r "$i/$j/libpq-fe.h"; then michael@148: PGSQL_INCLUDE=$i/$j michael@148: fi michael@148: done michael@148: - for lib in lib lib64; do michael@148: - for j in $lib $lib/pgsql $lib/postgres $lib/postgresql ""; do michael@148: + for lib in lib; do michael@148: + for j in $lib; do michael@148: if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then michael@148: PGSQL_LIBDIR=$i/$j michael@148: fi michael@148: Index: doc/dovecot-sql-example.conf michael@204: diff -Nau doc/dovecot-sql-example.conf.orig doc/dovecot-sql-example.conf michael@204: --- doc/dovecot-sql-example.conf.orig 2009-01-05 21:49:58.000000000 +0100 michael@204: +++ doc/dovecot-sql-example.conf 2009-05-27 14:29:11.973657746 +0200 michael@148: @@ -47,7 +47,8 @@ michael@148: # the default my.cnf location michael@148: # option_group - Read options from the given group (default: client) michael@148: # michael@148: -# You can connect to UNIX sockets by using host: host=/var/run/mysql.sock michael@148: +# You can connect to UNIX sockets by using host: michael@148: +# host=@l_prefix@/var/mysql/mysql.sock michael@148: # Note that currently you can't use spaces in parameters. michael@148: # michael@148: # MySQL supports multiple host parameters for load balancing / HA. michael@148: @@ -58,7 +59,7 @@ michael@148: # Examples: michael@148: # connect = host=192.168.1.1 dbname=users michael@148: # connect = host=sql.example.com dbname=virtual user=virtual password=blarg michael@148: -# connect = /etc/dovecot/authdb.sqlite michael@148: +# connect = @l_prefix@/etc/dovecot/authdb.sqlite michael@148: # michael@148: #connect = michael@148: michael@148: Index: dovecot-example.conf michael@204: diff -Nau dovecot-example.conf.orig dovecot-example.conf michael@204: --- dovecot-example.conf.orig 2009-05-13 18:41:46.000000000 +0200 michael@204: +++ dovecot-example.conf 2009-05-27 14:29:11.981522023 +0200 michael@204: @@ -13,11 +13,10 @@ michael@204: # those. These are exceptions to this though: No sections (e.g. namespace {}) michael@204: # or plugin settings are added by default, they're listed only as examples. michael@204: # Paths are also just examples with the real defaults being based on configure michael@204: -# options. The paths listed here are for configure --prefix=/usr michael@204: -# --sysconfdir=/etc --localstatedir=/var --with-ssldir=/etc/ssl michael@204: +# options. michael@148: michael@148: # Base directory where to store runtime data. michael@148: -#base_dir = /var/run/dovecot/ michael@148: +#base_dir = @l_prefix@/var/dovecot/run michael@148: michael@204: # Protocols we want to be serving: imap imaps pop3 pop3s managesieve michael@148: # If you only want to use dovecot-auth, you can set this to "none". michael@204: @@ -43,7 +42,7 @@ michael@204: # listen = *:12000 michael@148: # .. michael@148: # } michael@148: -#listen = * michael@148: +#listen = 127.0.0.1 michael@148: michael@148: # Disable LOGIN command and all other plaintext authentications unless michael@148: # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP michael@204: @@ -65,7 +64,9 @@ michael@187: michael@187: # Log file to use for error messages, instead of sending them to syslog. michael@187: # /dev/stderr can be used to log into stderr. michael@187: -#log_path = michael@187: +log_path = @l_prefix@/var/dovecot/log/dovecot-error.log # Error messages. michael@187: +info_log_path = @l_prefix@/var/dovecot/log/dovecot-info.log # Info/debug messages. michael@187: +log_timestamp = '%b %d %H:%M:%S ' # Prefix for each line written to log file. michael@187: michael@187: # Log file to use for informational and debug messages. michael@187: # Default is the same as log_path. michael@204: @@ -87,7 +88,7 @@ michael@148: # IP or host address where to listen in for SSL connections. Remember to also michael@148: # add imaps and/or pop3s to protocols setting. Defaults to same as "listen" michael@148: # setting if not specified. michael@148: -#ssl_listen = michael@148: +#ssl_listen = 127.0.0.1 michael@148: michael@204: # Disable SSL/TLS support. michael@204: #ssl_disable = no michael@204: @@ -96,8 +97,8 @@ michael@148: # dropping root privileges, so keep the key file unreadable by anyone but michael@148: # root. Included doc/mkcert.sh can be used to easily generate self-signed michael@148: # certificate, just make sure to update the domains in dovecot-openssl.cnf michael@148: -#ssl_cert_file = /etc/ssl/certs/dovecot.pem michael@148: -#ssl_key_file = /etc/ssl/private/dovecot.pem michael@148: +#ssl_cert_file = @l_prefix@/etc/dovecot/ssl/dovecot.crt michael@148: +#ssl_key_file = @l_prefix@/etc/dovecot/ssl/dovecot.key michael@148: michael@148: # If key file is password protected, give the password here. Alternatively michael@148: # give it when starting dovecot with -p parameter. Since this file is often michael@204: @@ -140,7 +141,7 @@ michael@148: # which login needs to be able to connect to. The sockets are created when michael@148: # running as root, so you don't have to worry about permissions. Note that michael@148: # everything in this directory is deleted when Dovecot is started. michael@148: -#login_dir = /var/run/dovecot/login michael@148: +#login_dir = @l_prefix@/var/dovecot/run/login michael@148: michael@148: # chroot login process to the login_dir. Only reason not to do this is if you michael@148: # wish to run the whole Dovecot without roots. michael@204: @@ -150,7 +151,7 @@ michael@148: # and don't use it anywhere else. The user must also belong to a group where michael@148: # only it has access, it's used to control access for authentication process. michael@148: # Note that this user is NOT used to access mails. michael@148: -#login_user = dovecot michael@187: +#login_user = @l_nusr@ michael@148: michael@148: # Set max. process size in megabytes. If you don't use michael@148: # login_process_per_connection you might need to grow this. michael@204: @@ -271,8 +272,8 @@ michael@187: # System user and group used to access mails. If you use multiple, userdb michael@187: # can override these by returning uid or gid fields. You can use either numbers michael@204: # or names. michael@187: -#mail_uid = michael@187: -#mail_gid = michael@187: +#mail_uid = @l_rusr@ michael@187: +#mail_gid = @l_rusr@ michael@187: michael@187: # Group to enable temporarily for privileged operations. Currently this is michael@187: # used only with INBOX when either its initial creation or dotlocking fails. michael@204: @@ -507,20 +508,24 @@ michael@187: ## michael@148: michael@148: protocol imap { michael@187: + # Override main log file paths michael@187: + log_path = @l_prefix@/var/dovecot/log/imap-error.log michael@187: + info_log_path = @l_prefix@/var/dovecot/log/imap-info.log michael@187: + michael@148: # Login executable location. michael@148: - #login_executable = /usr/libexec/dovecot/imap-login michael@148: + #login_executable = @l_prefix@/libexec/dovecot/imap-login michael@148: michael@148: # IMAP executable location. Changing this allows you to execute other michael@148: # binaries before the imap process is executed. michael@204: # michael@204: # This would write rawlogs into ~/dovecot.rawlog/ directory: michael@204: - # mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap michael@204: + # mail_executable = @l_prefix@/libexec/dovecot/rawlog @l_prefix@/libexec/dovecot/imap michael@204: # michael@204: # This would attach gdb into the imap process and write backtraces into michael@148: # /tmp/gdbhelper.* files: michael@204: - # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap michael@204: + # mail_executable = @l_prefix@/libexec/dovecot/gdbhelper @l_prefix@/libexec/dovecot/imap michael@148: # michael@148: - #mail_executable = /usr/libexec/dovecot/imap michael@148: + #mail_executable = @l_prefix@/libexec/dovecot/imap michael@148: michael@148: # Maximum IMAP command line length in bytes. Some clients generate very long michael@148: # command lines with huge mailboxes, so you may need to raise this if you get michael@204: @@ -534,7 +539,7 @@ michael@148: # Support for dynamically loadable plugins. mail_plugins is a space separated michael@148: # list of plugins to load. michael@148: #mail_plugins = michael@148: - #mail_plugin_dir = /usr/lib/dovecot/imap michael@148: + #mail_plugin_dir = @l_prefix@/lib/dovecot/imap michael@148: michael@148: # Send IMAP capabilities in greeting message. This makes it unnecessary for michael@148: # clients to request it with CAPABILITY command, so it saves one round-trip. michael@204: @@ -576,12 +581,16 @@ michael@187: ## michael@148: michael@148: protocol pop3 { michael@187: + # Override main log file paths michael@187: + log_path = @l_prefix@/var/dovecot/log/pop3-error.log michael@187: + info_log_path = @l_prefix@/var/dovecot/log/pop3-info.log michael@187: + michael@148: # Login executable location. michael@148: - #login_executable = /usr/libexec/dovecot/pop3-login michael@148: + #login_executable = @l_prefix@/libexec/dovecot/pop3-login michael@148: michael@148: # POP3 executable location. See IMAP's mail_executable above for examples michael@148: # how this could be changed. michael@148: - #mail_executable = /usr/libexec/dovecot/pop3 michael@148: + #mail_executable = @l_prefix@/libexec/dovecot/pop3 michael@148: michael@148: # Don't try to set mails non-recent or seen with POP3 sessions. This is michael@148: # mostly intended to reduce disk I/O. With maildir it doesn't move files michael@204: @@ -641,7 +650,7 @@ michael@148: # Support for dynamically loadable plugins. mail_plugins is a space separated michael@148: # list of plugins to load. michael@148: #mail_plugins = michael@148: - #mail_plugin_dir = /usr/lib/dovecot/pop3 michael@148: + #mail_plugin_dir = @l_prefix@/lib/dovecot/pop3 michael@148: michael@148: # Workarounds for various client bugs: michael@148: # outlook-no-nuls: michael@204: @@ -701,6 +710,10 @@ michael@187: ## michael@187: michael@187: protocol lda { michael@187: + # Override main log file paths michael@187: + log_path = @l_prefix@/var/dovecot/log/deliver-error.log michael@187: + info_log_path = @l_prefix@/var/dovecot/log/deliver-info.log michael@187: + michael@187: # Address to use when sending rejection mails. michael@187: postmaster_address = postmaster@example.com michael@187: michael@204: @@ -711,7 +724,7 @@ michael@148: # Support for dynamically loadable plugins. mail_plugins is a space separated michael@148: # list of plugins to load. michael@148: #mail_plugins = michael@148: - #mail_plugin_dir = /usr/lib/dovecot/lda michael@148: + #mail_plugin_dir = @l_prefix@/lib/dovecot/lda michael@148: michael@148: # If user is over quota, return with temporary failure instead of michael@148: # bouncing the mail. michael@204: @@ -725,7 +738,7 @@ michael@148: #deliver_log_format = msgid=%m: %$ michael@148: michael@148: # Binary to use for sending mails. michael@148: - #sendmail_path = /usr/lib/sendmail michael@148: + #sendmail_path = @l_prefix@/sbin/sendmail michael@148: michael@148: # Subject: header to use for rejection mails. You can use the same variables michael@148: # as for rejection_reason below. michael@204: @@ -736,7 +749,7 @@ michael@148: #rejection_reason = Your message to <%t> was automatically rejected:%n%r michael@148: michael@148: # UNIX socket path to master authentication server to find users. michael@148: - #auth_socket_path = /var/run/dovecot/auth-master michael@148: + #auth_socket_path = @l_prefix@/var/dovecot/run/auth-master michael@148: } michael@148: michael@148: ## michael@204: @@ -744,7 +757,7 @@ michael@148: ## michael@148: michael@148: # Executable location michael@148: -#auth_executable = /usr/libexec/dovecot/dovecot-auth michael@148: +#auth_executable = @l_prefix@/libexec/dovecot/dovecot-auth michael@148: michael@148: # Set max. process size in megabytes. michael@148: #auth_process_size = 256 michael@204: @@ -834,7 +847,7 @@ michael@148: #auth_ntlm_use_winbind = no michael@148: michael@148: # Path for Samba's ntlm_auth helper binary. michael@148: -#auth_winbind_helper_path = /usr/bin/ntlm_auth michael@148: +#auth_winbind_helper_path = @l_prefix@/bin/ntlm_auth michael@148: michael@148: # Number of seconds to delay before replying to failed authentications. michael@148: #auth_failure_delay = 2 michael@204: @@ -867,7 +880,7 @@ michael@148: michael@148: #passdb passwd-file { michael@148: # File contains a list of usernames, one per line michael@148: - #args = /etc/dovecot.deny michael@148: + #args = @l_prefix@/etc/dovecot/dovecot.deny michael@148: #deny = yes michael@148: #} michael@148: michael@204: @@ -950,13 +963,13 @@ michael@148: # SQL database michael@148: #passdb sql { michael@148: # Path for SQL configuration file, see doc/dovecot-sql-example.conf michael@148: - #args = michael@148: + #args = @l_prefix@/etc/dovecot/dovecot-sql.conf michael@148: #} michael@148: michael@148: # LDAP database michael@148: #passdb ldap { michael@148: # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf michael@148: - #args = michael@148: + #args = @l_prefix@/etc/dovecot/dovecot-ldap.conf michael@148: #} michael@148: michael@148: # vpopmail authentication michael@204: @@ -1021,13 +1034,13 @@ michael@148: # SQL database michael@148: #userdb sql { michael@148: # Path for SQL configuration file, see doc/dovecot-sql-example.conf michael@148: - #args = michael@148: + #args = @l_prefix@/etc/dovecot/dovecot-sql.conf michael@148: #} michael@148: michael@148: # LDAP database michael@148: #userdb ldap { michael@148: # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf michael@148: - #args = michael@148: + #args = @l_prefix@/etc/dovecot/dovecot-ldap.conf michael@148: #} michael@148: michael@148: # vpopmail michael@204: @@ -1040,7 +1053,7 @@ michael@187: # authentication with BSDs internally accesses shadow files, which also michael@187: # requires roots. Note that this user is NOT used to access mails. michael@187: # That user is specified by userdb above. michael@187: - user = root michael@187: + user = @l_nusr@ michael@187: michael@187: # Directory where to chroot the process. Most authentication backends don't michael@187: # work if this is set, and there's no point chrooting if auth_user is root. michael@204: @@ -1064,7 +1077,7 @@ michael@148: # Master socket provides access to userdb information. It's typically michael@148: # used to give Dovecot's local delivery agent access to userdb so it michael@148: # can find mailbox locations. michael@148: - #path = /var/run/dovecot/auth-master michael@168: + #path = @l_prefix@/var/dovecot/run/auth-master michael@148: #mode = 0600 michael@148: # Default user/group is the one who started dovecot-auth (root) michael@148: #user = michael@204: @@ -1074,7 +1087,7 @@ michael@148: # The client socket is generally safe to export to everyone. Typical use michael@148: # is to export it to your SMTP server so it can do SMTP AUTH lookups michael@148: # using it. michael@148: - #path = /var/run/dovecot/auth-client michael@168: + #path = @l_prefix@/var/dovecot/run/auth-client michael@148: #mode = 0660 michael@148: #} michael@148: #} michael@204: @@ -1088,7 +1101,7 @@ michael@148: #auth external { michael@148: # socket connect { michael@148: # master { michael@148: -# path = /var/run/dovecot/auth-master michael@148: +# path = @l_prefix@/dovecot/run/auth-master michael@148: # } michael@148: # } michael@148: #} michael@204: @@ -1104,8 +1117,8 @@ michael@148: # referenced using URIs in format "proxy::". michael@148: michael@148: dict { michael@148: - #quota = mysql:/etc/dovecot-dict-quota.conf michael@148: - #expire = db:/var/lib/dovecot/expire.db michael@148: + #quota = mysql:@l_prefix@/etc/dovecot/dovecot-dict-quota.conf michael@148: + #expire = db:@l_prefix@/var/dovecot/lib/expire.db michael@148: } michael@148: michael@148: # Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf michael@204: @@ -1156,7 +1169,7 @@ michael@148: # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter michael@148: # specifies how many seconds to wait between stat()ing dovecot-acl file michael@148: # to see if it changed. michael@148: - #acl = vfile:/etc/dovecot-acls:cache_secs=300 michael@148: + #acl = vfile:@l_prefix@/etc/dovecot/dovecot-acls:cache_secs=300 michael@148: michael@148: # Convert plugin. If set, specifies the source storage path which is michael@148: # converted to destination storage (mail_location) when the user logs in. michael@204: @@ -1175,14 +1188,14 @@ michael@148: # until the message can be saved within quota limits. The configuration file michael@148: # is a text file where each line is in format: michael@148: # Mails are first deleted in lowest -> highest priority number order michael@148: - #trash = /etc/dovecot-trash.conf michael@148: + #trash = @l_prefix@/etc/dovecot/dovecot-trash.conf michael@148: michael@148: # Expire plugin. Mails are expunged from mailboxes after being there the michael@148: # configurable time. The first expiration date for each mailbox is stored in michael@148: # a dictionary so it can be quickly determined which mailboxes contain michael@148: # expired mails. The actual expunging is done in a nightly cronjob, which michael@148: # you must set up: michael@148: - # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool michael@148: + # dovecot --exec-mail ext @l_prefix@/libexec/dovecot/expire-tool michael@148: #expire = Trash 7 Spam 30 michael@148: #expire_dict = proxy::expire michael@148: michael@148: Index: src/deliver/deliver.c michael@204: diff -Nau src/deliver/deliver.c.orig src/deliver/deliver.c michael@204: --- src/deliver/deliver.c.orig 2009-02-27 00:31:13.000000000 +0100 michael@204: +++ src/deliver/deliver.c 2009-05-27 14:29:11.983461484 +0200 michael@148: @@ -41,7 +41,7 @@ michael@148: #include michael@148: michael@148: #define DEFAULT_CONFIG_FILE SYSCONFDIR"/dovecot.conf" michael@148: -#define DEFAULT_SENDMAIL_PATH "/usr/lib/sendmail" michael@148: +#define DEFAULT_SENDMAIL_PATH "@l_prefix@/sbin/sendmail" michael@148: #define DEFAULT_ENVELOPE_SENDER "MAILER-DAEMON" michael@148: michael@148: /* After buffer grows larger than this, create a temporary file to /tmp michael@148: Index: src/master/master-settings.c michael@204: diff -Nau src/master/master-settings.c.orig src/master/master-settings.c michael@204: --- src/master/master-settings.c.orig 2009-05-13 19:32:34.000000000 +0200 michael@204: +++ src/master/master-settings.c 2009-05-27 14:29:11.985776641 +0200 michael@148: @@ -178,14 +178,14 @@ michael@148: MEMBER(syslog_facility) "mail", michael@148: michael@148: /* general */ michael@148: - MEMBER(protocols) "imap imaps", michael@148: - MEMBER(listen) "*", michael@148: - MEMBER(ssl_listen) "", michael@148: + MEMBER(protocols) "imap", michael@148: + MEMBER(listen) "127.0.0.1", michael@148: + MEMBER(ssl_listen) "127.0.0.1", michael@148: michael@148: - MEMBER(ssl_disable) FALSE, michael@148: + MEMBER(ssl_disable) TRUE, michael@148: MEMBER(ssl_ca_file) "", michael@148: - MEMBER(ssl_cert_file) SSLDIR"/certs/dovecot.pem", michael@148: - MEMBER(ssl_key_file) SSLDIR"/private/dovecot.pem", michael@148: + MEMBER(ssl_cert_file) "@l_prefix@/etc/dovecot/ssl/dovecot.crt", michael@148: + MEMBER(ssl_key_file) "@l_prefix@/etc/dovecot/ssl/dovecot.key", michael@148: MEMBER(ssl_key_password) "", michael@148: MEMBER(ssl_parameters_regenerate) 168, michael@148: MEMBER(ssl_cipher_list) "", michael@148: @@ -200,7 +200,7 @@ michael@148: /* login */ michael@148: MEMBER(login_dir) "login", michael@148: MEMBER(login_executable) NULL, michael@148: - MEMBER(login_user) "dovecot", michael@148: + MEMBER(login_user) "@l_musr@", michael@148: MEMBER(login_greeting) "Dovecot ready.", michael@148: MEMBER(login_log_format_elements) "user=<%u> method=%m rip=%r lip=%l %c", michael@148: MEMBER(login_log_format) "%$: %s", michael@204: @@ -325,7 +325,7 @@ michael@148: MEMBER(anonymous_username) "anonymous", michael@148: MEMBER(krb5_keytab) "", michael@148: MEMBER(gssapi_hostname) "", michael@148: - MEMBER(winbind_helper_path) "/usr/bin/ntlm_auth", michael@148: + MEMBER(winbind_helper_path) "@l_prefix@/bin/ntlm_auth", michael@148: MEMBER(failure_delay) 2, michael@148: michael@148: MEMBER(verbose) FALSE,