View previous topic :: View next topic |
Author |
Message |
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Mon Feb 23, 2004 12:21 am Post subject: |
|
|
I'm trying to install the Virus Scanner. I was wonderin g, is there anyway i can turn the Spam filter for amavis off. So that i can use bogofilter, for spam filtering. I just want a virus scanner. _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
Dillinger Apprentice
Joined: 27 Jul 2003 Posts: 226 Location: Huntington Beach, Ca
|
Posted: Mon Feb 23, 2004 3:16 am Post subject: |
|
|
Alright well after chaning all the $myhostname $mydomain to just dillinger.homelinux.org and adding mydomain = dillinger.homelinux.org and my hostname = dillinger.homelinux.org I'm able to send at recieve email on the server. Also had to change the net/mask to 192.168.0.0/24 instead of 192.168.0.1/24. Great guide man, it worked out great once I figured out a couple of my own mistakes! _________________ registered Linux user #338885
www.easylinuxguide.com
www.linuxforums.org
Last edited by Dillinger on Thu Mar 04, 2004 4:37 am; edited 4 times in total |
|
Back to top |
|
|
Mad_Moo_Cows n00b
Joined: 11 Feb 2004 Posts: 7
|
Posted: Wed Feb 25, 2004 1:34 am Post subject: |
|
|
Ok so I tried to get mail up and running on my system by fallowing this post....
first few times around I did the whole thing with out testing inbetween steps... and I could send email but not be sent any email from the out side world...
so I steped thought this again testin as I have went...
and Step 3.2 Adding SMTP-AUTH to Postfix is why I could not get any mail from other mail servers....
So not to get my IMAP up and working
Last edited by Mad_Moo_Cows on Sat Feb 28, 2004 9:44 pm; edited 1 time in total |
|
Back to top |
|
|
mterlouw n00b
Joined: 17 Feb 2004 Posts: 32
|
Posted: Sat Feb 28, 2004 11:14 am Post subject: |
|
|
I had to add the following lines to the bogotrainer script keep it from choking on a Courier IMAP folder (in ~/.maildir/)...
Code: | if dir[len(maildir):len(maildir) + 19] == "courierimapkeywords":
return 0
|
Code: | def cleanhamdirs(dir):
#We don't want Spam in the hamdirs :)
if dir[len(maildir):len(maildir) + 5] == ".Spam":
return 0
#The maildirs of the inbox, must be handled especially
if dir[len(maildir):len(maildir) + 3] == "cur":
return 0
if dir[len(maildir):len(maildir) + 3] == "tmp":
return 0
if dir[len(maildir):len(maildir) + 3] == "new":
return 0
if dir[len(maildir):len(maildir) + 19] == "courierimapkeywords":
return 0
#If you threw it away, you obviously don't want it :)
if dir[len(maildir):len(maildir) + 6] == ".Trash":
return 0
return 1 |
|
|
Back to top |
|
|
malloc l33t
Joined: 19 Sep 2003 Posts: 762
|
Posted: Sat Feb 28, 2004 10:11 pm Post subject: |
|
|
I'm having a little problem with this. I have everything running by-the-book, including the amavisd/clamav thing. However i seem to be having a weird problem. Fetchmail won't work, or rather it will correctly connect to the pop3 servers in wich i have accounts and it will poll them right, however whenever it tries to download any msg it spurts out an error like Unable to connect to localhost, smtp error 10 and it won't download anything. I've made the changes in smtpd_recipient_restrictions that are indicated in the guide however i still have no luck.
Anyone has any idea? |
|
Back to top |
|
|
mterlouw n00b
Joined: 17 Feb 2004 Posts: 32
|
Posted: Mon Mar 01, 2004 7:45 am Post subject: |
|
|
mterlouw wrote: | I had to add the following lines to the bogotrainer script keep it from choking on a Courier IMAP folder (in ~/.maildir/)... |
Also, I had to modify the first-run check to look for wordlist.db, since Bogofilter was using a combined wordlist by default, and every time the script ran it would retrain (or actually, overtrain) Bogofilter. |
|
Back to top |
|
|
Dolio l33t
Joined: 17 Jun 2002 Posts: 650
|
Posted: Mon Mar 01, 2004 10:13 am Post subject: |
|
|
Howdy.
This isn't a request for aid (since I have an idea of what's going wrong) so much as a heads-up for people thinking of using this guide.
I went the:
Email Client->Cyrus-SASL->Postfix->Cyrus-SASL->ISP SMTP Server->Internet
route. However, I've found that some of my outgoing mail is getting bounced by the recipient. For example, sending mail to my father at work, and to the ruby-talk mailing list.
Am I correct in assuming that the re-mailing process makes my e-mails look like spam to certain filters, and they're bouncing them accordingly? That seems like it'd be the case (bounce all mail with spoofed headers and such).
Just a pitfall you might want to note in the appropriate section of the howto. Feel free to debunk me if I'm off base.
Again, great tutorial. _________________ They don't have a good bathroom to do coke in. |
|
Back to top |
|
|
Ataraxis Tux's lil' helper
Joined: 18 Sep 2002 Posts: 76 Location: Germany
|
Posted: Mon Mar 01, 2004 10:37 pm Post subject: |
|
|
Hi, the bogofilter script didn't work for me and I wanted to spamassassin and bogofilter to learn from each other in one script. So i started to look around and adapted a shell script I found on the net.
I tested it for the last two weeks and it worked really well.
What you need:
Calls to Bogofilter and SpamAssassin in you .procmailrc (see first page)
The following folders in your maildir:
-Spam
|-Bogofilter
|-False-Negatives
|-False-Positives
|-SpamAssassin
Call to spamtrainer.sh -vrsnbp in your crontab
for example use crontab -e and add
Code: | 1 1 * * * /path/to/spamtrainer.sh -vrsnbp |
What it does:
With mails in Bogofilter
All mails marked as read (security measure) are given to spamassasin to train. Then they will be deleted.
With mails in SpamAssassin
All mails marked as read (security measure) are given to bogofilter to train. Then they will be deleted.
With mails in False-Positives
Both filters will learn that those mails are not spam. The mails will be procmailed again.
With mails in False-Negatives
Both filter will learn that those mails are spam. The mails will be deleted then.
How to use:
Check your spamfolders on a regular basis and mark your spam as read. By marking the mails as read the script is allowed to delete them. This way no False-Positive mail gets deleted by accident.
If there is a nonspam mail in your spamfolder, put it in the folder "False-Positive".
If you get a spam mail into your inbox put it in the folder "False-Negative".
Code: |
#!/bin/bash
#
# spamtrainer.sh, v1.0
#
## Small shell script to complement bogofilter
## and spamassassin in my .procmailrc file
## Kai Becker <info@kai-becker.com>, 2004-02-13
## based on handle_bogofilter_misjudgements.sh by
## Stig Sandbeck Mathisen <ssm@fnord.no>, 2003-06-02
## Program paths
spamassassin=/usr/bin/sa-learn
bogofilter=/usr/bin/bogofilter
procmail=/usr/bin/procmail
maildir=~/.maildir
## Get options
while getopts pnbsrv flag
do
case $flag in
p) false_positives=$(find ${maildir}/.Spam.False-Positives/{cur,new,tmp} -type f);;
n) false_negatives=$(find ${maildir}/.Spam.False-Negatives/{cur,new,tmp} -type f);;
b) bogo_spam=$(find ${maildir}/.Spam.Bogofilter/cur -type f -name *S);;
s) sa_spam=$(find ${maildir}/.Spam.SpamAssassin/cur -type f -name *S);;
r) rebuild=true;;
v) verbose=true;;
?) echo "Usage: $0 -vpnbsr"; exit 2;;
esac
done
# Handle false positives (mail misidentified as spam)
for mail_file in ${false_positives}
do
${spamassassin} --ham --no-rebuild "${mail_file}" &&
${bogofilter} -Sn < "${mail_file}" &&
${procmail} < "${mail_file}" &&
rm -f "${mail_file}" &&
if [ -n "${verbose}" ]
then
echo "${mail_file} marked as good, and procmailed"
fi
done
# Mark spam
for mail_file in ${bogo_spam}
do
${spamassassin} --spam --no-rebuild "${mail_file}" &&
rm -f "${mail_file}" &&
if [ -n "${verbose}" ]
then
echo "${mail_file} marked as spam, and deleted"
fi
done
for mail_file in ${sa_spam}
do
${bogofilter} -Ns < "${mail_file}" &&
rm -f "${mail_file}" &&
if [ -n "${verbose}" ]
then
echo "${mail_file} marked as spam, and deleted"
fi
done
# Handle false negatives (spam misidentifed as mail)
for mail_file in ${false_negatives}
do
${spamassassin} --spam --no-rebuild "${mail_file}" &&
${bogofilter} -Ns < "${mail_file}" &&
${procmail} < "${mail_file}" &&
rm -f "${mail_file}" &&
if [ -n "${verbose}" ]
then
echo "${mail_file} marked as spam, and procmailed"
fi
done
if [ -n "${rebuild}" ]
then
${spamassassin} --rebuild
fi
|
What you need to do:
Use it Post your comments, questions, problems, praise, flame here _________________ I emerge therefore I am |
|
Back to top |
|
|
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Tue Mar 02, 2004 2:16 am Post subject: SpamAssassin Trainer |
|
|
SpamAssassin Trainer
OK, since everyone is haring their own scripts for teaching both spamfilters on what spam and ham is. I thought i should share my own script.
I modified the bogofilter trainer for my SpamAssassin training. I found that the bogofiltertrainer had many limitations. For example, i have many folders. I want the filter to learn using ALL my folders. Its not gonna be a good filter if it only looks at spam, and not look at all the ham that i have. So i used the bogofiltertrainer script, to understand how Pythong works (this is my very first python script). Then i created this to scan through all folders that are available in my ~/.maildir folder and learn them as ham, EXCEPT the .Spam.Spam and .Spam folders.
There are 2 clearly named spam folders (.Spam and .Spam.Spam), and there's one folder for ham called .Spam.Ham . The filter will retrain from .Spam.Spam and .Spam.Ham.
I hated the naming that was used in the original script (with the positive and negative). I kept on mixing it up (yeh, i'm an idiot).
The script learns from all the folders starting with dot, except for the . and .. folders (or are they files?).
It learns from the cur folder inside each mail folders, i might expand it to include the new folder too, if its needed.
It does the same things as the original script, if it finds spam or ham.
This script is for SpamAssassin, however it can be very easily modified to work with bogofilter.
I put spamassassin first, then bogofilter, in my promailcrc. I found bogofilter to make a lot of mistakes.
Save the file in somwhere like /usr/bin/spamassassintrainer
Here's the code:
Code: |
#! /usr/bin/python
#########################################################
# Md Mooktakim Ahmed Mooktakim@hotmail.com #
# http://www.mooktakim.com #
# #
# This scripted was created to teach SpamAssassin #
# using sa-learn about spam and ham (non-spam) #
# The script is fairly dynamic, it only requires 3 #
# folders that are .Spam, Spam.Spam, Spam.Ham. #
# Spam.Spam and Spam.Ham is there if the spam filter #
# makes a mistake, the user should manually move the #
# email to the correct folder, so that sa-learn can #
# learn to correct the mistake. The ham then gets #
# redirected to procmail, once it has corrected the ham #
# mail, so procmail can filter it to the correct folder #
# instead of the spam folder. The spam gets moved to #
# the .Spam folder. The script is dynamic in a way that #
# it will learn ALL folders that are inside ~/.maildir #
# and has . infront of the name as a ham folder. #
# Warning, this includes the .Trash folder. So make #
# sure you always put spam email to either the .Spam #
# folder or .Spam.Spam folder. The emails inside #
# .Spam.Spam folder will be re-learnt, so that this #
# mistake does not happen again. #
# #
# As always, this script is GPL Licensed. #
# #
#########################################################
import os, os.path
#Configuration entries. Not much ATM. More if needed.
spamdir = os.listdir(os.path.expanduser("~/.maildir"))
home = os.path.expanduser("~/.maildir/")
for dir in spamdir:
dir = os.path.join(home,dir)
if (dir[19:] == ".Spam.Spam.Old"):
print "NOT Regestering spam folder ", dir, " Too BIG"
#os.system("sa-learn --dir --spam " + dir + "/cur/")
elif (dir[19:] != ".Sent Items"
and dir[19:] != ".Spam.Ham"
and dir[19:] != ".Spam.Spam"
and dir[19:] != "."
and dir[19:] != ".."
and dir[19:20] == "." ):
print "Regestering ham folder ", dir
os.system("sa-learn --dir --ham " + dir + "/cur/")
else:
if (dir[19:] == ".Spam.Spam"):
print "Correcting spam in ", dir
os.system("sa-learn --dir --spam " + dir + "/cur/")
os.system("mv -vv " + dir + "/cur/* $HOME/.maildir/.Spam/cur/")
elif (dir[19:] == ".Spam.Ham"):
print "Correcting ham in ", dir
os.system("sa-learn --dir --ham " + dir + "/cur/")
filelist = os.listdir(dir + "/cur/")
for file in filelist:
os.system("/usr/bin/procmail -d $USER < " + dir + "/cur/" + file)
os.remove(dir + "/cur/" + file)
print "Regestering ham folder Index"
os.system("sa-learn --dir --ham $HOME/.maildir/cur")
|
I have cron run something like this:
Code: | 0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/spamassassintrainer >/dev/null 2>&1 |
It runs the script every 2 hours.
I kept a page in my website, that i will most likely use for updates:
http://www.mooktakim.com/Code.php
Enjoy the script. It seems to be working at the moment, but if you find any errors, please let me know.
PS: as you can see my programming skills in python is very limited. I used bash and the system command for most things. This was a learning experience for me _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
mterlouw n00b
Joined: 17 Feb 2004 Posts: 32
|
Posted: Tue Mar 02, 2004 3:55 am Post subject: Re: SpamAssassin Trainer |
|
|
MooktaKiNG wrote: | I found that the bogofiltertrainer had many limitations. For example, i have many folders. I want the filter to learn using ALL my folders. Its not gonna be a good filter if it only looks at spam, and not look at all the ham that i have. |
The Bogofilter script actually does this. If you have a "Ham" folder, however, it will look in that folder exclusively for ham (we're talking about the first-run initial training here). This is in case you have a very large ham base to start off with, and thus don't want Bogofilter to scan it all.
Quote: | Then i created this to scan through all folders that are available in my ~/.maildir folder and learn them as ham, EXCEPT the .Spam.Spam and .Spam folders. |
This is what the original script does. It will scan any folder except those that start with ".Spam" (so, Spam and all of its subfolders), and Trash. It should IMO be further modified to only look in folders that begin with a ".". That would have solved my problem, which was the existence of a folder the author didn't anticipate, namely "courierimapkeywords". I think this would be the correct change, but I don't know enough about the maildir structures to be positive.
Quote: | I hated the naming that was used in the original script (with the positive and negative). I kept on mixing it up (yeh, i'm an idiot). |
Heh, I renamed them too. I called them ".spam.is" and ".spam.not" to make them easier to type in Pine. I'd be willing to share my changes, but since I renamed the folders I think it's too different from the original.
Quote: | The script learns from all the folders starting with dot, except for the . and .. folders (or are they files?). |
Ok, that's what mine does so maybe we're doing the right thing. "." is just a notation for "current directory" and ".." is notation for "parent directory", so no, you don't want to be scanning those.
Quote: | I have cron run something like this:
Code: | 0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/spamassassintrainer >/dev/null 2>&1 |
It runs the script every 2 hours. |
That's a good idea, no sense letting useful email sit in the false-positives folder all day! Since we have our own mail servers, might as well make use of those cycles.
Thanks for sharing! |
|
Back to top |
|
|
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Tue Mar 02, 2004 2:39 pm Post subject: |
|
|
Also i should have mentioned this, but my script considers the .Trash folder be Ham.
This is becuase i like to keep all my emails inside the .Trash as backup. I never delete them. So i don't keep any spam in that folder.
All spam either goes into .Spam or .Spam.Spam (the spam will move from .Spam.Spam folder to the .Spam folder anyway ).
Also i recommend people don't delete any of their spam mail either.
That way, just incase you want to use a different server, or reinstall, then you won't have to wait for all those spam to arrive for teaching the filters
Code: | if (dir[19:] == ".Spam.Spam.Old"):
print "NOT Regestering spam folder ", dir, " Too BIG"
#os.system("sa-learn --dir --spam " + dir + "/cur/") |
The above lines seem a bit useless. But it all makes sense once i explain why its there .
Basicly i also keep another folder called Spam.Spam.Old i know, i have weird naming folder issues
I have like 2000 spams in that folder. They are old spam. I just put them lines their just to make the spam filter train from them. Once i run it, i don't have to do it again. It seems waste of time, becuase all the spam inside that folder will be old (already learnt) spam. Therefore i commened that line out. _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
dagol n00b
Joined: 26 Feb 2004 Posts: 21 Location: Mississauga, Ontario, Canada
|
Posted: Wed Mar 03, 2004 5:54 pm Post subject: Little help? |
|
|
Hello everyone, I've been working through this guide for a few days and I *think* I have things mostly right.
Now I may have misunderstood something somewhere along the way, but what I hope to get out of this endevour is my own personal mail filtering solution. I currently have 2 pop3 accounts, which collectively receive about 300 spam messages per day. Originally, my solution was to add another filter to outlook express, such that mail from anyone I do not know (not in address book) is thrown into a 'Check Me!' folder. This works well enough, until someone I don't know contacts me, and then it falls apart, as I rarely catch the one legitimate e-mail among the hundreds of spam.
So I'm hoping that between bogofilter and spamassassin the number of spam I have to deal with will be drastically cut down.
So for my setup, there will be only one user (initially) - me.
I've followed the directions for amavisd-new, clamav, and (I *think* - f-prot..at least I emerged it, and amavisd only has clamav and fprot in it's config, as posted elsewhere in this thread), also I went the 'mail is sent through local ISP' route.
So, my questions:
Procmail:
Now in the antivirus setup post, it is mentioned that for the antivirus software to function properly, it skips procmail. So at this stage I
Code: | kraken root # emerge --unmerge procmail |
and didn't think about it again, until I entered the script found on page 15 of this thread, to train bogofilter, and spamassassin at the same time, which seems to make use of procmail.. so I re-emerged procmail, read it's man page, and finally understood a little what it did.
Now I want to write a number of recipes to mimic my current outlook express filters, how do I set it up so that the AV and Spam filtering occurs, and then procmail sorts things by folder?
IMAP :
I'd like to be able to access and send messages from anywhere in the world, so long as my server is online. I use dynsns (legion.merseine.nu), so what changes need I make to client, and server to accomplish this?
CRON :
Not necessarily related, but as a user, I cannot run
Code: | ian@kraken ian $ fcrontab -e |
so if anyone has any answers, I'd greatly appreciate hearing from you,
Thanx!
~ Ian |
|
Back to top |
|
|
dromer n00b
Joined: 04 Mar 2004 Posts: 12 Location: Amsterdam
|
Posted: Thu Mar 04, 2004 12:21 pm Post subject: |
|
|
Hello, first of all, great howto!!!
and sorry for my bad english I'm Dutch...
I'v been trying to get the virtual howto working, but i think the setup is outdated so i turned over to this one.
I can mail (send and receive) with squirrelmail and pine localaly and from outside. The thing not working is Outlook. I keep receiving the 454 error. So reading this forum i shut down my norton firus scanner..
But i stil get the same error..
So i went to howly log files!!(man i love them).. and i get this message:
Mar 4 13:17:13 TRUUS postfix/smtpd[1526]: starting TLS engine
Mar 4 13:17:13 TRUUS postfix/smtpd[1526]: TLS engine: cannot load CA data
Mar 4 13:17:13 TRUUS postfix/smtpd[1526]: 1526:error:02001002:system library:fopen:No such file or directory:bss_file.c:104:fopen('/etc/ssl/postfix/server.pem','r'):
Mar 4 13:17:13 TRUUS postfix/smtpd[1526]: 1526:error:2006D002:BIO routines:BIO_new_file:system lib:bss_file.c:106:
Mar 4 13:17:13 TRUUS postfix/smtpd[1526]: 1526:error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:by_file.c:274:
Mar 4 13:17:13 TRUUS postfix/smtpd[1526]: watchdog_create: 0x80a1408 18000
Oke i think i get it, i don't have the /etc/ssl/postfix dir...I think i deleted it when i was fed up with the virtual mail howto....
Oke knowing this, my question is (sorry if its a stupid one): how do i get this directory back?
Do i have to re-emerge a package or anything??
Thanks...!!! |
|
Back to top |
|
|
Gwyd10n n00b
Joined: 09 Jun 2003 Posts: 41 Location: Long Beach
|
Posted: Fri Mar 05, 2004 12:09 am Post subject: |
|
|
Thank you for the wonderful guide. I finally got everything working, for the most part.
I have one issue still remaining.
If I enable
smtpd_client_restrictions = premit_sasl_authenticated, reject in my main.cf
it seems no mail can get deleivered to my system from an outside source, ie hotmail or my isp's email system.
here is my main.cf
Code: |
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 450
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.16-r1/sample
readme_directory = /usr/share/doc/postfix-2.0.16-r1/readme
default_destination_concurrency_limit = 10
alias_database = hash:/etc/mail/aliases
local_destination_concurrency_limit = 2
alias_maps = hash:/etc/mail/aliases
home_mailbox = .maildir/
myhostname = shattertheillusion.net
mydomain = shattertheillusion.net
myorigin = $mydomain
inet_interfaces = all
mydestination = $mydomain
mynetworks = 192.168.1.0/24, 127.0.0.0/8
relayhost = smtp.west.cox.net
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
#smtpd_client_restrictions = premit_sasl_authenticated, reject
smtpd_use_tls=yes
smtpd_tls_key_file = /etc/ssl/postfix/server.key
smtpd_tls_cert_file = /etc/ssl/postfix/server.crt
smtpd_tls_CAfile = /etc/ssl/postfix/server.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
|
Now my question is am I wide open to allowing other people to use me as a relay? _________________ ---------------------
AMD 64 +3200
512 MB PC3200
MSI K8TNEO-FIS2R
Geforce FX 5200 128MB |
|
Back to top |
|
|
Dillinger Apprentice
Joined: 27 Jul 2003 Posts: 226 Location: Huntington Beach, Ca
|
Posted: Sun Mar 07, 2004 4:17 am Post subject: |
|
|
I'm not sure if this has been posted in this thread yet (haven't been through all 15 pages) but squirrelmail had be baffled for a couple of days until I found out after much searching the need to add the PHP4 like below to /etc/conf.d/apache2
Code: |
APACHE2_OPTS="-D SSL -D PHP4"
|
Just thought I'd post what I needed to do to make it work, might be something to add to the guide. _________________ registered Linux user #338885
www.easylinuxguide.com
www.linuxforums.org |
|
Back to top |
|
|
MooktaKiNG Guru
Joined: 11 Nov 2002 Posts: 326 Location: London, UK
|
Posted: Sun Mar 07, 2004 9:17 pm Post subject: |
|
|
I feel like sharing one more handy script that i use:
I like to be subscribed to maling lists, eg: gentoo mailing lists.
I also like to keep ALL my emails. But as we all know, mailing lists grow exponentially.
So i created this script to get rid of all the mailing list emails, which i don't need.
I have two folders, .Trash and .Trash.Old. I like to have .Trash hold all the latest emails that i deleted. I don't like to have the email client list all 3K of emailsm for me to just access few emails that i deleted. Thats why i created .Trash.Old. this folder will eventually hold ALL my deleted mails. This will get BIG, its a folder that i rarely go into.
This script deletes all the mailing list emails. then it moves all the email from .Trash to .Trash.Old
Code: |
#!/bin/bash
MAILDIR="$HOME/.maildir"
CLEANDIRS=".Trash .Trash.Old"
TRASH=".Trash"
OLDTRASH=".Trash.Old"
for CLEANDIR in $CLEANDIRS
do
for file in `ls $MAILDIR/$CLEANDIR/cur`
do
## Remove all mailing list emails
cat $MAILDIR/$CLEANDIR/cur/$file | grep "List-Id: Gentoo Linux mail" && rm -vv $MAILDIR/$CLEANDIR/cur/$file
done
done
ls $MAILDIR/$TRASH/cur/* >/dev/null 2>&1 && mv -vv $MAILDIR/$TRASH/cur/* $MAILDIR/$OLDTRASH/cur/
|
Its crued i know. But i like it
I run this script once a day, late at night
Simple, but effective. _________________ http://www.mooktakim.com
Athlon XP 2001, Giga-Byte GA-7VRXP MB, 640Mb DDR RAM 333MHz, MSI Geforce 4800SE 128Mb DDR, 40x12x48 Liteon CDRW drive, Flower Cooler, ADSL Router |
|
Back to top |
|
|
john5211 n00b
Joined: 04 Feb 2004 Posts: 14
|
Posted: Wed Mar 10, 2004 2:17 am Post subject: |
|
|
Gwyd10n,
I had some of the same problems in my main.cf. The problem is that smtpd_client_restrictions actually restricts who is allowed to send mail to postfix (including outside servers). Using
Code: | smtpd_client_restrictions = premit_sasl_authenticated, reject |
causes postfix to reject mail that cannot authenticate via sasl (which is hopefully everyone outside!). Leaving the line out isn't a security problem, and it won't make you an open relay. Alternately, if you feel like you need to place restrictions on the mail that comes into your network, you can use something like:
Code: | smtpd_client_restrictions = premit_sasl_authenticated, reject_unauth_destination
|
Oh, and just in case you ever want to test your configuration to see if you are an open relay, you can go to http://www.abuse.net/relay.html and use their test to check your mailserver.
John
Last edited by john5211 on Wed Mar 10, 2004 4:34 am; edited 1 time in total |
|
Back to top |
|
|
northfuse Tux's lil' helper
Joined: 13 Nov 2003 Posts: 96
|
Posted: Wed Mar 10, 2004 4:22 am Post subject: |
|
|
I followed these directions and I can access the IMAP server great from squirrelmail, thunderbird, etc. But, it won't let me recieve any mail. Is there anything else that I haven't done? |
|
Back to top |
|
|
avtryck Tux's lil' helper
Joined: 25 Oct 2003 Posts: 78 Location: Stockholm, Sweden
|
Posted: Sat Mar 13, 2004 7:23 pm Post subject: |
|
|
I followed the guide but I've run into some problems. One that is a bit strange is that if I delete a mail and then want to compress my folder, I recieve the following error message: "Server XXX has disconnected. The server may have gone down or there may be a network problem". This message appears several times but it still compresses my folder. I don't have any particular network problems and It still does what I want i to do.
My client is Thunderbird 0.5. Could the client be responsible for the error messages?
My other problem is about sending mail. Since I just followed the guide instead of learned all the tools, is there a simple way to remove the TLS support in order to se if works without it?
Thanks for a great guide and some thanks in advance for some aid with my current troubles
-Jimmy |
|
Back to top |
|
|
DozePih n00b
Joined: 14 Mar 2004 Posts: 2
|
Posted: Sun Mar 14, 2004 9:52 pm Post subject: |
|
|
Dolio wrote: | For clients, both KMail and Thunderbird don't work. I haven't tried others. KMail doesn't generate any errors other than something like "failed to send some messages" in the status bar. Thunderbird gives 'Could not establish an connection because certificate presented is invalid or corrupted. Error Code: -8182' when trying to send.
|
I'm having the same problem with Thunderbird 0.8. I've spend all day trying to figure this one out. I can connect fins and all my mails are visible. But as soon as I press the send button, Postfix gets to
Code: |
Mar 14 22:16:58 localhost postfix/smtpd[31284]: setting up TLS connection from xxx[213.xx.xx.xx]
|
Thunderbord pops up the "Could not ... Error Code: -8182". I press ok and Postfix continues with
Code: |
Mar 14 22:17:01 localhost postfix/smtpd[31284]: SSL_accept error from ...
Mar 14 22:17:01 localhost postfix/smtpd[31284]: 31284:error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate:s3_pkt.c:1052:SSL alert number 42:
|
This problems seems to be i imapd.pem certificate. According to one post I read he said:
Quote: |
OK, riddle solved. Mozilla does not accept a certificate if CN of CA is equal
to CN of the subject. The sad thing is that the quality of Mozilla'a error
messages seems to approach zero.
|
This problem basically means I cannot use my Postfix for sending mails from an TLS/IMAP connected client outside my LAN (eg. when connected from work). Or what options do I have here? |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Mon Mar 15, 2004 8:36 pm Post subject: |
|
|
Hello, think this howto may be what i need but not sure?
I need to setup a small business email/file sharing/groupware server.
The business if is connected via adsl with perminant IP and has its web site on a shared server, which is also its mail server.
I have setup a hardware based firewall but there setill remains the problem of viruses via email and as current email server, on shared server, has no virus checker and one cannot be added.
The email setup will need to collect email from external mail server, check it for viruses and make it availble to end user via IMAP using outlook as client (working on changing outlook) or web browser, sent email will need to go via external email smtp server but will also need to be checked for viruses.
I also need to setup a groupware and file sharing at same time so need what ever email setuo i go with to work with or be part of groupware.
Any ideas?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
MarkG Tux's lil' helper
Joined: 28 Apr 2002 Posts: 90 Location: Dorset, UK
|
Posted: Thu Mar 18, 2004 8:26 pm Post subject: |
|
|
I'm just in the fine tuning stage of setting up an email system based on this guide and I've noticed an anomaly with the bogofilter scrips on the first page.
When my cron job runs, it always starts of with Code: | Databases NOT found. Generating... |
Investigating this I notice that the database in ~/.bogofilter is called "wordlist.db" not "spamlist.db"
The original code:
Code: | #I'm just assuming if the spamlist.db exists, goodlist.db does too
#Program will die if goodlist.db doesn't exist anyway.
if os.path.isfile(os.path.join(bogodir, "spamlist.db")):
print "Databases found"
else:
|
The "goodlist.db" dosnt exist at all, so I can only asume this is cased by a change to bogofilter. Fortunately the code change is obvious, don't forget to update the comments to preserve future sanity
MarkG |
|
Back to top |
|
|
ufoq n00b
Joined: 25 Mar 2004 Posts: 33
|
Posted: Sat Mar 27, 2004 9:09 am Post subject: |
|
|
Well, after installing all of the things in proper order, i couldn't connect to the server. I double checked everything aaaand guess what --
during initial emerging of applications beowulf says to enter USE="blablabla"
well, in my case USE didn't work, i had to write 'export USE', then emerge took this options into consideration.
Well, i am a gent(n)oo(b)
P.S. I have installed the latest 2004.0 dist. |
|
Back to top |
|
|
ufoq n00b
Joined: 25 Mar 2004 Posts: 33
|
Posted: Sat Mar 27, 2004 3:22 pm Post subject: |
|
|
About the TLS certs:
In fact i think you have to make all the things are said in Virtual mail howto (point 5), because standards certs that come bundled (server.pem etc.) are referring to localhost, thus are useless.
Following this point you have to replace /etc/postfix with /etc/ssl/postfix cause that's the directory beowulf mentioned in the howto.
Then, launch this command:
Code: |
cd /etc/ssl/postfix
openssl x509 -in cacert.pem -out cacert.crt
|
Next, copy cacert.crt to your client PC, and launch it. It should ask if install the certificate etc...
After that, you should be able to receive the mail from newly made server in i.e. Thunderbird.
Well, to be honest i can't force MS Outlook 2003 to work correctly with this setup, but mentioned Thunderbird works flawlessly.
BTW.
I was unable to get any mail to the server from the internet. I had to hash out line beginning with "smtpd_client_restrictions=". I think smtp_recipient_restrictions is enough to not to have open relay. |
|
Back to top |
|
|
jewps n00b
Joined: 29 Mar 2004 Posts: 74
|
Posted: Mon Mar 29, 2004 2:38 am Post subject: |
|
|
First off I've gotta thank beowolf for this comprehensive guide, but while trying to setup the servers, I'm encountering a problem that I cannot resolve.
Everytime i try to send email to and from the server, i get a 554 access denied problem, however if i try to send from the server ( echo 'lalal' | sendmail "email@email.com" ), it works. I don't have any problem logging in via Outlook 03 and can receive whatever email i send from the server to the email via outlook.
Attached is the log and main.cf config. help!!
Code: |
myhostname = mobile.yingerdesign.com
mydomain = mobile.yingerdesign.com
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
myorigin = $myhostname
mydestination = $myhostname, localhost.$mydomain $mydomain
unknown_local_recipient_reject_code = 450
mynetworks_style = subnet
mynetworks = 127.0.0.0/8 192.168.0.0/24
mailbox_command = /usr/bin/procmail
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.16-r1/sample
readme_directory = /usr/share/doc/postfix-2.0.16-r1/readme
default_destination_concurrency_limit = 2
alias_database = hash:/etc/mail/aliases
local_destination_concurrency_limit = 2
alias_maps = hash:/etc/mail/aliases
home_mailbox = .maildir/
#smtpd_sasl_auth_enable = yes
#smtpd_sasl_security_options = noanonymous
#smtpd_sasl_password_maps = hash:/etc/postfix/saslpass
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated, reject
#smtpd_recipient_restrictions = check_relay_domains, permit_mynetworks, reject_unauth_destination
#smtpd_recipient_restrictions = permit_sasl_authenticated, permit_auth_destination, permit_mynetworks, check_relay_domains, reject_unauth_destination
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/ssl/postfix/server.key
smtpd_tls_cert_file = /etc/ssl/postfix/server.crt
smtpd_tls_CAfile = /etc/ssl/postfix/server.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
|
Code: |
Log:
Mar 28 10:30:02 pukka postfix/master[12791]: daemon started -- version 2.0.19
Mar 28 10:30:12 pukka postfix/smtpd[12795]: starting TLS engine
Mar 28 10:30:12 pukka postfix/smtpd[12795]: connect from web60606.mail.yahoo.com[216.109.118.244]
Mar 28 10:30:12 pukka postfix/smtpd[12795]: A4FF6364069: client=web60606.mail.yahoo.com[216.109.118.244]
Mar 28 10:30:12 pukka postfix/smtpd[12795]: A4FF6364069: reject: RCPT from web60606.mail.yahoo.com[216.109.118.244]: 554 <web60606.mail.yahoo.com[216.109.118.244]>: Client host rejected: Access denied; from=<jewpsie@yahoo.com> to=<lith@mobile.yingerdesign.com> proto=SMTP helo=<web60606.mail.yahoo.com>
Mar 28 10:30:13 pukka postfix/smtpd[12795]: disconnect from web60606.mail.yahoo.com[216.109.118.244]
|
Also, I'm not using my isp's smtp servers cause i have a mx record pointing to my ip, therefore i've commented out a few lines.
thanks |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|