Exim-tls debian + mysql

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
bodo
Posts: 99
Joined: 2002-12-29 11:55
Location: Nürnberg

Exim-tls debian + mysql

Post by bodo » 2003-12-31 10:42

Exim â?? mysql Problem

Im exim-tls packet ist ja kein mysql aktiviert, drum wollte ich mir das selber bauen,

Hab dann ein:

Code: Select all

 apt-get source exim-tls
gemacht und habe das â??debian/editme-diffâ?? wie folgt angepasst:

Code: Select all

--- src/EDITME  Wed Dec 19 11:50:26 2001
+++ Local/Makefile      Sat Jan 19 13:37:44 2002
@@ -74,8 +74,8 @@
 # for processing log files. If you haven't got Perl, Exim will still build and
 # run; you just won't be able to run those utilities.

-# CHOWN_COMMAND=/usr/bin/chown
-# CHGRP_COMMAND=/usr/bin/chgrp
+CHOWN_COMMAND=/bin/chown
+CHGRP_COMMAND=/bin/chgrp
 # MV_COMMAND=/bin/mv
 # RM_COMMAND=/bin/rm
 # PERL_COMMAND=/usr/bin/perl
@@ -92,8 +92,8 @@
 # appropriate code is included in the binary. You then need to set up the
 # runtime configuration to make use of the mechanism(s) selected.

-# AUTH_CRAM_MD5=yes
-# AUTH_PLAINTEXT=yes
+AUTH_CRAM_MD5=yes
+AUTH_PLAINTEXT=yes


 # The binary directory: This variable defines where the exim binary will be
@@ -103,7 +103,7 @@
 # installed in this directory. There is no default for this variable built into
 # the source files; it must be set in one of the local configuration files.

-BIN_DIRECTORY=/usr/exim/bin
+BIN_DIRECTORY=/usr/sbin


 # The default distribution of Exim contains only the plain text form of the
@@ -121,14 +121,14 @@
 # files. Both the name of the command and the suffix that it adds to files
 # need to be defined here. See also the EXICYCLOG_MAX configuration.

-COMPRESS_COMMAND=/opt/gnu/bin/gzip
+COMPRESS_COMMAND=/bin/gzip
 COMPRESS_SUFFIX=gz


 # If the exigrep utility is fed compressed log files, it tries to uncompress
 # them using this command.

-ZCAT_COMMAND=/opt/gnu/bin/zcat
+ZCAT_COMMAND=/bin/zcat


 # The runtime configuration file: This variable defines where Exim's runtime
@@ -137,7 +137,7 @@
 # location of all other runtime files and directories can be changed in the
 # runtime configuration file.

-CONFIGURE_FILE=/usr/exim/configure
+CONFIGURE_FILE=/etc/exim/exim.conf


 # In some installations there may be multiple machines sharing file systems,
@@ -231,8 +231,8 @@
 # "security" setting, which controls how privilege is released (setuid vs
 # seteuid).

-# EXIM_UID=
-# EXIM_GID=
+EXIM_UID=8
+EXIM_GID=8


 # Compiling the Exim monitor: If you want to compile the Exim monitor,
@@ -286,7 +286,7 @@
 # "panic", or "reject" to form the final file name. For example, some
 # installations may want something like this:

-# LOG_FILE_PATH=/var/log/exim_%slog
+LOG_FILE_PATH=/var/log/exim/%slog

 # which results in files with names /var/log/exim_mainlog, etc. The directory
 # in which the log files are placed must exist; Exim does not try to create
@@ -335,12 +335,11 @@

 LOOKUP_DBM=yes
 LOOKUP_LSEARCH=yes
-
-# LOOKUP_CDB=yes
-# LOOKUP_DNSDB=yes
-# LOOKUP_LDAP=yes
+LOOKUP_CDB=yes
+LOOKUP_DNSDB=yes
+LOOKUP_LDAP=yes
-# LOOKUP_MYSQL=yes
+LOOKUP_MYSQL=yes
-# LOOKUP_NIS=yes
+LOOKUP_NIS=yes
 # LOOKUP_NISPLUS=yes
 # LOOKUP_PGSQL=yes

@@ -351,7 +350,7 @@
 # specified in INCLUDE.

-# LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/local/mysql/include -I /usr/local/pgsql/include
+LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/include/mysql
-# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber -lmysqlclient -lpq
+LOOKUP_LIBS=-lldap -llber -lmysqlclient

 # If you have set LDAP=yes, you should set LDAP_LIB_TYPE to indicate which LDAP
 # library you have. Unfortunately, though most of their functions are the
@@ -411,7 +410,7 @@
 # the file name, allowing sites that run two separate daemons to distinguish
 # them. Some installations may want something like this

-# PID_FILE_PATH=/var/lock/exim%s.pid
+PID_FILE_PATH=/var/run/exim/exim%s.pid

 # If PID_FILE_PATH is not defined, Exim writes a file in its spool directory
 # (see SPOOL_DIRECTORY below) with the name "exim-daemon.pid" for the standard
@@ -441,7 +440,7 @@

 # This one is very special-purpose, so is not included by default.

-# ROUTER_IPLOOKUP=yes
+ROUTER_IPLOOKUP=yes


 # The spool directory: This directory is where all the data for messages in
@@ -460,7 +459,7 @@
 # uid and gid.

 # Many installations will want something like this:
-# SPOOL_DIRECTORY=/var/spool/exim
+SPOOL_DIRECTORY=/var/spool/exim

 # Others may prefer to keep all Exim things under one directory:
 # SPOOL_DIRECTORY=/usr/exim/spool
@@ -492,8 +491,8 @@
 # of formats. The code for three specialist formats, maildir, mailstore, and
 # MBX, is included only when requested by the following settings:
-# SUPPORT_MAILDIR=yes
-# SUPPORT_MAILSTORE=yes
+SUPPORT_MAILDIR=yes
+SUPPORT_MAILSTORE=yes
 # SUPPORT_MBX=yes


@@ -512,7 +511,7 @@
 # support, which is intended for use in conjunction with the SMTP AUTH
 # facilities, is included only when requested by the following setting:

-# SUPPORT_PAM=yes
+SUPPORT_PAM=yes

 # You probably need to add -lpam to EXTRALIBS, and in some releases of
 # GNU/Linux -ldl is also needed.
@@ -567,7 +566,7 @@
 # This one is special-purpose, and commonly not required, so do not include
 # it by default.

-# TRANSPORT_LMTP=yes
+TRANSPORT_LMTP=yes


 # TCP wrappers: If you want to use tcpwrappers from within Exim, uncomment
und dann gebaut mit:

Code: Select all

dpkg-buildpackage -uc -b
dann hab ichâ??s installiert:

Code: Select all

dpkg -i exim-tls_3.35-3woody1_i386.deb
Aber wenn ichs starten will meldet es immer noch einen Fehler:

Code: Select all

 /etc/init.d/exim start
Starting MTA: 2003-12-31 11:31:37 Exim configuration error
  main option "mysql_servers" unknown in line 11
Meine exim.conf sieht wie folgt aus:

Code: Select all

 ##########################################
########### Exim-Configuration ###########
########### /etc/exim.conf     ###########
##########################################


####################### Globals:

primary_hostname = server.domain.tld

hide mysql_servers = 127.0.0.1/exim/exim/pw

domainlist local_domains = mysql; SELECT domain FROM domains WHERE 
domain='$domain'
domainlist relay_to_domains =
hostlist   relay_from_hosts = 127.0.0.1

acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data

qualify_domain = domain.tld

never_users = root

host_lookup = *

rfc1413_hosts = *
rfc1413_query_timeout = 30s

ignore_bounce_errors_after = 2d

timeout_frozen_after = 7d

# spamd_address gilt so für die Standard-Konfiguration von Spamassassin
#spamd_address = 127.0.0.1 783
#av_scanner = clamd:/tmp/clamd

####################### ACL:

begin acl

acl_check_rcpt:
  accept  hosts = :

  deny    domains       = +local_domains
          local_parts   = ^[.] : ^.*[@%!/|]

  deny    domains       = !+local_domains
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\.\./

  accept  local_parts   = postmaster
          domains       = +local_domains

  require verify        = sender

  accept  domains       = +local_domains
          endpass
          verify        = recipient

  accept  domains       = +relay_to_domains
          endpass
          verify        = recipient

  accept  hosts         = +relay_from_hosts

  accept  authenticated = *

  deny    message       = relay not permitted

acl_check_data:
  deny    message       = This message contains malformed MIME
          demime        = *
          condition     = ${if >{$demime_errorlevel}{2}{1}{0}}

  deny    message       = This message contains unaccepted attachments
          demime        = bat:com:exe:pif:prf:scr:vbs

#  warn    message       = X-Spam-Score: $spam_score
#          spam          = exim:true
#  warn    message       = X-Spam-Report: $spam_report
#          spam          = exim:true

#  deny    message       = This message scored $spam_score spam points
#          spam          = exim:true
#          condition     = ${if >{$spam_score_int}{120}{1}{0}}

#  deny    message       = Message contains a virus or harmful content
#          demime        = *
#          malware       = *

  accept

####################### Routers:

begin routers

dnslookup:
  driver = dnslookup
  domains = ! +local_domains
  transport = remote_smtp
  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
  no_more

aliases:
  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup mysql {SELECT redirect FROM aliases WHERE 
alias='${quote_mysql:$local_part}@${quote_mysql:$domain}'}{$value}fail}

localuser:
  driver = accept
  condition = ${lookup mysql{SELECT ID FROM users WHERE 
email='${quote_mysql:$local_part}@${quote_mysql:$domain}'} 
{$value}fail}
  transport = imap_delivery
  cannot_route_message = Unknown user

####################### Transports:

begin transports

remote_smtp:
  driver = smtp

imap_delivery:
  driver = appendfile
  create_directory
  directory_mode = 700
  headers_remove = "Bcc"
  delivery_date_add
  envelope_to_add
  return_path_add
  user = exim
  group = exim
  mode = 660
  directory = ${lookup mysql{SELECT directory FROM users WHERE 
email='${quote_mysql:$local_part}@${quote_mysql:$domain}'}
{$value}{}}
  maildir_format
  mode_fail_narrower = false

####################### Retry:

begin retry

# Domain               Error       Retries
# ------               -----       -------

*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h

####################### Rewrite:

begin rewrite

####################### Authenticators:

begin authenticators

plain:
        driver = plaintext
        public_name = PLAIN
        server_prompts = :
        server_condition = 
${if crypteq {$3}{${lookup mysql {SELECT password FROM users 
WHERE email='$2'}}}{yes}{no}}
        server_set_id = $2

login:
        driver = plaintext
        public_name = LOGIN
        server_prompts = Username:: : Password::
        server_condition = ${if crypteq {$2}{${lookup mysql 
{SELECT password FROM users WHERE email='$1'}}}{yes}{no}}
        server_set_id = $1


# End of Exim configuration file
Das ist in etwa die config aus:
http://www.rootforum.org/forum/viewtop ... light=exim
aber ich habe den Spam-/Virenscan nicht installiert.

Mit freundlichen Grüßen,
Bodo

dodolin
RSAC
Posts: 4009
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe

Re: Exim-tls debian + mysql

Post by dodolin » 2003-12-31 15:01

Du verwendest ACLs in deiner exim.conf.
ACLs gibt es erst seit Exim 4. Du hast Exim 3.35 (BTW, solltest mal auf 3.36 updaten, ist glaub ich aktuell).

Warum nutzt du eigentlich nicht die Backports von Exim 4? -daemon-heavy hat bestimmt sowohl TLS als auch Mysql-Support - alles out-of-the-box...

captaincrunch
Userprojekt
Userprojekt
Posts: 7225
Joined: 2002-10-09 14:30
Location: Dorsten

Re: Exim-tls debian + mysql

Post by captaincrunch » 2003-12-31 15:17

Du hast Exim 3.35
... also die aktuelle Version aus stable. ;)
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc

bodo
Posts: 99
Joined: 2002-12-29 11:55
Location: Nürnberg

Re: Exim-tls debian + mysql

Post by bodo » 2003-12-31 16:54

naja das prob is halt das ich mir durch mischen von stable und testing/unstable meine schöne Packetverwaltung relativ sehr zerschieße ...

Naja ... hm da kann man sonst nix machen, oder? Außer dann Postfix zu nehmen ...

Oder kann man das patchen, wobei das dann auch net besser für die Packetverwaltung ist. :roll: :?: :?: :?: Hilfe kann mir jemand einen Tipp geben? Eigentlich hatte ich mich wegen der Doku jetzt für Exim entschieden gehabt...

captaincrunch
Userprojekt
Userprojekt
Posts: 7225
Joined: 2002-10-09 14:30
Location: Dorsten

Re: Exim-tls debian + mysql

Post by captaincrunch » 2003-12-31 17:06

Daher das kleine Wörtchen Backports ... ;)

http://www.debianhowto.de/howtos/en/exim4/index.html
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc

dodolin
RSAC
Posts: 4009
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe

Re: Exim-tls debian + mysql

Post by dodolin » 2003-12-31 17:24

... also die aktuelle Version aus stable.
Stimmt. Ich dachte, mit der aktuellen Release von woody (RC2?) wäre das auf 3.36 gegangen, stimmte aber nicht. Anyway... die anderen Dinge gelten weiterhin: Die Config-Dateien von Exim4 und Exim3 sind nicht miteinander kompatibel, also sollte man sich schon entscheiden, was man jetzt haben will...