Postfix not sending mail

Hi there,

I am having some troubles with Postfix. I constantly get this in the logs:

Mar 31 18:17:39 server1 postfix/qmgr[20159]: 02DC0A30C64: from=<>, size=693, nrcpt=1 (queue active) Mar 31 18:17:39 server1 postfix/qmgr[20159]: 02DC0A30C64: to=<>, orig_to=<root>, relay=none, delay=40480, delays=40480/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to[]: Connection refused)

I have searched far and wide but nothing I try is working.

I appreciate any help or ideas anyone has. Thank you!


Hi Ryan,

I’d expect to see that error if Postfix were erroring when it launched.

If you log in over SSH, and type:

/etc/init.d/postfix restart

Take a look in those mail logs again, and see if there were any errors generated when it restarted.

And if so, what are the errors? :slight_smile:

I don’t see any unusual errors. I have just passed 3000 emails in the queue. I have just a bunch of this in the log and then it goes back into the other error.

Mar 31 20:26:13 server1 postfix/postfix-script: stopping the Postfix mail system Mar 31 20:26:13 server1 postfix/master[21811]: terminating on signal 15 Mar 31 20:26:13 server1 postfix/postfix-script: starting the Postfix mail system Mar 31 20:26:13 server1 postfix/master[24133]: daemon started -- version 2.3.3, configuration /etc/postfix Mar 31 20:26:13 server1 postfix/qmgr[24136]: 6A5DEA30A2C: from=<>, size=2212, nrcpt=1 (queue active) Mar 31 20:26:13 server1 postfix/smtp[24137]: connect to[]: Connection refused (port 10024) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 659F4A30778: from=<>, size=3200, nrcpt=1 (queue active) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 69F99A30E40: from=<>, size=640, nrcpt=1 (queue active) Mar 31 20:26:13 server1 postfix/smtp[24139]: connect to[]: Connection refused (port 10024) Apr 1 00:26:13 server1 postfix/smtp[24137]: 6A5DEA30A2C: to=<>, orig_to=<root@localhost>, relay=none, delay=58684, delays=58684/0.01/0/0, dsn=4.4.1, status=deferred (connect to[]: Connection refused) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 65E2DA309C0: from=<>, size=11080, nrcpt=1 (queue active) Apr 1 00:26:13 server1 postfix/smtp[24139]: 659F4A30778: to=<>, relay=none, delay=87444, delays=87444/0.01/0/0, dsn=4.4.1, status=deferred (connect to[]: Connection refused) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 695DBA30F0B: from=<>, size=623, nrcpt=1 (queue active) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 662E5A30CC5: from=<>, size=1417, nrcpt=1 (queue active) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 61680A30E7D: from=<>, size=638, nrcpt=1 (queue active) Mar 31 20:26:13 server1 postfix/qmgr[24136]: 6B5CBA30E7F: from=<>, size=638, nrcpt=1 (queue active)

Ahh I see, it’s trying to connect to port 10024:

connect to[]: Connection refused (port 10024)

Are you doing something fancy in your file? :slight_smile:

For example, if there was a check_policy_service line that told Postfix to connect to that port, but the daemon on that port wasn’t running or had died, that could cause that error.

I also see a bunch of Google hits suggesting Amavis runs on that port.

I am running CSF firewall. Maybe thats the problem. I opened up port 10024 and 10025 on incoming and outgoing tcp to see what that would do but that doesn’t seem to have done anything. Not sure if they are even supposed to be open or not.

I thought I would have been using a default postfix config file that would have been installed with Virtualmin Pro when I used the script but maybe not. Maybe it was already set up on the system or something and the install script didn’t overwrite it…

I don’t know how to do anything fancy =) I don’t have any check_policy_service line in my file.

Maybe avmavis didn’t get setup then or something. Is the install script supposed to set that up?

Mmm, no, Virtualmin does fairly predictable things to the file, in general :slight_smile:

Can you post a copy of your /etc/postfix/ as well as your /etc/postfix/

Maybe something in one of those will stand out as being an issue.


woops i used code instead of quote like i usually do and messed your layout up a bit.

Hrm, that’s a pretty non-standard file, is it possible somebody had done some work on it before you did?

However, it does look like Amavis, I see this line:

content_filter = amavis:[]:10024

That’s not something Virtualmin would attempt to set up, so that was something someone else setup there – intentionally or not :wink:

It is entirely possible. I ordered this server as some sort of 1 hour special deal. It was instantly ready. It sent me an email instantly with the root login info. It had tons of brute force attempts against it. I don’t know what all was setup on it I just started trying to set it up.

So I commented that line out and tried to restart postfix. To my surprise I got a couple emails. I ran postfix flush.

In the log its saying:

Mar 31 21:27:17 server1 postfix/pipe[26670]: fatal: get_service_attr: unknown username: vmail Mar 31 21:27:18 server1 postfix/master[26501]: warning: process /usr/libexec/postfix/pipe pid 26670 exit status 1 Mar 31 21:27:18 server1 postfix/master[26501]: warning: /usr/libexec/postfix/pipe: bad command startup -- throttling Mar 31 21:27:18 server1 postfix/qmgr[26503]: warning: premature end-of-input on private/maildrop socket while reading input attribute name Mar 31 21:27:18 server1 postfix/qmgr[26503]: warning: private/maildrop socket: malformed response Mar 31 21:27:18 server1 postfix/qmgr[26503]: warning: transport maildrop failure -- see a previous warning/fatal/panic logfile record for the problem description

Hmm, something isn’t right at all. In it has reference to user vmail but I don’t know what that is.

So what should my standard postfix config files be like? Wouldn’t they be the same on all virtualmin pro installs?

Well, Virtualmin makes sure a couple of parameters are set, and it may add one or two of it’s own – but overall, it assumes that it’s a fresh distro install, and/or that whatever changes were made were done so for a reason :slight_smile:

In this case, it looks like a lot of non-default things are set.

A big key to a successful Virtualmin install is putting it on a freshly installed distro – but if that and are the only issues, I may be able to dig up some files you can use in their place with just a little tweaking.

What distro are you using?

It is CentOS 5.2.

I really appreciate your help =) I was beginning to feel a bit lost. I thought it would be a clean install but it wasn’t so I figured I better work with what I had. You get what you pay for I guess. I think I would have to pay a lot of money to get them to set it all up again and then I would have to go through the trouble of setting it all up again which would be a pain. But if thats what I have to do I would do it without hesitation if I knew it would be all I have to do to make things work. It has websites running on it already though and so far they seem to be doing fine except they don’t have any email.

Alright, so here’s the deal.

I have a CentOS 5 server setup in VMware, with stock config that was then modified by Virtualmin with the appropriate options.

The catch with your system is – I can’t guarantee that it’ll work. I don’t know what else has been changed from a stock distro install beyond those two config files.

It’s worth a try, just remember that it may require some additional tweaking :slight_smile:

What I would recommend is:

  1. Backup your current and

  2. Poke through these files and make sure they look sane

  3. Install them into /etc/postfix/

  4. Restart Postfix (/etc/init.d/postfix restart)

  5. See if things start working :slight_smile:
    [file size=10504][/file]

Awesome, thank you for that =)

However things don’t appear to have changed all that much. There must be something else somewhere somehow mentioning amavis somewhere. I am searching for it, maybe I will eventually find it.

I still get this line:

warning: connect to transport amavis: Connection refused

So it must be somewhere. Also I get this error:

(mail transport unavailable)

And I would guess thats due to it trying to use amavis.

So somewhere its still on there somehow. I tried this command: grep -r -n ‘amavis’ /*

It has been running for quite some time but hasn’t found anything yet.

Hmm, are you super-sure that the file in /etc/postfix/ now is the one I attached here?

If you do this, what do you see:

grep -i amavis /etc/postfix/

I am pretty sure I used those files. I uploaded them and overwrote the old ones using winscp. It doesn’t show anything when I run that command.

Could it be something compiled into procmail-wrapper? Or maybe it is something thats actually in the mails trying to be sent?

I do seem to be getting some email. Just not all of them. I think maybe I am only getting new ones or something. But its still showing those errors.

Can I log in quick and take a look?

If that’s okay, you can email root login details to

Include a link to this post if you can – as well as a valid email address on the server so I can send a test email there.


I never edited until after the error to try to fix it. Not sure exactly what I have changed since then. Commented out a couple things as suggested in some places I think is all. I don’t believe I have touched the file at all. I ordered a dedicated server with CentOS on it. Whether it was a fresh install I doubt it. It already had webmin installed on it for some reason eventhough I ordered it with no control panel. I just that with yum before I ran the install script. It was a special deal so maybe thats why.

I found a command to strip out the comments from the configuration files so I will post that.

[code:1][root@server1 ~]# cat /etc/postfix/ | egrep -v "^\s*(#|$)"
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
mydomain =
inet_interfaces = all
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
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
myhostname =
mynetworks =
virtual_alias_domains =
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_sender_restrictions = hash:/etc/postfix/sender_access
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks
content_filter = amavis:[]:10024
receive_override_options = no_address_mappings
mailbox_size_limit = 0
message_size_limit = 0
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
[root@server1 ~]#

[code:1][root@server1 ~]# cat /etc/postfix/ | egrep -v "^\s*(#|$)"
smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes
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=R user=vmail argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}
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
amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_bind_address=
[root@server1 ~]#