Форум русскоязычного сообщества Ubuntu


Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

Автор Тема: настройка почтового сервера со связью с внешним миром  (Прочитано 7471 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн KyMappP

  • Автор темы
  • Новичок
  • *
  • Сообщений: 45
    • Просмотр профиля
Здравствуйте, прошу сильно не пинать, тк с линуксом еще не работал....
В данный момент пользуюсь хостингом и на нем создал несколько почтовых ящиков...т.к. объем писем достаточно большой, чтобы не засорять хостинг (размер достаточно маленький) принял решения попробовать поставить почтовый сервер....

в данный момент поставил Ubuntu 13 server, прочитал N-е кол-во гайдов по настройке, но как я понял, они для корпоративной почты (внутри сети), мне же нужно чтобы была связь с внешним миром (принимать/отправлять письма на абсолютно любые почтовые ящики яндекс, маил и т.д.)

Прошу ткните носом в более-менее разжалованный гайд (чтобы мог разобраться не очень опытный с работой линукса пользователь) по настройке почтового сервера с требованиями выше...

надеюсь на понимание....
« Последнее редактирование: 16 Июля 2013, 15:46:36 от KyMappP »


Оффлайн KyMappP

  • Автор темы
  • Новичок
  • *
  • Сообщений: 45
    • Просмотр профиля
почти сразу столкнулся с проблемой(

[b]root@dihlofoz-TWC:~#[/b] sudo apt-get install postfix postfix-mysql postfix-ldap postfix-doc postfix-tls libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql dovecot-imapd dovecot-pop3d dovecot-common mysql-client mysql-server apache2 libapache2-mod-php5 php5 php5-mysql
Чтение списков пакетов… Готово
Построение дерева зависимостей       
Чтение информации о состоянии… Готово
E: Не удалось найти пакет postfix-tls

Оффлайн ArcFi

  • Старожил
  • *
  • Сообщений: 15189
    • Просмотр профиля
    • aetera.net
В конце статьи ссылка на соответствующее обсуждение на форуме.
Её автор наверняка вам поможет.

Оффлайн rower

  • Новичок
  • *
  • Сообщений: 1
  • i help you :)
    • Просмотр профиля
    • Osshelp.ru
Здравствуйте, прошу сильно не пинать, тк с линуксом еще не работал....
В данный момент пользуюсь хостингом и на нем создал несколько почтовых ящиков...т.к. объем писем достаточно большой, чтобы не засорять хостинг (размер достаточно маленький) принял решения попробовать поставить почтовый сервер....

в данный момент поставил Ubuntu 13 server, прочитал N-е кол-во гайдов по настройке, но как я понял, они для корпоративной почты (внутри сети), мне же нужно чтобы была связь с внешним миром (принимать/отправлять письма на абсолютно любые почтовые ящики яндекс, маил и т.д.)

Прошу ткните носом в более-менее разжалованный гайд (чтобы мог разобраться не очень опытный с работой линукса пользователь) по настройке почтового сервера с требованиями выше...

надеюсь на понимание....



Для начала рекомендую установить Ubuntu 10.04, в ней по крайне мере стабильно работают такие связки как dovecot+postfix+sasl.
Osshelp - посредник между вами и сервером

Оффлайн KyMappP

  • Автор темы
  • Новичок
  • *
  • Сообщений: 45
    • Просмотр профиля
Прошу не пинать, а объяснить дураку, почитал эту и еще ряд подобных статей...
но не где не написано как почтовый сервер будет забирать почту у хостинг провайдера (к которому прикреплен домен) ведь  в настройках ни где не нужно указывать пароль от хостинга....

Оффлайн ArcFi

  • Старожил
  • *
  • Сообщений: 15189
    • Просмотр профиля
    • aetera.net
KyMappP, для сбора почты с других ящиков можно использовать fetchmail.

Оффлайн DihlofoZ

  • Новичок
  • *
  • Сообщений: 5
    • Просмотр профиля
Получается в моей ситуации нужно: fetchmail +  postfix + procmail ?
или по другому?

Оффлайн ArcFi

  • Старожил
  • *
  • Сообщений: 15189
    • Просмотр профиля
    • aetera.net
Получается в моей ситуации нужно: fetchmail +  postfix + procmail ?
или по другому?
Как связана ваша "ситуация" и задачи ТС?

Оффлайн DihlofoZ

  • Новичок
  • *
  • Сообщений: 5
    • Просмотр профиля
не совсем понял "задачи ТС" ?

попробую более конкретно обрисовать ситуацию....

пользуюсь платным хостингом на нем висит сайт + на нем же создано несколько почтовых ящиков: info@название_сайта.ру, andrey@название_сайта.ру, dima@название_сайта.ру и т.д....
оборот писем на этих почтовых ящиках достаточно большой, а размер арендуемого хостинга всего 5гб да и для безопасности это не очень хорошо..., по этому было принято решение завести почтовый сервер под эти нужды.

вот я и думаю как можно реализовать на линуксе почтовый сервер который бы забирал почту с info@название_сайта.ру, andrey@название_сайта.ру, dima@название_сайта.ру и т.д (в скором будущем кол-во ящиков будет увеличиваться)....и уже непосредственно он раздавал почту на локальные машины

Оффлайн KyMappP

  • Автор темы
  • Новичок
  • *
  • Сообщений: 45
    • Просмотр профиля
в итоге настроил на домене "А" и "МХ" записи, прописал все как полагается, установил почту на iRedMail, все прошло без ошибок.... но блин отправляю письмо на внешний адрес, а мне в ответ:

<kymappp5562@gmail.com>: host gmail-smtp-in.l.google.com[173.194.71.26] said:
    550-5.7.1 [178.47.179.23] The IP you're using to send mail is not
    authorized to 550-5.7.1 send email directly to our servers. Please use the
    SMTP relay at your 550-5.7.1 service provider instead. Learn more at 550
    5.7.1 http://support.google.com/mail/bin/answer.py?answer=10336
    e6si16458656lbv.107 - gsmtp (in reply to end of DATA command)
Reporting-MTA: dns; mail.ffyy.ru
X-Postfix-Queue-ID: 28CC522128
X-Postfix-Sender: rfc822; postmaster@ffyy.ru
Arrival-Date: Wed, 24 Jul 2013 20:25:32 +0600 (YEKT)

Final-Recipient: rfc822; kymappp5562@gmail.com
Original-Recipient: rfc822;kymappp5562@gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [тут мой внешний айпишник] The IP you're using to send
    mail is not authorized to 550-5.7.1 send email directly to our servers.
    Please use the SMTP relay at your 550-5.7.1 service provider instead. Learn
    more at 550 5.7.1 http://support.google.com/mail/bin/answer.py?answer=10336
    e6si16458656lbv.107 - gsmtp

Пользователь решил продолжить мысль 24 Июля 2013, 18:36:27:
где мог ошибиться?

Оффлайн ArcFi

  • Старожил
  • *
  • Сообщений: 15189
    • Просмотр профиля
    • aetera.net
KyMappP, как вариант, сделать нормальную PTR-запись и убрать relayhost в конфиге postfix.

Оффлайн KyMappP

  • Автор темы
  • Новичок
  • *
  • Сообщений: 45
    • Просмотр профиля


https://help.ubuntu.ru/wiki/%D0%BF%D0%BE%D1%87%D1%82%D0%BE%D0%B2%D1%8B%D0%B9_%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80_%D1%81%D0%BE_%D0%B2%D1%81%D0%B5%D0%BC_%D1%84%D0%B0%D1%80%D1%88%D0%B5%D0%BC_%D0%BD%D0%B0_10.04_lts

все таки начал настраивать с помощью данной статьи...

на моменте:
Цитировать
AUTH PLAIN YWRtaW4AYWRtaW4Ac2VjcmV0

выдает:
535 5.7.8 Error: authentication failed: authentication failure
Если посмотреть логи:

auth.log:
Jul 26 09:35:59 prox saslauthd[1401]: pam_ldap: ldap_simple_bind Can't contact LDAP server
Jul 26 09:35:59 prox saslauthd[1401]: pam_ldap: reconnecting to LDAP server...
Jul 26 09:35:59 prox saslauthd[1401]: pam_ldap: ldap_simple_bind Can't contact LDAP server
Jul 26 09:35:59 prox saslauthd[1401]: DEBUG: auth_pam: pam_authenticate failed: Permission denied
Jul 26 09:35:59 prox saslauthd[1401]: do_auth         : auth failure: [user=admin] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]

syslog:
Jul 26 09:34:41 prox postfix/smtpd[1943]: connect from localhost[127.0.0.1]
Jul 26 09:35:59 prox postfix/smtpd[1943]: warning: SASL authentication failure: Password verification failed
Jul 26 09:35:59 prox postfix/smtpd[1943]: warning: localhost[127.0.0.1]: SASL PLAIN authentication failed: authentication failure
Jul 26 09:36:07 prox postfix/smtpd[1943]: disconnect from localhost[127.0.0.1]

и собственно сам ldap.conf:
###DEBCONF###
##
## Configuration of this file will be managed by debconf as long as the
## first line of the file says '###DEBCONF###'
##
## You should use dpkg-reconfigure to configure this file via debconf
##

#
# @(#)$Id: ldap.conf,v 1.38 2006/05/15 08:13:31 lukeh Exp $
#
# This is the configuration file for the LDAP nameservice
# switch library and the LDAP PAM module.
#
# PADL Software
# http://www.padl.com
#

# Your LDAP server. Must be resolvable without using LDAP.
# Multiple hosts may be specified, each separated by a
# space. How long nss_ldap takes to failover depends on
# whether your LDAP client library supports configurable
# network or connect timeouts (see bind_timelimit).
#host 127.0.0.1
host 192.168.2.4

# The distinguished name of the search base.
base dc=polusdm,dc=ru

# Another way to specify your LDAP server is to provide an
uri ldap://192.168.2.4/
# Unix Domain Sockets to connect to a local LDAP Server.
#uri ldap://127.0.0.1/
#uri ldaps://127.0.0.1/   
#uri ldapi://%2fvar%2frun%2fldapi_sock/
# Note: %2f encodes the '/' used as directory separator

# The LDAP version to use (defaults to 3
# if supported by client library)
ldap_version 3

# The distinguished name to bind to the server with.
# Optional: default is to bind anonymously.
#binddn cn=proxyuser,dc=padl,dc=com

# The credentials to bind with.
# Optional: default is no credential.
#bindpw secret

# The distinguished name to bind to the server with
# if the effective user ID is root. Password is
# stored in /etc/ldap.secret (mode 600)
rootbinddn cn=admin,dc=polusdm,dc=ru

# The port.
# Optional: default is 389.
#port 389

# The search scope.
#scope sub
#scope one
#scope base

# Search timelimit
#timelimit 30

# Bind/connect timelimit
#bind_timelimit 30

# Reconnect policy: hard (default) will retry connecting to
# the software with exponential backoff, soft will fail
# immediately.
#bind_policy hard
bind_policy soft

# Idle timelimit; client will close connections
# (nss_ldap only) if the server has not been contacted
# for the number of seconds specified below.
#idle_timelimit 3600

# Filter to AND with uid=%s
#pam_filter objectclass=account

# The user ID attribute (defaults to uid)
#pam_login_attribute uid

# Search the root DSE for the password policy (works
# with Netscape Directory Server)
#pam_lookup_policy yes

# Check the 'host' attribute for access control
# Default is no; if set to yes, and user has no
# value for the host attribute, and pam_ldap is
# configured for account management (authorization)
# then the user will not be allowed to login.
#pam_check_host_attr yes

# Check the 'authorizedService' attribute for access
# control
# Default is no; if set to yes, and the user has no
# value for the authorizedService attribute, and
# pam_ldap is configured for account management
# (authorization) then the user will not be allowed
# to login.
#pam_check_service_attr yes

# Group to enforce membership of
#pam_groupdn cn=PAM,ou=Groups,dc=padl,dc=com

# Group member attribute
#pam_member_attribute uniquemember

# Specify a minium or maximum UID number allowed
#pam_min_uid 0
#pam_max_uid 0

# Template login attribute, default template user
# (can be overriden by value of former attribute
# in user's entry)
#pam_login_attribute userPrincipalName
#pam_template_login_attribute uid
#pam_template_login nobody

# HEADS UP: the pam_crypt, pam_nds_passwd,
# and pam_ad_passwd options are no
# longer supported.
#
# Do not hash the password at all; presume
# the directory server will do it, if
# necessary. This is the default.
pam_password md5

# Hash password locally; required for University of
# Michigan LDAP server, and works with Netscape
# Directory Server if you're using the UNIX-Crypt
# hash mechanism and not using the NT Synchronization
# service.
#pam_password crypt

# Remove old password first, then update in
# cleartext. Necessary for use with Novell
# Directory Services (NDS)
#pam_password clear_remove_old
#pam_password nds

# RACF is an alias for the above. For use with
# IBM RACF
#pam_password racf

# Update Active Directory password, by
# creating Unicode password and updating
# unicodePwd attribute.
#pam_password ad

# Use the OpenLDAP password change
# extended operation to update the password.
#pam_password exop

# Redirect users to a URL or somesuch on password
# changes.
#pam_password_prohibit_message Please visit http://internal to change your password.

# RFC2307bis naming contexts
# Syntax:
# nss_base_XXX base?scope?filter
# where scope is {base,one,sub}
# and filter is a filter to be &'d with the
# default filter.
# You can omit the suffix eg:
# nss_base_passwd ou=People,
# to append the default base DN but this
# may incur a small performance impact.
#nss_base_passwd ou=People,dc=padl,dc=com?one
#nss_base_shadow ou=People,dc=padl,dc=com?one
#nss_base_group ou=Group,dc=padl,dc=com?one
#nss_base_hosts ou=Hosts,dc=padl,dc=com?one
#nss_base_services ou=Services,dc=padl,dc=com?one
#nss_base_networks ou=Networks,dc=padl,dc=com?one
#nss_base_protocols ou=Protocols,dc=padl,dc=com?one
#nss_base_rpc ou=Rpc,dc=padl,dc=com?one
#nss_base_ethers ou=Ethers,dc=padl,dc=com?one
#nss_base_netmasks ou=Networks,dc=padl,dc=com?ne
#nss_base_bootparams ou=Ethers,dc=padl,dc=com?one
#nss_base_aliases ou=Aliases,dc=padl,dc=com?one
#nss_base_netgroup ou=Netgroup,dc=padl,dc=com?one

# attribute/objectclass mapping
# Syntax:
#nss_map_attribute rfc2307attribute mapped_attribute
#nss_map_objectclass rfc2307objectclass mapped_objectclass

# configure --enable-nds is no longer supported.
# NDS mappings
#nss_map_attribute uniqueMember member

# Services for UNIX 3.5 mappings
#nss_map_objectclass posixAccount User
#nss_map_objectclass shadowAccount User
#nss_map_attribute uid msSFU30Name
#nss_map_attribute uniqueMember msSFU30PosixMember
#nss_map_attribute userPassword msSFU30Password
#nss_map_attribute homeDirectory msSFU30HomeDirectory
#nss_map_attribute homeDirectory msSFUHomeDirectory
#nss_map_objectclass posixGroup Group
#pam_login_attribute msSFU30Name
#pam_filter objectclass=User
#pam_password ad

# configure --enable-mssfu-schema is no longer supported.
# Services for UNIX 2.0 mappings
#nss_map_objectclass posixAccount User
#nss_map_objectclass shadowAccount user
#nss_map_attribute uid msSFUName
#nss_map_attribute uniqueMember posixMember
#nss_map_attribute userPassword msSFUPassword
#nss_map_attribute homeDirectory msSFUHomeDirectory
#nss_map_attribute shadowLastChange pwdLastSet
#nss_map_objectclass posixGroup Group
#nss_map_attribute cn msSFUName
#pam_login_attribute msSFUName
#pam_filter objectclass=User
#pam_password ad

# RFC 2307 (AD) mappings
#nss_map_objectclass posixAccount user
#nss_map_objectclass shadowAccount user
#nss_map_attribute uid sAMAccountName
#nss_map_attribute homeDirectory unixHomeDirectory
#nss_map_attribute shadowLastChange pwdLastSet
#nss_map_objectclass posixGroup group
#nss_map_attribute uniqueMember member
#pam_login_attribute sAMAccountName
#pam_filter objectclass=User
#pam_password ad

# configure --enable-authpassword is no longer supported
# AuthPassword mappings
#nss_map_attribute userPassword authPassword

# AIX SecureWay mappings
#nss_map_objectclass posixAccount aixAccount
#nss_base_passwd ou=aixaccount,?one
#nss_map_attribute uid userName
#nss_map_attribute gidNumber gid
#nss_map_attribute uidNumber uid
#nss_map_attribute userPassword passwordChar
#nss_map_objectclass posixGroup aixAccessGroup
#nss_base_group ou=aixgroup,?one
#nss_map_attribute cn groupName
#nss_map_attribute uniqueMember member
#pam_login_attribute userName
#pam_filter objectclass=aixAccount
#pam_password clear

# Netscape SDK LDAPS
#ssl on

# Netscape SDK SSL options
#sslpath /etc/ssl/certs

# OpenLDAP SSL mechanism
# start_tls mechanism uses the normal LDAP port, LDAPS typically 636
#ssl start_tls
#ssl on

# OpenLDAP SSL options
# Require and verify server certificate (yes/no)
# Default is to use libldap's default behavior, which can be configured in
# /etc/openldap/ldap.conf using the TLS_REQCERT setting.  The default for
# OpenLDAP 2.0 and earlier is "no", for 2.1 and later is "yes".
#tls_checkpeer yes

# CA certificates for server certificate verification
# At least one of these are required if tls_checkpeer is "yes"
#tls_cacertfile /etc/ssl/ca.cert
#tls_cacertdir /etc/ssl/certs

# Seed the PRNG if /dev/urandom is not provided
#tls_randfile /var/run/egd-pool

# SSL cipher suite
# See man ciphers for syntax
#tls_ciphers TLSv1

# Client certificate and key
# Use these, if your server requires client authentication.
#tls_cert
#tls_key

# Disable SASL security layers. This is needed for AD.
#sasl_secprops maxssf=0

# Override the default Kerberos ticket cache location.
#krb5_ccname FILE:/etc/.ldapcache

# SASL mechanism for PAM authentication - use is experimental
# at present and does not support password policy control
#pam_sasl_mech DIGEST-MD5
nss_initgroups_ignoreusers backup,bin,daemon,dnsmasq,dovecot,dovenull,games,gnats,irc,landscape,libuuid,list,lp,mail,man,messagebus,mysql,news,postfix,proxy,root,sshd,sync,sys,syslog,uucp,whoopsie,www-data

Оффлайн KyMappP

  • Автор темы
  • Новичок
  • *
  • Сообщений: 45
    • Просмотр профиля
Нужно срочно ставить сервер, по этому все таки поставил iredmail....
в итоге внутренняя почта летает, внешняя почта уходит (отправил письмо на гугл почту дошло отлично), но блин внешняя почта не доходит.....

с гугл почты отправил письмо на почту сервера, и гугл мне ответил:
Delivery to the following recipient failed permanently:

     tests@ffyy.ru

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain ffyy.ru by mail.ffyy.ru. [95.129.176.42].

The error that the other server returned was:
550 <tests@ffyy.ru>, Recipient unknown

----- Original message -----

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=STcdA0Ifw0v9Nnuf0WUV5F3t5O350MpHt5QF5Qp31kA=;
        b=M3Gu8QrY4b4tt5XsOM44jrM+/VDks7dY5T6dX1Q2Gr/HZagyFzc3x8jeDl/OoZ9icQ
         9Mevk1GpLwY0XoJN8EpMydAo2tVuuovuaxdZ/2N95NOPM7ycI4U/W6AVbHb8+0xGgjRL
         A1Q4CxzpHcXAgW+FXua2zp8SkJtVUdi2kHzuGqjIOqhVsnP1+8A4dAyzxtru4IOT6b0V
         b79rNTuudlqre96Zv3HukHmGNgQGQSIxNfBuG+WrvgbKsl0HSL6IZJXirC7dE2u59/mJ
         vv88YPOE9tR/az3klZ/Uv3r9TOSoe5iiWIMWRnzgt2N47mpt1+/B9mwd38KrTI03tOLx
         o4ZQ==
MIME-Version: 1.0
X-Received: by 10.50.97.102 with SMTP id dz6mr183655igb.5.1374903936390; Fri,
 26 Jul 2013 22:45:36 -0700 (PDT)
Received: by 10.64.143.40 with HTTP; Fri, 26 Jul 2013 22:45:36 -0700 (PDT)
In-Reply-To: <22a4374311a25a08a8e812e6aba959f3@ffyy.ru>
References: <22a4374311a25a08a8e812e6aba959f3@ffyy.ru>
Date: Sat, 27 Jul 2013 11:45:36 +0600
Message-ID: <CADEOHsJkGHeYRGTYqGXDu99CWRod_SdRYMFPshWi+eRfMCFihw@mail.gmail.com>
Subject: Re: asdf
From: =?KOI8-R?B?4c7E0sXKIOvB0s7B1cjP1w==?= <kymappp5562@gmail.com>
To: tests@ffyy.ru
Content-Type: multipart/alternative; boundary=047d7b10ca11ba9bac04e277c475

vbxcvbxcvbcx


2013/7/27 <tests@ffyy.ru>

> fdgsdfgsdfg
>



блин помогите разобраться((
« Последнее редактирование: 27 Июля 2013, 13:06:21 от KyMappP »

Оффлайн ArcFi

  • Старожил
  • *
  • Сообщений: 15189
    • Просмотр профиля
    • aetera.net
KyMappP,
postconf relayhost?

 

Страница сгенерирована за 0.075 секунд. Запросов: 25.