Micah Anderson | 9 Sep 2011 00:40

piping with TO


Hello,

I'm using maildrop with dovecot, and am wanting to change to dovecot's
mdbox format, however maildrop's delivery mechanism only understands
maildir format. That shouldn't be a problem if I can ask maildrop to use
dovecot's LDA to deliver the mail into the mailstore.

Typically, one does:

  to <some_mail_box>

but I believe, if I understand things correctly, I should be able to use
an external program with the 'to' statement, according to maildropfilter(7):

The to statement delivers the message to a mailbox. expression must
evaluate to a valid mailbox. A valid mailbox is either a mailbox file, a
maildir, or an external program (which includes forwarding to another
address).

...

An expression that begins with the "|" character specifies an external
program to run to handle the actual delivery. The SHELL variable
specifies the shell to execute the given command. The message is
provided to the command on standard input. maildrop's exit code will be
the process's exit code.

So, I've been trying to get this to work;

(Continue reading)

Sam Varshavchik | 9 Sep 2011 02:52
Gravatar

Re: piping with TO

Micah Anderson writes:

> So, I've been trying to get this to work;
>
>   to "|/usr/lib/dovecot-lda -d $TO"
>
> but what I am finding is that maildrop is piping the message to
> dovecot-lda, but it is somehow stripping the -d flag, while preserving
> the interpolated $TO, resulting in these errors in my mail log:
>
> Sep  8 15:14:45 spoonbill postfix/pipe[24988]: 513AA96:  
> to=<test <at> riseup.net>, relay=maildrop, delay=0.14, delays=0.02/0.01/0/0.11,  
> dsn=5.3.0, status=bounced (command line usage error. Command output: lda:  
> Fatal: Unknown argument: micahstest3 <at> riseup.net Usage: dovecot-lda [-c  
> <config file>] [-a <address>] [-d <username>] [-p <path>] [-f <envelope  
> sender>] [-m <mailbox>] [-e] [-k] )
>
> as you can see, the usage clearly says that -d <username> should work,
> and the unknown argument is because there is no -d passed.
>
> Is maildrop removing this somehow?

No, maildrop does not remove anything. It just hands off the entire command  
to $SHELL. It does not parse the to command in any way.

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
(Continue reading)


Gmane