Bug#592787: caff: $CONFIG{'email'} is not being used for MAIL FROM command

2014-03-27 Thread Guilhem Moulin
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


Bug#592787: caff: $CONFIG{'email'} is not being used for MAIL FROM command

2010-08-12 Thread Rimas Kudelis
Package: signing-party
Version: 1.1.3-1
Severity: important

I have my e-mail specified in ~/.caffrc. I also use the following mailer
config:
$CONFIG{'mailer-send'} =  [ 'smtp', Debug = 5, Server =
'smtp.example.org', Auth = ['m...@example2.org', 'mypassword'] ];

My SMTP server requires myself to authenticate using my email address
and also requires MAIL FROM: command to contain that email address.

The problem is that when I use caff, the email address for MAIL FROM
command is being composed from my username and the local hostname, thus
becoming r...@suga
r in my case, which is of course not what the server expects. Thus, I
effectively cannot send out my signatures at the moment.

Here's the relevant debug output:

[WARN] You have set arguments to pass to Mail::Mailer.  Better fix your
MTA.  (Also, Mail::Mailer's error reporting is non existant, so it won't
tell you whe
n it doesn't work.)
Net::SMTP Net::SMTP(2.31)
Net::SMTP   Net::Cmd(2.29)
Net::SMTP Exporter(5.63)
Net::SMTP   IO::Socket::INET(1.31)
Net::SMTP IO::Socket(1.31)
Net::SMTP   IO::Handle(1.28)
Net::SMTP=GLOB(0x9ad9c68) 220 smtp.example.org ESMTP Postfix
Net::SMTP=GLOB(0x9ad9c68) EHLO localhost.localdomain
Net::SMTP=GLOB(0x9ad9c68) 250-smtp.example.org
Net::SMTP=GLOB(0x9ad9c68) 250-PIPELINING
Net::SMTP=GLOB(0x9ad9c68) 250-SIZE 78643200
Net::SMTP=GLOB(0x9ad9c68) 250-VRFY
Net::SMTP=GLOB(0x9ad9c68) 250-ETRN
Net::SMTP=GLOB(0x9ad9c68) 250-STARTTLS
Net::SMTP=GLOB(0x9ad9c68) 250-AUTH LOGIN PLAIN
Net::SMTP=GLOB(0x9ad9c68) 250-ENHANCEDSTATUSCODES
Net::SMTP=GLOB(0x9ad9c68) 250-8BITMIME
Net::SMTP=GLOB(0x9ad9c68) 250 DSN
Net::SMTP=GLOB(0x9ad9c68) AUTH LOGIN
Net::SMTP=GLOB(0x9ad9c68) 334 
Net::SMTP=GLOB(0x9ad9c68) 
Net::SMTP=GLOB(0x9ad9c68) 334 
Net::SMTP=GLOB(0x9ad9c68) 
Net::SMTP=GLOB(0x9ad9c68) 235 2.7.0 Authentication successful
Net::SMTP=GLOB(0x9ad9c68) MAIL FROM:r...@sugar
Net::SMTP=GLOB(0x9ad9c68) 553 5.7.1 r...@sugar: Sender address
rejected: not owned by user m...@example2.org
Net::SMTP=GLOB(0x9ad9c68) RCPT TO:some...@example3.org
Net::SMTP=GLOB(0x9ad9c68) 503 5.5.1 Error: need MAIL command
Net::SMTP=GLOB(0x9ad9c68) DATA
Net::SMTP=GLOB(0x9ad9c68) 503 5.5.1 Error: need RCPT command
Net::SMTP=GLOB(0x9ad9c68) User-Agent: caff 0.0.0.452 -
http://pgp-tools.alioth.debian.org/
Net::SMTP=GLOB(0x9ad9c68) Subject: Your signed PGP key 0x123456789ABCDEF0
Net::SMTP=GLOB(0x9ad9c68) MIME-Version: 1.0
Net::SMTP=GLOB(0x9ad9c68) X-Mailer: Mail::Mailer[v2.06] Net::SMTP[v2.31]
Net::SMTP=GLOB(0x9ad9c68) Sender: Rimas Kudelis m...@example2.org
Net::SMTP=GLOB(0x9ad9c68) Reply-To: m...@example2.org
Net::SMTP=GLOB(0x9ad9c68) Content-Type: multipart/encrypted;
Net::SMTP=GLOB(0x9ad9c68)  protocol=application/pgp-encrypted;
Net::SMTP=GLOB(0x9ad9c68)  boundary=--=_1281616228-5106-1
Net::SMTP=GLOB(0x9ad9c68) To: some...@example3.org
Net::SMTP=GLOB(0x9ad9c68) Content-Transfer-Encoding: 7bit
Net::SMTP=GLOB(0x9ad9c68) From: Rimas Kudelis m...@example2.org
Net::SMTP=GLOB(0x9ad9c68) This is a multi-part message in MIME format...
Net::SMTP=GLOB(0x9ad9c68) =_1281616228-5106-1
Net::SMTP=GLOB(0x9ad9c68) Content-Type: application/pgp-encrypted;
name=signedkey.msg
Net::SMTP=GLOB(0x9ad9c68) Content-Disposition: attachment;
filename=signedkey.msg
Net::SMTP=GLOB(0x9ad9c68) Content-Transfer-Encoding: 7bit
Net::SMTP=GLOB(0x9ad9c68) Version: 1
Net::SMTP=GLOB(0x9ad9c68) =_1281616228-5106-1
Net::SMTP=GLOB(0x9ad9c68) Content-Type: application/octet-stream;
name=msg.asc
Net::SMTP=GLOB(0x9ad9c68) Content-Disposition: inline; filename=msg.asc
Net::SMTP=GLOB(0x9ad9c68) Content-Transfer-Encoding: 7bit
Net::SMTP=GLOB(0x9ad9c68) -BEGIN PGP MESSAGE-
Net::SMTP=GLOB(0x9ad9c68) Version: GnuPG v1.4.10 (GNU/Linux)
SNIP
Net::SMTP=GLOB(0x9ad9c68) -END PGP MESSAGE-
Net::SMTP=GLOB(0x9ad9c68) =_1281616228-5106-1--
Net::SMTP=GLOB(0x9ad9c68) .
Net::SMTP=GLOB(0x9ad9c68) 221 2.7.0 Error: I can break rules, too.
Goodbye.
Net::SMTP=GLOB(0x9ad9c68) QUIT
Net::SMTP: Unexpected EOF on command channel at
/usr/share/perl5/Mail/Mailer/smtp.pm line 59


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages signing-party depends on:
ii  gnupg   1.4.10-4 GNU privacy guard - a free
PGP rep
ii  libc6   2.11.2-2 Embedded GNU C Library:
Shared lib
ii  libclass-methodmaker-perl   2.15-2   Perl module for creating
generic m
ii  libgnupg-interface-perl 0.42-3   Perl interface to GnuPG
ii  libmailtools-perl   2.06-1   Manipulate email in perl
programs
ii  libmime-tools-perl  5.428-1  Perl5 modules for
MIME-compliant m
ii  libterm-readkey-perl2.30-4   A perl module