[rt-users] rt2 SendmailArguments only honors first argument?

Vivek Khera khera at kcilink.com
Wed Feb 25 16:32:58 EST 2004


On Feb 24, 2004, at 6:17 PM, Phil Homewood wrote:

> Vivek Khera wrote:
>> It appears that in rt2 the $RT::SendmailArguments only honors the 
>> first
>> argument given it.
>
> Can you verify this, say, by pointing $SendmailPath to
> a wrapper script and capturing the args it sees?

I wrote a small test program:

--cut here--
#!/usr/local/bin/perl -wT
use strict;

use MIME::Entity;

my $entity = MIME::Entity->build( Type  =>"multipart/mixed",
                                   From => 'vivek at khera.org',
                                   Bcc => undef,
                                   To => 'khera at kcilink.com',
                                   Subject => 'SnuffyFunk',
                                   'X-RT-Loop-Prevention' => 'RT2',
                                 );

$entity->attach(  Data => "This is my sample message.\n");

#$entity->send('sendmail', '-oi -fnobody at example.com');
$entity->send('sendmail', '-fnobody at example.com -oi');
--cut here--


When you run this on the command line, you see the warning from the 
sendmail program (Postfix' version of "sendmail"):

sendmail: warning: -f option specified malformed sender: 
nobody at example.com -oi


It is apparent that the argument is passed as a single value, not split 
as multiple arguments.  Ie, it is as if you ran this on the command 
line:

  /usr/sbin/sendmail '-fnobody at example.com -oi'


When you run it with the commented send line above you'll see your own 
sender address rather than nobody at example.com.

Changing it to something like this seems to work by passing all 
arguments to the sendmail program individually.  Naturally, this 
doesn't take into account any quoting that may be present in the 
argument list...

$entity->send('sendmail', split(/ /,'-oi -fnobody at example.com'));

So I'll say it is definitely a bug in how RT2 is using the Mail::Mailer 
API.  The second arg to send() needs to be a list, not a string, for 
multiple arguments.

Does RT3 do this as well?  If so, I can file a bug report (or you can 
feel free to do so on my behalf).





More information about the rt-users mailing list