High numbers of unprocessed mail in queue.
I've had some issues with email on my linode. Recently emails are significantly delayed or appear not sent at all. Looking into the issue further i see there is a high number of emails waiting in the queue to be sent.
postqueue -p | grep "*" | wc -l
=
I believe i have configured the mailserver to only allow from local domains and to block spam etc but if that is the case can't understand why the queue is so high. In the logs i see lots of entries such as :
Jan 23 20:19:51 westwood postfix/smtp[20329]: 96C7421785: to=<myku@pchome.com.tw>, relay=127.0.0.1[127.0.0.1]:10024, conn_use=29, delay=195601, delays=193391/2207/0/2.7, dsn=2.7.0, status=sent (250 2.7.0 Ok, discarded, id=20244-01-29 - spam)</myku@pchome.com.tw>
Jan 23 20:19:51 westwood postfix/smtpd[16249]: NOQUEUE: reject: RCPT from unknown[208.115.204.59]: 554 5.7.1 <odontomisiones@hotmail.com>: Relay access denied; from= <h.carrollmackin@max-tessuti.com>to= <odontomisiones@hotmail.com>proto=SMTP helo=<edelstahlhuette.com></edelstahlhuette.com></odontomisiones@hotmail.com></h.carrollmackin@max-tessuti.com></odontomisiones@hotmail.com>
Jan 23 20:19:52 westwood amavis[20241]: (20241-01-30) Blocked SPAM {DiscardedOpenRelay}, [198.143.153.157]:58274 [198.143.153.157] <hdwqqdc@ukunationals.org> -> <teste13.pop3@hotmail.com>,<teste1001_pop3@yahoo.com.br>, Queue-ID: 0121E1561AA, mail_id: GWJUvChdfE79, Hits: 7.241, size: 354, 1823 ms</teste1001_pop3@yahoo.com.br></teste13.pop3@hotmail.com></hdwqqdc@ukunationals.org>
All the emails [1,2,3] seem to be taking the correct action ie discarded, rejected or blocked so i can't understand why the mail queue is so high.
In combination with this i get a number of linode alerts indicating high disk IO rate which i presume is to do with the email coming in.
My main.cf is below, please let me know if you need more.
# 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 (Ubuntu)
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
# http://www.internetblog.org.uk/post/1541/how-to-fix-an-open-relay-in-postfix/
smtpd_helo_required = yes
smtpd_delay_reject = no
disable_vrfy_command = yes
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, reject_unknown_hostname, reject_non_fqdn_hostname
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
smtpd_tls_cert_file=/etc/dovecot/dovecot.pem
smtpd_tls_key_file=/etc/dovecot/private/dovecot.pem
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
#Enabling SMTP for authenticated users, and handing off authentication to Dovecot
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
reject_rbl_client list.dsbl.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client sbl-xbl.spamhaus.org
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_data_restrictions = reject_unauth_pipelining
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = westwood.afeltham.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = afeltham.com, westwood.afeltham.com, localhost.afeltham.com, localhost
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
# mynetworks = 0.0.0.0/0 [::/0]
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#Handing off local delivery to Dovecot's LMTP, and telling it where to store mail
virtual_transport = lmtp:unix:private/dovecot-lmtp
#Virtual domains, users, and aliases
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
# virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman
# virtual_alias_domains = blacklava.co.uk, divebinder.com
content_filter = smtp-amavis:[127.0.0.1]:10024
relay_domains = $mydestination, divebinder.com, lists.blacklava.co.uk, lists.rawhydeultimate.com
relay_recipient_maps = hash:/var/lib/mailman/data/virtual-mailman
transport_maps = hash:/etc/postfix/transport
mailman_destination_recipient_limit = 1
Thanks in advance for any help.