Linux serverNETWORK ADMINISTRATIONSsmtp server liux

PERFECT LITTLE HOME SERVER [Raspberry Pi 3] PART 2 – MAIL SERVER

Follow me on TWITTER: https://twitter.com/salkohd

This is the part 2 of the tutorial on how to create your own perfect little Raspberry Pi Home Server.

NOTE: You can use this tutorial for any other computer running Debian or Ubuntu.

Topics covered in this video are:

– Postfix 00:00 – 24:20
– Dovecot 24:30
– Roundcube 44:46
– SpamAssassin 56:29
– Dovecot LMTP 1:10:10
– Sieve 1:18:00
– Port forwarding 1:26:58
– Overview of the current progress 1:29:42
– Outlook configuration 1:30:40

Here are SOME of the commands used in the tutorial:
If you want more commands, visit this link:
http://salkohd.com/rpiPSPT2.txt

apt-get update
POSTFIX:
======================================================
apt-get install postfix

cd /etc/postfix/

cp main.cf main.cf.BAK
cp master.cf master.cf.BAK

home_mailbox = Maildir/
mailbox_command =

apt-get install dovecot-common dovecot-imapd

sudo maildirmake.dovecot /etc/skel/Maildir
sudo maildirmake.dovecot /etc/skel/Maildir/.Drafts
sudo maildirmake.dovecot /etc/skel/Maildir/.Sent
sudo maildirmake.dovecot /etc/skel/Maildir/.Spam
sudo maildirmake.dovecot /etc/skel/Maildir/.Trash
sudo maildirmake.dovecot /etc/skel/Maildir/.Templates

sudo cp -r /etc/skel/Maildir /home/USER/
sudo chown -R USER:USER /home/USER/Maildir
sudo chmod -R 700 /home/USER/Maildir

sudo apt-get install telnet

telnet localhost 25

nano /etc/postfix/main.cf

smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination

smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination

/etc/init.d/postfix restart

nano /etc/postfix/helo_access

salkohd.com REJECT Get lost – you’re not who you say you are
mail.salkohd.com REJECT Get lost – you’re not who you say you are

postmap /etc/postfix/helo_access

/etc/init.d/postfix restart

Dovecot:
======================================================
apt-get install dovecot-common dovecot-imapd

nano /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir

nano /etc/postfix/main.cf
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

nano /etc/dovecot/conf.d/10-master.conf
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
}

nano /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no
auth_mechanisms = plain login

adduser testmail
/etc/init.d/postfix restart
/etc/init.d/dovecot restart

echo -ne ‘ 00testmail 00test1234’ | openssl base64

nano /etc/postfix/master.cf
smtps inet n – – – – smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
/etc/init.d/postfix restart

openssl s_client -connect localhost:465 -quiet
openssl s_client -connect localhost:465 -quiet -CApath /etc/ssl/certs

nano /etc/postfix/main.cf
smtpd_tls_auth_only = yes
/etc/init.d/postfix restart

nano /etc/dovecot/conf.d/10-master.conf
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}

nano /etc/dovecot/conf.d/10-ssl.conf
ssl = yes
ssl_protocols = !SSLv2 !SSLv3

Part of this tutorial is based on a very good tutorial by Steve Hobbs:
https://samhobbs.co.uk/raspberry-pi-email-server

source

by Salko

linux smtp server

Leave a Reply

Your email address will not be published. Required fields are marked *