Click to See Complete Forum and Search --> : mail filtering
i want to set up mail filtering for two users.
1 user is on linux the other is using windows
i have a linux server that i want to use fetchmail to get each user's mail and then filter it for spam.
i then want each user to be able to either using pop3 or imap download their mail from my server.
how can i do this?
what server do i need to run for pop3 or imap?
seabass55
01-01-2003, 01:39 PM
setup imap on the linuxbox
I just did this the otherday for me here at home and it's the greatest thing :D
I use fetchmail go grab my mail off from my ISP and it gets saved in /var/spool/ I used pine to check my email and I'd always save it to my /home/ Doing the Pine thing was great when I was on the road cause I could ssh in and check email...but at home with multiple machines and multiple OS's it got old. So now I can open up Eudora in Winblows and have all my new mail and all my saved mail (in /home) and I can still use Pine when using my linuxbox's or on the road.
I used UW IMAP (which comes with RH)
Sebastian
lonescout
01-01-2003, 09:37 PM
Sebastian,
could you give a brief description of how you setup fetchmail/pine to do multiple addresses. I want sooooo bad to get that working.
I have a total or 8 POP3 accounts that require authentication on three different mail servers (mail.elnk.net, mail.comcast.net, and my own domain) and one IMAP account (at work). I would actually like to use PINE or MUTT to check all of them (screen out the crap that I don't really need) then open up anything w/ HTML formatting and attachments with KMAIL. If this even feasable, and if so, I think all I may need is a basic jist of how the configuration file for fetchmail is supposed to look. I attempted this already with the provided instructions, and was basically given the 'middle digit' by fetchmail (it wouldn't log into ANY of the accounts). Still not sure that I understand how to do mulitple boxes w/ PINE or MUTT either, but figure that should be easy, once I give it some mail to look for :)
i can't even get fetchmail to work properly :)
ok well since no one helped i figured out a way to do it.
i am using fetchmail to get each user's mail with a preconnect that runs mailfilter to delete spam before downloading it to /var/spool mailboxes on my server.
i am using ipopd for pop3 access to the mail.
i'd still like to get imap set up but i found that the documentation for anything i tried totally sucked.
lonescout
01-02-2003, 09:00 PM
I've kinda got it working (definately not the right way)
I put 3 lines in my fetchmailrc
(sorry doing this from memory at work, so it may not be right)
poll mail.earthlink.net proto POP3 pass xxxxxxx fetchall
" " pop.comcast.net " "
poll mail.mydomain.net " "
the problem is I have to type fetchmail -u <username> for each account, and let is error out on the fetchmail lines that don't have that user at that domian.... not a big deal, no damage exept error messages, I can still read the mail from all the accounts in Pine (although I can't send...still working on that)
I read somewhere that you can attach the other boxnames as "alliases" onto your username ....guess I need to figure out how that works, and then learn how to write a small script that will check all the boxes with one command, or even better at 10 minute intervals, like fetchmail is supposed to work
haven't even touched the IMAP thing yet...not feeling that brave.
Good luck
i use fetchmail as a daemon and have both accounts in the global fetchmailrc file. it is in /etc for debian.
i still use my isp's smtp server to send mail which i don't really care about.
anyone ever set up imap before who can help us?
seabass55
01-02-2003, 09:38 PM
Sorry was busy yesterday evening and couldn't reply.
Unfortunatly Pine doesn't support multiple mailboxes....we'll get back to this shortly.
As far as fetchmail...it's great and is very easy to configure. Here is a sample of mine...
{----------------------------------------------------}
set postmaster "seabass55"
set bouncemail
set no spambounce
#set syslog
set properties ""
set daemon 60
poll popserver.yourisp.com with proto POP3
user 'username' password 'yourpassword' is username here
mda "/usr/bin/procmail -d %T"
user 'different' there with password 'whatever' is username here
mda "/usr/bin/procmail -d %T"
warnings 3600 antispam 451 571 550 501 554
{-----------------------------------------------------}
The above will poll popserver.yourisp.com with pop3 to get mail. It will check two accounts on the server (username and different) and deliver it to where I keep my mail.
I don't run sendmail or postfix...just procmail. I don't have my own domainname and I use my ISPs SMTP server to send mail. If you have multiple pop3 accounts on multiple servers then just "poll" the other servers.
Now is when things get a little tricky...I don't send anything on my second pop account. It's pretty much a recieve only account for new forum messages, redhat notices and a few other things. Nobody knows me by that email address other than a few lists I subscribe to. So for me it's easy.....all mail goes to one spot and only goes out one way. imap is there just to make things easy on using multiple computers at home (and multiple OS's)
This post got me thinking about something with pine...it's not perfect...but it works.
cat .pinerc > .otherpinerc
So now we have two .pinerc files
chmod 660 .otherpinerc
owner and group can read and write
Change pine settings (folders, name) to whatever you want
vi .otherpinerc
Now you can run pine like you did before by just typing
pine
Or you can run pine by running
pine -p .otherpinerc (I would just write a shell script called otherpine or something)
The reason it's not perfect (and again..pine doesn't support multiple accounts so I never expected it to be perfect) and here's why. Even using two pine accounts on the same profile results in mail being sent from the same user. A quick way around it would be to add Reply-To: different.yourisp.com in customized-hdrs=
This still shows email from your regular pine account...but the reply to will be different so they "should" reply to the right addy.
In Eudora it's easy since it support multiple accounts whenever I reply or new message I can choose which 'personality' I want to send the email from so my from line can be whatever I set it to.
I'm sure you could setup fetchmail to send the email into seperate accounts...but I just don't have need for it (so you actually have two inboxes). I would probably just make another username that corresponds to that email account and run another fetchmail session for that username. I could still check all of them in the same session of Eudora (via imap) and I wouldn't have to do that .otherpinerc thing with Pine. If using pine I would just "su - otheruser" to check the different accounts. But again IN MY CASE I don't have to do that because I just send all a mail to the same mail spool.
I'm sure there is something you could do with postfix or sendmail that would seperate the mail into different spools...I just don't have a need for it.
Sebastian
lonescout
01-02-2003, 10:30 PM
really preciate that seabass...that takes care of alot of my issues I really don't care if all the mail gets dumped into one spot. The little bit that i don't delete, i can filter myself. I was using KMAIL, which was great for filtering all the different accounts into their respective folders (I think it's the closest thing to OE for Linux that I have seen, but I'm fairly new, so be that as it may). Any way I will just poll all my accounts the way you showed, and have them all dumpted into one mass in Pine. I don't really care about sending from multiple accounts either... I use primarily, one that i don't mind getting hammered with spam, and I can change from time to time.
I think I'm off base on the IMAP thing. I was referring to actually checking my IMAP work box (which I currently do w/ KMail now, and may just leave there (it handles it pretty well, and don't think i want that stuff mixed up (get 20-50 messages a day, and have a gazillion filters already set up one it). Seems you guys are referring to actually running an IMAP server on your machines whiich polls all your POP accounts.... little too rich for my blood :)
couple questions on your setup:
what does 'mda "/usr/bin/procmail -d %T"' do?
and what does the ' warnings 3600 antispam 451 571 550 501 554 ' do?
I see that antispam in my /usr/bin....wasn't sure how to invoke it :)
Thanks again for the info
how do you setup UW IMAP to use /var/spool/username ?
actually - how do you setup IMAP at all :)
seabass55
01-03-2003, 04:13 AM
lonescout:
Fetchmail can fetchmail off of imap servers. just give it the imap servers name and tell it to fetch with proto imap. If you have the fetchmailconf package installed you can setup imap via the gui....which in all reality once you have a template (like the file above) you don't really need it. It's been a long while since I've used fetchmailconf.
Even running kmail you should still be able to read what fetchmail grabs.
The procmail is what actually delivers my mail since I don't use sendmail or postfix. That's the command to put mail where it is meant to go (/var/spool/mail/username in my case).
I'm not even sure if the warnings and antispam work anymore since I'm not running an smtp server. What they are is smtp server errors that account for alot of spam (fake domains, etc)...they are setup stock with fetchmail and I've kinda just kep the since..the only one I added is 451.
Procmail can also be setup with spamassasin along with doing rules by itself. Pretty neat program...but .procmailrc can be quite "greek" to do to some folks.
Cy....99:
I'll get back to you in the morning...little tipsy right now and in all honesty I'm trying to figure out some IMAP stuff right now. I had a tough time finding the info I needed on the web about setting up imap that comes with redhat for the stuff I needed to setup...so it just took a few days of trial and error. I'm sure there is some stuff I did in a few howto's that I didn't have to do that I'm getting rid of. Just gonna get rid of things 1 by 1 till it stops working so I know exactly what has to be done. I learned a few things today...but I"ve got a ways to go.
Sebastian
Originally posted by seabass55
Cy....99:
I'll get back to you in the morning...little tipsy right now and in all honesty I'm trying to figure out some IMAP stuff right now. I had a tough time finding the info I needed on the web about setting up imap that comes with redhat for the stuff I needed to setup...so it just took a few days of trial and error. I'm sure there is some stuff I did in a few howto's that I didn't have to do that I'm getting rid of. Just gonna get rid of things 1 by 1 till it stops working so I know exactly what has to be done. I learned a few things today...but I"ve got a ways to go.
Sebastian
cool. thanks. im looking forward to being able to get imap up and running.
i got uw-imapd installed and working but it wont work under ssl with Evolution. I get an error that it can't connect on port 993. I checked in /etc/services and imaps is there with port 993: tcp and udp.
any ideas?
lonescout
01-03-2003, 03:25 PM
I must say thanx a million...
It's working awesome.
Added all my accounts to your script, and boom, no more waiting..........for Kmail when I just wanna browse my email real quick...Hell far as I'm concerced I'll only use Kmail once a week now to clean up IMAP stuff (decided agaist pine for that....think it might get ugly).
Only problem I'm having now is Pine just refuses to let me create folders...gonne keep screwing with that....maybe see if mutt is a little nicer to me. I'm really new, so when trying stuff out, the program that forgives the most ignorance usually wins my favor ;)
BTW, I believe the spam thing may actually work cause one of my boxs is specifically created as a spam "test box", and I did notice some crap mail missing....will give it a couple more days, and let you know.
Thanx again
seabass55
01-03-2003, 05:55 PM
when your making your folders in Pine (saved-messages, etc)...type out the whole pathname of the folder (ie /home/user/mail/saved-stuff)
C