Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Production mailserver setup, courier imap/smtp/pop3 v1.7
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Thu Mar 04, 2004 4:53 pm    Post subject: Production mailserver setup, courier imap/smtp/pop3 v1.7 Reply with quote

THIS HOWTO HAS MOVED TO MY OWN WIKI!!!
http://wiki.kaspersandberg.com/doku.php?id=howtos:courier-mailsuite
_________________
Sandberg Enterprises


Last edited by Redeeman on Thu Aug 25, 2005 5:10 pm; edited 7 times in total
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Sat Mar 20, 2004 8:38 am    Post subject: Reply with quote

is there any interrest at all? if there isnt, i will not keep adding more stuff to it
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
sn4ip3r
Guru
Guru


Joined: 14 Dec 2002
Posts: 325
Location: Tallinn, Estonia

PostPosted: Sat Mar 20, 2004 11:15 pm    Post subject: Reply with quote

Nice howto, I think I might try it on my "home-server".

But I have some questions:

Is it possible to filter all mail through spamassassin instead of
only for those users who have .mailfilter file?

Is it possible to have a user with no home directory?

Some other guides have also included fetchmail, can it be
used here aswell?
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Sun Mar 21, 2004 12:10 am    Post subject: Reply with quote

sn4ip3r wrote:
Nice howto, I think I might try it on my "home-server".

But I have some questions:

Is it possible to filter all mail through spamassassin instead of
only for those users who have .mailfilter file?

Is it possible to have a user with no home directory?

Some other guides have also included fetchmail, can it be
used here aswell?


you need to have a "main" directory for the users, but that doesent mean a home directory, just some directory, you specify.

i think its possible to pipe all mail through spamasassin. i will try to find out how, and explain it better.

fetchmail.. yes, i can try, but me and fetch/procmail isnt best friends, but i will do my best
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
riposte
n00b
n00b


Joined: 17 Nov 2003
Posts: 69
Location: New Zealand

PostPosted: Wed Mar 24, 2004 5:22 am    Post subject: Reply with quote

Excellent how-to - thanks

I have one small problem you may be able to help with.
Incoming mail is making it to the mail queue but is not being delivered.
What settings if any should there be in /etc/courier/courierd with regard to delivery?
Do I need to enable maildrop?
Back to top
View user's profile Send private message
GurliGebis
Retired Dev
Retired Dev


Joined: 08 Aug 2002
Posts: 509

PostPosted: Wed Mar 24, 2004 1:58 pm    Post subject: Reply with quote

Does the SMTP use auth?
_________________
Queen Rocks.
Back to top
View user's profile Send private message
AkiAki007
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 150
Location: New York, NY

PostPosted: Wed Mar 24, 2004 2:34 pm    Post subject: Reply with quote

I have an interesting problem which I can't figure out the answer to. I have set up mail using QMail, f-prot for virus checking, SpamAssassin (with spamd) and courier-imap. QMail, f-prot and courier-imap all work fine. I can't get SpamAssassin to do anything, nor can I figure out how to log what it is doing.

I've sent some test spam and they all manage to get through. What's more annoying is that there is no X-Spam header saying that it got through SpamAssassin and what the score was.

my /etc/conf.d/spamd file is
Code:
SPAMD_OPTS="-a -d -c -u qmaild -x -C /etc/mail/spamassassin/local.cf"

and my /etc/mail/spamassassin/local.cf file is
Code:
required_hits 5.0
rewrite_subject 1
subject_tag *****SPAM*****
report_safe 1
report_header 1
use_bayes 1
auto_learn 1
skip_rbl_checks 0
use_razor2 1
use_dcc 1
use_pyzor 1
ok_languages all
ok_locales all


I also have copied all the xx_*.cf files into /etc/mail/spamassassin (i saw this in another post) from /usr/share/spamassassin

Any help would be great.

Oh, and while I'm asking, I don't suppose anyone would know about qmail-scanner. It is good, but it quarantines the virus, I'd rather have it send a notification to someone (admin). It currently only notifies the sender (which I don't want it to do) and does not notify the admin (which I do want it to do).

thanks!

and if anyone needs help with qmail, i can try. I managed to get it to relay quite well to MS Exchange, which was my initial goal.
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Wed Mar 24, 2004 5:37 pm    Post subject: Reply with quote

i think this is a qmail settings which is wrong. but i dont know
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Wed Mar 24, 2004 5:38 pm    Post subject: Reply with quote

i think this is a qmail settings which is wrong. but i dont know
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
AkiAki007
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 150
Location: New York, NY

PostPosted: Wed Mar 24, 2004 8:43 pm    Post subject: Reply with quote

I eventually got some help in IRC in #qmail...the problem was that I didn't have spamd running when I emerged qmail-scanner. When compiling qmail-scanner, all external scanners to be used by qmail must be running (f-prot, clamav, spamd/spamassassin, sophos, whatever), otherwise the script that is generated won't be correct.
Back to top
View user's profile Send private message
pagerc@ufl.edu
n00b
n00b


Joined: 02 Jan 2004
Posts: 15

PostPosted: Thu Mar 25, 2004 3:46 am    Post subject: Tip for propogating global configurations to all users Reply with quote

If you really want to propogate stuff, stick it in /etc/skel/
when new users are created, all the files in /etc/skel are copied to the new home directory. This user's home dir may exist anywhere.

Don't do anything stupid with links though, like have root's config files link to /etc/skel, this would cause headaches for some people, so be forewarned.
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Thu Mar 25, 2004 7:17 am    Post subject: Re: Tip for propogating global configurations to all users Reply with quote

pagerc@ufl.edu wrote:
If you really want to propogate stuff, stick it in /etc/skel/
when new users are created, all the files in /etc/skel are copied to the new home directory. This user's home dir may exist anywhere.

Don't do anything stupid with links though, like have root's config files link to /etc/skel, this would cause headaches for some people, so be forewarned.


if you are referring to the thing about making global mailfilters, this isnt a way of doing it, as this guide could aswell use virtual users, that doesent have a global system user, but it could also be a system user, and then it would work
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
Roderik
n00b
n00b


Joined: 06 Jun 2002
Posts: 55
Location: Belgium

PostPosted: Fri Mar 26, 2004 12:46 am    Post subject: Reply with quote

I really liked the guide but if you aren't too busy you might have time to ad an addendum to the guide for a folowing situation.

I'm currently working in a small buisness and we run MS small buisness server 2003 with the pop3 connector. So the enterprise mail system and a pop3 downloader that places the mails on a pop3 account in one users mailbox. This way we keep the stability of our web/mail host + the ability to work with the same mails at the same time. (IMAP etc)

I'm looking for a linux gentoo based system like the one you described above together with a pop3 connector (fetchmail?) to replace this system with an opensource one. The pop3 connector part is nowhere to be found in any of the linux mail server guides i could find. Maybe you could help :)
_________________
"Never argue with an idiot, they'll drag you down to their level and beat you with experience."
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Fri Mar 26, 2004 6:08 am    Post subject: Reply with quote

yes, i am currently working on this. so it should likely come soon.
i need a pop3 connecter for my own setup too.

i havent decided wheter to use getmail for fetchmail.

but you will hear from me soon
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
Roderik
n00b
n00b


Joined: 06 Jun 2002
Posts: 55
Location: Belgium

PostPosted: Fri Mar 26, 2004 9:56 am    Post subject: Reply with quote

GREAT! :)
_________________
"Never argue with an idiot, they'll drag you down to their level and beat you with experience."
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Mon Apr 05, 2004 9:19 pm    Post subject: Reply with quote

i can see that i havent got any further on this yet, so it will take some time, i will update the guide right now, allthough only a very minor upgrade, its stille there..
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
malloc
l33t
l33t


Joined: 19 Sep 2003
Posts: 762

PostPosted: Mon Apr 05, 2004 10:29 pm    Post subject: Fetchmail HOW-TO Reply with quote

Redeeman asked for a volunteer to write a little faq on getting fetchmail to work, so here i am :)

So let's get down to business.
Once you've emerged fetchmail, first thing to do is to go over to /etc/conf.d/fetchmail and choose your poll time (remember this is in seconds). Don't choose a value too low if you're polling from external servers because they might get p*ssed at you and terminate your account and ban your ip.
Here's my config for example, it polls every 30 minutes you could go as low as 10 minutes, lower than that and make sure you're a close friend to the other mail server admin :)
Code:
# Polling frequency in seconds
# (fetchmail will daemonize and check for new mail at this interval)
polling_period="1800"


Choosing time in here will force fetchmail to run in daemon mode, this means that you must use a central fetchmailrc file for all your users, wich, depending on your config might be acceptable or not.

If you want to give the capacity to have each individual client run it's own instance of fetchmail (NOT in daemon mode) you need to enforce a ~/.fetchmailrc file to each client tailored to their individual need.

Let's look at an example of a fetchmailrc file
Code:

set postmaster "malloc"

poll pop3.mymail1.com with proto POP3 user "malloc" there with password "lalala" is malloc here options keep warnings 3600
poll mymail2.com with proto IMAP user "malloc@mymail2.com" there with password "ugauga" is malloc here options fetchall warnings 3600
poll mymail3.com with proto AUTO user "malloc@mymail3" there with password "xuxuxu" is malloc here options warnings 3600

Ok now let's see each command in detail...

Code:
set postmaster "malloc"

This one tells the MTA wich user is running the queue. If you want an individual config you need to put the user's name on each config file. If you're going global you should put the username of the MTA (for example user postfix if you're running it). Of course that if you go global you need to put every single user's external account here.

Code:
poll pop3.mymail1.com with proto POP3 user "malloc" there with password "lalala" is malloc here options keep warnings 3600

Ok this line is preety self-explanatory.
You say wich server you want to poll, wich protocol the external server runs (POP3, IMAP or AUTO) and the remote server username:password your user has. Then you just need to say who is your user, the options part has 2 parts the "warnings 3600" is just for more verbose messages the KEEP and FETCHALL options are to (in order) keep all the mail in the external server and to fetch all messages (even messages previously downloaded ones.)
YOU SHOULD NOT RUN THESE 2 OPTIONS TOGETHER IF YOU'RE RUNNING FETCHMAIL IN DAEMON MODE!!!!

Ok we're almost done.
Now try to run fetchmail in debug mode just to see if everything is ok
Now if you chose the global config just add fetchmail to the default runlevel and it's done.
If you've gone local, you can do one of 2 things.
Either add a global alias so that each user fetches his mail when he wants or put an entry on each user's crontab so that fetchmail runs at a given interval (This is not the same as running fetchmail in daemon mode).

Well i hope this helps.
Back to top
View user's profile Send private message
Roderik
n00b
n00b


Joined: 06 Jun 2002
Posts: 55
Location: Belgium

PostPosted: Mon Apr 05, 2004 11:03 pm    Post subject: Reply with quote

great stuff, but i'm not sure about something

i've set it up like the guide in post 1 describes, with users "only" in courier in the mySQL DB.

Code:

poll pop3.mymail1.com with proto POP3 user "malloc" there with password "lalala" is malloc here options keep warnings 3600


as far as i can gather tis wil deposit the mail from the pop server into the maildir of the "linux user" malloc. On my test system i've got a shell user roderik and in /srv/mailroot/roderik a mail homedir with a .maildir. The two have nothing in common save the login name.

How can i send the mail from the pop mail server to an .maildir in some other location.
_________________
"Never argue with an idiot, they'll drag you down to their level and beat you with experience."
Back to top
View user's profile Send private message
malloc
l33t
l33t


Joined: 19 Sep 2003
Posts: 762

PostPosted: Tue Apr 06, 2004 10:51 am    Post subject: Reply with quote

Fetchmail relies heavily on procmail or any other internal delivery system, so it will simply parse the mail to it and then where it goes is the delivery system business.
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 957
Location: Denmark

PostPosted: Wed Apr 14, 2004 7:46 pm    Post subject: Reply with quote

Roderik wrote:
great stuff, but i'm not sure about something

i've set it up like the guide in post 1 describes, with users "only" in courier in the mySQL DB.
.


i believe that if you want to use pop3 connectors, you will need to have real unix users, in order to have fetchmail run as them, let me know if this helps
_________________
Sandberg Enterprises
Back to top
View user's profile Send private message
gmichels
Guru
Guru


Joined: 20 Jun 2003
Posts: 480
Location: Brazil

PostPosted: Mon May 03, 2004 4:15 am    Post subject: Re: Production mailserver setup, courier imap/smtp/pop3 v1.6 Reply with quote

Redeeman wrote:
MX records
if you have some kind of ugly and deeply annoying isp, like mine (TDC). they block for incoming traffic on port 25
that will break support for incoming mail. but there is a workaround. but luckily the ISP is then providing a MX mailserver to fix this
Workaround for incoming smtp traffic
you need to add a MX record for this, at your nameserver.
i am using a free dyndns, (dyndns.linux.dk)
and then i have to set primary mailserver to my own (redeeman.linux.dk)
and secundary for my MX mailserver that the ISP luckily are providing (backup-mx.inet.tele.dk)
then you have to wait till the nameserver updates (mine does each 10 minutes). and you are ready to get incoming mail.

Would you mind explaining this a little further? My isp blocks incoming connections on port 25, so I am looking for a way to receive mail, but I couldn't understand your solution.

cheers
Back to top
View user's profile Send private message
GurliGebis
Retired Dev
Retired Dev


Joined: 08 Aug 2002
Posts: 509

PostPosted: Mon May 03, 2004 12:23 pm    Post subject: Reply with quote

It is really simple, some ISP's block access to port 25, so for you to be able to recieve emails you have to set your ISP's MX record so it works.
That means that people trying to send you mails will send the email to their mailserver, it will then try to connect to your mailserver which it cannot do, since your ISP is blocking it.
It then tries the next mailserver in the MX list, which in this case is backup-mx.inet.tele.dk .

Not sure if I made it really clear, but you might try contacting your ISP and ask them what you should do.
_________________
Queen Rocks.
Back to top
View user's profile Send private message
gmichels
Guru
Guru


Joined: 20 Jun 2003
Posts: 480
Location: Brazil

PostPosted: Mon May 03, 2004 12:54 pm    Post subject: Reply with quote

I must be missing something really easy, as I can't understand how this setup will get the mail to be delivered to my mail server.

My dyndns domain is michels.dyndns.org, which has an MX record pointing to michels.dyndns.org, where my mailserver is (25 incoming blocked).

Are you telling me if I create a backup MX record pointing to my ISP's mailserver, I can receive my mail? Will the ISP's mailserver relay the mail to my mailserver?
Back to top
View user's profile Send private message
GurliGebis
Retired Dev
Retired Dev


Joined: 08 Aug 2002
Posts: 509

PostPosted: Mon May 03, 2004 1:12 pm    Post subject: Reply with quote

yep
_________________
Queen Rocks.
Back to top
View user's profile Send private message
gmichels
Guru
Guru


Joined: 20 Jun 2003
Posts: 480
Location: Brazil

PostPosted: Mon May 03, 2004 1:37 pm    Post subject: Reply with quote

Ok, so let's hope my ISP really does that :D

Just to be sure, take a look at the setup (virtua.com.br is my ISP):
Code:
# dig mx virtua.com.br

; <<>> DiG 9.2.3 <<>> mx virtua.com.br
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59805
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 3, ADDITIONAL: 5

;; QUESTION SECTION:
;virtua.com.br.                 IN      MX

;; ANSWER SECTION:
virtua.com.br.          3600    IN      MX      10 mail3.globocabo.com.br.
virtua.com.br.          3600    IN      MX      20 mail2.globocabo.com.br.
virtua.com.br.          3600    IN      MX      10 mail1.globocabo.com.br.

;; AUTHORITY SECTION:
virtua.com.br.          3600    IN      NS      ns.embratel.net.br.
virtua.com.br.          3600    IN      NS      dns1.virtua.com.br.
virtua.com.br.          3600    IN      NS      dns2.virtua.com.br.

;; ADDITIONAL SECTION:
mail1.globocabo.com.br. 2402    IN      A       200.231.181.68
mail3.globocabo.com.br. 8658    IN      A       200.231.181.114
mail2.globocabo.com.br. 328     IN      A       200.231.181.97
dns1.virtua.com.br.     3600    IN      A       200.212.223.100
dns2.virtua.com.br.     3600    IN      A       200.212.223.102

;; Query time: 26 msec
;; SERVER: 192.168.0.254#53(192.168.0.254)
;; WHEN: Mon May  3 10:26:44 2004
;; MSG SIZE  rcvd: 255

Code:
# dig mx michels.dyndns.org

; <<>> DiG 9.2.3 <<>> mx michels.dyndns.org
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11439
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 7

;; QUESTION SECTION:
;michels.dyndns.org.            IN      MX

;; ANSWER SECTION:
michels.dyndns.org.     43200   IN      MX      10 mail1.globocabo.com.br.
michels.dyndns.org.     43200   IN      MX      5 michels.dyndns.org.

;; AUTHORITY SECTION:
dyndns.org.             86400   IN      NS      ns3.dyndns.org.
dyndns.org.             86400   IN      NS      ns4.dyndns.org.
dyndns.org.             86400   IN      NS      ns5.dyndns.org.
dyndns.org.             86400   IN      NS      ns1.dyndns.org.
dyndns.org.             86400   IN      NS      ns2.dyndns.org.

;; ADDITIONAL SECTION:
michels.dyndns.org.     60      IN      A       200.185.142.110
mail1.globocabo.com.br. 10501   IN      A       200.231.181.68
ns1.dyndns.org.         86400   IN      A       63.208.196.90
ns2.dyndns.org.         85233   IN      A       209.69.32.137
ns3.dyndns.org.         85233   IN      A       63.209.15.210
ns4.dyndns.org.         85233   IN      A       213.155.150.205
ns5.dyndns.org.         85233   IN      A       63.208.196.91

;; Query time: 211 msec
;; SERVER: 192.168.0.254#53(192.168.0.254)
;; WHEN: Mon May  3 10:35:18 2004
;; MSG SIZE  rcvd: 292

Is that ok?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
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