I got 5 Public IPs. i’m Gonna configure them, so Postfix can use multiple interfaces/ips for outgoing smtp connections.
First we need creating Interface aliases for those 5 public IPs.
In my system, using centos:
# cd /etc/sysconfig/network-scripts/
# cp ifcfg-eth0 ifcfg-eth0:1
# vi ifcfg-eth0\:1
DEVICE=eth0 <-- default device
IPADDR=202.XXX.XX.2 <-- default eth0 IP address
Change DEVICE and IPADDR parameters Continue reading “Postfix SMTP Rotating IP using IPTables” »
OpenDKIM is method to digitally sign & verify emails on the mail servers using public & private keys. In other words opendkim implements the DKIM (DomainKeys Identified Mail) standard for signing and verifying email messages on a per-domain basis. DomainKeys are implemented to reduce the chances of outgoing mails to be marked as SPAM.
In this post we will demonstrate how to install & configure DomainKeys with postfix (MTA) on CentOS 7, i am assuming Postfix is already installed with following domain and hostname.
Hostname = mail5.freshdaymall.com
Domain = freshdaymall.com
Step:1 Set EPEL Repository using below rpm command
OpenDKIM package is not available in the default yum repositories but available in CentOS 7 EPEL repositories
[root@mail5 ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Step:2 Install OpenDKIM Package using yum
[root@mail5 ~]# yum install -y opendkim
Step:3 Run below Command to create keys
Execute the below command to create public & private keys under folder “/etc/opendkim/keys” Continue reading “Configure DomainKeys- DKIM (OpenDKIM) with Postfix on CentOS 7” »
Step 1 » Assign hostname for the server using the below command.
[root@krizna ~]# hostnamectl set-hostname mail.krizna.com
Step 2 » Make a host entry with your IP in /etc/hosts file.
Step 3 » Now start installing packages.
[root@krizna ~]# yum -y install postfix dovecot
After package installation continue with postfix configuration. Continue reading “Setup mail server on centos 7 using postfix and dovecot” »
This is so simple to do, but I have to look it up every time I need it (not something that comes up regularly!);
When configuring a development server, you may find you have a need to ensure that emails will not be sent to any domain except those you explicitly permit (for example if you’re using real-world data to do some testing, do you want to send all those users irrelevant emails?).
This documentation details how to configure Postfix on a Linux server to disregard any mail sent to domains that are not explicitly permitted.
Don’t use IPTables
You could, of course, add two IPTables rules to the outgoing chain. The first of which would allow connections on Port 25 to the domain you wish to allow, the second blocking connection to any server on Port 25.
It’ll block the mail from being sent, but will mean that every one of those messages sits in the mail queue for 60 days until it’s disregarded. You could reconfigure the timeout, but given the ease of the steps below, what’s the point?
Use Transport Mapping
Using this method, we can tell Postfix to either reject the mail, or disregard it. The latter is generally the preferred method as we want the sending application to believe the mail has been sent. Continue reading “Configuring Postfix to block outgoing mail to all but one domain” »
UPDATE THE SYSTEM
Before going any further, make sure you’re in a screen session and your system is fully up-to-date by running:
## screen -U -S opendkim-screen
## yum update
ENABLE EPEL REPOSITORY
OpenDKIM is available in the EPEL repository, so we need to enable it on the system before we can install OpenDKIM
## wget -P /tmp http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm
## rpm -Uvh /tmp/epel-release-6-8.noarch.rpm
## rm -f /tmp/epel-release-6-8.noarch.rpm
Install the package using yum:
## yum install opendkim
Next thing to do is to configure OpenDKIM. Its main configuration file is located in /etc/opendkim.conf, so before making any changes create a backup and add/edit the following: Continue reading “Install and integrate DKIM with OpenDKIM and Postfix on a CentOS 6” »
Postfix by default restrict attachment size to approx 10MB i.e. 10240000 bytes.
You can check it using following command:
postconf | grep message_size_limit
To change attachment-size to say 50 MB, run a command like:
postconf -e message_size_limit=52428800
If you are running a mail-server with SMTP/IMAP access, you need to change postfix attachment size only. I spent half-hour debugging dovecot to increase attachment size, just to realize that above change in postfix config was all I needed!
When I tried to start postfix today, I got the following message:
fatal: parameter inet_interfaces: no local interface found for 22.214.171.124
Solution is straightforward:
comment out “inet_interfaces = all”
add “inet_protocol = ipv4”
Just a small hack, but worked good on my ISPConfig 3 setup. Add the following:
mailbox_size_limit = 104857600
Save and restart postfix service.
According to official postfix documentation:
message_size_limit (default: 10240000) The maximal size in bytes of a message, including envelope information. Note: be careful when making changes. Excessively small values will result in the loss of non-delivery notifications, when a bounce message size exceeds the local or remote MTA’s message size limit. Continue reading “Allow large attachment (greater than 10MB) in ISPConfig postfix MTA” »
This is quite simple, and with a very simple setup, and does not require that much, since we do not need to send out e-mails from clients from this server, or use ASMTP. I find that MySQL is not needed here, but could be used. I will use normal flat files, since the number of domains to run a backup for is most likely a rather small number.
This setup can be editet to run all times of different checks, antivirus etc. Normally you would make sure that the setup is exactly the same on both the primary MTA, and the backup. It hardenens the systems, and should reduce spam, and unwanted traffic. Create public DNS entries. Remember to create an MX record with an lower priority than the primary mail server, or else this will not work!
Example:example.com. 43200 IN MX 10 mail.example.com.
example.com. 43200 IN MX 20 backup.example.com.
After this these two records are created with A records pointing to different IPs (different servers). Continue reading “Perfect Backup MX using Postfix” »
If you’re receiving the following message on webmin- “Failed to open /var/mail/root : No such file or directory”.
Possible resolution is-
rumi@mordor:~$ sudo touch /var/mail/rumi
rumi@mordor:~$ sudo chown thufir:mail /var/mail/rumi
rumi@mordor:~$ sudo chmod o-r /var/mail/rumi
rumi@mordor:~$ sudo chmod g+rw /var/mail/rumi
No mail for thufir