Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 11432  / 2 Years ago, sat, may 14, 2022, 9:36:05

I have server where I want to set up a mail server to let me receive and send email from my domain. I'm currently having a problem where while I am authorized to send email from the server, but according to the logs, am not authorized to receive email from any provider other than my own network.



I'm going off of this tutorial, which shows how to configure a mail server using Postfix, Dovecot, and using MySQL as the backend (here).



Appropriate logs:



Jan  6 13:55:49 mail postfix/smtpd[26857]: permit_mynetworks: mail-la0-f50.google.com 209.85.215.50
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostname: mail-la0-f50.google.com ~? 127.0.0.0/8
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostaddr: 209.85.215.50 ~? 127.0.0.0/8
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostname: mail-la0-f50.google.com ~? 127.0.0.2/32
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostaddr: 209.85.215.50 ~? 127.0.0.2/32
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostname: mail-la0-f50.google.com ~? 192.99.104.50/32
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostaddr: 209.85.215.50 ~? 192.99.104.50/32
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostname: mail-la0-f50.google.com ~? [::1]/128
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_hostaddr: 209.85.215.50 ~? [::1]/128
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_list_match: mail-la0-f50.google.com: no match
Jan 6 13:55:49 mail postfix/smtpd[26857]: match_list_match: 209.85.215.50: no match
Jan 6 13:55:49 mail postfix/smtpd[26857]: generic_checks: name=permit_mynetworks status=0
Jan 6 13:55:49 mail postfix/smtpd[26857]: generic_checks: name=reject_unauth_destination
Jan 6 13:55:49 mail postfix/smtpd[26857]: reject_unauth_destination: [email protected]
Jan 6 13:55:49 mail postfix/smtpd[26857]: permit_auth_destination: [email protected]`
Jan 6 13:55:49 mail postfix/smtpd[26857]: ctable_locate: leave existing entry key [email protected]`
Jan 6 13:55:49 mail postfix/smtpd[26857]: NOQUEUE: reject: RCPT from mail-la0-f50.google.com[209.85.215.50]: 554 5.7.1 <me@d$`
Jan 6 13:55:49 mail postfix/smtpd[26857]: generic_checks: name=reject_unauth_destination status=2`
Jan 6 13:55:49 mail postfix/smtpd[26857]: > mail-la0-f50.google.com[209.85.215.50]: 554 5.7.1 <[email protected]>: Relay access denied`
Jan 6 13:55:49 mail postfix/smtpd[26857]: < mail-la0-f50.google.com[209.85.215.50]: DATA`
Jan 6 13:55:49 mail postfix/smtpd[26857]: > mail-la0-f50.google.com[209.85.215.50]: 554 5.5.1 Error: no valid recipients`
Jan 6 13:55:49 mail postfix/smtpd[26857]: < mail-la0-f50.google.com[209.85.215.50]: QUIT`
Jan 6 13:55:49 mail postfix/smtpd[26857]: > mail-la0-f50.google.com[209.85.215.50]: 221 2.0.0`


My main.cf:



smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/dovecot.pem
smtpd_tls_key_file=/etc/ssl/private/dovecot.pem
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = duper51.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = duper51.com, mail.duper51.com, localhost
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4

More From » 12.04

 Answers
0

From the config you posted, you had "mydestination" right, but then you commented it out and just set it to "localhost". This would definitely prevent you from receiving mail from the outside world.


[#21782] Saturday, May 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oleard

Total Points: 344
Total Questions: 105
Total Answers: 113

Location: Bonaire
Member since Tue, Sep 20, 2022
2 Years ago
oleard questions
Mon, Sep 26, 22, 18:21, 2 Years ago
Mon, Nov 1, 21, 21:27, 3 Years ago
Sat, May 7, 22, 20:47, 2 Years ago
Sun, Oct 2, 22, 01:10, 2 Years ago
;