Posts

Showing posts with the label Postfix

StatusDnsQueryFailed resolving domain

Welcome file If you are seeing the following error in PowerMTA or Postfix logs : StatusDnsQueryFailed resolving domain It’s likely caused by 3 reasons : The requested domain does not exist. It doesn’t have neither MX nor A record. The upstream DNS provider is throttling excessive queries from your mail server. You are hitting bandwidth limits on either WAN(if the dns resolver request is going out via internet interface). As always, i highly recommend to use dedicated recursive DNS server on LAN for your mailing infrastructure or use unthrottled upstream DNS resolver.

How to include Gmail's Feedback-ID header in DKIM signature

article1 Feedback-ID is an additional header required by Gmail Feedback Loop to see aggregated data in Google Postmaster tools . Gmail requires it to include in DKIM-Signature. The following guide explains how it can be configured in OpenDKIM : Edit opendkim.conf vim /etc/opendkim.conf Add the following line : SignHeaders Feedback-ID Reload openkdim : systemctl reload opendkim.service Reload postfix : systemctl reload postfix.service Send a test email with swaks to gmail : swaks --from postmaster@postfix.io --to xxxx@gmail.com --h-Feedback-ID 123:asd:123 --server 127.0.0.1:25 My test mail results : Authentication-Results: mx.google.com;dkim=pass header.i=@postfix.io header.s=key1 header.b=oY1NVInb;spf=pass (google.com: domain of postmaster@postfix.io designates 45.55.57.182 as permitted sender) smtp.mailfrom=postmaster@postfix.io;dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=postfix.io Date: Sun, 12 Nov 2017 11:04:42 +0000 DKIM-Signature: v=1...

421 4.5.1 No more messages on this connection http://tele.dk/25153

article1 tele.dk is an ISP from Denmark. As per the Postmaster guidelines , tele.dk mail servers do not accept more than 3 messages per connection, if you attempt to send more emails, you would get the following error message : 421 4.5.1 No more messages on this connection, see http://tele.dk/25153 The following quick How-to explains, how to configure Postfix to limit number of messages per smtp connection / session to danish domains which are hosted by tele.dk . Note: The following configurations worked on Postfix 3.2.3. Add the following to /etc/postfix/main.cf # mail.dk transport transport_maps = hash:/etc/postfix/transport teledk_initial_destination_concurrency = 3 teledk_destination_concurrency_limit = 3 Add the following to /etc/postfix/transport .mail.dk teledk: .tdcadsl.dk teledk: .tele.d teledk: .dknet.dk teledk: youseeme.dk teledk: besked.com teledk: beskedboks.dk teledk: You can add more domains by revie...

How to find out which Postfix version I'm running?

article1 Run the following command on Linux server : postconf mail_version Mine, returns the following output : mail_version = 3.2.3

How to configure Postfix with SMTP-AUTH over SASL2 with authentication against PAM in Ubuntu

article1 I would like to submit emails to Postfix using smtp authentication. I will authenticate my smtp users against PAM. Install sasl2: apt-get install sasl2-bin Add the following to /etc/postfix/sasl/smtpd.conf: pwcheck_method: saslauthdmech_list: PLAIN LOGIN Create saslauthd’s config file copy to /etc/default/saslauthd-postfix so that is used from postfix: cp /etc/default/saslauthd /etc/default/saslauthd-postfix Update the following in /etc/default/saslauthd-postfix: START=yes NAME="saslauthd-postf" OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd" Since we have chrooted saslauthd to postfix so its good to symlink it: rm -rf /run/saslauthd ln -s /var/spool/postfix/var/run/saslauthd /run/saslauthd Create required subdirectories: dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd Setup proper permission by adding postfix to ‘sasl’ group: adduser postfix sasl Restart saslauthd service systemctl restar...

How to configure OpenDKIM with Postfix

article1 In this HowTo, you will find out how we configured OpenDKIM and Postfix(3.1.0) to sign our @postfix.io emails with DKIM. I will not talk about what is DKIM and settings like hash algorithms, DKIM Identity, Selectors etc. Install OpenDKIM and tools. apt-get install opendkim opendkim-tools Add the following settings to /etc/opendkim.conf after “UserID” directive. Map AuthorDomains to RSA keys.KeyTable /etc/dkimkeys/rsakeys.tableSigningTable refile:/etc/dkimkeys/signingdomains.table# "simple" recommended by DKIMCoreCanonicalization simpleMode svSubDomains noAutoRestart yesAutoRestartRate 10/1MBackground yesDNSTimeout 5SignatureAlgorithm rsa-sha256OversignHeaders From Generate RSA key for @postfix.io cd /etc/dkimkeys/opendkim-genkey --bits=1024 --selector=key1 --domain=postfix.io --append-domain It will create two files. “ key1.private ” which is for server side and “ key1.txt ” which contain the following DNS record that needs to be created i...

How to enable Outbound Opportunistic TLS in Postfix

article1 Most ISPs like Gmail, Hotmail and Yahoo now support Server-side-tls. ESPs like Sendgrid, Sparkpost, Mailchimp have also enabled outbound TLS in their MTAs. You can either enforce Postfix to always use TLS or the other recommend way is to use ‘Opportunistic TLS’ so Postfix should use TLS when the recipient domain supports it otherwise falls back to non-TLS connection. vim /etc/postfix/main.cf Add after “smtp_banner” settings. smtp_tls_security_level = may Reload Postfix systemctl reload postfix.service Verify logs for errors. tail -f /var/log/mail.log Expected output: Nov 26 13:21:54 console postfix/postfix-script[9285]: refreshing the Postfix mail systemNov 26 13:21:54 console postfix/master[2323]: reload -- version 3.1.0, configuration /etc/postfix

How to change Postfix default smtp port to 2525

article1 By default Postfix listens on Port 25. You can change it to any port. In our case, we would want to change it to 2525. vi /etc/postfix/master.cf Replace smtp inet n - n - - smtpd with 2525 inet n - n - - smtpd Restart Postfix service. systemctl restart postfix.service