Squid Mailserver
Squid Mailserver
#o not want users to down"oad a"" o! t+e !o""owing !i"es0 MP32 MP132 MP32 A(32 A('2 141
5 vi 6etc6squid6squid.con!
Create custo2 error 2essage 34M. file called +,,&-./C0+*&F1.+S in /etc/squid/error/ directory or
/usr/share/squid/errors/+nglish directory.
) vi +,,&-./C0+*&F1.+S
5-/*96
Caution8 *o not include 34M. close tags </HTML> </BODY> as it <ill $e closed $y squid.
8
Configuring Content Filtering squid
5 vi 6etc6squid6%"ocks.!i"es.ac"
,o %"ock site ca""ed sex.com you need to add !o""owing two "ines to your squid
con!iguration !i"e.
) vi /etc/squid/squid.conf
#eny access !or anyone w+o %rowses to a UR9 wit+ t+e word :%ar; in it.
A**end !o""owing A90
acl $lockregexurl url®ex i $ar
htt%&access deny $lockregexurl
10
Understanding and Managing
Mail Servers
11
-asics of Mail Server
Cne im*ortant *oint to make a%out t+e SM,P *rotoco" is t+at it does not
require aut+entication. ,+is a""ows anyone on t+e 'nternet to send emai"
to anyone e"se or even to "arge grou*s o! *eo*"e. 't is t+is c+aracteristic
o! SM,P t+at makes Dunk emai" or spam *ossi%"e.
14
Mail 7ccess Protocols
,+e de!au"t PCP server under Red Hat 1nter*rise 9inux. $+en using a
PCP server2 emai" messages are down"oaded %y emai" c"ient
a**"ications. )y de!au"t2 most PCP emai" c"ients are automatica""y
con!igured to de"ete t+e message on t+e emai" server a!ter it +as %een
success!u""y trans!erred2 +owever t+is setting usua""y can %e c+anged.
PCP works %est !or users w+o +ave one system on w+ic+ to read emai".
PCP uses ,P *ort //@ and PCP3s uses SS9 encry*tion over ,P
*ort >>5.
16
1M7P
,+e de!au"t 'MAP server under Red Hat 1nter*rise 9inux . $+en using
an 'MAP mai" server2 emai" messages remain on t+e server w+ere
users can read or de"ete t+em. 'MAP a"so a""ows c"ient a**"ications to
create2 rename2 or de"ete mai" directories on t+e server to organiBe and
store emai".
'MAP is *articu"ar"y use!u" !or t+ose w+o access t+eir emai" using
mu"ti*"e mac+ines.
'MAP uses ,P *ort /E3 and 'MAPs uses SS9 encry*tion over ,P
*ort >>3.
17
+2ail Progra2 Classifications
'n genera"2 a"" emai" a**"ications !a"" into at "east one o! t+ree
c"assi!ications
'! t+e reci*ient receives mai" on t+e same mac+ine as t+e sender2
sendmai" uses :/usr/sbin/mail#local; *rogram.
'! t+e reci*ient mac+ine is over t+e 'nternet2 t+e sending mac+ine
trans*orts t+e mai" using SMTP.
24
Send2ail 1nstallation and Configuration
vi /etc/2ail/send2ail.2c
chkconfig send2ail on
28
/ther Configuration Files
access 8 S*eci!ies w+ic+ systems can use Sendmai" !or out%ound emai"
virtuserta$le 8 S*eci!ies a domain&s*eci!ic !orm o! a"iasing2 a""owing
mu"ti*"e virtua" domains to %e +osted on one mac+ine.
aliases 8 A con!igura%"e "ist required %y t+e mai" *rotoco"
29
Using *ovecot Configuration File
vi /etc/dovecot.conf
chkconfig dovecot on
30
/etc/2ail/access
You can make sure that only trusted PCs on your network have the
ability to relay mail via your mail server by using the
/etc/mail/access file.
The first lists IP addresses and domains from which the mail is
coming or going.
The second lists the type of action to be taken when mail from
these sources or destinations is received. Keywords include
!"#Y$ !%!CT$ &K and 'I(C#'.
lConnect8localhost.localdo2ain ,+.79
Connect8localhost ,+.79
Connect8:MN.O.O.: ,+.79
Connect8exa2%le.co2 /0
Connect8$ads%a22er.co2 ,+Q+C4
Fro28tux;$ads%a22er.co2 /0
4o8$adguy;exa2%le.co2 ,+Q+C4
31
/etc/2ail/access
GouF"" t+en +ave to convert t+is text !i"e into a sendmai" reada%"e data%ase !i"e
named 6etc6mai"6access.d%.
) cd /etc/2ail
) 2ake
32
/etc/2ail/virtuserta$le
Second co"umn "ists t+e "oca" userFs mai" %ox2 a remote emai" address2
or a mai"ing "ist entry in t+e /etc/aliases !i"e to w+ic+ t+e emai" s+ou"d %e
!orwarded.
'! t+ere is no matc+ in t+e virtuserta%"e !i"e2 sendmai" c+ecks !or t+e !u"" emai"
address in t+e 6etc6a"iases !i"e.
<e$2aster;anothersite.co2 <e$2asters
;anothersite.co2 2arc
sales;2ysite.co2 sales;anothersite.co2
%aul;2ysite.co2 alok
finance;2ysite.co2 %aul
;2ysite.co2 error8nouser User unkno<n
33
/etc/2ail/virtuserta$le
*au" and !inance at my&site.com goes to "oca" user <or mai"ing "ist= *au"
-irst co"umn +as t+e mai"ing "ist name <sometimes ca""ed a virtua"
mai"%ox=
,o start2 sendmai" searc+es t+e !irst co"umn o! t+e !i"e !or a matc+. '! t+ere is
no matc+2 t+en sendmai" assumes t+e reci*ient is a regu"ar user on t+e "oca"
server and de*osits t+e mai" in t+eir mai"%ox.
'! it !inds a matc+ in t+e !irst co"umn2 sendmai" notes t+e nickname entry in
t+e second co"umn. 't t+en searc+es !or t+e nickname again in t+e !irst
co"umn to see i! t+e reci*ient isnFt on yet anot+er mai"ing "ist.
'! sendmai" doesnFt !ind a du*"icate2 it assumes t+e reci*ient is a regu"ar user
on t+e "oca" server and de*osits t+e mai" in t+eir mai"%ox.
35
/etc/aliases
Mail sent to ad2inlist gets sent to all the users listed in the file
/ho2e/2ailings/ad2inlist.
) My 2ailing list file
ad2inlist8 R8include8/ho2e/2ailings/ad2inlistR
3'(1 : ne$aliases; or :/usr/lib/sen%mail &bi; to a**"y c+anges
36
Masquerading
1dit vi /etc/2ail/localhostna2es
exam*"e.com
37
4esting Send2ail8
,+e con!iguration !i"es !or Post!ix are +uman reada%"e and su**ort
u*ward o! 25@ directives. Un"ike Sendmai"2 no macro *rocessing is
required !or c+anges to take e!!ect .
/etc/%ostfix/2ain.cf /etc/%ostfix/2ain.cf
41
Configuring Mail Server Postfix
)y de!au"t2 Post!ix does not acce*t network connections !rom any +ost ot+er
t+an t+e "oca" +ost. Per!orm t+e !o""owing ste*s as root to ena%"e mai"
de"ivery !or ot+er +osts on t+e network0
vi 6etc6*ost!ix6main.c!
Uncomment t+e 2ydo2ain "ine %y removing t+e +as+ mark <5=2 and re*"ace
%omain#tl% wit+ t+e domain t+e mai" server is servicing2 "ike exa2%le.co2.
Cnce t+ese ste*s are com*"ete2 t+e +ost acce*ts outside emai"s !or de"ivery.
43
Configuring Mail Clients
)
Questions