Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Jul 22 '11 at 1:48

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer

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

share|improve this answer
    
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 pastebin.com/ec7ALtJ7 –  Shoshomiga 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

Your Answer

 
discard

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.