Linode Forum
https://forum.linode.com/

Postfix not sending to the right domain
https://forum.linode.com/viewtopic.php?f=11&t=3008
Page 1 of 1

Author:  vaxen [ Sun Dec 30, 2007 5:54 pm ]
Post subject:  Postfix not sending to the right domain

Hi, I've setup postfix using the guide in the wiki. My mails are going to the wrong place. Instead of going to user@domain.com, its going to user@hostname.domain.com.

Here is my main.cf

Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mugen.ext9.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mugen.ext9.org, localhost.ext9.org, localhost.localdomain, localhost, ext9.org
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


and here is my /etc/host
Code:
127.0.0.1 localhost.localdomain localhost
#67.18.187.77 mugen.ext9.org mugen

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


and /etc/hostname
Code:
mugen.ext9.org


How do I fix this? Thanks[/code]

Author:  SteveG [ Sun Dec 30, 2007 6:16 pm ]
Post subject: 

What do mean "mails are going to the wrong place"? Mails you send from an external host? Mails sent from the same host? Your postfix setup says it should accept mails addressed to either @hostname.domain.com or @domain.com equally well. (that's what the mydestinations parameter does)

What's in /etc/mailname?

Oh, and your DNS setup is broken -- your MX record for ext9.org points to mail.ext9.org, but there's not A record for that. Is that what you were saying, that you
could send mail to hostname.domain.com, but not domain.com? The DNS problem would explain that.

Author:  vaxen [ Mon Dec 31, 2007 9:17 am ]
Post subject: 

/etc/mailname == ext9.org

Quote:
that you
could send mail to hostname.domain.com, but not domain.com? The DNS problem would explain that.


Exactly what I mean. I've changed my MX record to mugen.ext9.org. Hope this works.

Author:  SteveG [ Mon Dec 31, 2007 6:27 pm ]
Post subject: 

Your DNS looks good now. BTW, what I did was:

Code:
$ dig -t MX ext9.org
; <<>> DiG 9.3.4 <<>> -t MX ext9.org
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64405
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;ext9.org.                      IN      MX

;; ANSWER SECTION:
ext9.org.               7200    IN      MX      0 mugen.ext9.org.

;; AUTHORITY SECTION:
ext9.org.               7190    IN      NS      ns3.zoneedit.com.
ext9.org.               7190    IN      NS      ns9.zoneedit.com.

;; ADDITIONAL SECTION:
mugen.ext9.org.         7190    IN      A       67.18.187.77
ns3.zoneedit.com.       20952   IN      A       72.51.43.223

Author:  vaxen [ Mon Jan 07, 2008 9:07 am ]
Post subject: 

Thanks so much SteveG

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/