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 want my mailserver to send mail from my local application "from" any user supplied email address "to" my own address, say "contact@mysite.com". The MX records for "mysite.com" actually point to a different server, even though the outgoing mainserver is running with mydomain set as "mysite.com". Perhaps this is part of the problem?

postfix is currently causing a SMTPRecipientsRefused error within the python application. Can anyone point me to what to change in the configuration?

Thanks

postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = mysite.com, localhost.com, , localhost, *
myhostname = mysite.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
share|improve this question
1  
You might need to add the output of postconf -n to your question. The mynetworks setting is the one I suspect isn't right. –  Ladadadada Nov 15 '12 at 10:11
    
Added output, thanks –  Jon Nov 15 '12 at 10:22

2 Answers 2

Your current mynetworks only allows the local machine to relay email. It doesn't allow any other machines on the network to send emails (although it will still accept emails that it can deliver locally).

If your web box is not the same machine as your mail box, you will need to add your local network or the specific boxes to mynetworks.

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24

or

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/8

or something like that.

share|improve this answer

You have set

mydestination = mysite.com,

So server tries to deliver it locally and probably recipient does not exist there.

share|improve this answer

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.