caff: support using a SMTP-server to send out the mails instead
authorkink-guest <kink-guest@b513b33f-fedd-0310-b452-c3deb5f4c849>
Wed, 1 Mar 2006 14:49:51 +0000 (14:49 +0000)
committerkink-guest <kink-guest@b513b33f-fedd-0310-b452-c3deb5f4c849>
Wed, 1 Mar 2006 14:49:51 +0000 (14:49 +0000)
of a local MTA.
Patch provided by Mathias Brossard (by private email, why are people
not filing bugs?), change is simple enough to provide the option.

git-svn-id: svn://svn.debian.org/pgp-tools/trunk@265 b513b33f-fedd-0310-b452-c3deb5f4c849

caff/caff
debian/changelog

index 47c4ec89802c7211bfe5f46f18ab63d951fc3dd9..bb687a289b97768ce8aa38bc0d385bb0b4c19ab3 100755 (executable)
--- a/caff/caff
+++ b/caff/caff
@@ -245,6 +245,15 @@ Add a Reply-To: header to messages sent. Default: none.
 Address to send blind carbon copies to when sending mail.
 Default: none.
 
+=item B<smtp-server> [string]
+
+Send mail through specified SMTP server. Default: none (uses
+sendmail).
+
+=item B<smtp-port> [string]
+
+Use specified port for sending mail to SMTP server. Default : 25.
+
 =back
 
 =head1 AUTHORS
@@ -770,7 +779,14 @@ sub send_mail($$$@) {
        $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();
+
+       if($CONFIG{'smtp-server'}) {
+               $message_entity->smtpsend(Host => $CONFIG{'smtp-server'},
+                       ($CONFIG{'smtp-port'} ? (Port => $CONFIG{'smtp-port'}) : ()),
+                       MailFrom => $CONFIG{'email'});
+       } else {
+               $message_entity->send();
+       }
        $message_entity->stringify();
 };
 
index 8da7cda364bfd254ed42dd34a19532bb062c6a40..f1ad65b75cc0f7a664601fdd25c7d366687be110 100644 (file)
@@ -7,11 +7,13 @@ signing-party (0.4.5-1) UNRELEASED; urgency=low
   * 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).
 
- -- Thijs Kinkhorst <kink@squirrelmail.org>  Tue, 28 Feb 2006 18:41:13 +0100
+ -- Thijs Kinkhorst <kink@squirrelmail.org>  Wed,  1 Mar 2006 15:47:33 +0100
 
 signing-party (0.4.4-2) unstable; urgency=low