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 set up a mailserver yesterday according to this tutorial: http://wiki.hetzner.de/index.php/DebianMailserver3 (tutorial is in german).

Sending emails is working fine, recieving emails from other addresses on the same server is working too BUT everytime i try to send something from other email providers it gets rejected with the errormessage:

host xxxxx said: 554 5.7.1 : Relay access denied (in reply to RCPT TO command)

Here are the postfix config files:

main.cf:

myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no

mydomain = takistanliferevolution.com
myhostname = takistanliferevolution.com
mydestination = mail.$mydomain, localhost, localhost.$mydomain, $mydomain, mysql:/etc/postfix/mysql-mydestination.cf
mynetworks = 127.0.0.1
relay_domains = $mydomain
mailbox_transport = cyrus
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf
virtual_mailbox_domains = $mydomain
sender_canonical_maps = mysql:/etc/postfix/mysql-canonical.cf
alias_maps = $alias_database
smtp_host_lookup = native,dns

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_dely_reject = yes
smtpd_helo_required = yes
disable_vrfy_command = yes
srict_rfc821_envelopes = yes
smtpd_sender_restrictions = 
    permit_sasl_authenticated,
    permit_mynetworks,
    reject_non_fqdn_sender,
    reject_unknown_sender_domain,
    permit
smtpd_recipient_restrictions = 
    reject_invalid_hostname,
    reject_non_fqdn_hostname,
    reject_non_fqdn_sender,
    reject_non_fqdn_recipient,
    reject_unknown_sender_domain,
    reject_unknown_recipient_domain,
    reject_unauth_pipelining,
    permit_sasl_authenticated,
    permit_mynetworks,
    #check_policy_service inet:127.0.0.1:60000,
    reject_unauth_destination
    permit
smtpd_data_restrictions =
    reject_unauth_pipelining,
    permit

smtp_use_tls = yes

smtpd_use_tls = yes
smtpd_sasl_local_domain =
smtpd_sasl_auth_only = yes
smtpd_tls_note_starttls_offer = yes
smtpd_tls_cert_file = /etc/ssl/certs/smtps.pem
smtpd_key_file = /etc/ssl/certs/smtps.pem
smtpd_CAfile = /etc/ssl/certs/smtps.pem
smtpd_tls_loglevel = 1
smtpd_tls_recived_header = yes
smtpd_tlr_sessions_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
relayhost =

##Clam
content_filter = scan:127.0.0.1:10026
receive_override_options = no_address_mappings

master.cf:

# service type  private unpriv  chroot  wakeup  maxproc command + args
smtp      inet  n       -       n       -       -       smtpd
 -o content_filter=spamassassin
smtps     inet  n       -       n       -       -       smtpd
 -o content_filter=spamassassin
 -o smtpd_tls_wrappermode=yes
 -o smtpd_sasl_auth_enable=yes
 -o smtpd_client_restrictions=permit_sasl_authenticated,reject
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
    -o smtp_fallback_relay=
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
cyrus     unix  -       n       n       -       -       pipe
    flags= user=cyrus argv=/usr/sbin/cyrdeliver -r ${sender} -m ${extension} ${user}
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

#AV
scan unix   -   -   n   -   16  smtp
127.0.0.1:10025 inet n  -   n   -   16  smtpd
    -o content_filter=
    -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    -o smtpd_helo_restrictions=
    -o smtpd_client_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks_style=host
    -o smtpd_authorized_xforward_hosts=127.0.0.0/8

spamassassin unix - n   n   -   -   pipe
    user=nobody argv=/usr/bin/spamc -f -e
    /usr/sbin/sendmail -oi -f ${sender} ${recipient}

(If you need another file of it just tell me that)

Anybody got an idea why this happends (Because all ideas i got didn't work...)

Greetings chill0r

Edit: Found a solution... You are not allowed to enter your domain as both, mydomain AND virtual_mailbox_domains. Second problem was that reject_invalid_hostname always rejected the mails Have to go further in testing why this happens but at least it's working now... Maybe someone of you knows why with enabled reject_invalid_hostname it rejects the mails from outside because normally it should reject mails with it only if it's no fqdn the mails are coming from...

share|improve this question
1  
Hi, Please post your solution as an answer to better fit the QA style here @ ServerFault. –  Jacob Feb 3 '13 at 18:30
    
I'll do that when i find the correct solution for it, for now it's just testing –  chill0r Feb 3 '13 at 18:37
    
Check your mail logs, they will usually give you a much clearer indication of why the email is rejected. –  Jenny D Mar 27 at 7:30
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.