Success!

Mlmmj requires that the Return-Path and Delivered-To headers show the envelope 
return and forward addresses.  In XMail create a user, alias user+* to it, and 
then use a script from mailproc.tab to add these headers (removing any existing 
ones) and append the spool file's contents past "<<MAIL-DATA>>".  That's it!  
This does VERP all by itself, no requirement of the MTA (though it doesn't 
mention it in the docs, duh).

If you were using my TMDA tip, the script modified for use with TMDA and mlmmj 
called from TMDA is below.  This script is improved: it uses fcopy to do 
zero-copy between disk and pipe and it handles headers in-line.

Feature requests of XMail: SMTP VERP extension, delivery to pipes for Unix 
mailers!

Cheers,
Sabahattin

#!/usr/bin/tclsh
set user "sgucukoglu"

set first [string first "-" [lindex $argv 1]]
if {$first!=-1} {
incr first
set last [string last "@" [lindex $argv 1]]
if {$last==-1} {
set env(EXT) [string range [lindex $argv 1] $first end]
} else {
incr last -1
set env(EXT) [string range [lindex $argv 1] $first $last]
}
} else {
set env(EXT) ""
}

set env(HOME) "/home/$user"
set env(SENDER) [lindex $argv 0]
set env(RECIPIENT) [lindex $argv 1]

set infile [open [lindex $argv 2]]
fconfigure $infile -encoding binary -translation crlf
while {[gets $infile] ne "<<MAIL-DATA>>"} continue
set outpipe [open "|/usr/bin/setuidgid $user /usr/bin/tmda-filter" w]
fconfigure $outpipe -encoding binary -translation crlf -buffering none
puts $outpipe "From [expr {[lindex $argv 0] eq ""?"MAILER-DAEMON":[lindex $argv 
0]}] [clock format [clock seconds]]"
puts $outpipe "Return-Path: <[lindex $argv 0]>"
puts $outpipe "Delivered-To: <[lindex $argv 1]>"
while {![eof $infile]} {
gets $infile line
if {$line eq ""} {puts $outpipe $line;break}
if {[string equal -nocase -length 12 "Return-Path:" $line]} continue
if {[string equal -nocase -length 13 "Delivered-To:" $line]} continue
if {[string equal -nocase -length 5 "From " $line]} continue
puts $outpipe $line
}
fcopy $infile $outpipe
close $infile
close $outpipe
_______________________________________________
xmail mailing list
[email protected]
http://xmailserver.org/mailman/listinfo/xmail

Reply via email to