[Mimedefang] outbound mail copy back to origin sender

Jan Pieter Cornet johnpc at xs4all.nl
Mon Oct 24 18:27:07 EDT 2005


On Mon, Oct 24, 2005 at 04:47:20PM -0500, Sean Ware wrote:
> > I see... you want userA's procmail to sort the mail into his Sent
> > folder, but userB's procmail to *not* sort the identical mail...
> > 
> > Can you configure procmail to sort to the Sent folder ONLY if both
> > of the following conditions are true?
> > 
> > * X-Outbound header is added
> > * From header matches user name (that is, "from myself")
> 
> Yup.
> 
> Some variation on this recipie ought to do the trick:
> 
>      :0:
>      * ^X-Outbound: Yes
>      * ^From:.*some_particular at email.address.org
>      Sent

except that I think a central procmailrc is used, so you'd have to
go for something like

:0:
*$ ^(Resent-)?(From|Sender):(.*[^-a-zA-Z0-9_.])?$LOGNAME
...

anyway, another option is to not use the X-Outbound header, but to
generate a whole separate email and remail that, with an extra header
like "X-Sent: yes" that can be used by procmail without From: checking
(and by MIMEDefang to prevent loops). You'd have to copy and adapt
resend_message from the mimedefang.pl file to do it.

Or while you're spawning exteral programs anyway, you can just as well
dump INPUTMSG to procmail with a separate argument

system("sudo procmail -f '$Sender' /etc/procmailrcs/drop_in_Sent -d $user < INPUTMSG");

... or something similar (and less riddled with security holes).

BTW, how _do_ you determine the sending user? Delivering IP address?
SMTP AUTH? Or do you disallow users to use the "bounce" (or resend?)
button on their MUAs, and use the "From" header?

-- 
#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$p=3-2*/[^\W\dmpf_]/i;s.[a-z]{$p}.vec($f=join('',$p-1?chr(sub{$_[0]*9+$_[1]*3+
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig;                                # Jan-Pieter Cornet


More information about the MIMEDefang mailing list