Centos ile Spam+Antivirüs içeren Exchange için Mail Gateway

Centos ile Spam+Antivirüs içeren Exchange için Mail Gateway

24. April 2009

Read this article in your language IT | EN | DE | ES

Öncelikle sendmail'i durdurmalıyız.

Service sendmail stop ile sendmaili durduruyoruz
chkconfig sendmail off komutu da sendmail'in açılışta çalışmasını engelliyor
yum install postfix komutu ile postfix'i kuruyoruz.
Ardından /etc/psotfix/main.cf dosyasında aşağıdaki değişiklikleri yapıyoruz:
myhostname = altalan.alanadi.com.tr
mydomain = altalan.alanadi.com.tr
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain $mydomain
mynetworks_style = host 
relay_domains = alanadi.com.tr 
transport_maps = hash:/etc/postfix/transport
append_at_myorigin = no
/etc/postfix/transport dosyasına şu satırı ekliyoruz
alalanadi.com.tr                smtp:[exchange server ip'si] 
postmap /etc/postfix/transport koumutu ile postfix'in transport dosyasını indekslemesini sağlıyoruz. 

service postfix stop
service postfix start komutlarıyla da yaptığımız değşiklikleri aktif hale getiriyoruz.

Lütfen bu aşamada maillerin exchange'e ulaştığından emin olun. Hataları sonra düzeltmek daha zor olacaktır.

NOT: Ayrıca altalan.alanadi.com.tr ismine dikkat edin. Exchange sunucusu da kendisini aynı şekilde tanıtırsa postfix mailleri exchange'e teslim etmeyecektir.
Örn: Linux makinanın adını mail.egeonline.com yazmşsam ve exchange sunucusu da kendisini mail.egeonline.com olarak tanıtırsa, linux üzerinde kurulu postfix mailleri teslim etmeyecektir. Bu sorunun çözümü için şöyle yapabiliriz:
Eğer exchange sunucumuzun adı mail.egeonline.com ise, linux sunucunun adını linux.egeonline.com şeklinde ayarlayın. Alan adımız yani $mydomain egeonline.com oalcağı için sorun çıkmaz.

Eğer

Recipient address rejected: User unknown in local recipient table; 
şeklinde bir hata alırsanız mydomain değişkenini myhostname ile aynı yapmayı deneyin. 

MailScanner kurulumu

http://mailscanner.info adresinden sisteminize ait dosyayı indiriniz.

tar zxvf MailScanner-versiyon.tar.gz komutuyla mailscanner'ı açıyoruz.
sonra da cd  MailScanner-versiyon komutuyla bu dizine giriyoruz.
./install komutu sizin için gerekli kurulumları yapacaktır. Eğer eksik bir bileşen varsa bunu kurmanız için sizi uyaracaktır.
Bende rpm-build paketi eksikti. yum install rpm-build komutuyla bu paketi kurdum.
chkconfig --list | grep MailScanner komutuyla kurulumun durumunu kontrol edelim. Çıktı şu şekilde olmalıdır :
MailScanner     
0:kapalı       1:kapalı       2:açık        3:açık       4:açık 5:açık        6:kapalı
chkconfig postfix off komutuyla postfixi devreden çıkarıyoruz. MailScanner postfix'i kendisi çalıştıracaktır.
/etc/postfix/main.cf dosyasına
header_checks = regexp:/etc/postfix/header_checks satırını ekliyoruz.
/etc/postfix/header_checks dosyasına:
/^Received:/ HOLD satırını ekliyoruz.
/etc/MailScanner/MailScanner.conf dosyasında aşağıdaki değişikikleri yapıyoruz
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix 
Sonra da MailScanner çalışma dizinlerinin sahipliklerini değiştiriyoruz:
chown postfix.postfix /var/spool/MailScanner/incoming
chown postfix.postfix /var/spool/MailScanner/quarantine
service MailScanner restart komutuyla mailscanner'i yeniden çalıştırıyoruz.
Bu aşamada tekrar mail alıp gödnermeyi deneyiniz. Bir hata var ise büyümeden düzeltmek zamanımızı kurtaracaktır.

Spamassassin

http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
dosyasını indirerek rpmforge repo'sunu repo lsitemize ekliyoruz

yum install perl-Digest-SHA1 perl-HTML-Parser perl-MIME-Base64 perl-Net-DNS perl-Mail-SPF-Query perl-Time-HiRes perl-DB_File komutuyla gerekli perl modüllerini kuruyoruz

yum install spamassassin komutu da spamassassin kurulumunu bizim için yapacaktır.

Kurulum tamamlandıktan sonra /etc/MailScanner/MailScanner.conf dosyasına:
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin 
komutunu ekliyoruz. Yada zaten vasrsa bu şekle gelmesini sağlıyoruz.
Ardından şu komutları çalıştırıyoruz:
mkdir /var/spool/MailScanner/spamassassin
chown postfix.postfix /var/spool/MailScanner/spamassassin
service MailScanner restart komutuyla mailscanner'ı yeniden başlatıyoruz.

ClamAV

Sıra geldi clamav kurulumuna

groupadd clamav
useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav
http://dag.wieers.com/rpm/packages/clamav/clamav-0.92.1-1.el5.rf.i386.rpm
http://dag.wieers.com/rpm/packages/clamav/clamav-db-0.92.1-1.el5.rf.i386.rpm
http://dag.wieers.com/rpm/packages/clamav/clamd-0.92.1-1.el5.rf.i386.rpm
clamav'ın centos 5 rpm'leri yukarıdaki adreste verilmiştir.

ardından gerekli perl modüllerini sistemimize yüklüyoruz

yum install perl-Parse-RecDescent perl-Inline perl-Mail-ClamAV
service clamd start komutuyla clamavı başlatıyoruz. 
freshclam komutuyla clamav veritabanını güncelliyoruz.
/etc/MailScanner/MailScanner.conf dosyasına clamav'ı kullanmasını söylüyoruz:
'Virus Scanners = clamav'
ve
Monitors for ClamAV Updates = /var/clamav/*.inc/* /var/clamav/*.cvd
ile güncellenmiş dosyaların yerşni bildiriyoruz.
Artık Exchange'inizin önünde bir spam ve antivirüs tarayıcısı var.
Güle Güle Kullanın 
Kaynak: Egeonline.com
FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Linux , , ,

Comments

3/2/2010 5:19:07 AM #
The successful man will profit from his mistakes and try again in a different way.
3/18/2010 8:53:23 PM #
Your blog is so informative … keep up the good work!!!!
3/22/2010 1:01:09 PM #
Hey I love your style I will subscribe for your feed please keep posting!
3/23/2010 1:19:42 PM #
Hey, i've been reading this blog for a while and have a question, maybe you can help... it's how do i add your feed to my rss reader as i want to follow you.  Big thanks for the useful info i found on Centos ile Spam+Antivirüs içeren Exchange için Mail Gateway.
4/2/2010 12:07:50 AM #
Hi. I read a few of your other posts and i wanted to say thank you for the informative posts.
4/4/2010 1:59:31 PM #
Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I'm more of a visual learner,I found that to be more helpful well let me know how it turns out!
4/7/2010 4:53:11 PM #
Hi. I read a few of your other posts and i wanted to say thank you for the informative posts.
4/9/2010 2:50:19 PM #
There is obviously a lot to know about this.  I think you made some good points in Features also.
4/27/2010 2:15:44 PM #
I have witnessed the softening of the hardest of hearts by a simple smile.
5/6/2010 1:19:27 AM #
I found trading shares quite exhilarating until the stock markets became stagnant and the movement on my stock profiles were minimum. I needed something more exciting, something a little more risky, yet could deliver the adrenalin rush I needed when I was on a big win.
5/13/2010 5:57:41 AM #
I simply finished reading through throughout the posting, top quality data, appreciate your revealing with us
5/14/2010 6:07:35 PM #
This document has satisfied some necessary issues what i had, thanks and take care
5/17/2010 12:47:08 AM #
  I think you made some good points in Features also.
5/20/2010 4:07:27 AM #
Of course, what a great site and advisory posts, Can I add backlink - import your rss feed? Regards, Reader.
5/22/2010 1:25:55 AM #
Hi webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep 'em coming... you all do such a great job at such Concepts... can't tell you how much I, for one appreciate all you do!
5/24/2010 7:39:44 PM #
Man, I've been looking all over for this stuff.  Thanks.  Do you have any other sites other than Centos ile Spam+Antivirüs içeren Exchange için Mail Gateway?  I'd like a list of the best way to prepage for all of this and what is the best place to start?  It'd be nice, no?
5/27/2010 7:49:05 PM #
Do you have any other sites other than Centos ile Spam+Antivirüs içeren Exchange için Mail Gateway?  Because with the economy getting better, we'll see.  Because getting prepared and ready with the right stuff and a list is going to make it better, ya know?
6/2/2010 5:55:14 AM #
I just want to emphasize the good work on this blog, has excellent views and a clear vision of what you are looking for.
6/4/2010 7:23:15 PM #
If you are ready to accept visitor blog poster please let me know. I will deliver  unique articles for your webstie.
6/4/2010 8:57:15 PM #
Do you accept guest posts? I would love to write couple articles here.
6/4/2010 11:21:32 PM #
Anybody upgraded to the latest Ubuntu release? I'm running Koala currently, trying to get an idea if I should be upgrading.
6/7/2010 7:32:54 PM #
I take great delight in your blog, Its outstanding to realize not every body is just posting a heap of trash these days!

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.03125 saniyede yuklendi.