Skip to main content

Postfix

By Default CWP server comes with Postfix + Dovecot + AntiSpam Solutions. We need to do some modifications on Postfix + Dovecot , for better security and to get high performance. In this series tutorials , We will learn about Postfix + Dovecot with AntiSpam Solutions .

1. How to Build Postfix + Dovecot Mail Server with Anti-Spam Solutions on CWP Server ?
2. How to Secure CWP Postfix and Dovecot with Lets Encrypt SSL Certificate ?
3. How to Enable logging of Email’s Subject Line in Postfix Maillog ?
4. How to Remove Sensitive Data from Postfix Headers ?
5. How to Block (Virus) Extensions on Postfix Mail Server ?
6. How to Configure SMTP Relay on CWP CentOS 7 with Relay Provider ?
7. How to Configure autodiscover information for mail clients to setup pop/imap/smtp settings automatically on CentOS WebPanel?
8. How to Produce Postfix MTA logfile summary using Pflogsumm on CWP?

Spam Filtering for Postfix/Dovecot Mail Server on CWP7:
https://kb.leuxner.net/article-category/mail/ 

BIMI:




IP Rotation:
http://gbooksite.blogspot.com/2017/01/ip-rotation-with-postfix-mail-server.html
https://i-mscp.net/thread/10838-rotate-ips-postfix/
https://pastebin.com/Eem0y5N0

FetchMail with PostfixAdmin
https://blog.acmenet.ru/en/2014/11/25/mail-centos-en/

ClamAV
http://woshub.com/install-use-clamav-antivirus-linux/
https://www.interserver.net/tips/kb/scan-centos-for-malware-viruses-and-rootkits/
https://hostpresto.com/community/tutorials/how-to-install-clamav-on-centos-7/

Email Log:
https://linuxhint.com/analyze_postfix_logs_pflogsumm/

Series:
https://www.sidn.nl/en/news-and-blogs/hands-on-implementing-spf-dkim-and-dmarc-in-postfix
https://www.lntn203.com/wiki/doku.php/linux/mail-postfix-dovecot/sasl-login-authentication-failed-ugfzc3dvcmq6 

Z-Push  ActiveSync
https://medium.com/@DonSYS/configuring-exchange-activesync-with-autodiscover-on-zimbra-c93e110158fb
https://imanudin.net/2019/08/30/exchange-activesync-for-zimbra-open-source-edition/
https://think.unblog.ch/en/how-to-install-z-push/
https://www.qmailtoaster.org/msas.html
https://kb.kopano.io/display/ZP/Installation#Installation-RHELbasedsystems

False Positives 
https://sanesecurity.com/support/false-positives/ 
http://www.clamav.net/reports/fp 
https://www.securiteinfo.com/services/anti-spam-anti-virus/whitelisting_clamav_signatures.shtml 
https://www.securiteinfo.com/services/anti-spam-anti-virus/improve-detection-rate-of-zero-day-malwares-for-clamav.shtml?lg=en

https://rtcamp.com/tutorials/mail/
https://access.redhat.com/solutions/120383

PHP-Mail Security Setup:
https://stackoverflow.com/questions/112190/php-ini-smtp-how-do-you-pass-username-password
https://www.php.net/manual/en/mail.configuration.php#ini.sendmail-path

Postfix Round-robin
http://marinovl.blogspot.com/2012/09/postfix-how-to-balance-outgoing-emails.html

How-to Prevent external sender spoofing to EFA
https://forum.efa-project.org/viewtopic.php?f=14&t=1278

Postfix Security
https://www.linuxtopia.org/online_books/mail_systems/postfix_documentation/TUNING_README_007.html
https://www.linuxtopia.org/online_books/mail_systems/postfix_documentation/index.html
https://www.howtoforge.com/how-to-set-up-a-mail-server-with-postfixadmin-on-debian-11/
https://zozoo.io/install-postfix-dovecot-auth-tls-mysql-postfixadmin-postgrey-spamassassin-and-clamav-on-centos-7/
https://linoxide.com/setup-greylisting-service-postfix-mail-server/


Rate Limiting with Postfix
https://beamtic.com/rate-limiting-postfix
https://vinters.com/blog/rate-limit-outbound-mail-in-postfix/
https://grovetech.co/blog/stay-off-of-blacklists-limit-postfix-recipients/

Domain Black list Checker:
https://grademyemail.co/email-blocklist-checker

Postgrey
https://www.howtoforge.com/greylisting_postfix_postgrey
https://wiki.centos.org/HowTos/postgrey
https://linoxide.com/setup-greylisting-service-postfix-mail-server/
https://help.ubuntu.com/community/PostfixGreylisting
https://postgrey.schweikert.ch/
https://archive.virtualmin.com/node/34950
http://forums.sentora.org/showthread.php?tid=1136
https://installati.one/centos/7/postgrey/
https://rimuhosting.com/knowledgebase/linux/mail/greylisting%20with%20postgrey
https://www.linuxbabe.com/redhat/blocking-email-spam-postfix-centos



SQL 
https://www.digitalocean.com/community/tutorials/how-to-optimize-mysql-queries-with-proxysql-caching-on-ubuntu-16-04

https://www.digitalocean.com/community/tutorials/how-to-measure-mysql-query-performance-with-mysqlslap

https://www.digitalocean.com/community/tutorials/how-to-use-proxysql-as-a-load-balancer-for-mysql-on-ubuntu-16-04

Postfix Relay:
https://stackoverflow.com/questions/55159882/how-do-i-configure-postfix-to-only-relay-emails-from-a-specific-domain

https://forum.efa-project.org/viewtopic.php?t=2222
https://cloud.google.com/appengine/docs/standard/php/mail/mail-with-headers-attachments 
https://www.suse.com/support/kb/doc/?id=000016697

Postfix Aa a MailGateway 
http://www.linuxpcfix.com/how-to-configure-mx-gateway-mail-gateway-on-postfix/
http://www.linuxpcfix.com/how-to-set-up-a-postfix-mailserver-as-a-backup-mx-mail-exchanger/
http://www.techspacekh.com/configuring-postfix-e-mail-gateway-for-ms-exhchange-server-2013-with-rhelcentos-7/
https://connexeon.com/linux/mailscanner-with-postfix-mailwatch-installation-procedure-on-rhel/
https://ftp.unpad.ac.id/orari/library/library-sw-hw/linux-1/ANTI-VIRUS/MailScanner/docs/MailScanner_conf.htm 

Transport Map for Gateway
https://edoceo.com/sys/postfix-gateway

https://sites.google.com/site/wikirolanddelepper/mailscanner
https://prolinuxhub.com/category/mailscanner/
https://linuxhint.com/configuring_postfix_relayhost/
https://linuxhint.com/postfix_mail_queue_management/
https://brokkr.net/tag/postfix/page/2/
https://www.middlewareinventory.com/blog/postfix-relay-office-365/

Relay and Open Relay
https://www.ionos.com/help/server-cloud-infrastructure/server-administration/configuration-of-the-helo-entry-of-your-mail-transfer-agent-mta/

https://anandarajpandey.com/2019/04/09/postfix-forward-all-outgoing-emails-to-one-email-address-on-centos-redhat/

https://anandarajpandey.com/2019/12/30/postfix-how-to-prevent-open-relay/
https://anandarajpandey.com/2014/07/15/how-to-install-apc-in-centos-for-php-better-performance-opcode/

https://mailtrap.io/blog/test-smtp-relay/

https://marcelog.github.io/articles/configure_postfix_forward_all_email_smtp_gateway.html

https://serverfault.com/questions/280585/how-do-i-configure-postfix-to-deliver-mail-for-specified-domains-to-another-host *

https://serverfault.com/questions/710450/postfix-ignoring-relay-recipient-maps

https://edoceo.com/sys/postfix-gateway
https://beginlinux.com/index.php/server_training/mail-server/118-mail-server/1044-postfix-mail-gateway

https://www.mail-archive.com/search?l=postfix-users@postfix.org&q=subject:%22Re%5C%3A+relay_recipient_maps%22&o=newest&f=1

https://stackoverflow.com/questions/62561912/how-to-configure-postfix-with-transport-maps-and-randmap

https://linux.die.net/man/5/transport
https://www.howtoforge.com/how-to-whitelist-hosts-ip-addresses-in-postfix
https://www.akadia.com/services/postfix_uce.html

Series 
https://www.nesono.com/node/276
https://www.stefan-seelmann.de/wiki/mailserver-postfix-dovecot


SpamTitan
https://docs.titanhq.com/en/8792-spamtitan-gateway-admin-guide.html
https://docs.titanhq.com/en/8958-bayes-database.html

Content Filter
http://www.postfix.org/header_checks.5.html
https://www.seaglass.com/postfix/faq.html#dnshnf2
http://www.postfix.org/docs.html
https://selfsolved.com/problems/simple-content-based-filtering-f.html
https://www.akadia.com/services/postfix_mta.html
https://www.akadia.com/services/postfix_uce.html

Email Masquaride:
https://superuser.com/questions/695170/changing-default-from-e-mail-address-for-system-accounts-when-using-sendmail
https://opensource.apple.com/source/postfix/postfix-147/postfix/html/rewrite.html 

DNS DANE:
https://github.com/internetstandards/toolbox-wiki/blob/master/DANE-for-SMTP-how-to.md
https://blog.apnic.net/2019/11/20/better-mail-security-with-dane-for-smtp/
https://dane.sys4.de/

MTA-STS
https://www.digitalocean.com/community/tutorials/how-to-configure-mta-sts-and-tls-reporting-for-your-domain-using-apache-on-ubuntu-18-04 

DANE-TLSA
https://joscor.com/blog/dane-tlsa-tutorial/

Enforce TLS on incoming Mail:
https://serverfault.com/questions/389636/can-you-set-postfix-to-enforce-tls-on-incoming-email-only-from-certain-domains-o

MailScanner
https://sites.google.com/site/wikirolanddelepper/mailscanner/mailwatch 

RBL:
http://www.uceprotect.net/en/rblcheck.php
https://www.blacklistalert.org/
http://www.whitelisted.org/
https://www.dnswl.org/selfservice/?action=register 

Tips:
https://www.hostdime.com/kb/hd/mail

Mail Tester
https://www.mailgenius.com/
https://dmarcguide.globalcyberalliance.org/#/dmarc/aggregates 

Virus DataBase:
https://forums.cpanel.net/threads/virus-in-email-attachments.664405/

Postfix CMD:
https://www.frontline.ro/en/blog/delete-messages-from-postfix-queue-by-sender-address-and-recipient-domain 

Error Solutions:
https://www.ronny-mueller.com/2019/05/06/howto-solve-lost-connection-with-private-dovecot-lmtp-while-sending-end-of-data-error/

https://dovecot.org/list/dovecot/2018-April/111612.html

/trivial-rewrite[42042]: warning: do not list domain gravity.glorency.com in BOTH mydestination and virtual_mailbox_domains
https://www.howtoforge.com/postfix-do-not-list-domain-example.com-in-both-mydestination-and-virtual_mailbox_domains

Increase Open File Limit:
https://www.24x7serversupport.com/blog/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux/
https://www.ibm.com/docs/hr/wsr-and-r/8.5.6?topic=installation-setting-process-file-descriptor-limit
https://djangoadventures.com/how-to-increase-the-open-files-limit-on-ubuntu/

Important Command
# openssl version
# openssl version –help
# openssl version -help
# openssl version -a
# openssl version -d

# dovecot --version
# postconf mail_version
# postconf -d | grep mail_version

# /opt/zimbra/common/sbin/postqueue -p | egrep -v '^ *\(|-Queue ID-' | awk 'BEGIN { RS = "" } { if ($7 == "khurshed.alam@naafco.com") print $1} ' | tr -d '*!' | /opt/zimbra/common/sbin/postsuper -d -
# mailq | tail -n +2 | head -n -2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if (($7 == "sender@example.com") && ($8 ~ "somedomain.com")) print $1 }' | tr -d '*!' | postsuper -d -
# mailq | tail -n +2 | head -n -2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($7 == "MAILER-DAEMON") print $1 }' | tr -d '*!' | postsuper -d -

Comments