0

I have set up a redmine server that I got from turnkey linux. Mail more-or-less works out of the box. I can mail to anyone that is not in my domain.

Let me explain:
If I run the mail command from the commandline and send to my personal email (or any other non-domain email) it works. If I mail to anyone in my domain it does not. Our mail is handled by Google and works find. For some reason this machine sees the domain and tries to handle it itself (which I don't want). I just want the mail to go its natural path to Google (or wherever it is going). I have a feeling that if I change the domain of the machine to something other than mine (and that is OK with me) it will start to work fine. I have tried doing this but think that I missed one. Any help would be most appreciated!

I thought that perhaps changing the domain may trick postfix. I changed the hostname file:

redmine.hsi.com

Here is the main.cf file:

# 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 (Debian/GNU)
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

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_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 = redmine
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localdomain, localhost, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_map

Here is the master.cf:

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       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_helo_timeout=5 -o smtp_connect_timeout=5
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
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
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}

here is the mail.log

Feb 27 21:13:13 redmine postfix/pickup[15860]: 56D53C0D32: uid=0 from=<[email protected]>
Feb 27 21:13:13 redmine postfix/cleanup[19150]: 56D53C0D32: message-id=<20150227211313.56D53C0D32@redmine>
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: from=<[email protected]>, size=349, nrcpt=1 (queue active)
Feb 27 21:13:13 redmine postfix/smtp[19159]: 56D53C0D32: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type)
Feb 27 21:13:13 redmine postfix/cleanup[19150]: 5E24FC0D33: message-id=<20150227211313.5E24FC0D33@redmine>
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: from=<>, size=2276, nrcpt=1 (queue active)
Feb 27 21:13:13 redmine postfix/bounce[19166]: 56D53C0D32: sender non-delivery notification: 5E24FC0D33
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: removed
Feb 27 21:13:13 redmine postfix/smtp[19159]: 5E24FC0D33: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=redmine.hsi.com type=AAAA: Host not found)
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: removed

here is the mail.info:

Feb 27 21:13:13 redmine postfix/pickup[15860]: 56D53C0D32: uid=0 from=<[email protected]>
Feb 27 21:13:13 redmine postfix/cleanup[19150]: 56D53C0D32: message-id=<20150227211313.56D53C0D32@redmine>
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: from=<[email protected]>, size=349, nrcpt=1 (queue active)
Feb 27 21:13:13 redmine postfix/smtp[19159]: 56D53C0D32: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type)
Feb 27 21:13:13 redmine postfix/cleanup[19150]: 5E24FC0D33: message-id=<20150227211313.5E24FC0D33@redmine>
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: from=<>, size=2276, nrcpt=1 (queue active)
Feb 27 21:13:13 redmine postfix/bounce[19166]: 56D53C0D32: sender non-delivery notification: 5E24FC0D33
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: removed
Feb 27 21:13:13 redmine postfix/smtp[19159]: 5E24FC0D33: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=redmine.hsi.com type=AAAA: Host not found)
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: removed

As Tutul suggested, I added the following line to main.cf, restarted postfix, and tried emailing again with the same results: Emails to any domain other than humansolutionsinc.com work find, those to anyone within the domain do not.

inet_protocols=ipv4

Here is the output of dig humansolutionsinc.com:

root@redmine ~# dig humansolutionsinc.com

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> humansolutionsinc.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31920
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;humansolutionsinc.com.         IN      A

;; AUTHORITY SECTION:
humansolutionsinc.com.  3600    IN      SOA     hsiwd1.hsi.com. hostmaster.hsi.com. 5 900 600 86400 3600

;; Query time: 1 msec
;; SERVER: 192.168.1.4#53(192.168.1.4)
;; WHEN: Mon Mar  2 14:03:05 2015
;; MSG SIZE  rcvd: 97

and the output of dig humansolutionsinc.com mx:

root@redmine ~# dig humansolutionsinc.com mx

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> humansolutionsinc.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36172
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;humansolutionsinc.com.         IN      MX

;; AUTHORITY SECTION:
humansolutionsinc.com.  3600    IN      SOA     hsiwd1.hsi.com. hostmaster.hsi.com. 5 900 600 86400 3600

;; Query time: 1 msec
;; SERVER: 192.168.1.4#53(192.168.1.4)
;; WHEN: Mon Mar  2 14:03:13 2015
;; MSG SIZE  rcvd: 97

Great! after a series of reboots (chasing other issues - nothing to do with mail) NO mail is being sent

OK, back to square one. I had changed /etc/host and /etc/hots to be redmine (without the domain.) I have subsequently changed them back to be redmine.hsi.com and run:

invoke-rc.d hostname.sh start
invoke-rc.d networking force-reload 
7
  • Interesting logs. Umm...has this machine got IPv4 connectivity? Feb 27, 2015 at 21:26
  • Yes. It may be showing IPV6 also but we are not using it. Feb 27, 2015 at 21:35
  • To be specific I am able to access it via its IPV4 address and it can access other machines via hostname or IPV4 addresses. At least that part is working. Feb 27, 2015 at 21:43
  • Try changin myhostname to something else - for example mail.redmine.hsi.com
    – davidgo
    Feb 28, 2015 at 5:15
  • There are something wrong with your DNS resolver. My server CAN send to humansolutionsinc.com. Feb 28 17:13:06 mail postfix/smtp[93028]: B9E9050818: to=<[email protected]>, relay=aspmx.l.google.com[74.125.200.26]:25, delay=5.8, delays=0.02/0.03/4.6/1.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1425118386 fn2si8348628pbc.93 - gsmtp)
    – masegaloeh
    Feb 28, 2015 at 10:15

2 Answers 2

2

Fix your NS server 192.168.1.4. It should return proper MX and A record, instead empty answer like above.

Explanation:

These log lines

Feb 27 21:13:13 redmine postfix/pickup[15860]: 56D53C0D32: uid=0 from=<[email protected]>
Feb 27 21:13:13 redmine postfix/cleanup[19150]: 56D53C0D32: message-id=<20150227211313.56D53C0D32@redmine>
Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: from=<[email protected]>, size=349, nrcpt=1 (queue active)
Feb 27 21:13:13 redmine postfix/smtp[19159]: 56D53C0D32: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type) 

tell us that an email invoked by mail command with sender [email protected] and recipient [email protected].

Because domain humansolutionsinc.com isn't defined in mydestination parameter, then postfix will mark this domain as outgoing domain, thus postfix must send it via remote SMTP. To determine where the mail server responsible for humansolutionsinc.com, postfix use DNS lookup especially to searching MX record (and optionally A record). We can use command dig to simulate NS lookup.

Here the (proper) dig output from MY server

$ dig humansolutionsinc.com

; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1 <<>> humansolutionsinc.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12591
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;humansolutionsinc.com.         IN      A

;; ANSWER SECTION:
humansolutionsinc.com.  1199    IN      A       98.136.187.13

;; Query time: 1508 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Mar 02 19:21:03 WIB 2015
;; MSG SIZE  rcvd: 66

and

$ dig humansolutionsinc.com MX

; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1 <<>> humansolutionsinc.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35479
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;humansolutionsinc.com.         IN      MX

;; ANSWER SECTION:
humansolutionsinc.com.  599     IN      MX      10 aspmx.l.google.com.
humansolutionsinc.com.  599     IN      MX      20 alt1.aspmx.l.google.com.
humansolutionsinc.com.  599     IN      MX      20 alt2.aspmx.l.google.com.
humansolutionsinc.com.  599     IN      MX      30 aspmx2.googlemail.com.
humansolutionsinc.com.  599     IN      MX      30 aspmx3.googlemail.com.

;; Query time: 942 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Mar 02 19:21:08 WIB 2015
;; MSG SIZE  rcvd: 180

Comparing with my version, your dig output contains zero answers.

That's explain why postfix complain with generic message like

Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type

First, Postfix will lookup MX record, if it fails the it'll fallback by lookuping A record (IPv4) and then AAAA record (IPv6). Because postfix can't found the destination host of your domain from three records above, then postfix bounced your email.

7
  • We don't have an internal mail server - it goes to Google as you can see. IMHO I really don't think I need to deal with our DNS server (it works for all other domains.) There is something special about humansolutionsinc.com in this particular postfix configuration that makes it handle emails to this domain differently. Mar 2, 2015 at 16:21
  • Well your dig output tells it... Or can you explain why do my dig output and your dig output has different result?
    – masegaloeh
    Mar 2, 2015 at 19:34
  • I'm sorry, I don't understand. dig output tells me what? I don't pretend to understand dig outputs. Perhaps out DNS is wrong for our domain and right for all other domains? Mar 2, 2015 at 20:13
  • masegaloeh OK, I'm a little dense, but I think I finally get it. I have asked out network group to look into this. Any suggestions on what needs to be added to the DNS server? Mar 2, 2015 at 20:25
  • Is there anyway to spoof this on the actual host without making changes to the DNS? Mar 2, 2015 at 20:31
0

Try changing myhostname to something else - for example mail.redmine.hsi.com

5
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
    – HBruijn
    Feb 28, 2015 at 7:27
  • @HBrujn In what way does it not answer the question ? I would have throught it a direct answe to the question " I have a feeling that if I change the domain of the machine to something other than mine (and that is OK with me) it will start to work fine. I have tried doing this but think that I missed one. " - ie I'm asserting that this setting in his config is incorrect and fixing that will fix his problem.
    – davidgo
    Feb 28, 2015 at 8:13
  • 1
    I read your answer as a comment and something different to try rather than a straight up answer, for exactly that reason.
    – HBruijn
    Feb 28, 2015 at 8:39
  • @HBruijn Not only is this an answer, it's usually a very good one in similar circumstances. Very often issues like this are caused by a misnamed host. I am not convinced it is the right answer in this particular situation though. Feb 28, 2015 at 13:37
  • Actually, I did change it. It was originally redmine.humansolutionsinc.com and I changed it to redmine.hsi.com thinking the same thing. That was my first thought,but it didn't seem to work 😩 Feb 28, 2015 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .