Can't flush Postfix Mail queue

11 posts / 0 new
Last post
#1 Wed, 03/25/2015 - 11:31
just_me

Can't flush Postfix Mail queue

Strange thing,

my postfix mailqueue fills up and i cannot flush the mails. Normal mails work via Outlook etc, but mails generated from system like newsletter or other webbased software keep hanging forever. I am pretty sure, it is some Postfix setting, but i can't see it.

Any idea, which setting this might be and how i can fix it?

Thanks and best j_m

Wed, 03/25/2015 - 12:07
andreychek

Howdy,

Many servers will begin issuing temporary email rejections after receiving so many from your server. It'll take a few hours before those start flowing again, but if there's enough of them, it could end up taking quite awhile for them all to go through.

How many emails are currently in your queue?

And what error are you seeing next to your messages when running the command "mailq"?

-Eric

Wed, 03/25/2015 - 13:15
just_me

around 19k are serverintern mails, so from a webservice to me to inform about updates. This mails should have been delivered locally. the rest are servergenerated emails, like ticket system who sends out an email telling that status has changed or notifying me (on the same server) that a new ticket arrived. 250 were created from a newsletter component of my joomla website. If i reboot the server, it will send all mails, but keeping to pile up. In the meanwhile i have another 360 mails in the queue. THere are also systemmails like From: root To: root.

I think, it could be some sort of postfix limitation, why he is stopping delivery. whether i flush or not, no difference. It also shows no error on mailq or on the flush command. I am a little bit ... well confused...

Thanks for help.

Wed, 03/25/2015 - 15:03
andreychek

Howdy,

What output do you receive if you run this command:

postconf -n

Also, does it help to run either of these two commands:

postqueue -f
/etc/init.d/postfix restart

The first is the normal command I use for flushing the queue. The second restarts Postfix, would could also have a similar effect.

-Eric

Wed, 03/25/2015 - 18:02
just_me
root@backup /opt/otrs/scripts # postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_destination_concurrency_limit = 10
default_destination_recipient_limit = 5
home_mailbox = Maildir/
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydomain = server-verwaltung.biz
myhostname = backup.server-verwaltung.biz
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
non_smtpd_milters = local:/var/run/milter-greylist/milter-greylist.sock
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = permit_mynetworks permit_inet_interfaces reject_unknown_reverse_client_hostname
smtpd_milters = local:/var/run/milter-greylist/milter-greylist.sock
smtpd_recipient_limit = 5
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service inet:127.0.0.1:10023
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual
postconf: warning: /etc/postfix/main.cf: unused parameter: reject_unauth_destination=hash:/etc/postfix/access
postconf: warning: /etc/postfix/main.cf: unused parameter: mesage_size_limit=900000000

The other twos:

root@backup /opt/otrs/scripts # postqueue -f
root@backup /opt/otrs/scripts # /etc/init.d/postfix restart
[....] Stopping Postfix Mail Transport Agent: postfix/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter                                                              : reject_unauth_destination=hash:/etc/postfix/access
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: mesage_size_limit=900000000
. ok
[....] Starting Postfix Mail Transport Agent: postfixpostconf: warning: /etc/postfix/main.cf: unused parameter: reject_unauth_destination=hash:/etc/postfix/access
postconf: warning: /etc/postfix/main.cf: unused parameter: mesage_size_limit=900000000
postconf: warning: /etc/postfix/main.cf: unused parameter: reject_unauth_destination=hash:/etc/postfix/access
postconf: warning: /etc/postfix/main.cf: unused parameter: mesage_size_limit=900000000
postconf: warning: /etc/postfix/main.cf: unused parameter: reject_unauth_destination=hash:/etc/postfix/access

etc. No message is sent. In the meanwhile there are 709 of them....

Thank you.

Wed, 03/25/2015 - 18:12
just_me

g

Wed, 03/25/2015 - 18:16
andreychek

Howdy,

You may want to try commenting out these lines, and then restart Postfix:

default_destination_concurrency_limit = 10
default_destination_recipient_limit = 5
non_smtpd_milters = local:/var/run/milter-greylist/milter-greylist.sock
smtpd_milters = local:/var/run/milter-greylist/milter-greylist.sock

Once you do that, do your emails go out?

-Eric

Thu, 03/26/2015 - 02:39
just_me

since it also claimed about those two lines:

mesage_size_limit = 9000000 reject_unauth_destination = hash:/etc/postfix/access

i commented them out. I also deleted most of that 20k Mails, and now i am waiting what happens. I will look into it several times over the day and check, whether the queue piles up again.

Can i limit the amount of mails php-scripts can send out at once? I had a severe spam problem last year and would like to use approbiate measures. A friend put his webpage onto my server and brought a spam script with it, which i had a hard time to find. It was a phpfile, which fired around 10k an hour ...

Best and thank you.

Thu, 03/26/2015 - 02:39
just_me

since it also claimed about those two lines:

mesage_size_limit = 9000000 reject_unauth_destination = hash:/etc/postfix/access

i commented them out. I also deleted most of that 20k Mails, and now i am waiting what happens. I will look into it several times over the day and check, whether the queue piles up again.

Can i limit the amount of mails php-scripts can send out at once? I had a severe spam problem last year and would like to use approbiate measures. A friend put his webpage onto my server and brought a spam script with it, which i had a hard time to find. It was a phpfile, which fired around 10k an hour ...

Best and thank you.

Thu, 03/26/2015 - 10:36
andreychek

Howdy,

Well, you can setup rate limits. That's available in Email Messages -> Mail Rate Limiting.

However, make sure you don't have a small rate limit on any domain that's sending out newsletters, as it'll cause problems on those domains and cause those messages to get stuck.

-Eric

Tue, 03/31/2015 - 02:25
just_me

The problem is fixed now. Concerning the Mail Rate Limiting:

I have a webpage on the server for someone, whose Mailserver is on a different provider. Therefore i did NOT enable email for that domain. When i tried to send an email i got the reply:

Host or domain name not found Then i removed the DNS entry for the mail server, which wouldnt fix the problem.

Next try i entered his mailserver information in Bind config, now it tells me:

mail for example.com loops back to myself

Am a little out of my wits now. On the other hand, after i disabled the email feature, it does not let me set the Mail Rate limit, because the domain won't be listed. But the Newsletter software, running on his CMS would work, correct?

Best and thank you very much. j_m

Topic locked