0

I have a postfix mail server with which I am able to :

  • send mails (to google for example) with the commande : "echo foo | mail -s 'bar' mail@gmail.com"
  • send mails with php mail()
  • send and receive internal mails from and to 'root' or 'myusername'. in ~/Maildir/

TLS,spf and dkim are running fine. (ran multiple test on DNSs ...) there is no dmarc system.

My problem is as follow : Before setting TLS I was able to receive mails from gmail. But not now. When i send a mail from gmail to my server example.com I get this in /var/log/mail.log

postfix/smtpd[2495]: connect from mail-pg1-f177.google.com[209.85.215.177]
postfix/smtpd[2495]: fatal: host/service locahost/9898 not found: Temporary failure in name resolution
postfix/master[2272]: warning: process /usr/lib/postfix/sbin/smtpd pid 2495 exit status 1
postfix/master[2272]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling

Since opendkim is binded on localhost:9898 I suspect the problem comming from here but I can't figure out why ?

postfix/main.cf :

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
compatibility_level = 2
tls_random_source = dev:/dev/urandom
smtp_tls_key_file = /etc..
smtp_tls_cert_file = /etc..
smtp_tls_CAfile = /etc..
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
smtpd_tls_key_file=/etc..
smtpd_tls_cert_file= /etc..
smtpd_tls_CAfile = /etc..
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
old TLS parameters
smtp_use_tls=yes
smtpd_use_tls=yes
smtp_tls_session_cache_database = btree:${data_directory}/smtpd_scache

authorized_submit_users = static:all
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
myhostname = BricoleServer1.bricole-s.com
masquerade_domains = bricole-s.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
myorigin = localhost
mydestination = $myhostname, localhost.$mydomain, example.com, mail.example.com, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
home_mailbox = .Maildir/
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:locahost:9898,
non_smtpd_milters = inet:localhost:9898,

master.cf :

(i've replaced '#' by '%')

% ==========================================================================
% service type private unpriv chroot wakeup maxproc command + args
% (yes) (yes) (no) (never) (100)
% ==========================================================================
smtp inet n - y - - smtpd
%smtp inet n - y - 1 postscreen
%smtpd pass - - y - - smtpd
%dnsblog unix - - y - 0 dnsblog
%tlsproxy unix - - y - 0 tlsproxy
submission inet n - y - - smtpd
% -o syslog_name=postfix/submission
-o smtpd_etrn_restrictions=reject
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
-o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
-o smtpd_helo_restrictions=permit_mynetworks,permit
% -o smtpd_tls_auth_only=yes
% -o smtpd_reject_unlisted_recipient=no
% -o smtpd_client_restrictions=$mua_client_restrictions
% -o smtpd_helo_restrictions=$mua_helo_restrictions
% -o smtpd_sender_restrictions=$mua_sender_restrictions
% -o smtpd_recipient_restrictions=
% -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
% -o milter_macro_daemon_name=ORIGINATING
%smtps inet n - y - - smtpd
% -o syslog_name=postfix/smtps
% -o smtpd_tls_wrappermode=yes
% -o smtpd_sasl_auth_enable=yes
% -o smtpd_reject_unlisted_recipient=no
% -o smtpd_client_restrictions=$mua_client_restrictions
% -o smtpd_helo_restrictions=$mua_helo_restrictions
% -o smtpd_sender_restrictions=$mua_sender_restrictions
% -o smtpd_recipient_restrictions=
% -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
% -o milter_macro_daemon_name=ORIGINATING

I've been on that for a while and I am staying open to add any additional informations.

3
  • 2
    Please fix your formatting, the editor should offer you a simple click to mark something you pasted as code to be displayed without additional formatting. – anx Mar 4 at 12:53
  • I believe there is something related to linux users or client allowance but I am not skilled enough to find out :'( – Mr Bricole Mar 6 at 0:48
  • It looks like smtpd_milters = inet:locahost:9898 is not a typo, since the incorrect hostname also appears in the log. – berndbausch Mar 8 at 23:12
3

Typo. In the setting smtpd_milters it says locahost (lacking L) in a place you very likely meant to put localhost.

2
  • I've tried but it makes no difference. Thanks for your answer though. – Mr Bricole Mar 6 at 0:45
  • 1
    I am so sorry that I didn't read correctly what you said. I thought Localhost instead of localhost. You were write and that problem is now solved. And I've got an other one haha. The solution was indeed : in smtpd_milters add the loca"L"host to get localhost instead of locahost Thanks a lot ! ;) – Mr Bricole Mar 7 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.