LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-13-2022, 03:03 PM   #1
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 173

Rep: Reputation: 22
Integrating DKIM into Postfix


I have TWO CentOS servers.

The first one was installed some weeks ago with two forums and sendmail to enable the Forum to send notifications to users.

I created an SPF and a DMARC Record for my Domain as well as a DKIM record for the domain.

Now I created a SECOND Centos server. It will be solely used as a mail server with Postfix and Dovecot.

Test mails show it is using the SPF and DMARC records, but I am at a loss of how to make postfix aware of DKIM as the DKIM record was created using opendkim on a different server.

Should I install opendkim on the second server or what?

Last edited by baldur2630; 09-13-2022 at 03:05 PM.
 
Old 09-14-2022, 06:29 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by baldur2630 View Post
Should I install opendkim on the second server or what?
Yes, that's what you need to do. There's any number of tutorials in using postfix with opendkim. You'll install it and then use the private keys from the existing server.

Unless you've a compelling reason I'd also suggest eventually replacing sendmail with postfix on the existing server.
 
1 members found this post helpful.
Old 09-14-2022, 10:18 AM   #3
Ladowny
Member
 
Registered: Oct 2006
Distribution: Debian, OpenBSD, FreeBSD
Posts: 54

Rep: Reputation: 15
Quote:
Originally Posted by baldur2630 View Post
I have TWO CentOS servers.
the DKIM record was created using opendkim on a different server.
It does not matter what you use to create DKiM key pair or where you create it. It's just RSA key pair, you can as well use openssl, which I use
Code:
openssl rsa -in mydomain.private.pem -out mydomain.pub.pem -pubout -outform PEM
and then create TXT DNS record for [selector]._domainkey.mydomain containing public key "v=DKIM1; k=rsa; p=[your public key in a single line]"

You can use any string for selector and you can have as many selectors as you like for your domain. For example some companies send some email using third party and do not want to share their private key with them so they use different key pair with different selector for these emails. However if you manage both servers you can as well use the same selector and key for both.

On the second server you need to install OpenDKiM or any other DKiM signing software. Doesn't really matter what you choose as long as your private key and selector you use to sign your emails have matching public key and selector published in DNS.

Myself, I am using the same key pair for many domains to make it more manageable. Initially I tried having unique key pairs, but I ended up with hundreds of pairs and started getting lost. It's also easier to change your key pair if your private key becomes compromised.
 
1 members found this post helpful.
Old 09-14-2022, 03:08 PM   #4
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 173

Original Poster
Rep: Reputation: 22
Yes, I closed down the Sendmail server completely. I installed Opendkim on the Postfix server and created a new keypair.

It took me some time to get the key into my DNS, after removing the " quotes and then trying to put it into one long line. The only way I managed to do it was to open my phpBB Click the Code and then paste the key into the Once I managed to get a single line I pasted it into my DNS and it works perfectly.

Thanks for the help and advice, guys.
 
  


Reply

Tags
dkim, dovecot, postfix



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] DKIM Keeps bringing up dkim=neutral (bad format) header.i=@ j.smith1981 Linux - Server 4 08-28-2019 06:26 AM
LXer: Set Up DKIM For Multiple Domains On Postfix With dkim-milter 2.8.x (CentOS 5.3) LXer Syndicated Linux News 0 09-07-2009 06:20 PM
LXer: Set Up DKIM On Postfix With dkim-milter (CentOS 5.2) LXer Syndicated Linux News 0 04-06-2009 12:30 PM
how to set up perl-mail-dkim with postfix using amavisd in centos 5.2 homyangcha Linux - Newbie 1 09-08-2008 05:03 PM
LXer: Integrating amavisd-new Into Postfix For Spam- And Virus-Scanning LXer Syndicated Linux News 0 03-18-2007 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration