1 (edited by zerointeractive 2011-05-25 15:44:05)

Topic: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

Hi Fellows,

please dont spank me cause I am new but i definitely need your help ! smile

I have done a fresh install on a Debian 6.0 and everything went smooth but.. I cannot receive mails!!

I have made several tries but always same stories.

I have followed this HowTo : http://www.howtoforge.com/iredmail-0.7. … an-squeeze

But still have some problems in the /var/log/mail.log:

 
May 18 08:01:18 mail postfix/smtpd[8383]: NOQUEUE: reject: RCPT from mail-pz0-f52.google.com[209.85.210.52]: 451 4.3.5 Server configuration problem; from=<xxxxx@gmail.com> to=<yyyyy@--myrealdomainishere--.com> proto=ESMTP helo=<mail-pz0-f52.google.com>
May 18 08:01:19 mail postfix/smtpd[8383]: disconnect from mail-pz0-f52.google.com[209.85.210.52]
May 18 08:02:29 mail postfix/smtpd[8383]: connect from dub0-omc1-s20.dub0.hotmail.com[157.55.0.219]
May 18 08:02:29 mail postfix/smtpd[8383]: warning: connect to 127.0.0.1:10031: Connection refused
May 18 08:02:29 mail postfix/smtpd[8383]: warning: problem talking to server 127.0.0.1:10031: Connection refused
May 18 08:02:30 mail postfix/smtpd[8383]: warning: connect to 127.0.0.1:10031: Connection refused
May 18 08:02:30 mail postfix/smtpd[8383]: warning: problem talking to server 127.0.0.1:10031: Connection refused
May 18 08:02:30 mail postfix/smtpd[8383]: NOQUEUE: reject: RCPT from dub0-omc1-s20.dub0.hotmail.com[157.55.0.219]: 451 4.3.5 Server configuration problem; from=<xxxxx@hotmail.it> to=<yyyy@--myrealdomainishere--.com> proto=ESMTP helo=<dub0-omc1-s20.dub0.hotmail.com>
May 18 08:02:30 mail postfix/smtpd[8383]: disconnect from dub0-omc1-s20.dub0.hotmail.com[157.55.0.219]
May 18 08:04:43 mail postfix/smtpd[8509]: connect from mail-iy0-f180.google.com[209.85.210.180]
May 18 08:04:44 mail postfix/smtpd[8509]: warning: connect to 127.0.0.1:10031: Connection refused
May 18 08:04:44 mail postfix/smtpd[8509]: warning: problem talking to server 127.0.0.1:10031: Connection refused
May 18 08:04:45 mail postfix/smtpd[8509]: warning: connect to 127.0.0.1:10031: Connection refused
May 18 08:04:45 mail postfix/smtpd[8509]: warning: problem talking to server 127.0.0.1:10031: Connection refused
May 18 08:04:45 mail postfix/smtpd[8509]: NOQUEUE: reject: RCPT from mail-iy0-f180.google.com[209.85.210.180]: 451 4.3.5 Server configuration problem; from=<xxxx@gmail.com> to=<yyyy@--myrealdomainishere--.com> proto=ESMTP helo=<mail-iy0-f180.google.com>
May 18 08:04:45 mail postfix/smtpd[8509]: disconnect from mail-iy0-f180.google.com[209.85.210.180]

My /etc/postfix/master.cf is:

#
# 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
#submission inet n       -       -       -       -       smtpd
#  -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 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       -       -       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
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
    -o smtp_fallback_relay=
#       -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}

# Bypass checks for internally generated mail.
pickup    fifo  n       -       n       60      1       pickup
  -o content_filter=
submission inet n       -       n       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
#  -o content_filter=smtp-amavis:[127.0.0.1]:10026

smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o content_filter=smtp-amavis:[127.0.0.1]:10026
# Use dovecot deliver program as LDA.
dovecot unix    -       n       n       -       -      pipe
    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${domain}
procmail unix    -       n       n       -       -      pipe
  flags=DRhu user=vmail:vmail argv=/usr/bin/procmail -r -t SENDER=${sender} RECIPIENT=${recipient} DOMAIN=${nexthop} -m USER=${user} EXTENSION=${extension} /etc/procmailrc
smtp-amavis unix -  -   -   -   2  smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20

127.0.0.1:10025 inet n  -   -   -   -  smtpd
    -o content_filter=
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_delay_reject=no
    -o smtpd_client_restrictions=permit_mynetworks,reject
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks_style=host
    -o mynetworks=127.0.0.0/8
    -o strict_rfc821_envelopes=yes
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
    -o smtpd_client_connection_count_limit=0
    -o smtpd_client_connection_rate_limit=0
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings

Can you advise on how to fix the error and start receiving mail ??
Thanks in advance,
Luigi

2

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

10031 is port used by policyd.

/etc/init.d/policyd restart

Check that your configs are OK.

3

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

also you can try

lsof -i :10031

if you don't have the command, just install it

aptitude install lsof

should print something like this:

COMMAND     PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
postfix-p 17425 policyd    6u  IPv4 381936      0t0  TCP mail.domain.com:10031 (LISTEN)

maybe you have installed a firewall which is blocking the port?

4

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

I have done every single action you suggested and the result is the following:
policyd is not listening on port 10031
/etc/init.d/policyd restart is not a valid command.

For the time being I have disabled check_policyd from the main.cf and now I can receive mail.
Is this a bug ?

c33s wrote:

also you can try

lsof -i :10031

if you don't have the command, just install it

aptitude install lsof

should print something like this:

COMMAND     PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
postfix-p 17425 policyd    6u  IPv4 381936      0t0  TCP mail.domain.com:10031 (LISTEN)

maybe you have installed a firewall which is blocking the port?

5

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

zerointeractive wrote:

/etc/init.d/policyd restart is not a valid command.

Do you have package postfix-policyd installed?

6

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

Apparentely everything seems installed...

Postfix here:

root@mail:~# dpkg -s postfix
Package: postfix
Status: install ok installed
Priority: extra
Section: mail
Installed-Size: 3492
Maintainer: LaMont Jones <lamont@debian.org>
Architecture: amd64
Version: 2.7.1-1
Replaces: mail-transport-agent, postfix-tls
Provides: mail-transport-agent, postfix-tls
Depends: libc6 (>= 2.11), libdb4.8, libsasl2-2, libssl0.9.8 (>= 0.9.8m-1), debco                                 nf (>= 0.5) | debconf-2.0, netbase, adduser (>= 3.48), dpkg (>= 1.8.3), lsb-base                                  (>= 3.0-6), ssl-cert
Recommends: python
Suggests: procmail, postfix-mysql, postfix-pgsql, postfix-ldap, postfix-pcre, sa                                 sl2-bin, libsasl2-modules, resolvconf, postfix-cdb, mail-reader, ufw
Conflicts: libnss-db (<< 2.2-3), mail-transport-agent, postfix-tls, smail
Conffiles:
 /etc/init.d/postfix 1e54ba2a74277aa4d4713a1771c15f96
 /etc/ppp/ip-up.d/postfix fccc53fc4eeeab46941ebcc95a71e766
 /etc/ppp/ip-down.d/postfix 52275dc23864f3bfca412c7558e28fe6
 /etc/network/if-up.d/postfix fccc53fc4eeeab46941ebcc95a71e766
 /etc/network/if-down.d/postfix 52275dc23864f3bfca412c7558e28fe6
 /etc/postfix/postfix-files 47e63262ab84069c840556b469b0fb2f
 /etc/postfix/postfix-script 0d01860b2f0778cf41951c801f538b30
 /etc/postfix/post-install d53706c232f6497539fa0c99df674b33
 /etc/rsyslog.d/postfix.conf d8a09827fff2a22311e4dd4a83e95c83
 /etc/ufw/applications.d/postfix 6716a7729145a40bf7cb721c8dc6c3b0
 /etc/resolvconf/update-libc.d/postfix 6c80adbe120bc46cbf42658a7364e17f
Description: High-performance mail transport agent
 Postfix is Wietse Venema's mail transport agent that started life as an
  alternative to the widely-used Sendmail program.  Postfix attempts to
  be fast, easy to administer, and secure, while at the same time being
  sendmail compatible enough to not upset existing users. Thus, the outside
  has a sendmail-ish flavor, but the inside is completely different.

And postfix-policyd...

root@mail:~# dpkg -s postfix-policyd
Package: postfix-policyd
Status: install ok installed
Priority: optional
Section: mail
Installed-Size: 240
Maintainer: OndÅej Surý <ondrej@debian.org>
Architecture: amd64
Source: postfix-policyd (1.82-2)
Version: 1.82-2+b1
Depends: dbconfig-common, mysql-client, libc6 (>= 2.3), libmysqlclient16 (>= 5.1.36), zlib1g (>= 1:1.1.4), debconf (>= 0.5) | debconf-2.0
Recommends: mysql-server
Conffiles:
 /etc/default/postfix-policyd 9e16589d5a811754e50f60f41baeb976
 /etc/init.d/postfix-policyd 5c6e60d6a831b3862f6675409b5e081a
 /etc/cron.daily/postfix-policyd 1245caae0a1c123d176ddc42ef0bba6d
Description: anti-spam plugin for Postfix
 Policyd is an anti-spam plugin for Postfix (MySQL based) that
 does  Greylisting, Sender-(envelope  or SASL)-based throttling
 (on messages and / or volume  per defined time unit), Spamtrap
 monitoring / blacklisting and HELO auto blacklisting.

7

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

zerointeractive wrote:

maybe you have installed a firewall which is blocking the port?

No firewall installed, I did a fresh new installation without any firewalling active.

8

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

Seems postfix-policyd was installed, but what does "/etc/init.d/policyd restart is not a valid command." mean?

9 (edited by zerointeractive 2011-05-24 15:38:09)

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

ZhangHuangbin wrote:

Seems postfix-policyd was installed, but what does "/etc/init.d/policyd restart is not a valid command." mean?

Well.. I found that postfix-policyd is in /usr/sbin/postfix-policyd

So i did a restart as follows but I have another problem...

root@mail:~# /usr/sbin/postfix-policyd restart
starting policyd v1.82
cannot set rlimit: Operation not permitted

I think this may depend on the user limits imposed by my VPS.
I have now asked support on this to be able to

ulimit -HS -n 8192

10

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

Does /etc/init.d/postfix-policyd exist? If so, use it:

# /etc/init.d/postfix-policyd restart

11

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

ZhangHuangbin wrote:

Does /etc/init.d/postfix-policyd exist? If so, use it:

# /etc/init.d/postfix-policyd restart

on my Debian 6.0 squeeze it is:

# /usr/sbin/postfix-policyd restart

but as explained in my last post, this didn't solve my problem

12

Re: [SOLVED] Cannot receive mails (Connect to 127.0.0.1:10031: ...refused

OK now it is working...
The problem was that the policyd was not running as Zhang has pointed out in its earlier post.

Thanks.