Secondary Mail

sketch > win > Backup MX (secondary mail server)

http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup

General dovecot (imap) + postfix (smtp) guide:
http://bsdbox.co/2014/01/28/mail-server-postfix-dovecot-on-freebsd/

Ez eleg jonak tunik:
http://www.linuxpcfix.com/how-to-set-up-a-postfix-mailserver-as-a-backup-mx-mail-exchanger/

Postfix + Active Directory
http://tech.sid3windr.be/2014/04/setting-up-a-postfix-smtp-relay-with-active-directory-authentication/

Unable to resolve host (sudo parancsnal)

Az /etc/hostname -bol atmasoljuk a "my-machine" nevet az /etc/hosts fajlba:

127.0.0.1  mail2.XXX.xxx

Adduser, disable root

ubuntu 14.04 kivalaszt, belep

apt-get update; apt-get upgrade
adduser XXX
su XXX
# grant root permission
visudo 
# lama    ALL=(ALL:ALL) ALL
# disable root login via ssh
sudo vi /etc/ssh/sshd_config # PermitRootLogin no
# disable local root login
sudo passwd -l root
sudo apt-get install vim # stop this vi nonsense

links:
basic user management
initial server setup

mc

sudo apt-get install mc

Postfix, MX backup

sudo apt-get install postfix
sudo vi /etc/main.cf
smtpd_banner = $myhostname Microsoft ESMTP MAIL Service, Version: 6.0.3490.675

# local new email notification
biff = no 

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail2.XXX.xx
mydomain = XXX.xx
transport_maps = hash:/etc/postfix/transportmaps
relay_domains = hash:/etc/postfix/relaydomains
relay_recipient_maps =
maximal_queue_lifetime = 15d

# a lenti sor kell a kov. hiba elimnalasahoz:
# warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
alias_maps = hash:/etc/aliases

# max value: 32bit signed integer
mailbox_size_limit = 2147483647 

inet_interfaces = all

Talan meg ez erdekes lehet. A lenyeg a backup MX-nek nem szabad a main.cf-ben mydestination-nek lennie.
http://serverfault.com/questions/179419/postfix-recipient-address-rejected-user-unknown-in-local-recipient-table

Postfix transportmap

/etc/postfix/transportmaps
XXX.xx smtp:mail.XXX.xxx:25

^^kettospont!
utana

postmap /etc/postfix/transportmaps
postmap /etc/postfix/relaydomains

Postfix reload

sudo service postfix restart

Hosztnevek osszefoglalo:

cat /etc/hosts

127.0.0.1 mail2.XXX.xx
(tobbi valtozatlan, ezt a sort pluszba betenni)

cat /etc/hostname

mail2.XXX.xx

cat /etc/postfix/transportmaps

XXX.xx smtp:mail.XXX.xx:25

cat /etc/postfix/relaydomains

XXX.xx OK

cat /etc/postfix/main.cf

...
smtpd_banner = $myhostname Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675
...
append_dot_mydomain = no
...
myhostname = mail2.mgyosz.hu
mydomain = mgyosz.hu
transport_maps = hash:/etc/postfix/transportmaps
relay_domains = hash:/etc/postfix/relaydomains
relay_recipient_maps =
maximal_queue_lifetime = 15d
alias_maps = hash:/etc/aliases

Aszem mashova nem kell beirni a hosztnevet.

logrotate

Ez legyen benne (tehat kommentelve):

vi /etc/rsyslog.d/50-default.conf
# daemon.*;mail.*;\
#     news.err;\
#     *.=debug;*.=info;\
#     *.=notice;*.=warn    |/dev/xconsole

Es akkor a /var/log/syslog-ban nem igy indul:

 rsyslogd-2039: Could no open output pipe '/dev/xconsole': No such file or directory [try http://www.rsyslog.com/e/2039 ]

logrotate -fv /etc/logrotate.d/rsyslog
Reszlet a /etc/logrotate.d/rsyslog fajlbol:

/var/log/syslog
{
    su root syslog

NGINX+uwsgi

sudo apt-get update
sudo apt-get install nginx

# start-stop nginx
sudo service nginx stop
sudo service nginx start

# start nginx at boot time:
sudo update-rc.d nginx defaults

NGINX konfiguralasa

forras: https://www.digitalocean.com/community/articles/how-to-deploy-flask-web-applications-using-uwsgi-behind-nginx-on-centos-6-4

Python

sudo apt-get install python-virtualenv
sudo apt-get install python-dev #kell a C-headerek leforditasahoz

Flask

virtualenv venv
source venv/bin/activate
(venv)$ pip install flask
(venv)$ pip install uwsgi
deactivate

DynDNS

https://wiki.debian.org/DDNS

SMTP test

perl -MMIME::Base64 -e 'print encode_base64("mmom\@invitel.hu");'
perl -MMIME::Base64 -e 'print encode_base64("AbBbqQ88");'

$shell> telnet submit.invitel.hu 25
telnet> EHLO submit.invitel.hu
invitel> 334 VXNlcm5hbWU6
telnet> bvd2b4M3QWOidml0ZVvWvGL=
invitel> 334 UGFzc3dvcmQ6
telnet> BVJWcQgYODg=
invitel> 235 2.7.0 Authentication successful
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-NoDerivs 3.0 License