Всем Привет!
Не могу никак разобраться с настройками сервера
Есть сервер текущий рабочий, хочу перенести все на новый
- Письма хранятся в папках, по такому типу (почта на два доменных имени):
/var/www/administrator/data/email/site1/
/var/www/administrator/data/email/site2/
1. Перенес с помощью rsync, в такую же папку, создал такого же пользователя "administrator"
2. Также перенес файлы конфигов dovecot и postfix
файл main.cf
spoilersoft_bounce = no
queue_directory = /var/spool/postfix
daemon_directory = /usr/libexec/postfix
command_directory = /usr/sbin
data_directory = /var/lib/postfix
mail_owner = postfix
default_privs = nobody
inet_interfaces = all
inet_protocols = ipv4
myhostname = site1.ru
mydomain = localdomain
myorigin = site1.ru
mydestination = $myhostname,localhost.$myhostname,localhost
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
mynetworks = айпи.офиса.1.11/32
relay_domains =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#mail_spool_directory = /var/mail
smtpd_banner = $myhostname ESMTP
debug_peer_level = 2
debug_peer_list = 127.0.0.1
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/local/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
config_directory = /etc/postfix
mailbox_size_limit = 0
virtual_alias_domains = /etc/mail/local-host-names
virtual_alias_maps = hash:/etc/mail/virtusertable
smtp_generic_maps = hash:/etc/mail/generic
broken_sasl_auth_clients = no
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
tls_random_source = dev:/dev/urandom
#smtpd_tls_key_file = /etc/postfix/sslsmtpd.key
#smtpd_tls_cert_file = /etc/postfix/sslsmtpd.crt
smtpd_tls_CAfile = etc/postfix/postfix.pem
smtp_tls_CAfile = etc/postfix/postfix.pem
smtpd_tls_key_file = etc/postfix/postfix.pem
smtpd_tls_cert_file = etc/postfix/postfix.pem
smtpd_tls_received_header = yes
smtpd_tls_loglevel = 1
smtpd_sender_restrictions = permit_sasl_authenticated, check_sender_access hash:/etc/mail/access
smtpd_client_restrictions = permit_sasl_authenticated, check_client_access hash:/etc/mail/access
smtpd_recipient_restrictions = permit_sasl_authenticated, check_sender_access hash:/etc/mail/access, check_client_access hash:/etc/mail/access, check_recipient_access hash:/etc/mail/access, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, reject_unverified_recipient, reject_unknown_client, check_policy_service inet:127.0.0.1:60000
smtpd_reject_unlisted_sender = yes
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = inet:127.0.0.1:8891
message_size_limit = 71200000
файл dovecot.conf
spoiler## Dovecot configuration file
# If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration
# --sysconfdir=/etc --localstatedir=/var
# Protocols we want to be serving.
#protocols = imap pop3 lmtp
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::
#base_dir = /var/run/dovecot/
#login_greeting = Dovecot ready.
#login_trusted_networks =
#login_access_sockets =
#verbose_proctitle = no
#shutdown_clients = yes
#doveadm_worker_count = 0
#doveadm_socket_path = doveadm-server
# "proxy::<name>".
dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
#expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
!include conf.d/*.conf
#!include_try /etc/dovecot/local.conf
listen = *
# Существует несколько специальных переменных, которые вы можете использовать:
# %u - имя пользователя
# %n - пользовательская часть в user@domain, то же самое что и %u
# если не задана доменная часть
# %d - доменая часть в user@domain, пустая, если не указан домен
# %h - домашняя директория
# Смотрите doc/variables.txt для полного списка переменных.
# Некоторые примеры:
# mail_location = maildir:~/Maildir
# mail_location = mbox:~/mail:INBOX=/var/mail/%u
# mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
#
mail_location = maildir:/var/www/administrator/data/email/%d/%n
# Настройка пространства имен почтового ящика
# Указывает разделитель в пути, префикс для всех папок, и наличие отдельной папки Входящие
namespace private {
separator = /
prefix = [TESTMAIL]/
inbox = yes
}
В файле dovecot.passwd записи в таком виде:
spoilermanager@site1.ru:{CRAM-MD5}61f2a1axc3345a2f7788c9741b857834xxc1237597dfcae13a8e1443b843206a4:648:502::/var/www/administrator/data/email/site1/mananger:::maildir:/var/www/administrator/data/email/site1.ru/manager/.maildir
файл /etc/aliases
spoiler# Basic system aliases -- these MUST be present.
mailer-daemon: postmaster
postmaster: root
# General redirections for pseudo accounts.
bin: root
daemon: root
adm: root
lp: root
sync: root
shutdown: root
halt: root
mail: root
news: root
uucp: root
operator: root
games: root
gopher: root
ftp: root
nobody: root
radiusd: root
nut: root
dbus: root
vcsa: root
canna: root
wnn: root
rpm: root
nscd: root
pcap: root
apache: root
webalizer: root
dovecot: root
fax: root
quagga: root
radvd: root
pvm: root
amanda: root
privoxy: root
ident: root
named: root
xfs: root
gdm: root
mailnull: root
postgres: root
sshd: root
smmsp: root
postfix: root
netdump: root
ldap: root
squid: root
ntp: root
mysql: root
desktop: root
rpcuser: root
rpc: root
nfsnobody: root
ingres: root
system: root
toor: root
manager: root
dumper: root
abuse: root
newsadm: news
newsadmin: news
usenet: news
ftpadm: ftp
ftpadmin: ftp
ftp-adm: ftp
ftp-admin: ftp
www: webmaster
webmaster: root
noc: root
security: root
hostmaster: root
info: postmaster
marketing: postmaster
sales: postmaster
support: postmaster
# trap decode to catch security attacks
decode: root
virtuser_503: \virtuser_503
virtuser_504: \virtuser_504
virtuser_505: \virtuser_505,marketing3@site1.ru
virtuser_506: \virtuser_506
virtuser_507: \virtuser_507
virtuser_508: \virtuser_508
virtuser_509: \virtuser_509
virtuser_510: \virtuser_510
virtuser_511: \virtuser_511
И ТАК ДАЛЕЕ
# Person who should get root's mail
#root: marc
В папке /etc/mail/ файлы "access, access.db, domainips, generic, generic.db, local-host-names, virtusertable, virtusertable.db".
файл /etc/mail/virtusertable в таком виде.
spoilerusername@site1.ru virtuser_503
username2@site1.ru virtuser_504
username@site2.ru virtuser_502
username2@site2.ru virtuser_508
Тестирую логин IMAP
spoiler[amtyyes@domain ~]# telnet 127.0.0.1 143
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN AUTH=DIGEST-MD5 AUTH=CRAM-MD5] Dovecot ready.
1 LOGIN username@site1.ru *пароль*
1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in
1 SELECT INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $Forwarded $MDNSent Junk NonJunk)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $Forwarded $MDNSent Junk NonJunk \*)] Flags permitted.
* 3543 EXISTS
* 0 RECENT
* OK [UNSEEN 19] First unseen.
* OK [UIDVALIDITY 1411968184] UIDs valid
* OK [UIDNEXT 7968] Predicted next UID
* OK [HIGHESTMODSEQ 2685] Highest
1 OK [READ-WRITE] Select completed.
Тестирую SMTP без авторизации
spoiler[bloood@domain ~]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 site1.ru ESMTP
helo darling
250 site1.ru
MAIL FROM: root@localhost
451 4.7.1 Service unavailable - try again later
не могу понять, что я не так делаю.