Категорії
Mail systems Solaris

Рассылка писем через sendmail в Solaris

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

1. Указываем нужный домен для отправки:

В файле /etc/mail/sendmail.cf вносим домен для отправки:

# change sender domain
Djdomain.com
Dwdomain
Dkdomain.com

2. Меняем и скрываем версию Sendmail’a:

Для этого правим 2 файла:

/etc/mail/sendmail.cf, /etc/mail/submit.cf

# change version
DZ45.39 SP8

# change Greeting Message
O SmtpGreetingMessage=$j Microsoft ESMTP MAIL Service ready at $b

# change Header Receive (change $v/$Z -> $Z)

HReceived: ...
...
        $.by $j ($Z)$?r with $r$. id $i$?{tls_version}

Проверяем, с какого домена будет идти отправка:

# sendmail -d0.1 -bv root
Version 8.15.1+Sun
 Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8
                MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
                PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT
                XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = domain
  (canonical domain name) $j = domain.com
         (subdomain name) $m = com
              (node name) $k = domain.com
========================================================

root... deliverable: mailer local, user root

Теперь про некоторую особенность Sendmail’a под Solaris: добавить в файл /etc/hosts ключевое слово mailhost:

127.0.0.1 domain.com localhost loghost mailhost

Зачем это? Ответ цитатой ниже:

1) it is Sun’s tradition to ship a sendmail.cf with the relayhost set to mailhost.
Then you only need to define mailhost in the hosts file (or, even easier, in the naming service e.g. DNS).
1a) mailx, when delivering E-mail, spawns a sendmail that reads submit.cf.
The shipped submit.cf tells to deliver to port 25 on localhost.
2) there is also a sendmail daemon process that reads sendmail.cf and listens to port 25.

If you want mailx to deliver mail to mailhost without the sendmail daemon, you must define mailhost in submit.cf. Placing mailhost in the DS line should do it. (I would not go through the m4 hassle.)

Теперь обновляем aliases и перезапускаем сам сервер и клиент:

# newaliases ; svcadm restart svc:/network/sendmail-client:default ; svcadm restart svc:/network/smtp:sendmail

Прочие инструменты для диагностики

Залишити відповідь

Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *

Домашняя страничка Andy
Записки молодого админа
Самостоятельная подготовка к Cisco CCNA
Самостоятельная подготовка к Cisco CCNP
Powered by Muff