amuck-landowner

Running your own mail server

rm_

New Member
Added SPF and DKIM to the tutorials. Later just for the sake of having it.
Don't overcomplicate it, was already too much with all the greylisting/filtering, people are just going to glance over and decide, "nah this is too difficult and time-consuming, guess I'm staying with GMail". What's wrong with just showing how to get basic postfix+dovecot running, and all the extra stuff as separate tutorials? Also for example I don't even use any spam filtering on the server, just got a Bayesian plugin for my mail client (Claws-mail), works perfectly, and worlds simpler to set up and use.
 
Last edited by a moderator:

wlanboy

Content Contributer
Don't overcomplicate it, was already too much with all the greylisting/filtering, people are just going to glance over and decide, "nah this is too difficult and time-consuming, guess I'm staying with GMail". What's wrong with just showing how to get basic postfix+dovecot running, and all the extra stuff as separate tutorials? Also for example I don't even use any spam filtering on the server, just got a Bayesian plugin for my mail client (Claws-mail), works perfectly, and worlds simpler to set up and use.
I was thinking about splitting the tutorials too, but it is easier to maintain this topic in one complete list of todos.

If you have to open 10 posts to see what you can do / should do, the reader can easily lose track. It might look difficult too if I say "please read this 10 threads in this order and afterwards you know what you have to think about".

This is the main reason why I am updating my first post every week on each tutorial. Each comment and suggestion is used to make my tutorials better. No one should have to read through all the pages to see if the original post is still up to date.

I have now marked all things that you do not need as OPTIONAL.

But all steps should stay in this tutorial because everyone reading through it does have a chance to say "hey this feature is cool - I take the extra work for it".
 

peterw

New Member
Great tutorial. I added a rule on maildrop to move all spam mails to a spam folder.

Code:
/etc/courier/maildroprc

if ( /^X-Spam-Flag: YES/ )
{
to “Maildir/.Spam”
}
 

drmike

100% Tier-1 Gogent
Great work and thanks for updating the original tutorial/how to.

Eventually, I'll get this tested.  Time is a luxury currently.
 

HDPIXEL

New Member
Can you add notes or any additional configuration for using this tutorial with multiple domains on the same server?  Thank you so much for this.
 

wlanboy

Content Contributer
Can you add notes or any additional configuration for using this tutorial with multiple domains on the same server?  Thank you so much for this.
Depends on the stuff you want to do.

If you have different users per domain you have to setup vitual mapping. This will be added to the tutorial later.

If you just want to add a second domain following steps have to be done:

  1. Add MX, CNAME, SPF records to second domain (with the same ips of the mailserver)
  2. Edit the file /etc/postfix/main.cf
    And add the additional domains/subdomains to the mydestination line. Like:

mydestination = domain.com, subdomain.domain.com, domain.net, subdomain.domain.net

Keep in mind that this setup have some drawbacks. Because [email protected] and [email protected] ends up into the same mailbox. Because we do not have a domain based mapping (like virtual mappings have).

PS:


Cannot edit the original post so I have to add this here.
 

drmike

100% Tier-1 Gogent
Thanks for the additional info on multiple domains and willingness to append the original tutorial.

I'll ask about the post editing again. Not sufficient as-is where you and others edit/append useful information to their original post.
 

blergh

New Member
Verified Provider
Don't overcomplicate it, was already too much with all the greylisting/filtering, people are just going to glance over and decide, "nah this is too difficult and time-consuming, guess I'm staying with GMail". What's wrong with just showing how to get basic postfix+dovecot running, and all the extra stuff as separate tutorials? Also for example I don't even use any spam filtering on the server, just got a Bayesian plugin for my mail client (Claws-mail), works perfectly, and worlds simpler to set up and use.
Overcomplicate it? You sir are an idiot if you think DKIM/SPF is "overcomplicating it". If you are going to setup and run your own mail, at least do it right. Cutting corners is just going to make your service run like shit.
 

acd

New Member
I often disagree with blergh, but this time, he is absolutely right. DKIM and SPF has been made so easy to install on debian, you can do it in about 10 minutes. This guide elucidates how easy the process is. Granted, it could be made easier if debian's post-config script auto-installed into postfix's filter chains, but we can't have everything for free.

https://kura.io/2011/09/17/postfix-dk-dkim-spf/

Please configure your domains with spf records and in it, please use -all (not ~all). Reduce spam for everyone.

best regards,

-tw
 
Last edited by a moderator:

HalfEatenPie

The Irrational One
Retired Staff
Depends on the stuff you want to do.

If you have different users per domain you have to setup vitual mapping. This will be added to the tutorial later.

If you just want to add a second domain following steps have to be done:

  1. Add MX, CNAME, SPF records to second domain (with the same ips of the mailserver)
  2. Edit the file /etc/postfix/main.cf
    And add the additional domains/subdomains to the mydestination line. Like:

mydestination = domain.com, subdomain.domain.com, domain.net, subdomain.domain.net

Keep in mind that this setup have some drawbacks. Because [email protected] and [email protected] ends up into the same mailbox. Because we do not have a domain based mapping (like virtual mappings have).

PS:


Cannot edit the original post so I have to add this here.
I did a pretty crappy edit to the main post.  let me know if I should fix it up differently.  Thanks for this fantastic tutorial buddy! :)
 

rm_

New Member
You sir are an idiot if you think DKIM/SPF is "overcomplicating it". If you are going to setup and run your own mail, at least do it right. Cutting corners is just going to make your service run like shit.
Hello!

Yes, DKIM is some silly crap invented by Yahoo for no good reason, I completely ignore it.

SPF is an extravagancy you can bother with "to feel good about yourself" if you have too much free time, but in reality no one cares about SPF anyway, and you can not practically set hardfails either, since it breaks too much stuff such as forwarding.

And yes, both are unnecessary for a basic mail server. The principal thing to do is to ensure your IP is not in RBLs (can use http://bgp.he.net/ for that, it can check 51 RBLs automatically). Other than that, yes, DKIM and SPF are awesome-on-paper, pie-in-the sky ideas that (unfortunately?)went exactly nowhere in the real world.
 
Last edited by a moderator:

sleddog

New Member
Don't overcomplicate it, was already too much with all the greylisting/filtering, people are just going to glance over and decide, "nah this is too difficult and time-consuming, guess I'm staying with GMail". What's wrong with just showing how to get basic postfix+dovecot running, and all the extra stuff as separate tutorials? Also for example I don't even use any spam filtering on the server, just got a Bayesian plugin for my mail client (Claws-mail), works perfectly, and worlds simpler to set up and use.
I agree with this. Mail setup should be modular. First, the core setup that gets mail flowing, then the 'addons'.

Each addon needs to be evaluated and an informed decision made as to whether or not it appropriate or required.

The newbie mail admin really needs to understand how all the components interact. Simply copying/pasting commands and configurations is not only confusing but leads to problems down the road, when something breaks and he/she has no idea how to fix it.
 

wlanboy

Content Contributer
I did a pretty crappy edit to the main post.  let me know if I should fix it up differently.  Thanks for this fantastic tutorial buddy! :)
Thank you. Maybe you should write your name.

"HEP" is quite short...

I agree with this. Mail setup should be modular. First, the core setup that gets mail flowing, then the 'addons'.
Totally agree.

I have added optional tasks out of this reason.

Because email servers can have a lot of features like:

  • marking spam
  • graylisting
  • virus scanning
  • virtual mappings
  • etc
I will mark every step that is just adding a feature as OPTIONAL.

So let's start with the preparations:
 

peterw

New Member
how can you prevent your emails going gmail spam folder?
  1. Don't send spam
  2. Don't use dynmaic ips for sending emails
  3. Remove your ip from spam blocklists
  4. Configure rDNS and MX
  5. Create SPF
  6. Send all messages from the same ip (per domain)
  7. Sign email with domain keys or DKIM
  8. If you mass email add a list-unsubscribe header
 

grayfuz

New Member
thanks.. i already did all of that but still my emails are going to gmail spam folder. any more suggestions?
 

Aldryic C'boas

The Pony
If you have this running on a VM, it's very likely that Google has already greylisted the provider's IP ranges.  Safest bet is to contact Google directly, explain exactly what your mail server is used for (personal, mass, etc), and request a whitelisting for your assigned IP/domain.  If your provider offers SWIP, having the assigned IPs SWIP'd to your name will also help.
 
Top
amuck-landowner