Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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[2599]: NOQUEUE: reject: RCPT from[]: 554 5.7.1 <>: Relay access denied; from=<> to=<> proto=ESMTP helo=<>

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 = [::ffff:]/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[2679]: 227D638C7857: to=<>, relay=none, delay=0.32, delays=0.09/0/0.23/0, dsn=5.4.6, status=bounced (mail for loops back to myself)

What exactly is the problem here and how can I fix it?

share|improve this question

I think I've got it figured out. Adding permit_auth_destination to smtpd_recipient_restrictions and with the right mydestination allowed mail sent to the server to not bounce. However, mail was sent to /var/mail/ instead of dovecot. My mailbox_command was procmail, so I made a new file /etc/procmailrc with the following, as I have dovecot configured to use Maildir format.


This second half seems to have fixed the "mail loops back to myself" problems, presumably because procmail is not trying to use the default sendmail anymore.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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