Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Linux и FreeBSD » Общий по FreeBSD » помогите с sendmail

Ответить
Настройки темы
помогите с sendmail

Новый участник


Сообщения: 43
Благодарности: 1

Профиль | Отправить PM | Цитировать


У меня на компьютере 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



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






Отправлено: 22:35, 04-03-2005

 
mar mar вне форума

Аватара для mar

just mar


Moderator


Сообщения: 3904
Благодарности: 163

Профиль | Отправить PM | Цитировать


zic_t
а не можешь запостить сюда весь "диалог" из терминала ? ведь не сразу же после escape character is ‘]’ идет recipient names must be specified ??

Отправлено: 23:35, 11-03-2005 | #11



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Новый участник


Сообщения: 43
Благодарности: 1

Профиль | Отправить PM | Цитировать


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/Comp...am/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)




Отправлено: 17:52, 12-03-2005 | #12


Аватара для archy

Ветеран


Сообщения: 659
Благодарности: 3

Профиль | Отправить PM | Цитировать


Цитата:
inetd.conf
smtp stream tcp nowait root /usr/libexec/sendmail/sendmail sendmail
Зачем запускать sedmail из inetd? Это извращение imho...

Отправлено: 11:29, 14-03-2005 | #13


Новый участник


Сообщения: 43
Благодарности: 1

Профиль | Отправить PM | Цитировать


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





Отправлено: 22:56, 14-03-2005 | #14


Аватара для archy

Ветеран


Сообщения: 659
Благодарности: 3

Профиль | Отправить PM | Цитировать


Строка
Цитата:
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

Отправлено: 17:59, 15-03-2005 | #15


Новый участник


Сообщения: 43
Благодарности: 1

Профиль | Отправить PM | Цитировать


Я изменил 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

Отправлено: 20:43, 15-03-2005 | #16


Аватара для archy

Ветеран


Сообщения: 659
Благодарности: 3

Профиль | Отправить PM | Цитировать


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          *:*

Отправлено: 11:44, 16-03-2005 | #17


Новый участник


Сообщения: 43
Благодарности: 1

Профиль | Отправить PM | Цитировать


(%:/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
и попробую там настроить

Отправлено: 23:40, 16-03-2005 | #18


Новый участник


Сообщения: 43
Благодарности: 1

Профиль | Отправить PM | Цитировать


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



Отправлено: 23:11, 21-03-2005 | #19


Аватара для Protsko

Пользователь


Сообщения: 101
Благодарности: 3

Профиль | Отправить PM | Цитировать


Здрасте всем.
Хто знает как можно сохранять вложенные файлы, которые получил?

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 как видно есть, а как его сохранить в домашнем каталоге?
Заранее благодарен.

Отправлено: 17:14, 15-04-2005 | #20



Компьютерный форум OSzone.net » Linux и FreeBSD » Общий по FreeBSD » помогите с sendmail

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Debian/Ubuntu - Sendmail+UUCP RZEV Общий по Linux 0 27-04-2009 15:46
sendmail Twilight Общий по FreeBSD 28 24-12-2004 09:39
Помогите с Sendmail! champion Общий по FreeBSD 27 06-08-2004 15:41
sendmail avk Общий по FreeBSD 7 10-08-2003 20:45
sendmail Psih Общий по Linux 6 01-04-2003 05:02




 
Переход