Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix stop responding after some time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
MasterPrenium
Tux's lil' helper
Tux's lil' helper


Joined: 07 Dec 2006
Posts: 89

PostPosted: Fri Feb 19, 2016 12:42 pm    Post subject: Postfix stop responding after some time Reply with quote

Hi guys,

I'm running a mail server setup (postfix+courrier), inside a gentoo VPS running on OpenVZ. Postfix & courrier are using virtual accounts stored in a Mysql DB. Looking at resources counters, there is NO resource that is exhausted (also tried increasing all resources by x10, no change)
I'm having an issue with postfix, after a random time, it stop replying on smtp port. Here is what happens :

After a reboot of the VPS, Postfix works fine :
telnet localhost 25
Quote:
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.xxxx.com ESMTP Postfix
quit
221 2.0.0 Bye
Connection closed by foreign host.

Then after a random time (from 5 seconds to about 1hour), it stopped replying on port 25 :
telnet localhost 25
Quote:
Trying ::1...
Connected to localhost.
Escape character is '^]'.

and it's stucked here, no answer even if I retry the connection, even if I wait for hours

I don't find any errors in the logs, it seems there is nothing related with the number of opened sockets (postfix sometimes is working with about 20 connections opened, and sometimes it doesn't reply with only one connection opened).
Please note that restarting postfix doesn't solve the issue, I have to restart the VPS.
And sometimes after a VPS restart it's still not working ...

My setup :
Quote:
[ebuild R ] mail-mta/postfix-3.0.2::gentoo USE="berkdb eai mysql pam sasl ssl -cdb -doc -dovecot-sasl -hardened -ldap -ldap-bind -lmdb -mbox -memcached -nis -postgres (-selinux) -sqlite -vda" 0 KiB


Postconf -n :
Quote:
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
alias_maps = mysql:/etc/postfix/mysql-aliases.cf
broken_sasl_auth_clients = no
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
home_mailbox = .maildir/
html_directory = no
inet_protocols = all
local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
local_transport = local
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 209715200
myhostname = mail.xxxx.com
mynetworks = 127.0.0.0/8, 172.16.0.0/16, 10.8.0.0/16
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relocated_maps = mysql:/etc/postfix/mysql-relocated.cf
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_connection_count_limit = 150
smtpd_hard_error_limit = 30
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_soft_error_limit = 20
smtpd_tls_CAfile = /etc/postfix/ssl/xxxx.com.crt
smtpd_tls_ask_ccert = yes
smtpd_tls_cert_file = /etc/postfix/ssl/xxxx.com.combined.pem
smtpd_tls_key_file = /etc/postfix/ssl/xxxx.com.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /
virtual_mailbox_domains = /etc/postfix/virtual-domains.txt
virtual_mailbox_limit = 524288000
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_transport = virtual
virtual_uid_maps = static:5000



Any idea ? It's not the first time I setup a postfix server, but it's the first time I'm facing this behaviour ...

Thanks,
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 564
Location: France

PostPosted: Mon Feb 22, 2016 11:17 am    Post subject: Reply with quote

Maybe the problem is the mysql service ? When postfix stops responding, did you try to connect to the mysql server ?

I see you use an ipv6 address to connect to the postfix service ( ::1 ), but you defined none in your postfix configuration (mynetworks = 127.0.0.0/8, 172.16.0.0/16, 10.8.0.0/16). I don't think that explains your problem, but setting a coherent configuration should be better.
Back to top
View user's profile Send private message
sedros
n00b
n00b


Joined: 20 Jul 2016
Posts: 3

PostPosted: Wed Jul 20, 2016 7:27 pm    Post subject: Reply with quote

Hi,
It seems that I have the same problem. After some time postfix can't authenticate users trying to send emails and the only solution is to restart postfix.

Log entries that appear when it happens:
Code:
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin Parse the username user@email.tld
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin try and connect to a host
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin trying to open db '' on host ''
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin could not connect to host
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin couldn't connect to any host
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin Parse the username user@email.tld
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin try and connect to a host
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin trying to open db '' on host ''
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin could not connect to host
Jul 20 21:03:23 hostname postfix/smtpd[7295]: sql plugin couldn't connect to any host
Jul 20 21:03:23 hostname postfix/smtpd[7295]: warning: unknown[xxx.xxx.xxx.xxx]: SASL PLAIN authentication failed: generic failure


Postfix restart helps only for a few hours.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum