???????????????? Postfix.
Postfix - ??? ???????????, ???????? ???????? ??????, ???????????? ??????? ?????????? ????????????. ???????????? ?? ?????? ????????????? Linux. ?????? ???? ?????? ? ??????? ??? ??????.
????? ?????? ???????, ??????????? ????????????? ?????????, ??????? ?????? ???? ? ????? ????????????. ?????? ?????? ?? ??????????.
??? ????????? ????? ?????????????? ???????????? ?????, ??? ???????????????? ???????? ??????? ???????????? POP- ??????????????. ???????? ?????? ??? ????????? ????? ????? ?????? ??? ? ??????. ?? ????????? ??????? ??? ???????? ?????, ?????????????? ?? ???????????. ? ????????? ????? ?????? ?????????? ?????? SMTP-?????????????? ?? ???? ??????? (????????: rambler.ru, mail.ru), ??? ??????, ??? ??? ???????? ?????? ?????? ???????????? ????????? SMTP-??????????????, ????? ?? ?? ?????? ???????? ?????. ??? ???? ??????? ????????????? ????????.
?????? ?????? rambler.ru ??????? SMTP-??????????????, ??????? ????????? ?????? ??? ???????????? ?? rambler.ru ?????? ?????? SMTP-?????????????? ??? ??????. Postfix ?????????? ?????????? Cyrus SASL ??? SMTP-??????????????. ? ASPLinux ??? ??? rpm-??????: cyrus-sasl-1.5.24-25, cyrus-sasl-md5-1.5.24-25, cyrus-sasl-plain-1.5.24-25. ????????? ??????? Postfix ???????? ?? ?????? ???????????? ??????????????? ? ?????????? ?????????? SASL.
????? ??????? ?????? ????????? ??? ???????? ?????? ??? ???????? ????? ? ?????????? ?????
1. ??? ????? ??????????????? ?? ??? ????????? ????, ?????????? ?? ??????? ???????? ???? smtp.rambler.ru.
2. ??? ???????? ????????? ?? smtp.rambler.ru, ?????? ????????? ??????????????, ? ?????? ?????? ???? ???????? ??? ?????? SMTP-??????????????.
3.??? ???????? ?????????, ???????????? ????????? ????????? ????????? ? ???????. ???? ???? ?????????????? ?????? ???????, ?????? smtp.rambler.ru ?? ?????? ????????? ?? ??????????? ?????? gt.localdomain ? ??????????? ????????????. ???????, ??????? ?????????, ?? ????????? ?????? ?????????? ???????? ????? ???????????. ?????? ??????? ?? ???????? ??????? ??????????, ????????? ??????? ??????? ???????? ????? ?? ?????????. ???????? ????????? ????? ??????????????? ? ? ?????? ?????????????? ???????????.
4.?? ???????? ?????????? ????????? ??????????, ? ??????? ? ???????.
5.?? ?????????? ?????? ??? ? DNS .
????? ????????? ??? ???????? Postfix, ?????????? ???????? ??????? ???? ???????? /etc/postfix/main.cf.
?????? ? ????? ????????, ????????, ????? ??? ?????? ???????? ? ????????? ????????? ? ????????? ????.
#INTERNET HOST AND DOMAIN NAMES
myhostname = gt.localdomain
?????, ??? ????????? ?? ?????????.
# RECEIVING MAIL
inet_interfaces = all
? ????? ??????????? ??????????? ?????, ???????? ?? ????????????? ????????.
mydestination = $myhostname, localhost.$mydomain
????? ??????????? ??????, ??? ??????? ????? ??????????? ???????? ?????.
# TRUST AND RELAY CONTROL
mynetworks = 192.168.1.0/24 , 127.0.0.0/8
???????????? ????????? ????, ?? ??????? ??????????? ? ??????????????? ?????. ???????????? ????? ????? ????????? ????.
# ALIAS DATABASE
alias_maps = hash:/etc/postfix/aliases
???????????? ????? ???????????. ???? ???? ????????? ?????????????? ????? ? ????????? ?????. ? ??? ??????? ????? ????????? ?????? ????????. ???? ?????? ????? ????? root ???????????????? ?? ??????? ??????? ??????, ???????? ???? ???? :
# CHANGE THIS LINE to an account of a HUMAN
root : alex
??? ????? ????????????? ????? root ?? ??? alex .
?????? Postfix ????? ??? ?????? ? ???????? ????????? ?????? ????????? ????. ????????? ??????????? ??????? ? ?????????? ??????, ????? ??????? ???????? telnet ??? Windows. ???????:
telnet gt.localdomain 25
?? ?????????????? ????????? ?????? pppd, ???? ?? ???????. ????? ??? ?????, ? ??????? ?????. ?? ?????? ?????? ????????? ???-?? ?????:
220 gt.localdomain ESMTP Postfix
?????? ????????? ????????? ????????? ???????. ???????? ??? ??????? ??????: drt@gt.localdomain ? bgl@gt.localdomain. ??? ???????? ? ?????? ????? ?? POP ? SMTP ?????????? ??????? ?????? gt.localdomain. ????????? ???????? ????????? ? ????? ?????? ?? ??????. ?????? ????????? ???????? ??????? ?????? ????? ??????? /var/log/maillog. ?????? ?????????????? ???????? ??????:
cat /dev/null > /var/log/maillog
? ????? ????????? ?????????.
???????? ?????????? ??? ???????? ????????? ?? ??????? ????. ????????? ???? ????? ??????, ?? smtp.rambler.ru:
# INTERNET OR INTRANET
relayhost = smtp.rambler.ru
????????? ?????? ??? ?????? SMTP-??????????????:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
???????? ??? ?????? ? ????? /etc/postfix/main.cf. ?? ??????? ????????? smtp_sasl_auth_enabled , ? ?????????? smtpd_sasl_auth_enabled . ?????? ????????? ????????? ?????????????? Postfix , ????? ?? ????????? ?????, ? ?? ????????.
???????? ????????? ???? /etc/postfix/sasl_passwd:
rambler.ru dir:pAsswordDir
???????? ???????? ? ??????, ????? ???????????? ?? ???????? ??????? ?????? ? ?????? ???????????? ? ???????? ???? ????? ?????????. ?????? ?? ?????? ?????????? ? ???????. ?????? ????? ?????? ?? ?? ?????????? ?????, ? ?? ??????????????? ????. ??? ???? ???????? ????????:
postmap /etc/postfix/sasl_passwd
??? ????????????? ??????????, ? ?????? #ADDRESS REWRITING ????????:
sender_canonical_maps = hash:/etc/postfix/sender_canonical
???????? ????????? ????, ?? ??????????? ???????? ? ????????? ????????? ????????? ????? ?????????????? ????????? ????????????. ???? /etc/postfix/sender_canonical:
bgl@gt.localdomain buh@rambler.ru
drt@gt.localdomain dir@rambler.ru
???????? ??????????????? ????:
postmap /etc/postfix/sender_canonical
? ?????? 2.0 , ????????? ?????????????? ???????, ?????????? ????? ??? ??????????? ????????? ?????????????, ? ????????? ???? ???????????? ?? ???????????????, ????? ?????????, ????? ?????? ? ?????? ??????????:
# REJECTING MAIL FOR UNKNOWN LOCAL USERS
local_recipient_maps =
???????? ?????? ??????? ? ??????? ????????? ??? ??????? ????.
??????? ?????? ? ????? ????????? ????? ????????:
defer_transports = smtp
???????? ???????? ????????? ? ?????? ????. ??????? ?????? ? ????? ????? ????????:
disable_dns_lookups = yes
?? ??? ??? ?? ???. ?? ??????? ???? ???????? ??????????. ?????? ??????? ????????? ?????? ??????? ?????????? ???? ???????????, ??????? ? ??? ??????????, ???? ???? ?? ?? ???? ?? ??????. ?????? telnet ??? ??????? ???????????? ? ????, ?????? ?????????? ? ?????? ?????????? ????. ???? ??????? ????? pppd ? ?????? ??????? ?? ??????? ????, ? ?? ?????? ???? ??????, ???? ??? ????????? ?????????, ?? ???????? ?????? ? ?????????? ? ?????????? ? ???????? DNS. ????? ???????? ?????? ?? ??????, ?????? telnet ??? ?? ?????? ??????????? ?? ????, ???? ? ?? ???????????? ?????????. ?? ???????? ?????? ????? ????????. ???? ???? ?? ????????? IP ????? ??????? ????????? ???? ? /etc/hosts ? ????????? ???????? ?????????????????? ?????? ? /etc/host.conf /etc/nsswitch.conf , ?????? ?????? ????? ? ????????. ??????? ??????????? ????????? ???? ?? ???????????????. ??????? ??? ?????????? ?????????? ???????????, ????? ???????????? ?????? ssh . ??? ??????????? ???????, ?????? ?? ???????? ????????? ??? ? ????????? ??????? ?? ??????. ???? ??????? ?????? ??? Windows - PuTTY . ??????? ???????????? Linux .
?????????? ???? ??? ? Postfix. ??? ?????????? ?????????? IP ????? ????? smtp.rambler.ru. ?? ???? ? ??????? ??????? nslookup ????????? ??? ? ??????? ? /etc/hosts. ???? ????? ????? ????????, ??????? ???? ?? ??????? ?? ???? ??? ?????????, ???? ???????????? ?????????? ?????? DNS. ?? ?????? ??? ?? ?????????? ?????? ??????? ?????????? ? ?????? DNS ?????????, ??? ?????????? ? 25-? ?????? ???????. ?? ???????? ?????????? ??? ?????????? ?????? ????????? ????, ????? ??????? ? ???? ???????.
?????? ???????? ?????? ? ???????? ?????? ?????? ? ?????????? ????? ?? ???? ??????????. ??????? ???????? ??? ????? ????????, ???????? ????? ???????? ???????????? ????????, ??????????? ???? ???? ??? ??????????? ????????????? ? ???????. ????????? ??????????? ?????????????? ?????, ????????? ????? ???????? ??????? ????????????? ???????? ??????? ??????????. ??? ???????????? ???????? ??????? ?????????? ?????????? chroot. ???? ?????? ??????????? ? ???????? ?????? ?????????, ?? ?????? ????????? ????? ????? ?? ???????? ??? ?????????, ???? ???? ?? ?????? ???????????? ?????? ? ????? ?????.
???? ????? ???????????? ? ??????? Postfix. ??? ????????? /var/spool/postfix. ??? ????????? ????? ?????? ????????? ??????: localtime, services, resolv.conf. ???? resolv.conf ?????????? ???????? ????????????? ??? ???????. ????? Postfix ????????? ??? ????, ?????????? ??????????? ? ??? ?? ?????????? ????? /etc/hosts, /etc/nsswitch.conf ? /etc/host.conf. ? nsswitch.conf ? host.conf ???????? ??????????????? ??????? ?????????? ????. ? ???? hosts ????????? ?????? ? ????? ???? ??????????? ????????? ????, ? ??????? ????? ???????????? ?????. ?????? ??? ???????? ?????????? ? 25-? ?????? ???????, ????????? ? DNS ????????? ?? ??????????, ???? ???? ??????? ????? pppd.
???????? ??????. ???????? ???????? ????????? ? ????????? ??? ? ??????? ?????? bgl@gt.localdomain ?? dir@rambler.ru. ?????? ?????? ??????? ????????? ? ????????? ? ???????. ????????? ? ???????? ?? ?????? ??????????? ??? ?????????? pppd. ?????????? ??????? ????? ????????? ????????:
mailq
????????? ?????????:
postsuper -d ?????_?????????
????? ????????? ???????????? ???????? mailq. ? ??????????, ? ???????????? ???????? ??????? ?? ????????????? ???????? ???? ????????? ?? ??????? ? ????????.
???????????????? fetchmail.
??? ??????????? ?????? ?????????? ??????? ?? ?????? ?? ?????? ??????????, ?? ? ????????? ????? ?? ?????????. ???????????????? ? ??????? fetchmail ????? ????? Postfix. ???????? ???? /etc/fetchmailrc , ? ??????? ?? ?????? ? ?????? ?????? ???????????? root. ??? ??? ?????:
set postmaster "root"
set logfile "/var/log/fetchmail.log"
poll pop3.rambler.ru proto pop3 user buh pass buhgalter , is bgl here smtphost gt.localdomain
poll pop3.rambler.ru proto pop3 user dir pass pAsswordDir , is drt here smtphost gt.localdomain
???????? set postmaster ????????? ????????? sendmail, ????? ??? ?????????????? ????????? ???????????? ???????????? root. ?????? ?????? ????????? ???????????? ??????????? ?????, ?? ?????? ????? ?? ????? ???? ????? ??? ??????????? ???????.
????? ????????, ??? fetchmail ?????????? POP - ?????? ??????????, ????????? ?????, ????????????? ?????????? ? ????????? ???????? Postfix ?? ????????? SMTP ? ????????? ? ???? ?????. ??????? ??? ?????????? ?????? fetchmail, Postfix ?????? ???? ????????. ?????????? ????? ??? POP ??????? ?????? ??????????. ? ??????? ?????? ?????? ??????? ???????? ?????? pop3.rambler.ru, ????????? ???????? pop3, ???????? ???? ???????????? dir ? ??????? director ? ????????? ?? ?????? gt.localdomain ? ???? ???????????? drt. ???? ? ???????????? ????????? ??????? ???????? ??????, ?? ????? ???????? ? ??? ????? ? ????????? ? ????????????, ????????? ???????? ????.
??????????? ????????? ???????? ?????.
?????? ?????????? ?????? ????????? ?????, ??? ??????? ? WWW. ????? ??????? ?????? ???????? ?????? ????? ????????.
??? ??? ????? ??????????, ???????? ?????? ?????? ? ??????? ????????? ??? ??????? ????. ?????????? ???????????? ?????????? ??????????? ????? ? ???????? ? ????????? ???????? ?????. ????? ??????????? ????????? ?????????? ?? ???????. ???? ?????? ? WWW ?? ?????, ?? ??? ???????? ?????? ?????????????? ???????????? ??????? ???????????. ??? ?????? ??????????? ?????? pppd , ?????????? ?????? ? ??????????. ????? ??????????? ???????? ????????? ?? ????????? ?????? ?? ???????? ????????? ? ???????????? ??????????? ? ??????? ?????????? ???????. ????? ??? ???????? ??????????, ?????????? ???????????. ?????????? ????? /etc/ppp/options ??? ????? ??????:
connect /etc/ppp/redialer
lock
defaultroute
/dev/modem
idle 180
crtscts
debug
name "yourname"
??? ??????? ???? ?????? ????? ??????? ?????? /etc/ppp/ip-up.local ? ?????? ????? ?? ??????????. ?? ????????????? ??????????? ??? ????????? ?????????? ?? IP ?????????. ??????, ??????????? ?????? /etc/ppp/ip-up , ? ??? ?? ???? ?????????? ip-up.local . ??????? ? ???? ??????? ??? ?????? ???????????? ?????? ? ??????? ??????????. ???? ???????? ?????? ?????:
#!/bin/bash
# echo "???????? ???????? ????? ?? ??????? ??????????"
/usr/bin/fetchmail -t 20 -a -v -f /etc/fetchmailrc
# ??????? ??????? ???? ?? ????????
while mailq | grep -v 'Mail queue is empty$' > /dev/null 2>&1
do
/usr/sbin/sendmail -q
sleep 5
done
# echo "???????? ????????, ???????? ??????????"
/usr/bin/killall pppd > /dev/null 2>&1
exit 0
??????? /usr/bin/fetchmail -t 20 -a -v -f /etc/fetchmailrc ???????? ???????? ???????? ?????. ???????? ?????? ?? ????? ???????? ????????? ??????? mailq . ??? ?????????? ??????, ????? ??????? ??????, ? ???????????? ???????? ????? ???????. ? ?????????? ? 5 ?????? ?????????? ??????????? ????? ? ???????. ?????????? ?? ??????? ?????? ???????? ??? ?????? ?? HTTP ? FTP ??????????, ???????????? ??????????? ?????????? ? ????????????? ???????????.
??????? ???????? ????????? ? ??????? ?????? bgl@gt.localdomain ?? dir@rambler.ru. ?????????? ????????? ??????? ? ???????????. ??????? ??????? ???????????? ?? ????? ? ????????? echo ? ?????? ???????, ??? ?????????? ???? ??????????. ????????? pppd ? ?????????? ????????? ???????. ???????? ????????? ?????? ????????????? ?? ???????? ??????????? ??? ????? ? ??????????. ???????? ????????? ?????, ????? ???????? ??????? pppd, ????? ???????? ????????? ????? ?????????. ???????? ???????? ??????? ???? ???????? ????????? ? ?????????? ??????? ? ??????? ?????? drt@gt.localdomain.
????? ???????? ? ?????????? ????? ?????? ??????? ? 8 ???? ?? 18 ??????, ??????? ? ???? /etc/crontab ??????:
0,30 8-18 * * * root /usr/sbin/pppd
??????????? cron ?????? ???? ???????.
????? ???? ??????
www.linux.ru/articles/server2/
|