Bug 54677

Summary: deliver-wrapper is out of date w.r.t deliver
Product: [Retired] Red Hat Powertools Reporter: Bryan O'Sullivan <bos>
Component: cyrus-imapdAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-16 16:50:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryan O'Sullivan 2001-10-16 03:52:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.9-ac17 i686)

Description of problem:
The deliver-wrapper program that Red Hat bundles with its cyrus-imapd
package seems to have been written some time in 1998 or 1999, and not
maintained since then.  As far as I can tell from looking at the source, it
simply cannot work at all with recent versions of the Cyrus deliver
program.

The problem is that deliver-wrapper doesn't pass the correct flags or
mailbox name to deliver. The result, at least on my system, is that mail
passed through deliver-wrapper simply vanishes without any error messages
showing up in any logs.

I'm using sendmail as my MTA, with mail configured to be delivered through
procmail, which in its turn invokes deliver-wrapper.  There's an added
wrinkly with this, too: if you want to deliver to any mailbox other than
INBOX, that mailbox must have an ACL set on it so that the anonymous user
can post to it, otherwise the mail will just show up in the INBOX.  (This
isn't documented anywhere.)

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Simply take an RFC822 message, pop it into a file, and run "deliver-wrapper
user.INBOX < file".  You'll find that the message doesn't get delivered,
not matter what steps you try to take.

Actual Results:  Mail vanishes, no error messages, no output.

Expected Results:  Mail gets delivered.

Additional info:

Here's a rewrite of deliver-wrapper that actually works. The formatting is
probably messed up by the Web form submission.

#include <stdio.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
 
int main(int argc, char *argv[])
{
  char *const envp[] = { NULL };
  uid_t uid = getuid();
  struct passwd *ent = getpwuid(uid);

  if (ent == NULL)
    {
      fprintf(stderr, "Trouble: getpwuid didn't find uid %d\n", uid);
      return 71; /* EX_OSERR */
    }
  
  if (ent->pw_name == NULL || ent->pw_name[0] == '\0')
    {
      fprintf(stderr, "Trouble: user name for uid %d is empty\n", uid);
      return 71; /* EX_OSERR */
    }
  
  if (argc != 2)
    {
      fprintf(stderr, "Usage: %s mailbox\n", argv[0]);
      return 64; /* EX_USAGE */
    }
    
  execle("/usr/cyrus/bin/deliver", "deliver", "-e",
	 "-a", ent->pw_name, "-m", argv[1], ent->pw_name,
	 NULL, envp);

  perror("exec /usr/cyrus/bin/deliver");           
  return 71; /* EX_OSERR */
}

Comment 1 David Lawrence 2003-05-16 16:50:57 UTC
Closing as WONTFIX due to end of life of the Power Tools product line. Please
open a new bug report under the Red Hat Linux product if the component is still
included in the base Red Hat distribution.