Skip to content

Latest commit

 

History

History

mail

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mail servers

E-mail server factors

  • Transport encryption (TLS on SMTP in&out and IMAP)
  • Forwarding with SRS (Sender Rewriting Scheme)
  • Fetch instead of forwarding
  • Attack mitigation (SMTP vulnerability, authentication)
  • Spam filtering
  • Custom blackhole lists (RBL)
  • Custom whitelisting of hosts (broken mail servers)
  • Monitor IP reputation
  • Apply to whitelists
  • Register to feedback loops
  • Monitor delivery and delivery errors

Transactional email providers

Integrity Mailszolgáltatás (SMTP+IMAP)

Marketing tools

Webmails

http://www.rainloop.net/changelog/

Disposable email address

http://nincsmail.hu/ (inbox and sending)

Problems

Outlook 2013 IMAP fixes

  • Root: "Inbox"
  • To recognize standard folder names delete .pst/.ost file after account setup
  • Fix folder subscription, see /mail/courier-outlook-subscribe-bug.sh (Outlook 2007)

MacOS Mail.app IMAP fixes

Advanced/IMAP Path Prefix: "INBOX"

Open winmail.dat

https://github.com/Yeraze/ytnef

See /repo/debian/pool/main/y/ytnef/

MIME type: application/ms-tnef

Set up Google Apps mailing

https://toolbox.googleapps.com/apps/checkmx/

Online IMAP migration

Email filters

Decode emails

  • Encoded (base64 or QP) headers: conv2047.pl -d
  • Body and attachments: munpack -t
  • Syntax highlight: headers.vim for vim, /input/mc/email.syntax for mcedit
  • Enveloped-data (application/pkcs7-mime): cat smime.p7m | base64 -d | openssl smime -verify -inform DER

Settings

Malware (virus) scanning

  • ClamAV (CCTTS, Safe Browsing)
  • clamav-unofficial-sigs (paid: SecuriteInfo, MalwarePatrol, free: Sanesecurity)
  • clamav.py pythonfilter through pyClamd for Courier MTA

clamav-unofficial-sigs needs 1 GB of memory.

See "Best clamd.conf" in SecuriteInfo FAQ.

Block executables

courier-pythonfilter module: attachments.py

[attachments.py]
blockedPattern = r'^.*\.(ade|adp|bat|chm|cmd|com|cpl|dll|exe|hta|inf|ins|isp|jar|js|jse|lib|lnk|mde|msc|msp|mst|pif|reg|scf|scr|sct|shb|shs|sys|url|xxe|vb|vbe|vbs|vxd|wsc|wsf|wsh)$'

GMail's blocked file types

https://support.google.com/mail/answer/6590

Spamassassin rule

20_gmail-blocked-filetypes.cf

# GMail's blocked file types
ifplugin Mail::SpamAssassin::Plugin::MIMEHeader
mimeheader GMAIL_BLOCKED_ATTACH Content-Type =~ /\.(ADE|ADP|BAT|CHM|CMD|COM|CPL|EXE|HTA|INS|ISP|JAR|JSE|LIB|LNK|MDE|MSC|MSP|MST|PIF|SCR|SCT|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH)/i
mimeheader GMAIL_BLOCKED_ATTACH_CD Content-Disposition =~ /\.(ADE|ADP|BAT|CHM|CMD|COM|CPL|EXE|HTA|INS|ISP|JAR|JSE|LIB|LNK|MDE|MSC|MSP|MST|PIF|SCR|SCT|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH)/i
score GMAIL_BLOCKED_ATTACH 20
score GMAIL_BLOCKED_ATTACH_CD 20
endif

Send all messages in an mbox file to an email address

See mbox_send2.py

Email forwarding (srs)

Build Courier SRS

See /package/couriersrs-jessie.sh

Courier catchall address

http://www.courier-mta.org/makehosteddomains.html

http://www.courier-mta.org/dot-courier.html

Add alias:

@target.tld:  foo

Delivery instructions:

echo "|/pipe/command" > /var/mail/localhost/user/.courier-foo-default

Spamtrap

spamtrap@domain.net:  |/usr/local/bin/multi-stdout.sh "/usr/bin/spamc -4 --learntype=spam --max-size=1048576" "/usr/bin/spamc -4 --reporttype=report --max-size=1048576"
problematic@address.es:  spamtrap@domain.net

NAIH nyilvántartási szám - "Hungarian National Authority for Data Protection and Freedom of Information" registry

NAIH kereső http://www.naih.hu/kereses-az-adatvedelmi-nyilvantartasban.html

Courier kitchen sink (drop incoming messages)

See the description of /etc/courier/aliasdir in man dot-courier DELIVERY INSTRUCTIONS

echo > /etc/courier/aliasdir/.courier-kitchensink

Add alias:

ANY.ADDRESS@ANY.DOMAIN.TLD:  kitchensink@localhost

Courier MTA message processing order on reception

  1. SMTP communication
  2. NOADD*, opt MIME=none
  3. filters
  4. DEFAULTDELIVERY

Courier MTA log analyzer

Courier-analog

Courier as smarthost client

esmtproutes "both MX and A records get looked up"

Test

IMAP PLAIN authentication

D0 CAPABILITY
D1 AUTHENTICATE PLAIN
$(echo -en "\0USERNAME\0PASSWORD" | base64)
D2 LOGOUT

Spamassassin test and email authentication

sudo -u daemon -- spamassassin --test-mode --prefspath=/var/mail/.spamassassin/user_prefs -D < msg.eml

# For specific tests issue
#     man spamassassin-run
sudo -u daemon -- spamassassin --test-mode --prefspath=/var/mail/.spamassassin/user_prefs -D dkim < msg-signed.eml

opendkim -vvv -t msg-signed.eml

Mailserver SSL test

https://ssl-tools.net/

Authentication

SPF (HELO, MAIL FROM:)

Sender ID from Microsoft (From:)

DKIM

DKIM tests

Domain Keys

Deprecated.

ADSP

An optional extension to the DKIM E-mail authentication scheme.

https://unlocktheinbox.com/resources/adsp/

DMARC

Specs: https://datatracker.ietf.org/doc/draft-kucherawy-dmarc-base/?include_text=1

http://www.returnpath.com/solution-content/dmarc-support/what-is-dmarc/

Bulk mail

Headers and Body parts

  • ☀️ ☀️ ☀️ Descriptive From name "Firstname from Company"
  • ☀️ ☀️ Descriptive subject line
  • ☀️ Short preview line at top of the message
  • Link to online version (newsletter archive)
  • Short main header
  • 💡 Sections: image + title + description + call2action, see https://litmus.com/subscribe
  • External resources should be able to load through HTTPS (opening in a HTTPS webmail)
  • 📱 Mobile compatible

Footer

  • Sender's contact details (postal address, phone number)
  • Who (recipient name, email address, why) is subscribed
  • Unsubscribe link
  • Forward to a friend

Email headers

  • List-Unsubscribe: URL (invisible)
  • Precedence: bulk (invisible)
  • Return-Path: bounce@example.com (invisible)
  • Reply-to: reply@example.com (invisible) How to video
  • From: sender@example.com
  • To: recipients@addre.ss
  • bounce X-Autoreply: yes
  • bounce Auto-Submitted: auto-replied

Others

Email templates

Email design

Email tests

HTML content and CSS inlining

Providers

Deliverability

RBL-s (DNSBL)

Check RBL-s

rblcheck

Courier MTA

BLACKLISTS="-block=bl.blocklist.de"

Trendmicro ERS check

wget -qO- --post-data="_method=POST&data[Reputation][ip]=${IP}" https://ers.trendmicro.com/reputations \
    | sed -ne 's;.*<dd>\(.\+\)</dd>.*;\1;p' | tr '\n' ' '

OK response: IP Unlisted in the spam sender list None

Mail server reputation

Register here:

Free e-mail backup server

http://www.junkemailfilter.com/spam/free_mx_backup_service.html