Войти

Показать полную графическую версию : помогите с sendmail


Страниц : [1] 2

zic_t
04-03-2005, 22:35
У меня на компьютере ns.server.ua(192.168.0.5) установлен sendmail, qpopper и bind



telnet ns.server.ua 25

trying 192.168.0.5…

telnet: connect to address 192.168.0.5 connection refused

telnet: unable to connect to remote host



telnet localhost 25 работает



telnet localhost или ns.server.ua 110 работает



запись в файле зоны:

server.ua. IN MX 10 ns.server.ua.



nslookup

set type=mx

>server.ua

Server: localhost.server.ua address: 127.0.0.1

Server.ua preference=10 mail exchanger=ns.server.ua

Server.ua nameserver=ns.server.ua.

Ns.server.ua internet address=192.168.0.5



Система FreeBSD 5.2



Почему не работает telnet ns.server.ua 25 ?

И если можно подробнее , я только учусь настраивать sendmail



Заранее большое спасибо

Belansky
04-03-2005, 23:52
zic_t
Сразу после установки sendmail слушает 25 порт на локальном интерфейсе. Нужно еще настраивать sendmail таким образом, что бы он прослушивал 25 порт на сетевом интерфейсе.

zic_t
05-03-2005, 01:12
Belansky спасибо
не подскажешь как сделать это

archy
09-03-2005, 21:40
zic_t
в sendmail.mc нужно иметь строку

DAEMON_OPTIONS(`Name=IPv4, Family=inet, Port=smtp, Name=MTA')

после чего make в каталоге с этим файлом и make restart

zic_t
09-03-2005, 22:43
archy
большое спасибо

zic_t
11-03-2005, 03:02
Не помогло
После изменения freebsd.mc make и make install появились 4 файла
Ns.server.ua.cf
Ns.server.ua.mc
Ns.server.ua.submit.cf
Ns.server.ua.submit.mc

Netstat -a
Localhost.smtp listen

Что я делаю не так

В inetd.conf
# smtp stream nowait qmail /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-smptd

Если я добавляю в inetd.conf
smtp stream nowait root /usr/libexec/sendmail/sendmail sendmail
netstat –a
*.smtp listen
telnet ns.server.ua 25
trying 192.168.0.5…
connected to ns.server.ua.
escape character is ‘]’
recipient names must be specified
что значит имена получателей должны быть определены

mar
11-03-2005, 09:33
telnet ns.server.ua 25
trying 192.168.0.5…
connected to ns.server.ua.
escape character is ‘]’
recipient names must be specified
что значит имена получателей должны быть определены
все правильно, а что Вы хотели увидеть?

почитайте про протокол smtp: сначала надо сказать HELO (или EHLO - в зависимости от сервера), потом, если мне не изменяет память MAIL FROM, потом RCPT TO (те самые кому), а потом уже все остальное

archy
11-03-2005, 11:37
zic_t
выключаем qmail и

cp Ns.server.ua.cf sendmail.cf
cp Ns.server.ua.submit.cf submit.cf
make restart

zic_t
11-03-2005, 21:10
telnet ns.server.ua 25
trying 192.168.0.5…
connected to ns.server.ua.
escape character is ‘]’
recipient names must be specified
что значит имена получателей должны быть определены


mar
протокол smtp я знаю
проблема в том что sendmail подвисает когда появляется recipient names must be specified
можно писать команды но sendmail ни как не реагирует
помогает только перезагрузка


archy
сделал
тоже самое recipient names must be specified

что еще можно попробывать

zic_t
11-03-2005, 22:43
recipient names must be specified

netstat -a
ns.smtp established
но соединение с sendmail устанолено



telnet localhost 25
работает

mar
11-03-2005, 23:35
zic_t
а не можешь запостить сюда весь "диалог" из терминала ? ведь не сразу же после escape character is ‘]’ идет recipient names must be specified ??

zic_t
12-03-2005, 17:52
mar
сразу

После telnet ns.server.ua 25
trying 192.168.0.5…
connected to ns.server.ua.
escape character is ‘]’
recipient names must be specified
helo
quit
ehlo
и так далее

со второго терминала потому что 1 висит
Netstat -a

Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 ns.smtp ns.49152 ESTABLISHED
tcp4 0 0 ns.49152 ns.smtp ESTABLISHED
tcp4 0 0 *.smtp *.* LISTEN
tcp4 0 0 *.pop3 *.* LISTEN

inetd.conf
smtp stream tcp nowait root /usr/libexec/sendmail/sendmail sendmail

freebsd.mc который я компилирую make
после появления 2 файлов
сp ns.server.ua.cf sendmail.cf
cp ns.server.ua.submit.cf
make install

и перезагружаю sendmail

freebsd.mc
divert(-1)
#
# Copyright (c) 1983 Eric P. Allman
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the University of
# California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

#
# This is a generic configuration file for FreeBSD 5.X and later systems.
# If you want to customize it, copy it to a name appropriate for your
# environment and do the modifications there.
#
# The best documentation for this .mc file is:
# /usr/share/sendmail/cf/README or
# /usr/src/contrib/sendmail/cf/README
#

divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.28 2003/04/18 01:25:41 gshapiro Exp $')
OSTYPE(freebsd5)
DOMAIN(generic)

FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')

dnl Uncomment to allow relaying based on your MX records.
dnl NOTE: This can allow sites to use your server as a backup MX without
dnl your permission.
dnl FEATURE(relay_based_on_MX)

dnl DNS based black hole lists
dnl --------------------------------
dnl DNS based black hole lists come and go on a regular basis
dnl so this file will not serve as a database of the available servers.
dnl For that, visit
dnl http://directory.google.com/Top/Computers/Internet/Abuse/Spam/Blacklists/

dnl Uncomment to activate Realtime Blackhole List
dnl information available at http://www.mail-abuse.com/
dnl NOTE: This is a subscription service as of July 31, 2001
dnl FEATURE(dnsbl)
dnl Alternatively, you can provide your own server and rejection message:
dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', `"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}')

dnl Dialup users should uncomment and define this appropriately
dnl define(`SMART_HOST', `your.isp.mail.server')

dnl Uncomment the first line to change the location of the default
dnl /etc/mail/local-host-names and comment out the second line.
dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
define(`confCW_FILE', `-o /etc/mail/local-host-names')

dnl Uncomment both of the following lines to listen on IPv6 as well as IPv4
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Port=smtp, Name=MTA')
dnl DAEMON_OPTIONS(`Name=IPv6, Family=inet6')

define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
MAILER(local)
MAILER(smtp)

archy
14-03-2005, 11:29
inetd.conf
smtp stream tcp nowait root /usr/libexec/sendmail/sendmail sendmail
Зачем запускать sedmail из inetd? Это извращение imho...

zic_t
14-03-2005, 22:56
inetd.conf
#smtp stream tcp nowait root /usr/libexec/sendmail/sendmail sendmail

telnet ns.server.ua 25
trying 192.168.0.5…
telnet: connect to address 192.168.0.5 connection refused
telnet: unable to connect to remote host

telnet localhost 25 работает

netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 *.pop3 *.* LISTEN
tcp4 0 0 *.telnet *.* LISTEN
tcp4 0 0 *.ftp *.* LISTEN
tcp4 0 0 *.netbios-ssn *.* LISTEN
tcp4 0 0 localhost.smtp *.* LISTEN
tcp4 0 0 localhost.domain *.* LISTEN
tcp4 0 0 ns.domain *.* LISTEN
udp4 0 0 ns.netbios-dgm *.*
udp4 0 0 ns.netbios-ns *.*
udp4 0 0 *.netbios-dgm *.*
udp4 0 0 *.netbios-ns *.*
udp4 0 0 *.49152 *.*
udp4 0 0 localhost.domain *.*
udp4 0 0 ns.domain *.*
udp4 0 0 *.syslog *.*
udp6 0 0 *.syslog *.*
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
c1ab4dac stream 0 0 c1ab730c 0 0 0 /var/run/ndc
c1ab49d8 dgram 0 0 0 c1ab5000 0 c1ab4c94
c1ab4c94 dgram 0 0 0 c1ab5000 0 c1ab4d20
c1ab4d20 dgram 0 0 0 c1ab5000 0 c1ab4ec4
c1ab4ec4 dgram 0 0 0 c1ab5000 0 0
c1ab5000 dgram 0 0 c1ab3104 0 c1ab49d8 0 /var/run/log

archy
15-03-2005, 17:59
Строка
tcp4 0 0 localhost.smtp *.* LISTEN
говорит, что smtp порт слушается на localhost
Для того чтобы sendmail слушал все интерфейсы попробуй
поменять строку DAEMON_OPTIONS(`Name=IPv4, Family=inet, Port=smtp, Name=MTA') на DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=0.0.0.0, Port=smtp, Name=MTA'), либо иметь для каждого интерфейса (Addr) по строке. Далее как описывал выше...

PS: sockstat -4|grep 25 будет лучше чем netstat -a

zic_t
15-03-2005, 20:43
Я изменил FreeBSD.mc
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=192.168.0.5, Port=smtp, Name=MTA')
Я так понял что Addr это интерфейс на котором будет прослушиваться порт

Make cf
cp freebsd.mc ns.server.ua.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 ns.server.ua.mc > ns.server.ua.cf
cp freebsd.submit.mc ns.server.ua.submit.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 ns.server.ua.submit.mc > ns.server.ua.submit.cf


make install
install -m 444 ns.server.ua.cf /etc/mail/sendmail.cf
install -m 444 ns.server.ua.submit.cf /etc/mail/submit.cf

cp ns.server.ua.cf sendmail.cf
cp ns.server.ua.submit.cf submit.cf
перезагружаю

sockstat -4 | grep 25
root sendmail 408 4 tcp4 127.0.0.1:25 *:*
root syslogd 256 5 udp4 *:514 *:*

все равно прослушивается только localhost

archy
16-03-2005, 11:44
zic_t
Специально попробывал, все работает

(%:/etc/mail)- grep Addr hostname.mc|grep -v ^dnl
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=127.0.0.1, Port=smtp, Name=MTA')

(%:/etc/mail)- sudo make
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 hostname.mc > hostname.cf

(%:/etc/mail)- sudo make install
install -m 444 hostname.cf /etc/mail/sendmail.cf
install -m 444 hostname.submit.cf /etc/mail/submit.cf

(%:/etc/mail)- sudo make restart
Restarting: sendmail sendmail-clientmqueue.

(%:/etc/mail)- sockstat -4|grep 25
root sendmail 26869 4 tcp4 127.0.0.1:25 *:*

Производим необходимые манипуляции с hostname.mc

(%:/etc/mail)- grep Addr hostname.mc|grep -v ^dnl
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=192.168.1.1, Port=smtp, Name=MTA')
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=127.0.0.1, Port=smtp, Name=MTA')

(%:/etc/mail)- sudo make
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 hostname.mc > hostname.cf

(%:/etc/mail)- sudo make install
install -m 444 hostname.cf /etc/mail/sendmail.cf
install -m 444 hostname.submit.cf /etc/mail/submit.cf

(%:/etc/mail)- sudo make restart
Restarting: sendmail sendmail-clientmqueue.

(%:/etc/mail)- sockstat -4|grep 25
root sendmail 26919 4 tcp4 192.168.1.1:25 *:*
root sendmail 26919 5 tcp4 127.0.0.1:25 *:*

zic_t
16-03-2005, 23:40
(%:/etc/mail)- grep Addr freebsd.mc | grep -v ^dnl
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=192.168.0.5, Port=smtp, Name=MTA')
DAEMON_OPTIONS(`Name=IPv4, Family=inet, Addr=127.0.0.1, Port=smtp, Name=MTA')

(%:/etc/mail)- make
cp freebsd.mc ns.server.ua.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 ns.server.ua.mc > ns.server.ua.cf
cp freebsd.submit.mc ns.server.ua.submit.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 ns.server.ua.submit.mc > ns.server.ua.submit.cf

(%:/etc/mail)- cp ns.server.ua.cf sendmail.cf
(%:/etc/mail)- cp ns.server.ua.submit.cf submit.cf

(%:/etc/mail)- make install
install -m 444 ns.server.ua.cf /etc/mail/sendmail.cf
install -m 444 ns.server.ua.submit.cf /etc/mail/submit.cf

(%:/etc/mail)- make restart
Restarting: sendmail sendmail-clientmqueue.


(%:/etc/mail)- sockstat -4 | grep 25
root sendmail 412 4 tcp4 127.0.0.1:25 *:*
root syslogd 246 5 udp4 *:514 *:*

спасибо вам archy
завтра переустановлю FreeBSD 5.2 на 5.3
и попробую там настроить

zic_t
21-03-2005, 23:11
archy
Поставил я freeBSD 5.2.1
Тоже самое с sendmail
Я явно делаю что то не так

в лог обнаружил это:
Mar 21 22:13:27 ns sm-mta[398]: gethostbyaddr(192.168.0.5) failed: 2
Mar 21 22:13:27 ns sm-mta[399]: starting daemon (8.12.10): SMTP+queueing@00:30:00
Mar 21 22:13:27 ns sm-msp-queue[402]: starting daemon (8.12.10): queueing@00:30:00

Что то не так с интерфейсом gethostbyaddr(192.168.0.5) failed: 2 (Addr=192.168.0.5)
что озночает код ошибки 2

Protsko
15-04-2005, 17:14
Здрасте всем.
Хто знает как можно сохранять вложенные файлы, которые получил?

mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/mail/admin": 1 message 1 new
>N 1 protsko_alexandr@ua. Fri Apr 15 16:26 54/2400 ""

Файл 1.txt как видно есть, а как его сохранить в домашнем каталоге?
Заранее благодарен.




© OSzone.net 2001-2012