On Fri, Jan 28, 2000 at 07:40:05PM -0700, Patrick Walsh wrote:
> As far as I can tell setting the From: when using qmail with mutt
> requires that the environment variables MAILUSER, MAILHOST, MAILNAME
> be set before starting mutt, along with QMAILINJECT=f.
> 
> Is there a way to set the From: within a mutt session when using
> qmail as the MTA?

i had this problem a while ago, so i wrote (badly yes, diffs apreciated) a
perl wrapper.

in muttrc:

set sendmail="/var/qmail/bin/qmail-inject.wrap"

script attatched..

-- 
 Ben,  bro evil innocent com   | now with a
      <   _    @        .   >  | crazy sig!
#!/usr/bin/perl

use IO::File;

@plop = <STDIN>;

#print "cakes -> \n@plop\n <- taste nice \n";

for (@plop) {

   $poo = $_;

   if ($poo != /.*From:.+/ ) {
     $from = $poo;
     last;
   }
}

$from =~ s/\n//g;

$_ = $from;

if ( /^From:.*<(.*)>.*$/i ) {
    $from = $1;
}
elsif ( /^From:(.*)$/i ) {
    $from = $1;
}

$from =~ s/ //g;

open( TEMP , "| /var/qmail/bin/qmail-inject -f$from" ) or die "bah";
select( TEMP ); $| = 1; 
print TEMP @plop;
close( TEMP );

Reply via email to