SlideShare a Scribd company logo
1 of 24
But... I like gmail....
●   Privacy concerns...yadda yadda yadda
●   30 years from now, you will want to reread
    those old emails. Will gmail still exist ?
●   This is about Knowledge


                      ← how most
                      people see
                      the Internet

                       How you
                        do →
Can you host your emails at home ?
●   No.
●   At least, not all of it.
●   You need backup SMTP & DNS, SMTP relay on
    a static IP, and a domain name.

●   Cost:
       SMTP relay: ~$20/year (dyn.com)
       Domain: ~$15/year (gandi.net)
       Small (atom) server with 2*2.5” drives: ~$250
Step 1: Sending
  1.apt-get install postfix
  2. echo “yiipyy” | mail -s “I can Haz Mail” julien@linuxwall.info

  3.Have a beer.
  ●   Sending mail is easy, because postfix handles
      the DNS resolutions, queuing and sending.
  ●   But most recipients will reject your mail
      because of your IP reputation.
Feb 9 16:55:01 necto postfix/smtp[2538]: 5174341E26: to=<julienv@aweber.com>,
relay=mail1.aweber.com[207.106.200.39]:25, delay=0.93, delays=0.09/0/0.68/0.16, dsn=5.0.0,
status=bounced (host mail1.aweber.com[207.106.200.39] said: 550 c-68-80-50-
225.hsd1.pa.comcast.net is either part of a dynamic IP range or we have received spam
from this domain. Please see http://www.aweber.com/email-blocked.htm?reason=rdns_id-
1002&ip=68.80.50.225 (in reply to RCPT TO command))
How IP Reputation works
●   Real-time Blackhole List (RBLs) flag dynamic IPs from
    residential ISPs
    –   $ dig +short 225.50.80.68.zen.spamhaus.org
        ●   127.0.0.10
●   See http://www.spamhaus.org/faq/section/DNSBL%20Usage#200
Step 1.1 : Sending through a relay




                                                 Reverse DNS matters:
    In `/etc/postfix/main.cf`
                                             ●
●
                                                 –   $ dig +short sachiel.linuxwall.info
    –   relayhost = sachiel.linuxwall.info           ●   88.191.125.180
                                                 –   $ dig +short -x 88.191.125.180
                                                     ●   sachiel.linuxwall.info.
Step 2: Receiving
●   Buy a domain
●   Declare MX records to point to the public IP(s) of
    the mail server(s)
●   When receiving emails:
    –   You don't have to worry about the IP reputation
        (DNSBL, static vs dynamic IP)
    –   You can change the DNS records as you please (just
        be careful with the TTLs)
    –   You may, or may not, receive a lot of spam/bot traffic
    –   If your MX is configured as an open relay, you're toast
Step 3: Users mailboxes
●   Users are stored in LDAP. Postfix & Dovecot
    query LDAP for each access.
LDIF user definition
dn: cn=Bob Kelso,ou=people,dc=linuxwall,dc=info
uid: bob
uidNumber: 10002
                                    # ldapadd -h 127.0.0.1 -p 389
gidNumber: 998
                                    -D "cn=admin,dc=linuxwall,dc=info"
sn: Kelso
                                    -W -f /root/bob.ldif
cn: Bob Kelso
homeDirectory: /dev/null            Enter LDAP Password:
objectClass: posixAccount           adding new entry "cn=Bob
                                    Kelso,ou=people,dc=linuxwall,dc=info"
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
mail: bob@linuxwall.info
userPassword: {SSHA}MJ.....RR74
Postfix LDAP lookups
•   For Incoming email only (not local user auth)


    # grep ldap /etc/postfix/main.cf
    local_recipient_maps = ldap:/etc/postfix/ldap_recipient_map.cf,
    $alias_maps


    # cat /etc/postfix/ldap_recipient_map.cf
    server_host = localhost
    server_port = 389
    search_base = ou=people,dc=linuxwall,dc=info
    query_filter = (mail=%s)
    result_attribute = mail
User Authentication
             (Postfix & Dovecot)
●   LDAP stores hashed passwords (SSHA)
●   Dovecot connects to LDAP
●   Postfix connects to Dovecot
SPAM !
               Step 1: Postscreen




●   $ nc 192.168.1.249 25
    220-Welcome. Please wait to be seated
    220 necto.localdomain ESMTP Postfix (Debian/GNU)
Postscreen enforces clean SMTP
      and blocks everything else, such as bots
# Postcreen configuration
postscreen_access_list = cidr:/etc/postfix/postscreen_access.cidr
postscreen_blacklist_action = enforce

                                    postscreen_greet_banner = Bienvenue et merci
postscreen_dnsbl_sites =            d'attendre qu'on vous assigne une place
                                    postscreen_greet_action = enforce
  zen.spamhaus.org*3                postscreen_pipelining_enable = yes
                                    postscreen_pipelining_action = enforce
  dnsbl.njabl.org*2                 postscreen_non_smtp_command_enable = yes
                                    postscreen_non_smtp_command_action = enforce
  bl.spameatingmonkey.net*2         postscreen_bare_newline_enable = yes
                                    postscreen_bare_newline_action = enforce
  dnsbl.ahbl.org
  bl.spamcop.net
  dnsbl.sorbs.net
postscreen_dnsbl_threshold = 3
postscreen_dnsbl_action = enforce
Plenty of logs, to generate maps from
   https://github.com/jvehent/Postscreen-Stats
SPAM !
                  Step 2: DSPAM
 http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:dspam
●   Breaks down emails into tokens, and assigns
    a spam probability to each token
    “Heute Abend war ich mit meiner Freundin im
    Kino und habe viel gelacht”
TOKEN: ‘mit’ CRC: 5158417007107899392
TOKEN: ‘ich+mit’ CRC: 5158416839735805488
TOKEN: ‘war+#+mit’ CRC: 15707817493435847227
TOKEN: ‘war+ich+mit’ CRC: 6905336139605378569
TOKEN: ‘Abend+#+#+mit’ CRC: 5482652074219693289
TOKEN: ‘Abend+#+ich+mit’ CRC: 2006454003823721484
DSPAM doesn't accept or drop
it simply calculates a probability
DSPAM doesn't accept or drop
   it simply calculates a probability
X-DSPAM-Result: Spam
X-DSPAM-Processed: Fri Feb 8 15:08:25 2013
X-DSPAM-Confidence: 0.9984
X-DSPAM-Improbability: 1 in 64201 chance of being ham
X-DSPAM-Probability: 1.0000
X-DSPAM-Signature: 51155b39130198027420682
X-DSPAM-Factors: 15,
  com+ATTENDEE, 0.99872, SEQUENCE+0, 0.99872, RSVP+TRUE, 0.99872,
BEGIN+#+DTSTART, 0.99867, VCALENDAR+PRODID, 0.99867,
BEGIN+#+PRODID, 0.99867, TRUE+mailto, 0.99862, X+#+CDO, 0.99862,
X+#+#+INTENDEDSTATUS, 0.99862, mailto+#+#+#+ATTENDEE, 0.99862,
RSVP+#+mailto, 0.99862, MICROSOFT+#+INTENDEDSTATUS, 0.99862,
X+MICROSOFT, 0.99862, CDO+INTENDEDSTATUS,
0.99862,TRUE+#+#+#+com, 0.99862
Security: SSL/TLS everywhere
●   STARTTLS upgrades an existing TCP
    connections to SSL
●   Most MX support it, inbound and outbound
Security: SSL/TLS everywhere
# STARTTLS client options
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtp_tls_loglevel = 1


# TLS server options
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/postfix/certs/smtp.key
smtpd_tls_cert_file = /etc/postfix/certs/smtp.pem
smtpd_tls_CAfile = /etc/postfix/certs/ca.crt
smtpd_tls_mandatory_protocols = !SSLv2
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5
Security: DKIM
   http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:postfix:dkimproxy
DKIM-Signature: v=1; a=rsa-sha256;c=relaxed/relaxed;d=gmail.com;s=gamma;
h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:
content-type;bh=+h+GzK7..........=
Surviving outages with a backup MX
# postconf -v maximal_queue_lifetime
maximal_queue_lifetime = 5d
Configuration is documented at
http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:nectux

More Related Content

What's hot

Dynamic Domain Name System
Dynamic Domain Name SystemDynamic Domain Name System
Dynamic Domain Name SystemRajan Kumar
 
What is a domain name system(dns)?
What is a domain name system(dns)?What is a domain name system(dns)?
What is a domain name system(dns)?Abhishek Mitra
 
Linux networking commands
Linux networking commandsLinux networking commands
Linux networking commandsSayed Ahmed
 
Presentation aix basic
Presentation   aix basicPresentation   aix basic
Presentation aix basicxKinAnx
 
Dynomite at Erlang Factory
Dynomite at Erlang FactoryDynomite at Erlang Factory
Dynomite at Erlang Factorymoonpolysoft
 
DNS
DNSDNS
DNSFTC
 
Presentation on dns
Presentation on dnsPresentation on dns
Presentation on dnsAnand Grewal
 
Domain name service
Domain name serviceDomain name service
Domain name serviceishapadhy
 
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...Mohd Khairulazam
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeQasim Khawaja
 
Drush - More Beer, Less Effort
Drush - More Beer, Less EffortDrush - More Beer, Less Effort
Drush - More Beer, Less EffortRuben Teijeiro
 

What's hot (20)

Dynamic Domain Name System
Dynamic Domain Name SystemDynamic Domain Name System
Dynamic Domain Name System
 
What is a domain name system(dns)?
What is a domain name system(dns)?What is a domain name system(dns)?
What is a domain name system(dns)?
 
Dns server
Dns serverDns server
Dns server
 
Ubuntu For Intranet Services
Ubuntu For Intranet ServicesUbuntu For Intranet Services
Ubuntu For Intranet Services
 
Linux networking commands
Linux networking commandsLinux networking commands
Linux networking commands
 
DNS
DNSDNS
DNS
 
Presentation aix basic
Presentation   aix basicPresentation   aix basic
Presentation aix basic
 
Dynomite at Erlang Factory
Dynomite at Erlang FactoryDynomite at Erlang Factory
Dynomite at Erlang Factory
 
DNS
DNSDNS
DNS
 
Presentation on dns
Presentation on dnsPresentation on dns
Presentation on dns
 
Domain name service
Domain name serviceDomain name service
Domain name service
 
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
Mail server on Ubuntu Server 12.04 (Postfix, Courier, SSL, SpamAssassin, Clam...
 
2011 - DDU - Intro to Drush
2011 - DDU - Intro to Drush2011 - DDU - Intro to Drush
2011 - DDU - Intro to Drush
 
Linux and DNS Server
Linux and DNS ServerLinux and DNS Server
Linux and DNS Server
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
 
Dns2
Dns2Dns2
Dns2
 
M7 - Manual
M7 - ManualM7 - Manual
M7 - Manual
 
Drush - More Beer, Less Effort
Drush - More Beer, Less EffortDrush - More Beer, Less Effort
Drush - More Beer, Less Effort
 
Message
MessageMessage
Message
 
What is dns
What is dnsWhat is dns
What is dns
 

Viewers also liked

Total playing facilties in kp 26 1.6.2013
Total playing facilties in kp 26 1.6.2013Total playing facilties in kp 26 1.6.2013
Total playing facilties in kp 26 1.6.2013hayat alishah
 
12 сервисов для увеличения продаж в интернет-магазине
12 сервисов для увеличения продаж в интернет-магазине12 сервисов для увеличения продаж в интернет-магазине
12 сервисов для увеличения продаж в интернет-магазинеVladyslava Rykova
 
Прайс-агрегаторы: правила эффективной работы
Прайс-агрегаторы: правила эффективной работыПрайс-агрегаторы: правила эффективной работы
Прайс-агрегаторы: правила эффективной работыVladyslava Rykova
 
The quest for the Entrepreneurial North Star
The quest for the Entrepreneurial North StarThe quest for the Entrepreneurial North Star
The quest for the Entrepreneurial North StarRuta Aidis
 
Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...
Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...
Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...ZSL Biodiversity & Palm Oil Platform
 
Маркетинг образовательных услуг
Маркетинг образовательных услугМаркетинг образовательных услуг
Маркетинг образовательных услугVladyslava Rykova
 
The social media report state of the media - q3 2011
The social media report   state of the media - q3 2011The social media report   state of the media - q3 2011
The social media report state of the media - q3 2011Harsh Wardhan Dave
 
IEEE IRI 16 - Clustering Web Pages based on Structure and Style Similarity
IEEE IRI 16 - Clustering Web Pages based on Structure and Style SimilarityIEEE IRI 16 - Clustering Web Pages based on Structure and Style Similarity
IEEE IRI 16 - Clustering Web Pages based on Structure and Style SimilarityThamme Gowda
 
Русский север, наследие (2010 год)
Русский север, наследие (2010 год)Русский север, наследие (2010 год)
Русский север, наследие (2010 год)Балтийская Муза
 
Central women committee 1
Central women committee 1Central women committee 1
Central women committee 1hayat alishah
 
サービスと共に成長するチームとアーキテクチャ
サービスと共に成長するチームとアーキテクチャサービスと共に成長するチームとアーキテクチャ
サービスと共に成長するチームとアーキテクチャShinichiro Suzuki
 
Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468
Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468
Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468ZSL Biodiversity & Palm Oil Platform
 
Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...
Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...
Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...ZSL Biodiversity & Palm Oil Platform
 
Контекстная реклама. Основы AdWords
Контекстная реклама. Основы AdWordsКонтекстная реклама. Основы AdWords
Контекстная реклама. Основы AdWordsVladyslava Rykova
 

Viewers also liked (20)

Total playing facilties in kp 26 1.6.2013
Total playing facilties in kp 26 1.6.2013Total playing facilties in kp 26 1.6.2013
Total playing facilties in kp 26 1.6.2013
 
12 сервисов для увеличения продаж в интернет-магазине
12 сервисов для увеличения продаж в интернет-магазине12 сервисов для увеличения продаж в интернет-магазине
12 сервисов для увеличения продаж в интернет-магазине
 
Relationship movies
Relationship moviesRelationship movies
Relationship movies
 
Ped brochure
Ped brochurePed brochure
Ped brochure
 
Прайс-агрегаторы: правила эффективной работы
Прайс-агрегаторы: правила эффективной работыПрайс-агрегаторы: правила эффективной работы
Прайс-агрегаторы: правила эффективной работы
 
Ankit testing 17july (1)
Ankit testing 17july (1)Ankit testing 17july (1)
Ankit testing 17july (1)
 
The quest for the Entrepreneurial North Star
The quest for the Entrepreneurial North StarThe quest for the Entrepreneurial North Star
The quest for the Entrepreneurial North Star
 
Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...
Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...
Session 2-1-fahmuddin-agus-reducing-ghg-emissions-from-land-use-change-for-oi...
 
Маркетинг образовательных услуг
Маркетинг образовательных услугМаркетинг образовательных услуг
Маркетинг образовательных услуг
 
The social media report state of the media - q3 2011
The social media report   state of the media - q3 2011The social media report   state of the media - q3 2011
The social media report state of the media - q3 2011
 
Detector movemento cdm 180
Detector movemento cdm 180Detector movemento cdm 180
Detector movemento cdm 180
 
Your Financial Health
Your Financial HealthYour Financial Health
Your Financial Health
 
IEEE IRI 16 - Clustering Web Pages based on Structure and Style Similarity
IEEE IRI 16 - Clustering Web Pages based on Structure and Style SimilarityIEEE IRI 16 - Clustering Web Pages based on Structure and Style Similarity
IEEE IRI 16 - Clustering Web Pages based on Structure and Style Similarity
 
Русский север, наследие (2010 год)
Русский север, наследие (2010 год)Русский север, наследие (2010 год)
Русский север, наследие (2010 год)
 
Central women committee 1
Central women committee 1Central women committee 1
Central women committee 1
 
サービスと共に成長するチームとアーキテクチャ
サービスと共に成長するチームとアーキテクチャサービスと共に成長するチームとアーキテクチャ
サービスと共に成長するチームとアーキテクチャ
 
Основы SEO
Основы SEOОсновы SEO
Основы SEO
 
Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468
Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468
Session 3-2-christopher-stewart-maintaining-hcvs-in-oil-palm-landscapes-1468
 
Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...
Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...
Session 6-1-john-laidlow-responsible-investment-as-a-tool-to-guide-sustainabl...
 
Контекстная реклама. Основы AdWords
Контекстная реклама. Основы AdWordsКонтекстная реклама. Основы AdWords
Контекстная реклама. Основы AdWords
 

Similar to DIY eMail@Home

Massive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on RailsMassive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on Railsibelmonte
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Composeraccoony
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network IssuesApcera
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Mail server configuration
Mail server configurationMail server configuration
Mail server configurationchacheng oo
 
A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75Babak Farrokhi
 
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)Babak Farrokhi
 
Scaling Twitter
Scaling TwitterScaling Twitter
Scaling TwitterBlaine
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758davidblum
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studiodeWeb
 
Abusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itAbusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itBenjamin Delpy
 
Abusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get itAbusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get itE Hacking
 
Sharing your-internet-connection-on-linux
Sharing your-internet-connection-on-linuxSharing your-internet-connection-on-linux
Sharing your-internet-connection-on-linuxjasembo
 
TLS, SPF, DKIM, DMARC, authenticated email
TLS, SPF, DKIM, DMARC, authenticated emailTLS, SPF, DKIM, DMARC, authenticated email
TLS, SPF, DKIM, DMARC, authenticated emailrinnocente
 
Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayCosimo Streppone
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloudTahsin Hasan
 
NSC #2 - Challenge Solution
NSC #2 - Challenge SolutionNSC #2 - Challenge Solution
NSC #2 - Challenge SolutionNoSuchCon
 
Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Otto Kekäläinen
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїТарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїLEDC 2016
 
Active Https Cookie Stealing
Active Https Cookie StealingActive Https Cookie Stealing
Active Https Cookie StealingSecurityTube.Net
 

Similar to DIY eMail@Home (20)

Massive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on RailsMassive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on Rails
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network Issues
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Mail server configuration
Mail server configurationMail server configuration
Mail server configuration
 
A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75A curious case of broken dns responses - RIPE75
A curious case of broken dns responses - RIPE75
 
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
A curious case of broken DNS responses (Coloclue Presents - Nov 2019)
 
Scaling Twitter
Scaling TwitterScaling Twitter
Scaling Twitter
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studio
 
Abusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itAbusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get it
 
Abusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get itAbusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get it
 
Sharing your-internet-connection-on-linux
Sharing your-internet-connection-on-linuxSharing your-internet-connection-on-linux
Sharing your-internet-connection-on-linux
 
TLS, SPF, DKIM, DMARC, authenticated email
TLS, SPF, DKIM, DMARC, authenticated emailTLS, SPF, DKIM, DMARC, authenticated email
TLS, SPF, DKIM, DMARC, authenticated email
 
Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard Way
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
NSC #2 - Challenge Solution
NSC #2 - Challenge SolutionNSC #2 - Challenge Solution
NSC #2 - Challenge Solution
 
Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїТарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
 
Active Https Cookie Stealing
Active Https Cookie StealingActive Https Cookie Stealing
Active Https Cookie Stealing
 

Recently uploaded

REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfREFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfssusere8ea60
 
Ahmedabad Escorts Girl Services For Male Tourists 9537192988
Ahmedabad Escorts Girl Services For Male Tourists 9537192988Ahmedabad Escorts Girl Services For Male Tourists 9537192988
Ahmedabad Escorts Girl Services For Male Tourists 9537192988oolala9823
 
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改atducpo
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan
 
Postal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utilisePostal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utiliseccsubcollector
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)oannq
 
social media chat application main ppt.pptx
social media chat application main ppt.pptxsocial media chat application main ppt.pptx
social media chat application main ppt.pptxsprasad829829
 
办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭o8wvnojp
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxShubham Rawat
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ EscortsDelhi Escorts Service
 
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...ur8mqw8e
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证kbdhl05e
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfJess Walker
 
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service DhuleDhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhulesrsj9000
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 

Recently uploaded (20)

REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfREFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
 
Ahmedabad Escorts Girl Services For Male Tourists 9537192988
Ahmedabad Escorts Girl Services For Male Tourists 9537192988Ahmedabad Escorts Girl Services For Male Tourists 9537192988
Ahmedabad Escorts Girl Services For Male Tourists 9537192988
 
young Call girls in Neb Sarai 🔝 9953056974 🔝 Delhi escort Service
young Call girls in Neb Sarai 🔝 9953056974 🔝 Delhi escort Serviceyoung Call girls in Neb Sarai 🔝 9953056974 🔝 Delhi escort Service
young Call girls in Neb Sarai 🔝 9953056974 🔝 Delhi escort Service
 
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
 
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
 
Postal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utilisePostal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utilise
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)
 
social media chat application main ppt.pptx
social media chat application main ppt.pptxsocial media chat application main ppt.pptx
social media chat application main ppt.pptx
 
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road GurgaonCheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
 
办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptx
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
 
🔝9953056974🔝!!-YOUNG BOOK model Call Girls In Aerocity Delhi Escort service
🔝9953056974🔝!!-YOUNG BOOK model Call Girls In Aerocity Delhi Escort service🔝9953056974🔝!!-YOUNG BOOK model Call Girls In Aerocity Delhi Escort service
🔝9953056974🔝!!-YOUNG BOOK model Call Girls In Aerocity Delhi Escort service
 
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
 
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service DhuleDhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhule
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 

DIY eMail@Home

  • 1.
  • 2. But... I like gmail.... ● Privacy concerns...yadda yadda yadda ● 30 years from now, you will want to reread those old emails. Will gmail still exist ? ● This is about Knowledge ← how most people see the Internet How you do →
  • 3. Can you host your emails at home ? ● No. ● At least, not all of it. ● You need backup SMTP & DNS, SMTP relay on a static IP, and a domain name. ● Cost: SMTP relay: ~$20/year (dyn.com) Domain: ~$15/year (gandi.net) Small (atom) server with 2*2.5” drives: ~$250
  • 4.
  • 5. Step 1: Sending 1.apt-get install postfix 2. echo “yiipyy” | mail -s “I can Haz Mail” julien@linuxwall.info 3.Have a beer. ● Sending mail is easy, because postfix handles the DNS resolutions, queuing and sending. ● But most recipients will reject your mail because of your IP reputation. Feb 9 16:55:01 necto postfix/smtp[2538]: 5174341E26: to=<julienv@aweber.com>, relay=mail1.aweber.com[207.106.200.39]:25, delay=0.93, delays=0.09/0/0.68/0.16, dsn=5.0.0, status=bounced (host mail1.aweber.com[207.106.200.39] said: 550 c-68-80-50- 225.hsd1.pa.comcast.net is either part of a dynamic IP range or we have received spam from this domain. Please see http://www.aweber.com/email-blocked.htm?reason=rdns_id- 1002&ip=68.80.50.225 (in reply to RCPT TO command))
  • 6. How IP Reputation works ● Real-time Blackhole List (RBLs) flag dynamic IPs from residential ISPs – $ dig +short 225.50.80.68.zen.spamhaus.org ● 127.0.0.10 ● See http://www.spamhaus.org/faq/section/DNSBL%20Usage#200
  • 7. Step 1.1 : Sending through a relay Reverse DNS matters: In `/etc/postfix/main.cf` ● ● – $ dig +short sachiel.linuxwall.info – relayhost = sachiel.linuxwall.info ● 88.191.125.180 – $ dig +short -x 88.191.125.180 ● sachiel.linuxwall.info.
  • 8. Step 2: Receiving ● Buy a domain ● Declare MX records to point to the public IP(s) of the mail server(s) ● When receiving emails: – You don't have to worry about the IP reputation (DNSBL, static vs dynamic IP) – You can change the DNS records as you please (just be careful with the TTLs) – You may, or may not, receive a lot of spam/bot traffic – If your MX is configured as an open relay, you're toast
  • 9.
  • 10. Step 3: Users mailboxes ● Users are stored in LDAP. Postfix & Dovecot query LDAP for each access.
  • 11. LDIF user definition dn: cn=Bob Kelso,ou=people,dc=linuxwall,dc=info uid: bob uidNumber: 10002 # ldapadd -h 127.0.0.1 -p 389 gidNumber: 998 -D "cn=admin,dc=linuxwall,dc=info" sn: Kelso -W -f /root/bob.ldif cn: Bob Kelso homeDirectory: /dev/null Enter LDAP Password: objectClass: posixAccount adding new entry "cn=Bob Kelso,ou=people,dc=linuxwall,dc=info" objectClass: top objectClass: inetOrgPerson objectClass: organizationalPerson objectClass: person mail: bob@linuxwall.info userPassword: {SSHA}MJ.....RR74
  • 12. Postfix LDAP lookups • For Incoming email only (not local user auth) # grep ldap /etc/postfix/main.cf local_recipient_maps = ldap:/etc/postfix/ldap_recipient_map.cf, $alias_maps # cat /etc/postfix/ldap_recipient_map.cf server_host = localhost server_port = 389 search_base = ou=people,dc=linuxwall,dc=info query_filter = (mail=%s) result_attribute = mail
  • 13. User Authentication (Postfix & Dovecot) ● LDAP stores hashed passwords (SSHA) ● Dovecot connects to LDAP ● Postfix connects to Dovecot
  • 14. SPAM ! Step 1: Postscreen ● $ nc 192.168.1.249 25 220-Welcome. Please wait to be seated 220 necto.localdomain ESMTP Postfix (Debian/GNU)
  • 15. Postscreen enforces clean SMTP and blocks everything else, such as bots # Postcreen configuration postscreen_access_list = cidr:/etc/postfix/postscreen_access.cidr postscreen_blacklist_action = enforce postscreen_greet_banner = Bienvenue et merci postscreen_dnsbl_sites = d'attendre qu'on vous assigne une place postscreen_greet_action = enforce zen.spamhaus.org*3 postscreen_pipelining_enable = yes postscreen_pipelining_action = enforce dnsbl.njabl.org*2 postscreen_non_smtp_command_enable = yes postscreen_non_smtp_command_action = enforce bl.spameatingmonkey.net*2 postscreen_bare_newline_enable = yes postscreen_bare_newline_action = enforce dnsbl.ahbl.org bl.spamcop.net dnsbl.sorbs.net postscreen_dnsbl_threshold = 3 postscreen_dnsbl_action = enforce
  • 16. Plenty of logs, to generate maps from https://github.com/jvehent/Postscreen-Stats
  • 17. SPAM ! Step 2: DSPAM http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:dspam ● Breaks down emails into tokens, and assigns a spam probability to each token “Heute Abend war ich mit meiner Freundin im Kino und habe viel gelacht” TOKEN: ‘mit’ CRC: 5158417007107899392 TOKEN: ‘ich+mit’ CRC: 5158416839735805488 TOKEN: ‘war+#+mit’ CRC: 15707817493435847227 TOKEN: ‘war+ich+mit’ CRC: 6905336139605378569 TOKEN: ‘Abend+#+#+mit’ CRC: 5482652074219693289 TOKEN: ‘Abend+#+ich+mit’ CRC: 2006454003823721484
  • 18. DSPAM doesn't accept or drop it simply calculates a probability
  • 19. DSPAM doesn't accept or drop it simply calculates a probability X-DSPAM-Result: Spam X-DSPAM-Processed: Fri Feb 8 15:08:25 2013 X-DSPAM-Confidence: 0.9984 X-DSPAM-Improbability: 1 in 64201 chance of being ham X-DSPAM-Probability: 1.0000 X-DSPAM-Signature: 51155b39130198027420682 X-DSPAM-Factors: 15, com+ATTENDEE, 0.99872, SEQUENCE+0, 0.99872, RSVP+TRUE, 0.99872, BEGIN+#+DTSTART, 0.99867, VCALENDAR+PRODID, 0.99867, BEGIN+#+PRODID, 0.99867, TRUE+mailto, 0.99862, X+#+CDO, 0.99862, X+#+#+INTENDEDSTATUS, 0.99862, mailto+#+#+#+ATTENDEE, 0.99862, RSVP+#+mailto, 0.99862, MICROSOFT+#+INTENDEDSTATUS, 0.99862, X+MICROSOFT, 0.99862, CDO+INTENDEDSTATUS, 0.99862,TRUE+#+#+#+com, 0.99862
  • 20. Security: SSL/TLS everywhere ● STARTTLS upgrades an existing TCP connections to SSL ● Most MX support it, inbound and outbound
  • 21. Security: SSL/TLS everywhere # STARTTLS client options smtp_use_tls = yes smtp_tls_note_starttls_offer = yes smtp_tls_loglevel = 1 # TLS server options smtpd_tls_security_level = may smtpd_tls_auth_only = yes smtpd_tls_key_file = /etc/postfix/certs/smtp.key smtpd_tls_cert_file = /etc/postfix/certs/smtp.pem smtpd_tls_CAfile = /etc/postfix/certs/ca.crt smtpd_tls_mandatory_protocols = !SSLv2 smtpd_tls_mandatory_ciphers = high smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5
  • 22. Security: DKIM http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:postfix:dkimproxy DKIM-Signature: v=1; a=rsa-sha256;c=relaxed/relaxed;d=gmail.com;s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to: content-type;bh=+h+GzK7..........=
  • 23. Surviving outages with a backup MX # postconf -v maximal_queue_lifetime maximal_queue_lifetime = 5d
  • 24. Configuration is documented at http://wiki.linuxwall.info/doku.php/en:ressources:dossiers:nectux