Skip to content

Instantly share code, notes, and snippets.

@sahilrajput03
Created October 5, 2022 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahilrajput03/69cf3bf053e8817da8caf52c5c39c25a to your computer and use it in GitHub Desktop.
Save sahilrajput03/69cf3bf053e8817da8caf52c5c39c25a to your computer and use it in GitHub Desktop.
# cat /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
mailbox_size_limit = 0
recipient_delimiter = + .
inet_interfaces = all
# inet_protocols = all
inet_protocols = ipv4
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
# myhostname = mailer.pinlife.ml
myhostname = mailer.sahilrajput.ml
# myorigin = /etc/mailname
myorigin = mailer.pinlife.ml
mydestination = $myhostname, pinlife.ml, mailer.pinlife.ml, sahilrajput.ml, mailer.sahilrajput.ml, raspberrypi, localhost.localdomain, localhost
# relayhost = mailer.pinlife.ml:25
# relayhost = [smtp.gmail.com]:587
# relayhost = smtp-relay.gmail.com:25
relayhost =
mynetworks = 192.168.18.0/24 127.0.0.0/8 [::1]/128 mailer.pinlife.ml mailer.sahilrajput.ml
# mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 124.253.37.38
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
# home_mailbox = Maildir/
# mailbox_command =
disable_dns_lookups = yes
# TLS parameters
smtpd_tls_cert_file = /etc/letsencrypt/live/mailer.pinlife.ml/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mailer.pinlife.ml/privkey.pem
smtpd_tls_CAfile=/etc/letsencrypt/live/mailer.pinlife.ml/fullchain.pem
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
# smtpd_tls_mandatory_protocols=!SSLv2,!SSLv3
# smtpd_tls_protocols=!SSLv2,!SSLv3
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache
smtpd_tls_received_header = yes
# smtp_tls_mandatory_ciphers = high
# smtpd_use_tls=yes
# - sasl - #
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
# smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauthenticated_sender_login_mismatch, permit
# SMTP from your server to others
smtp_tls_cert_file = /etc/letsencrypt/live/mailer.pinlife.ml/fullchain.pem
smtp_tls_key_file=/etc/letsencrypt/live/mailer.pinlife.ml/privkey.pem
smtp_tls_CAfile=/etc/letsencrypt/live/mailer.pinlife.ml/fullchain.pem
smtp_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtp_tls_mandatory_protocols=!SSLv2,!SSLv3
smtp_tls_protocols=!SSLv2,!SSLv3
smtp_tls_loglevel = 1
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
# smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
# smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# -
# debug_peer_list = *
# debug_peer_level = 3
# message_size_limit = 20480000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment