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.

i've got the problem that my postfix accept his own relay domains.

Postfix is acting as an Relayhost.

Is it possible to stop this?

Thanks for replies

i tried the following telnet test from a client:

telnet MYSERVER 25
Trying XXX.XXX.XXX.XXX...
Connected to MYSERVER.
Escape character is '^]'.
220 MYSERVER ESMTP Postfix (Ubuntu)
helo example.com
250 MYSERVER
mail from:test@MYDOMAIN
250 2.1.0 Ok
rcpt to:test@MYDOMAIN
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
.
250 2.0.0 Ok: queued as 2C97....

main.cf

myhostname = MYSERVER
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = MYSERVER, localhost.MYDOMAIN, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
….
transport_maps = hash:/etc/postfix/transport
relay_domains = hash:/etc/postfix/relay_domains
relay_recipient_maps = hash:/etc/postfix/relay_recipients_map
….
# Restrictions

smtpd_helo_required = yes

smtpd_recipient_restrictions =
# White- and Blacklist
        check_client_access hash:/etc/postfix/accesslists/access_client,
        check_helo_access hash:/etc/postfix/accesslists/access_helo,
# use clear mails
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        reject_non_fqdn_helo_hostname,
        reject_invalid_helo_hostname,
# own user
       permit_sasl_authenticated,
       permit_mynetworks,
# RBL
        reject_rbl_client zen.spamhaus.org,
        reject_rbl_client ix.dnsbl.manitu.net,
        reject_rbl_client bl.spamcop.net,

       reject_unverified_recipient,

        reject_unauth_destination,

        permit
share|improve this question
    
What did you want it to do with email for MYSERVER? –  DerfK Nov 29 '12 at 20:40
    
sorry by telnet test it should MYDOMAIN instead of MYSERVER - if fix it above –  Knut Nov 29 '12 at 20:44
add comment

2 Answers

up vote 1 down vote accepted

i've got the problem that my postfix accept his own relay domains.

Yes, of course. if it didn't, how could it relay mail ?

Postfix is acting as an Relayhost.

Make sure you understand what this means.

Is it possible to stop this?

Of course; remove the domains in question from relay_domains.

Relaying mail is a binary operation: mail is either accepted and relayed, or it is not accepted.
There is no third alternative.

share|improve this answer
add comment

This is perfectly normal and is how SMTP works. You didn't relay THROUGH your server, you sent an email TO a user whose domain your server is authoritative for. You essentially "mimicked" an SMTP session to your server to send your user an email. Those commands are the same commands that any SMTP server will issue when connecting to your server to send your user an email.

To clarify: You DID NOT relay THROUGH your server. You sent an email TO your server for YOUR user.

share|improve this answer
    
Thanks for reply. If i understand you correctly this telnet code will work for each valid domain and adresses in relay_recipient_map and relay_domains? For example everyone who knows more valid adresses can sent messages to all known adresses if i am correct? So there must be a way to prevent this or do i absolutly understand it wrong? –  Knut Nov 29 '12 at 21:21
    
I have no idea what relay_recipient_map and relay_domains are. What I do know is that your server will accept email addressed to domains for which it is authoritative for. –  joeqwerty Nov 29 '12 at 21:29
    
They are the means by which postfix allows relaying to external domains. –  adaptr Nov 30 '12 at 10:56
add comment

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.