Control: tag -1 wontfix Hi,
On Thu, 20 Mar 2014 21:51:52 -0700, H. S. Teoh wrote:
> I'm also running into this problem, caff insists on sending email with
> MAIL FROM as username@localhost instead of the value I set in
> $CONFIG{'email'}. I've tried Todd Lyons' workaround but it still
> didn't work for me. So, this makes caff unusable for me. :-(
Which version of libmailtools-perl are you using? Also, caff uses
Mail::Mailer to send messages; by default messages are piped to
‘sendmail -t’, and as written in the manpage, the caffrc option
'mailer-send' allows to choose another sending method such as SMTP/SMTPS
with extra parameters as needed. Did you change the default method
(not-recommended, it's best to fix your MTA instead)?
I believe Todd's workaround only work for Mail::Mailer::smtp and
Mail::Mailer::smtps. However I personally find it cleaner to add an
extra parameter 'From' to set the Envelope From, rather than messing
around with the environment:
$CONFIG{'mailer-send'} = [ 'smtps'
, Server => 'smtp.example.org'
, Auth => [ 'username', 'password' ]
, From => $CONFIG{email}
];
If you prefer to use the sendmail binary via Mail::Mailer::sendmail
instead (and can't fix your MTA), you can set the envelope sender
address with ‘-f’, see sendmail(1):
$CONFIG{'mailer-send'} = [ 'sendmail', '-f', $CONFIG{email}, '-t' ];
A 'qmail' method is also available but I've never used it; I'm sure the
binary provides a way to set the Envelope From, though.
(Note that although the soon to be 1.1.6 release adds support for
Internalized Domain Names, the conversion to Punycode is only done
*after* reading the configuration file, so you'll have to encode
$CONFIG{email} — and other parameters to $CONFIG{'mailer-send'} —
manually in case they contain non ASCII characters.)
I'm tagging this bug as ‘wontfix’ because although I didn't find how to
set the Envelope From for Mail::Mailer methods anywhere but in the
source code [1], I believe one should file a documentation bug against
libmailtools-perl instead.
Cheers,
--
Guilhem.
[1] See Mail::Mailer::smtp, Mail::Mailer::smtps and
Mail::Util::mailaddress.
signature.asc
Description: Digital signature

