I have a Debian server with postfix configured with sasl and tls, and dovecot as a mail server. I'm having two separate problems sending mail to my account on the server.
First, when I send mail from my gmail account, I get
Jan 4 23:35:50 avalon postfix/smtpd: NOQUEUE: reject: RCPT from mail-pb0-f43.google.com[18.104.22.168]: 554 5.7.1 <email@example.com>: Relay access denied; from=<firstname.lastname@example.org> to=<email@example.com> proto=ESMTP helo=<mail-pb0-f43.google.com>
Doing some research, it seems like the problem is the following two lines
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
I'm a newbie, but from what I've garnered, postfix is serving as a relay server relaying mail from another MTA to dovecot, and only
mynetworks are allowed to send relay requests. Is this correct? If so, how would I fix this? I would like anyone to be able to send email to this server, but would also like to prevent abuse (e.g., spam).
The second problem is when I try to send email to myself, I get
Jan 4 23:53:22 avalon postfix/smtp: 227D638C7857: to=<firstname.lastname@example.org>, relay=none, delay=0.32, delays=0.09/0/0.23/0, dsn=5.4.6, status=bounced (mail for b.com loops back to myself)
What exactly is the problem here and how can I fix it?