From a8e7d4e7b9709d03b69b1fffb721716f4a3ebe4b Mon Sep 17 00:00:00 2001 From: kink-guest Date: Wed, 1 Mar 2006 14:49:51 +0000 Subject: [PATCH] caff: support using a SMTP-server to send out the mails instead 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 | 18 +++++++++++++++++- debian/changelog | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/caff/caff b/caff/caff index 47c4ec8..bb687a2 100755 --- 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 [string] + +Send mail through specified SMTP server. Default: none (uses +sendmail). + +=item B [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(); }; diff --git a/debian/changelog b/debian/changelog index 8da7cda..f1ad65b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 28 Feb 2006 18:41:13 +0100 + -- Thijs Kinkhorst Wed, 1 Mar 2006 15:47:33 +0100 signing-party (0.4.4-2) unstable; urgency=low -- 2.30.2