[LINUX:27807] Re: Dns ve Sendmail

---------

New Message Reply About this list Date view Thread view Subject view Author view

From: erkaN (Selamsana@uni.de)
Date: Mon 14 May 2001 - 14:24:08 EEST


Selam...

Veysi Gümüs wrote:

<<Arkadaşlar Dns Ve Sendmail Hakkında Local Serverimde
<<Yapmak istediğim Redhat 6.2 yüklü server 3 adet winxx ve birde linux
clienti olan bir networke sahibim bunlar arasında <<clientlerimle maillesmek
istiyorum. Sanal doman name olarakta plusbilgisayar.com kullanmak istiyorum
acaba dns ve sendmail <<serverda nasıl konfigure etmem lazım. şimdiden
teşekkür ederim yardımlarınız için

Makelenin Internetteki adresini bulamadigim icin sana böyle göndermek
zorunda kaliyorum, yarisi türkce yarisi ingilizce...

erkaN

===============================
Giris
Çeviri : Özgür Şefik Altınyurt
Posta kutunuza düzgün mail akısıni saglayabilmek icin bir Mail Transfer
Agent (kisaca MTA) kurmanız gerekir. Sendmail en bilineni (ve eskilerden)
olmasına karsın , qmail veya standart Debian surumlerinde yeralan exim gibi
kurulumu daha basit ve hızlı olanları da vardır. Biz sendmaili ele alacagız
ve kurulumda Berkley Universitesi'nden Eric Allman'in yolunu izleyecegiz.
Geri dönen iletileriniz Internet servis Sağlayıcınızda tutulur. Bu durum
fetchmail için gereklidir. fetchmail pop3 ya da imap ile kullanılır. uucp de
kullanabilirsiniz fakat bu durum, yazının epeyce dışına çıkacaktır.

Kurulum
Sendmail'i kurabilmeniz icin asagıdaki paketleri de yuklemeniz
gerekmektedir. (rpm halinde):

  a.. sendmail-8.8.7-20
  b.. sendmail-cf-8.8.7-20
  c.. sendmail-doc-8.8.7-20
Linux dagıtımınıza baglı olarak paketlerin isimleri ve surum numaraları
farklı olabilir.Burada gercekten gerekli olanlar ilk iki paketttir.

Sendmail'i uygun sekilde kurabilmek icin asagıdaki adımları izleyiniz:

  1.. Diyelim ki:
    a.. iss'nizin domain ismi isp.net
    b.. maillerinizi gondermek icin smtp.isp.net'e baglanıyorsunuz
    c.. maillerinizi almak icin pop.isp.net'e baglanıyorsunuz
    d.. e-posta adresiniz toto@isp.net
    e.. posta kutusu hesabınız "dede"

  2.. oncelikle bir dosya olusturun: /usr/lib/sendmail-cf/cf/config.mc
icerigi sunlar olsun:
# start of config.mc
include(`../m4/cf.m4')dnl
OSTYPE(`linux')dnl
define(`SMTP_MAILER_FLAGS', `e9')dnl
FEATURE(redirect)dnl
FEATURE(nocanonify)dnl
FEATURE(always_add_domain)dnl
FEATURE(local_procmail)dnl
GENERICS_DOMAIN(localhost.localdomain localhost localhost)
FEATURE(genericstable)
FEATURE(masquerade_envelope)dnl
define(`confCF_VERSION',`dede's cf - 22/05/98')dnl
define(`confCON_EXPENSIVE',`True')dnl
define(`confME_TOO',`True')dnl
define(`confCOPY_ERRORS_TO',`Postmaster')dnl
define(`confDEF_CHAR_SET',`ISO-8859-1')dnl
define(`confMIME_FORMAT_ERRORS',`True')dnl
define(`SMART_HOST',`smtp8:[smtp.isp.net]')dnl
define(`confTO_QUEUEWARN',`24h')
MAILER(local)
MAILER(smtp)
# End of config.mc

  define(`SMART_HOST'.... satırı sendmail'e, giden butun mailleri dogrudan
yollamaya calısmak yerine servis saglayıcınız uzerinden gondermesini
soyluyor.

  3.. Ayrıca /etc/genericstable da yaratın:

dede: toto@isp.net
root: toto@isp.net
news: toto@isp.net

  4.. /etc/alias in en azından bunları icerdigine emin olun:
MAILER-DAEMON: postmaster
postmaster: root

  5.. /etc/nsswitch.conf'u asagıdaki gibi olusturun veya uyarlayın:
passwd: files
shadow: files
group: files
hosts: files dns
services: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
netgroup:
publıckey:
automount: files
aliases: files

  ( hosts dısındaki her satırda tek basına "files" bulunmalıdır)

  6.. /etc/sendmail.cf yi asagıdaki gibi olusturun:
  m4 config.mc > /etc/sendmail.cf
  haklarını asagıdaki gibi duzenleyin:
  -rw------- 1 root root 26468 mai 12 22:52 /etc/sendmail.cf

  7.. Generate the address conversion data base:
  /usr/bin/sendmail -bi -oA/etc/genericstable
  /etc/genericstable.db isimli bir dosya yaratılmıs olmalı

  8.. Adlandırma(alias) tablosunu yeniden okutun:
  newaliases

  9.. /etc/hosts asagıdakine benzer bir satır icermeli:
  127.0.0.1 localhost.localdomain localhost localhost

  10.. sendmail'i yeniden baslatin:
  kill `head -1 /var/run/sendmail.pid`
  /usr/bin/sendmail -bd -os
  Sendmail Testi
  Sendmail icin yapilmasi gerekenler bu kadar.Simdi herseyin dogru isleyip
islemedigini kontrol etmeliyiz:
  Bunun icin asagidaki satirlari iceren test.mail isimli bir dosya yaratin:

        Subject: test local
        first line of my message
        (compulsory blank line)

  ve su komutu girin:
  /usr/bin/sendmail -v dede < test.mail
  Asagidaki satirlar ekrana yazilmali:

dede... Connecting to local
dede... Sent

  mail veya baska bir mail istemciyi (netscape'i degil!!) calistirin ve
mesajin alinip alinmadigini kontrol edin

  Yerel maillerinizi(sendmail tarafindan sunulanlari) Netscape ile
okuyabilmek icin:

    a.. Edit/Preferences/Mail & Groups/Mail Server menusune gidin
    b.. Outgoing mail (SMTP) server bolumune localhost.localdomain yazin
    c.. Mail server type'i movemail/built-in olarak secin
    d.. /var/spool/mail 'in haklarini chmod 1777 /var/spool/mail ile
degistirin.

  chmod 777 'yi de kullanabilirsiniz fakat bu degisiklik eger posta kutunuza
baglanan tek kisi siz degilseniz bir guvenlik acigi olabilir. chmod 1777
dizine yazma hakki olanlarin degil yalnizca dosya sahibinin o dasyayi
silebilecegi anlamina gelir.
  Su andan itibaren kendi PCniz Internet'e bagli olmasaniz bile Netscape'e
dogrudan mail sunabilir durumdadir. Ayrica XFmail, emacs, mutt, pine v.b.
mail istemcileri de kullanabilirsiniz.

  Configuration of fetchmail
  Before we try our new mail server on the Internet, we need to configure
fetchmail in order to tranfert messages stored in your mailboxes of your
ISP:
  create a file .fetchmailrc in /home/dede:

poll pop.isp.net protocol POP3
        user toto is dede
        password XXXXXXX

  where toto and XXXXX are the login and password of your mail account at
pop.isp.net. If you have more than one mailbox, just duplicate the above
lines for each mailbox you have.
  The file .fetchmailrc must have permissions set as follow, otherwise
fetchmail will refuse to run:

-rw------- 1 dede dede 189 oct 6 21:45 /home/dede/.fetchmailrc

  Now, for a test on the Internet:

    a.. Write a message (without beeing connected) to a mail mirror such as
echo@univ-rennes1.fr or echo@cnam.fr
    b.. send it.
  It should appear in the mail queue when issuing the command: mailq Next,
connect to your ISP (isp.net) and send the message:
/usr/bin/sendmail -q

  sendmail -q flushes the mail queue of sendmail and causes it to send out
the mail now. Wait for a while and type fetchmail to get your mail, you
should have a message sent back by the mirror. You can now disconnect if all
the messages have arrived.

  Automatisation
  Once all is setup, we still have to make it work on its own each time a
connection is established.

  With PPP, files /etc/ppp/ip-up and ip-down are executed each time you
connect or disconnect. Check that you have a line like this one in these
files, otherwise create it:
  [ -x /etc/ppp/ip-down.local ] && /etc/ppp/ip-down.local $*
  In /etc/ppp/ip-up you add:
  [ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local $*

  Files /etc/ppp/ip-up and ip-down then lauch files ip-up.local and
ip-down.local that we wrtite like this:

#!/bin/bash
# /etc/ppp/ip-up.local

#Record connection parameters
echo `date` $4 $5 ppp-on >> /etc/ppp/history
tail -n 1 connect-errors >> /etc/ppp/history

# Send waiting mail
echo Sending mail... > /dev/console
/usr/sbin/sendmail -q
echo Mail sent. > /dev/console

# Get mail waiting on the pop server
echo Getting mail... > /dev/console
fetchmail > /dev/console 2>&1
echo Got mail. > /dev/console

#End
exit 0
# end of /etc/ppp/ip-up.local

  In fact, the two important lines are commands sendmail -q and fetchmail.
The others are cosmetic and allow:

    a.. to log the movment of messages to the system console (xconsole)
    b.. to log connections in /etc/ppp/history
#!/bin/bash
# /etc/ppp/ip-down.local

#Record connection parameters
echo `date` ppp-off >> /etc/ppp/history

#end
exit 0
# end of /etc/ppp/ip-down.local

  These files are run as root, so it is necessary to copy the file
.fetchmailrc in the /root folder.

  If you have a permanent access to the Internet, sendmail regularly sends
mail if it has been started as a daemon with the following command:
  sendmail -bd -q10m
  In order to send your mail every 10 minutes for exemple.
  fetchmail can also be lauched in daemon mode with the command:
  fetchmail -d 600
  In order to retreive your incoming mail every 10 minutes (600 seconds) for
instance.

  Usually this type of commands are located in the startup (or init) files
in the directory /etc/rc or /etc/rc.d/ (may vary according to your
configuration).

  Conclusion
  With such a configuration, the outgoing mail waiting in the queue (mailq)
is sent. The incoming mail waiting in your mailbox on the server of your ISP
arrives. You can use xbiff or xmailbox or any other similar software to warn
you that you have mail. You can also fine tune the way your mail is sorted
and filtered with procmail. This last step is explained in the Novembre 1997
article from Angel Lopez.

  Other related articles
    a.. Building text files with m4 macros by John Perr
    b.. Configuring sendmail 8.8.x by John E. Gotts
    c.. Manage your mail with procmail par Angel Lopez
  Documentaion on sendmail and fetchmail:
    a.. www.sendmail.org
    b.. www.fetchmail.org

  Talkback form for this article
  Every article has its own talkback page. On this page you can submit a
comment or look at comments from other readers

 
 Listeden cikmak icin:
          unsub linux
 mesajini listeci@bilkent.edu.tr adresine gonderiniz.
   Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin.
 Listeci arayuzu: http://listweb.bilkent.edu.tr/yardim/bilkent/linux.html
 Liste arsivinin adresi: http://listweb.bilkent.edu.tr/


New Message Reply About this list Date view Thread view Subject view Author view

---------

Bu arsiv hypermail 2b29 tarafindan uretilmistir.