[Pgp-tools-commit] r267 - in trunk: caff debian

Peter Palfrader weasel at costa.debian.org
Wed Mar 1 15:39:16 UTC 2006


Author: weasel
Date: 2006-03-01 15:39:15 +0000 (Wed, 01 Mar 2006)
New Revision: 267

Modified:
   trunk/caff/caff
   trunk/debian/changelog
Log:
Allow passing arguments to Mail::Mailer->send

Modified: trunk/caff/caff
===================================================================
--- trunk/caff/caff	2006-03-01 15:01:44 UTC (rev 266)
+++ trunk/caff/caff	2006-03-01 15:39:15 UTC (rev 267)
@@ -245,6 +245,23 @@
 Address to send blind carbon copies to when sending mail.
 Default: none.
 
+=item B<mailer-send> [array]
+
+Parameters to pass to Mail::Mailer.
+This could for example be
+
+	$CONFIG{mailer-send} =  [ 'smtp', Server => 'mail.server', Auth => ['user', 'pass'] ]
+
+to use the perl SMTP client or
+
+	$CONFIG{mailer-send} =  [ 'sendmail', '-o8' ]
+
+to pass arguments to the sendmail program.
+For more information run C<< perldoc Mail::Mailer >>.
+Setting this option is strongly discouraged.  Fix your local MTA
+instead.
+Default: none.
+
 =back
 
 =head1 AUTHORS
@@ -286,6 +303,10 @@
 
 
 
+sub mywarn($) {
+	my ($line) = @_;
+	print "[WARN] $line\n";
+};
 sub notice($) {
 	my ($line) = @_;
 	print "[NOTICE] $line\n";
@@ -426,6 +447,8 @@
 	$CONFIG{'no-download'} = 0 unless defined $CONFIG{'no-download'};
 	$CONFIG{'no-sign'} = 0 unless defined $CONFIG{'no-sign'};
 	$CONFIG{'key-files'} = () unless defined $CONFIG{'key-files'};
+	$CONFIG{'mailer-send'} = [] unless defined $CONFIG{'mailer-send'};
+	die ("$PROGRAM_NAME: mailer-send is not an array ref in $config.\n") unless (ref $CONFIG{'mailer-send'} eq 'ARRAY');
 	$CONFIG{'mail-template'} = <<'EOM' unless defined $CONFIG{'mail-template'};
 Hi,
 
@@ -770,7 +793,8 @@
 	$message_entity->head->add("Reply-To", $CONFIG{'reply-to'}) if defined $CONFIG{'reply-to'};
 	$message_entity->head->add("Bcc", $CONFIG{'bcc'}) if defined $CONFIG{'bcc'};
 	$message_entity->head->add("User-Agent", $USER_AGENT);
-	$message_entity->send();
+	mywarn("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 when it doesn't work.)") if (scalar @{$CONFIG{'mailer-send'}} > 0);
+	$message_entity->send(@{$CONFIG{'mailer-send'}});
 	$message_entity->stringify();
 };
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-03-01 15:01:44 UTC (rev 266)
+++ trunk/debian/changelog	2006-03-01 15:39:15 UTC (rev 267)
@@ -1,19 +1,17 @@
 signing-party (0.4.5-1) UNRELEASED; urgency=low
 
-  [ Thijs Kinkhorst ]
   * Upgrade debhelper compatibility to the recommended level 5.
   * Update FSF addresses.
   * caff: tweak documentation.
   * gpg-key2ps, keylookup: make them less dependent on specific
     installation paths and thus better portable outside of Debian
     (Closes: #354142).
-  * caff: support using a SMTP-server to send out the mails instead
-    of a local MTA. Thanks Mathias Brossard for the patch.
-
-  [ Christoph Berg ]
   * caff: note that mailed keys are encrypted (suggested by Sune Vuorela).
+  * caff: You can now specify additional arguments to pass to the
+    send method of Mail::Mailer.  This allows you to send mails via
+    SMTP and use authentication for instance.  Thanks to Martin von Gagern.
 
- -- Thijs Kinkhorst <kink at squirrelmail.org>  Wed,  1 Mar 2006 15:47:33 +0100
+ -- Peter Palfrader <weasel at debian.org>  Wed,  1 Mar 2006 16:04:43 +0100
 
 signing-party (0.4.4-2) unstable; urgency=low
 




More information about the Pgp-tools-commit mailing list