Jak zainstalowa

Konfiguracja serwerów, usług, itp.
lukasz870
Posty: 19
Rejestracja: 28 lipca 2009, 13:04

Jak zainstalować serwer pocztowy na Debianie 5.0?

Post autor: lukasz870 »

Witam.
Pomógłby mi ktoś zainstalować serwer poczty na Debianie 5.0 z obsługą mysql. Zainstalowałem apache z mysql i ftp, natomiast nie wiem jak się zabrać za pocztę. Instalowałem to już parę razy ale za każdym razem mi nie wyszło. Nie wiem jakie paczki zainstalować i jak je skonfigurować. Mam tylko zwykłego postfixa, który mi obsługuje formularze na stronie. Pozdrawiam.
Ister
Junior Member
Posty: 566
Rejestracja: 05 marca 2009, 12:42

Re: Jak postawić serwer pocztowy na Debianie 5.0

Post autor: Ister »

lukasz870 pisze:mam tylko zwykłego postfixa który mi obsługuje formularze na stronie.
£adne mi tylko ]to[/URL]. Jak to nie pomoże to popytaj trochę sam wujka Google.
lukasz870
Posty: 19
Rejestracja: 28 lipca 2009, 13:04

Post autor: lukasz870 »

Witam mam taki problem teraz z pop3d przy logowaniu się do skrzynki pocztowej:

Kod: Zaznacz cały

Oct 28 10:00:45 debian pop3d: Connection, ip=[::ffff:91.195.158.60]
Oct 28 10:00:50 debian pop3d: chdir ochojski.com/kocica/: No such file or directory

Kod: Zaznacz cały

main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = ochojski.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = ochojski.com, localhost, localhost.localdomain
relayhost =.
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =.
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/spool/mail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yesclear
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_c
I w katalogu /home/vmail mam utworzony folder kocica taki jak e-mail.
Ister
Junior Member
Posty: 566
Rejestracja: 05 marca 2009, 12:42

Post autor: Ister »

Czy z tej linijki

Kod: Zaznacz cały

virtual_mailbox_base = /var/spool/mail 
nie wynika czasem, że katalog kocica powinien pojawić się właśnie w tej strukturze?
To raz. Dwa, wrzuć jeszcze ustawienia serwera pop3. No i napisz, którego serwera pop używasz.

[ Dodano: 2009-10-28, 10:30 ]
Dobra, poczytałem trochę. Podaj jeszcze zawartość

Kod: Zaznacz cały

/etc/postfix/mysql-virtual_mailboxes.cf
lukasz870
Posty: 19
Rejestracja: 28 lipca 2009, 13:04

Post autor: lukasz870 »

Kod: Zaznacz cały

authmysqlrc


MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD mail_admin_password
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/var/spool/mail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota
Dodałem katalog w /var/spool/mail, ale bez zmian.

Kod: Zaznacz cały

authdaemonrc

##VERSION: $Id: authdaemonrc.in,v 1.13 2005/10/05 00:07:32 mrsam Exp $
#
# Copyright 2000-2005 Double Precision, Inc.  See COPYING for
# distribution information.
#
# authdaemonrc created from authdaemonrc.dist by sysconftool
#
# Do not alter lines that begin with ##, they are used when upgrading
# this configuration.
#
# This file configures authdaemond, the resident authentication daemon.
#
# Comments in this file are ignored.  Although this file is intended to
# be sourced as a shell script, authdaemond parses it manually, so
# the acceptable syntax is a bit limited.  Multiline variable contents,
# with the \ continuation character, are not allowed.  Everything must
# fit on one line.  Do not use any additional whitespace for indentation,
# or anything else.

##NAME: authmodulelist:2
#
# The authentication modules that are linked into authdaemond.  The
# default list is installed.  You may selectively disable modules simply
# by removing them from the following list.  The available modules you
# can use are: authuserdb authpam authpgsql authldap authmysql authcustom authpipe

authmodulelist="authmysql"

##NAME: authmodulelistorig:3
#
# This setting is used by Courier's webadmin module, and should be left
# alone

authmodulelistorig="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"

##NAME: daemons:0
#
# The number of daemon processes that are started.  authdaemon is typically
# installed where authentication modules are relatively expensive: such
# as authldap, or authmysql, so it's better to have a number of them running.
# PLEASE NOTE:  Some platforms may experience a problem if there's more than
# one daemon.  Specifically, SystemV derived platforms that use TLI with
# socket emulation.  I'm suspicious of TLI's ability to handle multiple
# processes accepting connections on the same filesystem domain socket.
#
# You may need to increase daemons if as your system load increases.  Symptoms
# include sporadic authentication failures.  If you start getting
# authentication failures, increase daemons.  However, the default of 5
# SHOULD be sufficient.  Bumping up daemon count is only a short-term
# solution.  The permanent solution is to add more resources: RAM, faster
# disks, faster CPUs...

daemons=5

##NAME: authdaemonvar:2
#
# authdaemonvar is here, but is not used directly by authdaemond.  It's
# used by various configuration and build scripts, so don't touch it!

authdaemonvar=/var/run/courier/authdaemon
##NAME: DEBUG_LOGIN:0
#
# Dump additional diagnostics to syslog
#
# DEBUG_LOGIN=0   - turn off debugging
# DEBUG_LOGIN=1   - turn on debugging
# DEBUG_LOGIN=2   - turn on debugging + log passwords too
#
# ** YES ** - DEBUG_LOGIN=2 places passwords into syslog.
#
# Note that most information is sent to syslog at level 'debug', so
# you may need to modify your /etc/syslog.conf to be able to see it.

DEBUG_LOGIN=0

##NAME: DEFAULTOPTIONS:0
#
# A comma-separated list of option=value pairs. Each option is applied
# to an account if the account does not have its own specific value for
# that option. So for example, you can set
#   DEFAULTOPTIONS="disablewebmail=1,disableimap=1"
# and then enable webmail and/or imap on individual accounts by setting
# disablewebmail=0 and/or disableimap=0 on the account.

DEFAULTOPTIONS=""

##NAME: LOGGEROPTS:0
#
# courierlogger(1) options, e.g. to set syslog facility
#

LOGGEROPTS=""

##NAME: LDAP_TLS_OPTIONS:0
#
# Options documented in ldap.conf(5) can be set here, prefixed with 'LDAP'.
# Examples:
#
#LDAPTLS_CACERT=/path/to/cacert.pem
#LDAPTLS_REQCERT=demand
#LDAPTLS_CERT=/path/to/clientcert.pem
#LDAPTLS_KEY=/path/to/clientkey.pem

courier-authdaemon 
courier-imap 
courier-imap-ssl 
courier-pop 
courier-pop-ssl
[Dodano: 2009-10-28, 10:36]
/etc/postfix/mysql-virtual_mailboxes.cf:

Kod: Zaznacz cały

user = mail_admin
password = mail_admin_password
dbname = mail
table = users
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
where_field = email
hosts = 127.0.0.1
Ister
Junior Member
Posty: 566
Rejestracja: 05 marca 2009, 12:42

Post autor: Ister »

Wydaje mi się (podkreślam - wydaje), że przy takim ustawieniu nazwa użytkownika ustawiona w programie pocztowym powinna mieć postać

Kod: Zaznacz cały

uzytkownik@domena
a nie tylko

Kod: Zaznacz cały

uzytkownik
zrób może

Kod: Zaznacz cały

ls -l /var/spool/mail
i pokaż co wyszło.
lukasz870
Posty: 19
Rejestracja: 28 lipca 2009, 13:04

Post autor: lukasz870 »

Masz rację, musi być:

Kod: Zaznacz cały

uzytkownik@domena
bo inaczej jest:code]login failed[/code]ale miałem tak od początku zrobione. Po zrobieniu dowiązania w logach mail.log:

Kod: Zaznacz cały

Oct 28 11:03:54 debian pop3d: Connection, ip=[::ffff:91.195.158.60]
Oct 28 11:03:56 debian pop3d: chdir ochojski.com/kocica/: No such file or directory


[Dodano: 2009-10-28, 11:49]
Pomyliłem się ale nie zrobiłem dowiązania zrobiłem ,,ls -l'' pomyliło mi się z ,,ln''.

Ale bynajmniej ,,ln'' nie zrobiłem.

Wynik polecenia:

Kod: Zaznacz cały

lrwxrwxrwx 1 root root 7 sie 28 21:24 /var/spool/mail -> ../mail
Ister
Junior Member
Posty: 566
Rejestracja: 05 marca 2009, 12:42

Post autor: Ister »

Tfu, na psa urok ;-)

Chodziło mi oczywiście o

Kod: Zaznacz cały

ls -l /var/spool/mail/
przepraszam

(Wywaliłem kawałek bzdur, które napisałem ;-) )

No dobra masz tak

Kod: Zaznacz cały

CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') 
co powinno dać strukturę katalogu składającą się z dwóch części. Wykonaj w bazie danych

Kod: Zaznacz cały

SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') 
FROM odpowiedniatabela
Oczywiście zamiast odpowiedniatabela wstaw nazwę tabeli, w której przechowujesz e-maile.[/code]
lukasz870
Posty: 19
Rejestracja: 28 lipca 2009, 13:04

Post autor: lukasz870 »

Kod: Zaznacz cały

Oct 28 13:36:34 debian pop3d: Connection, ip=[::ffff:91.195.158.60]
Oct 28 13:36:34 debian pop3d: chdir ochojski.com/kocica/: No such file or directory
Dokonałem modyfikacji w tym pliku zrestartowałem postfixa i couriera a efekt dalej ten sam.
Ister
Junior Member
Posty: 566
Rejestracja: 05 marca 2009, 12:42

Post autor: Ister »

Zaraz, bo teraz ja nie rozumiem.
Jakie modyfikacje (oprócz tego wcześniej) podawałeś?

Czy wykonałeś zapytanie (w MySQLu), o którym pisałem? Bo tą konkatenację masz strasznie magiczną i boję się, że to ona miesza.
ODPOWIEDZ