0

Trying to use my server as a relay to send mail to another server gives you relay access denied, this is correct behavior.

MAIL FROM: admin@myserver
SMTP -> FROM SERVER:
250 2.1.0 Ok
RCPT TO: admin@gmail.com
SMTP -> FROM SERVER:
554 5.7.1 : Relay access denied
SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Relay access denied

Trying to use my server as a relay to my server works for some reason.

MAIL FROM: admin@myserver
SMTP -> FROM SERVER:
250 2.1.0 Ok
RCPT TO: admin@myserver
SMTP -> FROM SERVER:
250 2.1.5 Ok
Sending Mail Message Body...
SMTP -> FROM SERVER:
354 End data with .
SMTP -> FROM SERVER:
250 2.0.0 Ok: queued as 1D80D380166

How do I stop this? I already have spammer spamming me with job offers

Shoshomiga
  • 84
  • 7

2 Answers2

0

Turn on SMTP authorization.

See http://www.postfix.org/SASL_README.html and http://postfix.state-of-mind.de/patrick.koetter/smtpauth/smtp_auth_mailservers.html

Paul
  • 101
  • 1
  • I can't get sasl to work, I tried dovecot sasl and cyrus sasl like it says in the postfix sasl readme but for some reason I can't get it work. Here is my main.cf file http://pastebin.com/ec7ALtJ7 –  Jul 21 '11 at 22:47
  • What doesn't work? Are you getting an error or can you still send mail without authorization? – Paul Jul 21 '11 at 23:22
0

You need to create smtp_sender_restrictions. Allow your own network permit_mynetworks and/or authenticated senders permit_sasl_authenticated and then block any mail from your own domain name check_sender_access.

Neil
  • 248
  • 3
  • 11