[BSD] mailscanner install howto

Laszlo Nagy gandalf at shopzeus.com
2009. Okt. 15., Cs, 13:32:41 CEST


  Sziasztok!

Próbálkozom vele de elakadtam. A neten freebsd+mailscanner kifejezésre a 
legújabb amit találtam az freebsd 4-re vonatkozik. :-( Próbálom a doksik 
alapján, de ez meg nehezen megy mert minden csomagnak külön doksija van 
és egyik sem freebsd specifikus. mailscanner + spamassassin + clamav 
portok installálása sikerült. A következő az lenne hogy postfix-szel 
összekapcsoljam. A leírás szerint ez csak akkor fog menni, ha a postfix 
chroot-ban fut. A postfix chroot-olásához csak ennyit találtam:

/usr/local/share/doc/postfix/index.html

amiben ez van:

>                                                                                                                 
> Postfix Basic Configuration (p9 of 11)
> Running Postfix daemon processes chrooted
>      
>    Postfix daemon processes can be configured (via the master.cf file) 
> to run in a chroot jail. The processes run at a fixed low privilege 
> and with
>    file system access limited to the Postfix queue directories 
> (/var/spool/postfix). This provides a significant barrier against 
> intrusion. The barrier
>    is not impenetrable (chroot limits file system access only), but 
> every little bit helps.
>    
>    With the exception of Postfix daemons that deliver mail locally 
> and/or that execute non-Postfix commands, every Postfix daemon can run 
> chrooted.
>    
>    Sites with high security requirements should consider to chroot all 
> daemons that talk to the network: the smtp(8) and smtpd(8) processes, and
>    perhaps also the lmtp(8) client. The author's own porcupine.org 
> mail server runs all daemons chrooted that can be chrooted.
>    
>    The default /etc/postfix/master.cf file specifies that no Postfix 
> daemon runs chrooted. In order to enable chroot operation, edit the file
>    /etc/postfix/master.cf, and follow instructions in the file. When 
> you're finished, execute "postfix reload" to make the change effective.
>    
>    Note that a chrooted daemon resolves all filenames relative to the 
> Postfix queue directory (/var/spool/postfix). For successful use of a 
> chroot
>    jail, most UNIX systems require you to bring in some files or 
> device nodes. The examples/chroot-setup directory in the source code 
> distribution has
>    a collection of scripts that help you set up Postfix chroot 
> environments on different operating systems.
>    
>    Additionally, you almost certainly need to configure syslogd so 
> that it listens on a socket inside the Postfix queue directory. 
> Examples of syslogd
>    command line options that achieve this for specific systems:
>    
>    FreeBSD: syslogd -l /var/spool/postfix/var/run/log
>

Akkor ha jól értem, akkor ehhez először a syslog-nek kell adni egy -l 
kapcsolót. Beírtam az rc.conf-ba hogy

syslogd_flags="-s -l /var/spool/postfix/var/run/log"

A következő lenne a chroot környezet kialakítása (mert pl. ilyen 
könyvtár nem létezik). Van erre valami egyszerű parancs, vagy egyszerű 
leírás? (Az examples/chroot-setup könyvtár természetesen nincs sehol, de 
ha lenne azt sem freebsd-re találták volna ki...)

Ezután következne a master.cf átírása. Ha jól értem akkor itt:

> # 
> ==========================================================================
> # service type  private unpriv  chroot  wakeup  maxproc command + args
> #               (yes)   (yes)   (yes)   (never) (100)
> # 
> ==========================================================================
> smtp      inet  n       -       n       -       -       smtpd

mindenhol ahol a chroot oszlopban 'n' van azt átírom 'y'-ra. Ez nekem 
túl egyszerűnek tűnik. Jó lesz ez így? :-s

Bocs ha nagyon egyszerű dolgokat kérdezek, még nem csináltam ilyet és 
valahogy nem áll össze a kép. :-(

Köszi,

   Laci




További információk a(z) BSD levelezőlistáról