The following issue has been UPDATED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=359 
====================================================================== 
Reported By:                blake
Assigned To:                aaron
====================================================================== 
Project:                    DBMail
Issue ID:                   359
Category:                   PIPE delivery (dbmail-smtp)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
target:                      
Resolution:                 fixed
Fixed in Version:           2.1.7
====================================================================== 
Date Submitted:             08-Jun-06 08:09 CEST
Last Modified:              20-Jul-06 16:12 CEST
====================================================================== 
Summary:                    Redirect in sieve breaks trying to send.
Description: 
I have a redirect line in my sieve script, to copy mail to my gmail
account. But there is a non-fatal failure attempting to send the message.
Here is the relavent snipet of trace 5 log.

Also, is it just me, or should those queries not have quotes around the ID
numbers?


Jun  8 01:59:13 colo dbmail/smtp[29742]: Action is REDIRECT: REDIRECT
destination is [EMAIL PROTECTED]
Jun  8 01:59:13 colo dbmail/smtp[29742]: pipe.c, send_mail: sendmail
command is [/usr/sbin/sendmail]
Jun  8 01:59:13 colo dbmail/smtp[29742]: pipe.c, send_mail: opening pipe
to [/usr/sbin/sendmail -f  [EMAIL PROTECTED]
Jun  8 01:59:13 colo dbmail/smtp[29742]: pipe.c, send_mail: pipe opened
Jun  8 01:59:13 colo dbmail/smtp[29742]: db.c,db_send_message_lines:
request for [-2] lines
Jun  8 01:59:13 colo dbmail/smtp[29742]: dbmysql.c,db_query: query [SELECT
physmessage_id FROM dbmail_messages WHERE message_idnr = '1331800']
Jun  8 01:59:13 colo dbmail/smtp[29742]: db.c,db_send_message_lines:
sending [-2] lines from message [1331800]
Jun  8 01:59:13 colo dbmail/smtp[29742]: dbmysql.c,db_query: query [SELECT
messageblk FROM dbmail_messageblks WHERE physmessage_id = '809862' ORDER BY
messageblk_idnr]
Jun  8 01:59:13 colo dbmail/smtp[29742]:
dbmail-message.c,_set_content_from_stream: parse message
Jun  8 01:59:14 colo dbmail/smtp[29742]: pipe.c, send_mail: pipe closed
Jun  8 01:59:14 colo dbmail/smtp[29742]: pipe.c, send_mail: sendmail error
[16384]

====================================================================== 

---------------------------------------------------------------------- 
 aaron - 08-Jun-06 15:15  
---------------------------------------------------------------------- 
The quotes are fine. What's your MTA? That error is probably sendmail
reporting incorrect usage. Try running the same command in a shell by hand
and see if it works.

Does the mail get delivered to your INBOX when it fails to redirect, or is
it lost? If the latter, that's a huge bug. 

---------------------------------------------------------------------- 
 blake - 09-Jun-06 01:52  
---------------------------------------------------------------------- 
My MTA is Postfix 2.2.10, here is what the rule looks like:

# forward a copy of everything to gmail, unless it came from there
if not header :contains "X-Forwarded-For" "[EMAIL PROTECTED]" {
        redirect "[EMAIL PROTECTED]";
        keep;
}

I'm not sure if the "keep" is necessary, but it doesn't seem to have any
ill effects. All the messages are still delivered to my INBOX, or wherever
subsiquent sieve rules put them.

It looks like the problem is that "sendmail" wants more/different options
than it's given:

[EMAIL PROTECTED] ~ $ /usr/sbin/sendmail -f [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: test fwd

test
.
sendmail: fatal: Recipient addresses must be specified on the command line
or via the -t option

According to the man page, the -f option is for setting envelope sender,
not recipient:

       -f sender
              Set  the envelope sender address. This is the address where
delivery problems are sent to. With Postfix versions before 2.1, the
Errors-To: message header overrides
              the error return address. 

---------------------------------------------------------------------- 
 aaron - 09-Jun-06 04:08  
---------------------------------------------------------------------- 
Ok, I think I've got this covered. Now in SVN. 

---------------------------------------------------------------------- 
 blake - 09-Jun-06 10:54  
---------------------------------------------------------------------- 
Current SVN (2163) didn't seem to change anything. Tracing back through the
code, it was an empty string, not a null string, in from. So this trivial
patch catches that as well, and now mail sends.

--- dbmail/pipe.c.old   2006-06-09 04:44:42.253619999 -0400
+++ dbmail/pipe.c       2006-06-09 04:38:44.197411003 -0400
@@ -66,7 +66,7 @@
        field_t sendmail, postmaster;
        int result;

-       if (!from) {
+       if (!from || strcmp(from, "") == 0) {
                if (config_get_value("POSTMASTER", "DBMAIL", postmaster) <
0) {
                        trace(TRACE_MESSAGE, "%s, %s: no config value for
POSTMASTER",
                              __FILE__, __func__); 

---------------------------------------------------------------------- 
 aaron - 09-Jun-06 17:39  
---------------------------------------------------------------------- 
Ok, got it! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-Jun-06 08:09 blake          New Issue                                    
08-Jun-06 15:15 aaron          Note Added: 0001231                          
09-Jun-06 01:52 blake          Note Added: 0001232                          
09-Jun-06 04:08 aaron          Status                   new => resolved     
09-Jun-06 04:08 aaron          Fixed in Version          => SVN Trunk       
09-Jun-06 04:08 aaron          Resolution               open => fixed       
09-Jun-06 04:08 aaron          Assigned To               => aaron           
09-Jun-06 04:08 aaron          Note Added: 0001233                          
09-Jun-06 10:54 blake          Status                   resolved => feedback
09-Jun-06 10:54 blake          Resolution               fixed => reopened   
09-Jun-06 10:54 blake          Note Added: 0001234                          
09-Jun-06 17:39 aaron          Status                   feedback => resolved
09-Jun-06 17:39 aaron          Resolution               reopened => fixed   
09-Jun-06 17:39 aaron          Note Added: 0001235                          
20-Jul-06 16:12 paul           Fixed in Version         SVN Trunk => 2.1.7  
======================================================================

Reply via email to