Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've recently change the hosting for my site and one of the things I had to do was to move the email server (update DNS with new IP and MX records ...) I am using Postfix + Dovecot on CentOS 5.8. The email client is Squirrelmail deployed on Apache server. I noticed the following issues:

  1. I can send email from Squirrelmail to my gmail account, but I cannot send email from my gmail account to contact@mydomain.com. I receive no error, but message never arrives or Squirrelmain cannot see it.

  2. I can connect to Postfix on port 25 (smtp), but only from localhost. I see two possible causes here:

    • bad Postfix configuration; I have inet_interfaces = all in main.cf
    • firewall settings; I never changed the default firewall configuration since I bought the VPS

The DNS zone export from GoDaddy is:

; SOA Record
MYDOMAIN.COM.   3600    IN  SOA ns05.domaincontrol.com. dns.jomax.net (
                2012050704
                28800
                7200
                604800
                3600
                )

; A Records
@       3600    IN  A   my_host_ip
www     3600    IN  A   my_host_ip
mail    3600    IN  A   my_host_ip

; MX Records
@   3600    IN  MX  0   mail.mydomain.com

; NS Records
@   3600    IN  NS  ns05.domaincontrol.com
@   3600    IN  NS  ns06.domaincontrol.com 

I appreciate any help.

Updates:

main.cf file

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.mydomain.com
mydomain = mydomain.com
myorigin = $mydomain
inet_interfaces = all
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains = 
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

master.cf file

smtp      inet  n       -       n       -       -       smtpd
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
    -o fallback_relay=
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -   -   n   -   1   scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
old-cyrus unix  -       n       n       -       -       pipe
  flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
cyrus     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

Thank you for your help.

share|improve this question
    
If you run netstat -an |grep 25, what do you see? There should be a postfix process listening there, since you can connect across localhost. If it's only localhost, you'll need to show us the main.cf and master.cf files for postfix, as postfix isn't listening to the public interface. –  cjc May 7 '12 at 13:28
    
the result of netstat -an |grep 25 is tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN Should this be cause by the following main.cf setting: mynetworks = 192.168.0.0/24, 127.0.0.0/8 ? –  user337620 May 7 '12 at 14:43
    
Your postfix is only listening to localhost. The mynetworks parameter in main.cf doesn't tell postfix which interfaces to bind to; the master.cf does. grep smtp master.cf. What does that say? You should have a line that looks like 'smtp inet n - n - - smtpd'. –  cjc May 7 '12 at 16:20
    
sorry for my first comment. mynetworks is indeed not related with my problem. I have updated my post with the configuration files, striped by all commented lines (lots of them) –  user337620 May 7 '12 at 18:54

1 Answer 1

In seems that somehow I ended up in my main.cf with this

inet_interfaces = all
inet_interfaces = localhost

The last one was the one actually taken into account so I had to comment it and leave only:

inet_interfaces = all

Problem solved. Thank for helping everyone.

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.