Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2008-04-23 17:22:33

  djinn - Członek DUG

djinn
Członek DUG
Zarejestrowany: 2005-11-12

postfix + dovecot (maildir)

Witam.

Mam problem z konfigurowanie postfixa i dovecot`a.
Sprawa wygląda tak, chcę zakładać tylko konta wirtualne (nie systemowe). Autoryzacja działa.
Wysyłać emaile mogę bezproblemowo, gorzej jest z odbieraniem.

Wydaje mi się, że nie mogę zmusić postfixa do używania maildir.

Config postfixa:

Kod:

smtpd_banner = $myhostname ESMTP $mail_name (Debek)
biff = no
append_dot_mydomain = no
myhostname = mail.wefer.pl
mydomain = wefer.pl
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost =
home_mailbox = Maildir/
mail_spool_directory = /home/ebox
mynetworks = 127.0.0.0/8 192.168.1.0/24
#mailbox_command = /usr/bin/procmail -a "DOMAIN"
mailbox_command = /usr/bin/procmail -a "$EXTENSION" #DEFAULT=/var/spool/vmail/Maildir/ MAILDIR=/var/spool/vmail/Maildir
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
message_size_limit = 15000000

# Restrykcje antyspamowe
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination

# Tablice odwzorowań Postfiksa
#sender_canonical_maps = hash:/etc/postfix/sender_canonical_maps
virtual_mailbox_domains = wefer.pl
virtual_mailbox_base = /home/ebox/
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps
virtual_alias_maps = hash:/etc/postfix/virtual_alias_maps
virtual_minimum_uid = 100
virtual_uid_maps = static:10000
virtual_gid_maps = static:10000

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

# Szyfrowanie TLS
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

# Uwierzytelnianie SASL
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes

# Dovecot SASL configuration for the Postfix SMTP server
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

Config dovecot:

Kod:

default_mail_env = maildir:~
protocols = imap imaps pop3 pop3s
mail_privileged_group = mail

listen = *
log_timestamp = "%Y-%m-%d %H:%M:%S "
log_path=/var/log/dovecot.log
auth_debug = yes

disable_plaintext_auth = no
protocol imap {
  login_executable = /usr/lib/dovecot/imap-login
}
protocol pop3 {
  login_executable = /usr/lib/dovecot/pop3-login
  pop3_uidl_format = %08Xu%08Xv
}
auth default {
      mechanisms = plain login digest-md5
        passdb passwd-file {
        args = /etc/dovecot/vmail/passdb
        }
        userdb passwd-file {
        args = /etc/dovecot/vmail/userdb
        }
user = root
      socket listen {
        client {
          path = /var/spool/postfix/private/auth
          mode = 0660
          user = postfix
          group = postfix
        }
      }
}

ssl_disable = no
ssl_cert_file = /etc/postfix/ssl/smtpd.crt
ssl_key_file = /etc/postfix/ssl/smtpd.key
ssl_parameters_regenerate = 168
verbose_ssl = no

Wygląda to tak:
Gdy wyśle email na moją skrzynke to postfix stworzy plik z nazwą mojego usera i email zostanie tam zapisany.
Wtedy mail.log wyświetla:

Kod:

Apr 23 17:22:38 japong postfix/smtpd[20165]: connect from xion.pl[88.198.33.4]
Apr 23 17:22:39 japong postfix/smtpd[20165]: F410122A8B: client=xion.pl[88.198.33.4]
Apr 23 17:22:39 japong postfix/cleanup[20169]: F410122A8B: message-id=<86637299e99796578e24c955cc5004c3@mail.xion.pl>
Apr 23 17:22:39 japong postfix/smtpd[20165]: disconnect from xion.pl[88.198.33.4]
Apr 23 17:22:39 japong postfix/qmgr[20159]: F410122A8B: from=<bocian@xion.pl>, size=1090, nrcpt=1 (queue active)
Apr 23 17:22:39 japong postfix/virtual[20161]: F410122A8B: to=<bocian@wefer.pl>, relay=virtual, delay=0.12, delays=0.12/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Apr 23 17:22:39 japong postfix/qmgr[20159]: F410122A8B: removed

Natomiast gdy chcę odczytać tego emaila przez np. Thunderbird to dovecot wyrzuca takie logi:

Kod:

dovecot: 2008-04-23 17:24:56 Info: auth(default): client in: AUTH       1       PLAIN   service=POP3    secured lip=87.105.212.79       rip=192.168.1.2 resp=<hidden>
dovecot: 2008-04-23 17:24:56 Info: auth(default): client out: CONT      1
dovecot: 2008-04-23 17:24:56 Info: auth(default): client in: CONT<hidden>
dovecot: 2008-04-23 17:24:56 Info: auth(default): client out: OK        1       user=bocian
dovecot: 2008-04-23 17:24:56 Info: auth(default): master in: REQUEST    1       20079   1
dovecot: 2008-04-23 17:24:56 Info: auth(default): master out: USER      1       bocian  uid=10000       gid=10000       home=/home/ebox/wefer.pl/bocian/
dovecot: 2008-04-23 17:24:56 Info: pop3-login: Login: user=<bocian>, method=PLAIN, rip=192.168.1.2, lip=87.105.212.79, TLS
dovecot: 2008-04-23 17:24:56 Error: stat(/home/ebox/wefer.pl/bocian/) failed: Not a directory
dovecot: 2008-04-23 17:24:56 Error: POP3(bocian): lstat(/home/ebox/wefer.pl/bocian/cur) failed: Not a directory
dovecot: 2008-04-23 17:24:56 Error: POP3(bocian): lstat(/home/ebox/wefer.pl/bocian/cur) failed: Not a directory
dovecot: 2008-04-23 17:24:56 Error: POP3(bocian): Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2008-04-23 17:24:56]
dovecot: 2008-04-23 17:24:56 Info: POP3(bocian): No INBOX for user top=0/0, retr=0/0, del=0/0, size=0

(skasowałem plik od usera)
Natomiast robiąc odwrotnie (najpierw odczytuje swoje emaile), dovecot tworzy katalog dla usera, a gdy wyśle email na moją skrzynke to postfix zwróci takie logi:

Kod:

Apr 23 17:28:31 japong postfix/smtpd[20179]: connect from xion.pl[88.198.33.4]
Apr 23 17:28:31 japong postfix/smtpd[20179]: 7990022AE3: client=xion.pl[88.198.33.4]
Apr 23 17:28:31 japong postfix/cleanup[20182]: 7990022AE3: message-id=<e3670b55a19b53be3a086f2a29ab07a8@mail.xion.pl>
Apr 23 17:28:31 japong postfix/smtpd[20179]: disconnect from xion.pl[88.198.33.4]
Apr 23 17:28:31 japong postfix/qmgr[20159]: 7990022AE3: from=<bocian@xion.pl>, size=1096, nrcpt=1 (queue active)
Apr 23 17:28:31 japong postfix/virtual[20183]: 7990022AE3: to=<bocian@wefer.pl>, relay=virtual, delay=0.14, delays=0.1/0.02/0/0.02, dsn=4.2.0, status=deferred (delivery failed to mailbox /home/ebox//wefer.pl/bocian: cannot open file: Is a directory)

Czy ktoś wie jak rozwiązać ten problem ?

Ostatnio edytowany przez djinn (2008-04-23 17:23:25)


Peace

Offline

 

#2  2008-04-23 17:40:44

  HunteR - DUG

HunteR
DUG
Skąd: ?
Zarejestrowany: 2006-03-14

Re: postfix + dovecot (maildir)

Spróbuj zamienić wpis

Kod:

default_mail_env = maildir:~

na

Kod:

mail_location = maildir:/home/ebox/%d/%n

...

Offline

 

#3  2008-04-23 18:12:27

  djinn - Członek DUG

djinn
Członek DUG
Zarejestrowany: 2005-11-12

Re: postfix + dovecot (maildir)

Emaile dochodza, są zapisywane w jednym pliku. Natomiast gdy chcem odczytac emaile dovecot wyrzuca mi bledy takie jak poprzednio.

Ostatnio edytowany przez djinn (2008-05-06 01:08:33)


Peace

Offline

 

#4  2008-04-23 18:43:30

  HunteR - DUG

HunteR
DUG
Skąd: ?
Zarejestrowany: 2006-03-14

Re: postfix + dovecot (maildir)

Dlaczego sa takie duze:

Kod:

virtual_uid_maps = static:10000
virtual_gid_maps = static:10000

Wiesz o tym ze to jest UID i GID na jakim pracuje postfix prawda ?


...

Offline

 

#5  2008-04-25 02:17:27

  djinn - Członek DUG

djinn
Członek DUG
Zarejestrowany: 2005-11-12

Re: postfix + dovecot (maildir)

hm, w sumie to nie wiedzialem.
U mnie jest to uid z jakim sa tworzeni virtualni userzy. Do grupy dodalem postfixa i dovecota.


Peace

Offline

 

#6  2008-07-31 11:42:25

  djinn - Członek DUG

djinn
Członek DUG
Zarejestrowany: 2005-11-12

Re: postfix + dovecot (maildir)

Witam ponownie.
Problem jest teraz nastepujacy:
Jak zrobic zeby dovecot odczytywal emaile z podanego mu katalogu.
w confie mam wpisane:

Kod:

mail_location = maildir:/home/ebox/%d/%n

Niestety dovecot przeszukuje katalog /home/ebox/nazwa_usera
Pomija %d. Problem jest rozwiazany jezeli wpisze np. mail_location = maildir:/home/ebox/nazwa_domeny/%u, ale nie zadowala mnie to, gdyz uzywam kilku domen.

EDIT:
rozwiazane, nazwa konta nie mogla byc dupa, musialem tworzyc dupa@domena.pl, wtedy %d dziala :)

Ostatnio edytowany przez djinn (2008-07-31 14:55:10)


Peace

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
Możesz wyłączyć AdBlock — tu nie ma reklam ;-)