2

I have recently upgraded my production server (Ubuntu 15 to Ubuntu 16.04.1).

Before the upgrade, I've follow this tutorial for configuring Dovecot/Postfix and Vimbadmin.

Now, i can send succefully email but it's not possible to receive any e-mail. I have this error message from the mail.log :

mail postfix/smtpd[10751]: NOQUEUE: reject: RCPT from col004-omc2s1.hotmail.com[xxxx]: 554 5.7.1 <MON@EMAIL.COM>: Relay access denied; from=<EXPEDITEUR@hotmail.com> to=<MON@EMAIL.COM> proto=ESMTP helo=<COL004-OMC2S1.hotmail.com>

Sep 17 21:00:38

Here is my postfix conf :

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = localhost
myhostname = mail.domain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
non_smtpd_milters = inet:localhost:12301
policy-spf_time_limit = 3600s
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_CAfile = /etc/letsencrypt/live/mail.domain.com/chain.pem
smtp_tls_loglevel = 1
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_error_sleep_time = 2s
smtpd_hard_error_limit = 20
smtpd_helo_required = yes
smtpd_milters = inet:localhost:12301
smtpd_recipient_restrictions = reject_non_fqdn_recipient reject_unknown_recipient_domain permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_relay_restriction check_policy_service unix:private/policy-spf check_policy_service inet:127.0.0.1:10023
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_soft_error_limit = 10
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.domain.com/cert.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.domain.com/privkey.pem
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_received_header = yes
smtpd_tls_security_level = encrypt
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_wrappermode = no
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql/virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_uid_maps = static:5000
Braiam
  • 642
  • 4
  • 23
Shinix
  • 31
  • 1
  • 4

1 Answers1

3

You need to set mydestination = localhost to include your domain(s).

http://www.postfix.org/BASIC_CONFIGURATION_README.html

The mydestination parameter specifies what domains this machine will deliver locally, instead of forwarding to another machine. The default is to receive mail for the machine itself. See the VIRTUAL_README file for how to configure Postfix for hosted domains.

You can specify zero or more domain names, "/file/name" patterns and/or "type:table" lookup tables (such as hash:, btree:, nis:, ldap:, or mysql:), separated by whitespace and/or commas. A "/file/name" pattern is replaced by its contents; "type:table" requests that a table lookup is done and merely tests for existence: the lookup result is ignored.

IMPORTANT: If your machine is a mail server for its entire domain, you must list $mydomain as well.

Example 1: default setting.

/etc/postfix/main.cf: mydestination = $myhostname localhost.$mydomain localhost

As for your second problem, you'll have to clarify what you mean and provide more information... best to post a second question.

Ryan Babchishin
  • 6,260
  • 2
  • 17
  • 37
  • Thanks ! i've modified mydestination with `mydestination = $myhostname localhost.$mydomain localhost mail.mydomain.com` and i've checked my log and i've again the same error `NOQUEUE: reject: RCPT from` – Shinix Sep 17 '16 at 20:50
  • @Shinix If your domain is `example.com`, you must include it as such. `mydestination = example.com`. It looks like you didn't do that. The example I quoted wasn't quite right for your situation, it was just showing the default setting for Postfix. – Ryan Babchishin Sep 17 '16 at 21:13
  • Oops, thanks i've modified to `mydestination = example.com` but i've a `: unknown user: "contact"`. I think mydestination can be empty ? [info here](http://stackoverflow.com/a/18381975/5542131) – Shinix Sep 18 '16 at 08:27
  • `user unknown` = totally different problem. Post another question please. – Ryan Babchishin Sep 18 '16 at 16:20
  • is not working, – Fernando Torres Nov 11 '19 at 04:50