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
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)