Bug Tracker item #2881599, was opened at 2009-10-19 10:40 Message generated for change (Comment added) made by gaasmann You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2881599&group_id=250683
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: daemon Group: v3.8.0 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nicolas Haller (gaasmann) Assigned to: Stevan Bajic (sbajic) Summary: failure with Dpsam and Postgresql Initial Comment: HI, I have a problem with DSPAM 3.8.0 and I don't know if it's resolved in 3.9.0 (I don't see any clue in ChangeLog). I have a process chain to analyse spam: Internet----SMTP/25----Postfix----LMTP/4242----DSPAM----SMTP/10024----amavisd-new----SMTP/10025----Postfix----transport/deliver Dspam works with a PgSQL DB. When Pg fails(connection refused, DB can't answer to a request, ...) Dspam reject all future email. It send an error "530 5.2.0 Message is empty. Aborting." in the LMTP transaction. I must restart DSPAM daemon to accept new mail correctly. If you need more infos, tell me. Thanks ---------------------------------------------------------------------- Comment By: Nicolas Haller (gaasmann) Date: 2009-10-20 18:29 Message: Hallo Stevan I deploy the git version. I have compiled it with FreeBSD configure's flags. All is right for the moment. I will watch it's behavior when db fail. Thanks, ---------------------------------------------------------------------- Comment By: Stevan Bajic (sbajic) Date: 2009-10-20 00:05 Message: Hallo Nicolas Wait a minute. DSPAM 3.8.0. Right? Please try 3.9.0 because in commit dc209e5ef35bd128c921c3e305defe1263513a0a we have fixed a issue with wrong return codes from the function send_socket() and that function is returning errors in your case. That is the reason you see OK and then in the next line a error (-5) but in reality the data send to the socked was okay. Could you try with 3.9.0 GIT and see if the error still is there? Kind Regards from Switzerland Stevan Bajic ---------------------------------------------------------------------- Comment By: Nicolas Haller (gaasmann) Date: 2009-10-19 16:59 Message: Hallo, You're right about reconnecting. Is it possible dspam sends query without be sure the connection is ok? About delivering, I understand what you mean but the chain works correctly before and after DB problems. In fact, I don't really understand why Dspam seems to send "520 Message is empty" when PostgreSQL fails. When I restart DSPAM, all is working well: there is no problem with "delivery target". Also, I don't understand what is the log line "Received error in response to HELO" or "Oct 19 09:50:21 enigma dspam[62346]: Got error -5 in response to DATA: 250 2.1.5 Recipient <n...@noc.nerim.net> OK^M" Here it seems the "delivery target" said OK, what is the error -5 dspam is talking about? I don't know how to help you more but tell me if you need anything. Thanks ---------------------------------------------------------------------- Comment By: Stevan Bajic (sbajic) Date: 2009-10-19 14:35 Message: Hallo Nicolas @Reconnecting: You wrote that if you restart DSPAM then everything works again. So this means that somehow DSPAM can not connect to PostgreSQL and if we would RECONNECT the stalled PostgreSQL connections then everything should work again. Right? Regarding this here: > I know only a little about profiles but I have only one DB server. In > fact, I prefer DSPAM forward message on failure instead of rejecting it. > The errors "Delivery failed completely" you are seeing in your log are in fact errors where DSPAM is failing to deliver the message via SMTP or LMTP. I don't know how we can forward a message when DSPAM has trouble delivering a message via LMTP or SMTP. So your request to FORWARD a message in case of PostgreSQL connection errors are okay but DSPAM can not forward a message when the target refuses to accept a message. Do you understand what I mean? The errors about failed delivery are related to your dspam.conf entries starting with "Delivery". Assuming you would have the following in your dspam.conf: DeliveryHost 192.168.0.10 DeliveryPort 10026 DeliveryProto SMTP Then the SMTPD listening on 192.168.0.10 at port 10026 is the one that has an issue. Not DSPAM. And since that service refuses to accept messages, DSPAM can not deliver. Let alone forward. Kind Regards from Switzerland Stevan Bajic ---------------------------------------------------------------------- Comment By: Nicolas Haller (gaasmann) Date: 2009-10-19 12:16 Message: Hi Stevan, I don't understand what you mean about autoconnection. Dspam is configured as a daemon with a pool of Pg connection (PgSQLConnectionCache 20). The PgSQL is on a different host and they are using TCP/IP. The database can fail on different manner: - Server is down, connection are refused - The server is here but it can't execute a query. (62346: server closed the connection unexpectedly. This probably means the server terminated abnormally before or while processing the request.) I know only a little about profiles but I have only one DB server. In fact, I prefer DSPAM forward message on failure instead of rejecting it. Thanks for this quick answer. I don't have debug output but DSPAM said this on failure: ct 19 09:50:20 enigma dspam[62346]: Received error in response to HELO: Oct 19 09:50:20 enigma dspam[62346]: Delivery failed completely Oct 19 09:50:21 enigma dspam[62346]: Got error -5 in response to DATA: 250 2.1.5 Recipient <n...@noc.nerim.net> OK^M Oct 19 09:50:21 enigma dspam[62346]: Delivery failed completely Oct 19 09:50:21 enigma dspam[62346]: Got error -5 in response to RCPT TO: 250 2.1.0 Sender <na...@enigma.nerim.net> OK^M Oct 19 09:50:21 enigma dspam[62346]: Delivery failed completely Oct 19 09:50:21 enigma dspam[62346]: Got error -5 in response to MAIL FROM: Oct 19 09:50:21 enigma dspam[62346]: Delivery failed completely Oct 19 09:51:11 enigma dspam[62346]: Got error -5 in response to RCPT TO: 250 2.1.0 Sender <brutall...@advanceup.com> OK^M Oct 19 09:51:11 enigma dspam[62346]: Delivery failed completely Oct 19 09:51:11 enigma dspam[62346]: Got error -5 in response to message data: 354 End data with <CR><LF>.<CR><LF>^M Oct 19 09:51:11 enigma dspam[62346]: Delivery failed completely ---------------------------------------------------------------------- Comment By: Stevan Bajic (sbajic) Date: 2009-10-19 11:39 Message: Hallo Nicolas As far as I know, PostgreSQL does not offer an autoconnect feature as MySQL does. So the only way to to fix that issue in the PostgreSQL driver would be to shut down all (or just the ones not being able to connect) the connections from DSPAM to PostgreSQL and reopen them. Is it possible for you to post some more debugging information or error logs indicating where the error inside DSPAM is happening? How is your setup? Does PostgreSQL run on the same system as DSPAM? How do you connect to PostgreSQL? Using TCP/IP or do you use sockets? Do you know if your PostgreSQL instance has gone away while DSPAM was running? Have you tried to use connection profiles with DSPAM? Kind Regards from Switzerland Stevan Bajic ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2881599&group_id=250683 ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Dspam-devel mailing list Dspam-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspam-devel