Re: [SPAM] Some messages fail delivery in postfix -> maildrop -> crm114 chain

glen martin <[email protected]>
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
On 01/06/14 17:18, Sam Varshavchik wrote:
> glen martin writes:
>
>>
>> On 01/06/14 04:00, Sam Varshavchik wrote:
>> > glen martin writes:
>> >
>> >> Here is my ~/.mailfilter:
>> >>
>> >>    <snip>
>> >>    MAILDIR="$HOME/.maildir"
>> >>    DEFAULT="$MAILDIR"
>> >>
>> >>    logfile "maildropfilter.log"
>> >>    log "=========="
>> >>
>> >>    xfilter "/usr/bin/crm114 -u $HOME/.crm114/
>> >> $HOME/.crm114/mailfilter.crm"
>> >>
>> >>    log "----------"
>> >>
>> >>    if (/^X-CRM114-Status: SPAM/)
>> >>            to "$MAILDIR/.0_checkspam._R_spam"
>> >>
>> >>    </snip>
>> >>
>> >> The immediate symptom is that the some messages sit spooled forever
>> >> (until they expire, I suppose).  mailq gives me a whole bunch of
>> >> items that look like this:
>> >>
>> >>    <snip>
>> >>    51EE7520BA     1981 Sat Jan  4 11:27:34 MAILER-DAEMON
>> >>    (temporary failure. Command output: /usr/bin/maildrop: Unable to
>> >> filter
>> >>    message.)
>> >
>> > This usually indicates that the external command invoked via xfilter
>> > has terminated with a non-zero exit code, indicating an error.
>>
>> Hi Sam, Thanks for your response.
>>
>> That was my suspicion as well.  To test that, I've tried calling the
>> maildrop command from the shell, in both delivery mode and not, piping
>> the same message content. In essence, trying my best to duplicate how
>> postfix would have called.  The return code was 0 in those tests, the
>> message was delivered successfully both ways. You'll see details farther
>> down in my original message.
>>
>> Is there a way to catch the return code and log information from
>> maildrop when it is called from postfix in delivery mode?
>
> Unfortunately this is not logged with enough detail.
>
> But merely invoking something from the command line would not 
> reproduce this with 100% accuracy. You would have to invoke maildrop 
> by whatever userid and groupid maildrop gets invoked by, from postfix. 
> Additionally, all the variables in the environment must be accurately 
> reproduced.

I didn't think of the environment. Blech.

> But you can also attack this from another angle. Instead of invoking 
> your external filter, from maildrop, have maildrop execute a wrapper 
> shell script, that invokes your external filter, and then logs its 
> exit code, somewhere.

That's a good option.  I could also log the parameters and such cleanly, 
just cuz I'm feeling paranoid.  Let me fiddle with that for a bit, see 
where I get.

Thanks

glen




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.