Postfix (Roundcube Client) Sends Mail, But Not Able To Receive

Home » CentOS » Postfix (Roundcube Client) Sends Mail, But Not Able To Receive
CentOS 17 Comments

Dear All Recently I just setup postfix, dovecot, roundcube etc in a dedicated server.

But from my gmail account, when sent mail to my mail id, that I setup recently, I do not see that email in roundcuble inbox. Neither that mail bounced back in gmail. Not sure, how do I debug this.

Kindly let me know how should I proceed to fix this issue.

Thanks Austin

17 thoughts on - Postfix (Roundcube Client) Sends Mail, But Not Able To Receive

  • First look in your posftix log to see if there has been an attempt to deliver it. If it hasn’t gotten that far, make sure that your DNS MX
    record is visible to the rest of the world and also the A record for the name in the MX. Then check that there are no firewalls blocking port 25 either from the internet service provider or your router, or your host.

    These are easiest if you have some outside account where you can:
    dig -t MX your_domain.com then dig name_of_MX_host then telnet IP_address 25
    and you should get an SMTP ready prompt from your postfix.

    If your domain name did not resolve in DNS at all, gmail should have rejected it immediately, but it may resolve to the wrong address or the connection may be blocked somewhere and it would retry for a while.

  • Dear Les Mikesell I executed the steps you have advised.

    1. MX Record Check
    [root@ip-173-201-189-43 necs14]#
    [root@ip-173-201-189-43 necs14]# dig -t MX netcloudjobs.com

    ; < <>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 < <>> -t MX
    netcloudjobs.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 28659 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;netcloudjobs.com. IN MX ;; ANSWER SECTION: netcloudjobs.com. 86400 IN MX 0 mail.netcloudjobs.com. ;; AUTHORITY SECTION: netcloudjobs.com. 86400 IN NS ns2.netcloudjobs.com. netcloudjobs.com. 86400 IN NS ns1.netcloudjobs.com. ;; ADDITIONAL SECTION: mail.netcloudjobs.com. 86400 IN A 173.201.189.43 ns1.netcloudjobs.com. 86400 IN A 173.201.189.43 ns2.netcloudjobs.com. 86400 IN A 173.201.189.43 ;; Query time: 0 msec ;; SERVER: 10.0.0.1#53(10.0.0.1) ;; WHEN: Wed Mar 13 15:41:00 2013 ;; MSG SIZE rcvd: 139 [root@ip-173-201-189-43 necs14]# clear [root@ip-173-201-189-43 necs14]# 2. A record check [root@ip-173-201-189-43 necs14]# dig mail.netcloudjobs.com ; < <>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 < <>> mail.netcloudjobs.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 5672 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;mail.netcloudjobs.com. IN A ;; ANSWER SECTION: mail.netcloudjobs.com. 86400 IN A 173.201.189.43 ;; AUTHORITY SECTION: netcloudjobs.com. 86400 IN NS ns1.netcloudjobs.com. netcloudjobs.com. 86400 IN NS ns2.netcloudjobs.com. ;; ADDITIONAL SECTION: ns1.netcloudjobs.com. 86400 IN A 173.201.189.43 ns2.netcloudjobs.com. 86400 IN A 173.201.189.43 ;; Query time: 0 msec ;; SERVER: 10.0.0.1#53(10.0.0.1) ;; WHEN: Wed Mar 13 15:42:19 2013 ;; MSG SIZE rcvd: 123 [root@ip-173-201-189-43 necs14]# I see in my firewall telenet/25 is blocked. However SMTP/25 is allowed. Not sure how do I debug…, Any idea… -Austin

  • Dear All I have some basic doubts.

    1. Do I need to run postfix like /etc/init.d/postfix restart
    2. What I found it , it is starting.., but when I check immediately ps -ef
    | grep postfix, I do not see any postfix process running.
    3. Is there any system config file, where I need to mention system need to run postfix not sendmail….
    4. If postfix is not running, how am I able to send mails out….

    5. I read some “make sure port 25 does not relay mails”, can somebody explain more in this regard and how do I stop port 25 relaying mails…

    My apologize for novice questions.

    Regards
    -Austin

  • What does that mean? Both services use TCP. Telnet is normally port
    23, SMTP is 25. I suggested ‘telnet IP_address 25’ as a quick way to see if tcp/25 is permiited.

    I can’t connect now, though, so either postfix is not listening or there is a firewall somewhere.

  • telnet ipaddress 25 is not working, looks postfix is not running, but i am clueless why it does not startup even if i do /etc/init.d/postfix restart. even if it is not running, how i am able to send mails out using roundcube….

    -austin

  • In CentOS we still have the service command, and it works well with services like postfix. So you start, restart, and stop with:

    service postfix start/stop/restart/status

    Note that at some point, probably CentOS 7, ‘service’ is going away.

    Oh, and:

    chkconfig –list|grep postfix

    It should be on for all run levels if not:

    chkconfig postfix on

    Did you install sendmail?

    grep sendmail /root/install.log

    service sendmail status

    chkconfig –list|grep sendmail

    check to see what is running.

    Read to Postfix docs on this first then ask questions. Do a google search. This is something you need to know about. the campworld howto sets you up safe. If you got all of his stuff done.

  • Dear Robert I have a bigger problem.

    sendmail was running previously. thats the reason I was able to send mail. Mow did chkconfig off for sendmail.

    Now postfix is running.

    Both send/recv not working now.

    While sending mail from roundcuble it says “connection to server failed”.

    regards
    -austin

  • Look at /var/log/maillog and see what it says there.

    And I think roundcube does not directly send via port 25 (postfix) but sends through dovecot. So I would look for dovecot errors. Is it running? Have you set it to be running at boot?

  • Looks I did not start amavisd service. Thats why probably connection to
    127.0.0.1:10024 is being refused. I tried starting amavisd service. Gets bunch of erropr as below.

    *[root@ip-173-201-189-43 postfix]# service amavisd restart Shutting down amavisd: fetch_modules: error loading required module MIME/Head.pm:
    Can’t locate Mail/Header.pm in @INC (@INC contains:
    /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at
    /usr/share/perl5/MIME/Head.pm line 120.
    BEGIN failed–compilation aborted at /usr/share/perl5/MIME/Head.pm line
    120.
    Compilation failed in require at /usr/sbin/amavisd line 197. fetch_modules: error loading required module MIME/Entity.pm:
    Can’t locate Mail/Internet.pm in @INC (@INC contains:
    /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at
    /usr/share/perl5/MIME/Entity.pm line 229.
    BEGIN failed–compilation aborted at /usr/share/perl5/MIME/Entity.pm line
    229.
    Compilation failed in require at /usr/sbin/amavisd line 197. fetch_modules: error loading required module MIME/Parser.pm:
    Attempt to reload MIME/Head.pm aborted.
    Compilation failed in require at /usr/share/perl5/MIME/Parser.pm line 143.
    BEGIN failed–compilation aborted at /usr/share/perl5/MIME/Parser.pm line
    143.
    Compilation failed in require at /usr/sbin/amavisd line 197. ERROR: MISSING REQUIRED BASIC MODULES:
    MIME::Head
    MIME::Entity
    MIME::Parser BEGIN failed–compilation aborted at /usr/sbin/amavisd line 237.
    [FAILED]

    Starting amavisd: fetch_modules: error loading required module MIME/Head.pm:
    Can’t locate Mail/Header.pm in @INC (@INC contains:
    /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at
    /usr/share/perl5/MIME/Head.pm line 120.
    BEGIN failed–compilation aborted at /usr/share/perl5/MIME/Head.pm line
    120.
    Compilation failed in require at /usr/sbin/amavisd line 197. fetch_modules: error loading required module MIME/Entity.pm:
    Can’t locate Mail/Internet.pm in @INC (@INC contains:
    /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at
    /usr/share/perl5/MIME/Entity.pm line 229.
    BEGIN failed–compilation aborted at /usr/share/perl5/MIME/Entity.pm line
    229.
    Compilation failed in require at /usr/sbin/amavisd line 197. fetch_modules: error loading required module MIME/Parser.pm:
    Attempt to reload MIME/Head.pm aborted.
    Compilation failed in require at /usr/share/perl5/MIME/Parser.pm line 143.
    BEGIN failed–compilation aborted at /usr/share/perl5/MIME/Parser.pm line
    143.
    Compilation failed in require at /usr/sbin/amavisd line 197. ERROR: MISSING REQUIRED BASIC MODULES:
    MIME::Head
    MIME::Entity
    MIME::ParserBEGIN failed–compilation aborted at /usr/sbin/amavisd line
    237.
    [FAILED]

    *

  • That sounds like you installed something that wasn’t rpm-packaged
    (why?) and you are missing dependencies.

  • I hope this comes from perl-mailtools package. It was installed using yum.

    I just searched MIME/Header.pm is there but in a different path.

    In my system, MIME/Header.pm is present in path
    /usr/lib/perl5/vendor_perl/5.8.5/Mail/Header.pm

    Looks amivsd is searching at below paths

    */usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5 /usr/share/perl5

    *
    How can I instruct amivsd to look at path /usr/lib/perl5/vendor_perl/5.8.5

    Many thanks for great support.

    -Austin

  • It should already know where to look if you installed it via yum and let it pull in the dependencies. Is this the amavisd-new package from EPEL?

  • Hi Les Mikesell The rpm installed in my m/c is *amavisd-new-2.6.4-2.el6.noarch*.

    I believe it is from epel (I have epel repo enabled).

    Is it incompatible?

    Regards Austin

  • An unmodified version seems to start OK. Are you sure you have the
    64-bit versions of perl and related packages installed?
    rpm -q –qf “%{n}-%{version}.%{arch}\n” perl

  • perl-5.10.1.x86_64

    This is the output of command “rpm -q –qf “%{n}-%{version}.%{arch}\n”
    perl”.

    So must be 64 bit compatible one.

    should I uninstall this rpm and reinstall again

    regards austin

  • So how did something get installed at:
    /usr/lib/perl5/vendor_perl/5.8.5/Mail/Header.pm?

    If it is from a package, rpm -q –whatprovides /usr/lib/perl5/vendor_perl/5.8.5/Mail/Header.pm should tell you. Try to install the right version of that.

  • If you ARE using the amavisd from epel, you should follow the instructions from:

    http://wiki.CentOS.org/HowTos/Amavisd

    not

    http://campworld.net/thewiki/pmwiki.php/LinuxServersCentOS/Cent6VirtMailServer

    as it uses rpmfusion, if I recall right. But definitely not epel. Part of the reason I did not follow its anti-spam portion.

    The install should have been:

    yum install amavisd-new clamav clamav-devel clamd spamassassin

    Then there are group permission problems. I have entered a bug report for epel on this: 906396

    You need to:

    gpasswd -a clam amavis chkconfig clamd on chkconfig amavisd on

    Then there are some specific run directories that have to match. I am in the Orlando airport and they are blocking my SSH back to my server to get the correct changes but my old notes with me say something to the effect:

    in /etc/amavisd/amavisd.conf change .pid to match in /etc/clamd.conf
    But I can’t get to the exact info until I get home this afternoon.

    Then the var directory is not created by the rpm. You need to:

    cd /var/spool/amavisd mkdir var chown amavis:amavis var chmod 700 var

    Though one follow soujourner said 750 for the whole tree.

    Finally:

    sa-update service amavisd start service clamd start chkconfig amavisd on

    Then test with:

    telnet localhost 10024
    ehlo localhost quit

    telnet localhost 10025
    ehlo localhost quit

    postconf -e ‘content_filter=amavisfeed:[127.0.0.1]:10024’

    cd /usr/share/doc/amavisd-new-2.6.4/test-messages perl -pe ‘s/./chr(ord($&)^255)/sge’
    And test with:

    sendmail -i user@domain.com < sample-virus-simple.txt sendmail -i user@domain.com < sample-spam-GTUBE-junk.txt Check maillog to see what is happening. Depending on your amavisd.conf you may be dropping these or tagging them, but letting them go through. I really need to publish MY howto. But only after I go live in about a month…

LEAVE A COMMENT