Re: lug-bg: Sendmail
- Subject: Re: lug-bg: Sendmail
- From: vlk@xxxxxxxxxxxxxxxxx (Vesselin Kolev)
- Date: Mon, 30 Dec 2002 13:57:10 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Taka...
Sega neka formulirame reshenieto na zadachata.
Pyrvo problema, koito imash idva ot tova, che se opitvash da prashtash
maila si kato lokalen user, bez da polzvash SMTP. Ti napravo puskash
poshtata vyv spoolera. I zatova stavat tezi greshchici, koito vizhdash:)))
Ne, che e e greshno tova, koeto pravish, no nastroivaneto po tazi shema
e malko po-trudnichko. Shte ti kazha i zashto e taka:) prichinata e, che
v headera na izprashtania mail poleto Return-Path sydyrzha v obshtia
sluchai (ako ne si butal nishto po /etc/hosts ili po sendmail.cf) sydyrzha
localhost.localdomain. Kogato se priema ot drug SMTP server tvoia mail,
toi proveriava, che localdomain ne e validen TLD i ti kazva, che ne mozhe
da priema maila:)) Idilia....
Po princip izpolzvaneto na genericstable instrumenta e dobro, no ima i
kyde kyde po-prost nachin. Tozi nachin se naricha MAIL HUB. Pusni si
sendmail chrez default configuraciata. Ne mu davai smart host. Ne ti e i
nuzhnen. No e dobre da si opravish bibliotekata na resolvera i da imash
vse pak obrabotka na tyrsenata DNS informacia. Otchitai vinagi fakta,
che SMTP raboti v obshtia sluchai na osnovata na poluchenite MX
resursni zapisi ot strana na DNS.
Sled tova otvori faila /etc/mail/access i dobavi eto tozi red:
127.0.0.1 RELAY
posle zapazi zapisa i hashirai
makemap hash /etc/mail/access.db < /etc/mail/access
I gotovo. Zabelezhi, che ne e nuzhno da restartirash daemona sendmail
za da mozhesh da vliazat v sila novite promeni.
Proveri na lo interface-a dali 25/tcp e otvoren i sedmail slucha na nego.
Mozhesh da iazpolzvash nmap, no i edna telnet sesia do port 25 shte ti
e dostatychna proverka.
Posle si nastroi liubimata programa za mail (Pine, KMail, Netscape Messanger i
t.n. ) taka, che SMTP server da e 127.0.0.1. I tova e cialata rabota. Taka
SMTP servera ti e lokalnia host. Primerno taka mozhesh da si chetesh chrez
POP3 nastroikite (lichno az predpochitam IMAP, no nikoi ne me pita:)) ). Eto
naprimer mozhesh da prashtash mailove ot imeto na bugar@xxxxxxx.
Abe vsyshnost ia da opisha scenaria:) che da ne stavam ot novogodishnata
trapeza za da pisha doutochnenia:) Shte simulirame vsichko chrez telnet sesia
i shte imitiram programata ti za izprashtane na poshta prez SMTP.
Eto telnet sesiata:
========================================================
[vlk@velociraptor vlk]$ telnet 192.168.100.254 25
Trying 192.168.100.254...
Connected to 192.168.100.254 (192.168.100.254).
Escape character is '^]'.
220 redhat ESMTP Sendmail 8.12.5/8.12.5; Mon, 30 Dec 2002 14:58:21 +0200
helo test
250 redhat Hello e-lib.vpn.lcpe.uni-sofia.bg [192.168.100.111], pleased to
meet you
mail from: vlk@xxxxxxxxxxxxxxxxx
250 2.1.0 vlk@xxxxxxxxxxxxxxxxx... Sender ok
rcpt to: root@xxxxxxxxxxxxxxxxx
250 2.1.5 root@xxxxxxxxxxxxxxxxx... Recipient ok
data
354 Enter mail, end with "." on a line by itself
From: LCPE Webmaster <webmaster@xxxxxxxxxxxxxxxxx>
To: root <root@xxxxxxxxxxxxxxxxx>
Subject: Test mail from telnet session
Date: Mon, 30 Dec 2002 13:45:00 +0200 (EET)
Tova e samo edin test:))
.
250 2.0.0 gBUCwLij024027 Message accepted for delivery
quit
221 2.0.0 redhat closing connection
Connection closed by foreign host.
[vlk@velociraptor vlk]$
========================================================
a eto i tova, koeto az sym poluchil (zaedno s headera):
========================================================
Received: from test (e-lib.vpn.lcpe.uni-sofia.bg [192.168.100.111])
by redhat (8.12.5/8.12.5) with SMTP id gBUCwLij024027
for root@xxxxxxxxxxxxxxxxx; Mon, 30 Dec 2002 14:58:54 +0200
Message-Id: <200212301258.gBUCwLij024027@redhat>
From: LCPE Webmaster <webmaster@xxxxxxxxxxxxxxxxx>
To: root <root@xxxxxxxxxxxxxxxxx>
Subject: Test mail from telnet session
Date: Mon, 30 Dec 2002 13:45:00 +0200 (EET)
Status: R
X-Status: N
Tova e samo edin test:))
========================================================
Tova e iliustracia, koiato obiasniava kak stava tochno sesiata. Zabelezhi sega
neshto, koeto e imenno vazhnoto v sluchaia. Gore sym popylnil edno pole
mail from: i sled tova sy dal mail adres. VNIMANIE, kogato mail servera priema
moia mail za nego toi e izpraten ot izprashtacha, koito e zadaden chrez
mail from:. Tova pole sled tova se prisvoiava na poleto Return-Path v headera
na mail-syobshtenieto. Kogato ti izprashtash maila si bez SMTP, a napravo
go podavash na sendmail da go postavi s spoolera, to mail from: se zadava
avtomatichno ot sendmail. I ako ne si pravil nastroiki ili si slozhil izmislen
domain shte se poluchi DNS greshka pri opredelianeto na domaina. Zabelezhi
che tezi greshka niama da se generira v tvoia sendmail (e mozhe i da se
generira, ako resolvera ne chete /etc/hosts, no tova ne e nastroika po
podrazbirane), a shte se generira na servera, do koito tvoia sendmail shte
go izprati. S edna duma:) shte byde ludnica.. Zabelezhi, che v tozi sluchai
ne se proveriava poleto From:, koeto sym zadal gore. Poleto from shte sluzhi
na poshtenskata mi programa da mu kazhe ot kogo e polucheno pismoto.
Vsashnost v obshtia sluchai mail from: i From: syvpadat.
:)) Dano vsichko e stanalo iasno... ako ne e pishi, shte se postaraia da
otogovoria podrobno!
Pozdravi i pozhelania za leko hranosmilane prez praznichnite dni:)))
Vesselin Kolev
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+EDSd+48lZPXaa+MRAjz/AKCQGDy3B6ReZlaexs5XjdxoMBPmUgCg2SI1
NfkA4k1kLCegAPc5C77onKk=
=P810
-----END PGP SIGNATURE-----
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================
|