diff -urN ../swaks-20120320.0.orig/swaks ./swaks --- ../swaks-20120320.0.orig/swaks 2012-11-11 01:43:04.000000000 +0200 +++ ./swaks 2012-12-04 17:24:54.000000000 +0200 @@ -74,7 +74,7 @@ # XXX hash that we can pass verbatim here open_link(); -sendmail($opts->{from}, $opts->{to}, $opts->{helo}, $opts->{data}, +sendmail($opts->{from}, $opts->{from_size}, $opts->{to}, $opts->{helo}, $opts->{data}, $opts->{a_user}, $opts->{a_pass}, $opts->{a_type}); teardown_link(); @@ -171,6 +171,7 @@ sub sendmail { my $from = shift; # envelope-from + my $from_size = shift; # envelope-from size parameter my $to = shift; # envelope-to my $helo = shift; # who am I? my $data = shift; # body of message (content after DATA command) @@ -275,7 +276,7 @@ do_smtp_quit(1, 0) if ($G::quit_after eq 'auth'); # send MAIL - do_smtp_mail($from); # failures in this handled by smtp_mail_callback + do_smtp_mail($from, $from_size); # failures in this handled by smtp_mail_callback # QUIT here if the user has asked us to do so do_smtp_quit(1, 0) if ($G::quit_after eq 'mail'); @@ -685,8 +686,9 @@ sub do_smtp_mail { my $m = shift; # from address + my $mail_from_size = shift; # from size parameter - transact(cxn_string => "MAIL FROM:<$m>", expect => '250', defer => 1, fail_callback => \&smtp_mail_callback); + transact(cxn_string => "MAIL FROM:<$m>".($mail_from_size ? " SIZE=$mail_from_size" : ""), expect => '250', defer => 1, fail_callback => \&smtp_mail_callback); return(1); # the callback handles failures, so just return here } @@ -1212,6 +1214,9 @@ # envelope-(f)rom address { opts => ['f', 'from'], suffix => ':s', okey => 'mail_from', type => 'scalar', }, + # envelope-(f)rom size parameter + { opts => ['from-size'], suffix => ':s', + okey => 'from_size', type => 'scalar', }, # envelope-(t)o address { opts => ['t', 'to'], suffix => ':s', okey => 'mail_to', type => 'scalar', }, @@ -1751,6 +1756,7 @@ ? "$user\@$hostname" : interact("From: ", '^.*$')); $n{from} = '' if ($n{from} eq '<>'); + $n{from_size} = $o->{from_size} if ($o->{from_size}); # local interface to connect from $G::link{lint} = $o->{lint} || interact("Interface: ", '^.*$')