Skip to content
Browse files

* BBBikeMail: disabled mail sending on Windows

  It turned out that my favorite method (building a mailto: URL with
  to, cc, subject, and body included) works only for small contents
  (total number of bytes somewhere at 2000 bytes on Windows). This is
  too less to be usable.

  capabilities is now setting $can_send_mail = 0 on Windows.

  On Unix systems it's still enabled, as the maximum here is somewhere
  at 32K.
  • Loading branch information...
1 parent ce29098 commit 7a4092a19ba5cdab2ab0d6d98219a8668c89b90e @eserte committed Mar 10, 2013
Showing with 14 additions and 1 deletion.
  1. +14 −1 BBBikeMail.pm
View
15 BBBikeMail.pm
@@ -225,7 +225,20 @@ sub create_mailto_url {
}
sub capabilities {
- $can_send_mail = 1; # via browser
+ if ($^O eq 'MSWin32') {
+ # XXX Sending mail is currently disabled completely on
+ # windows. Reason: the method creating a mailto URL and using
+ # it with WWWBrowser::start_browser only works for short
+ # content (less than 2000 bytes). This is usually too less for
+ # route texts. An alternative is not yet found.
+ $can_send_mail = 0;
+ # Shortcut early, don't try Mail::Send or Mail::Mailer.
+ # Usually this does not work out-of-the-box, as the smtp host
+ # needs to be configured somewhere.
+ return;
+ } else {
+ $can_send_mail = 1; # via browser
+ }
eval {
die "Specified to not use Mail::Mailer via variable \$cannot_send_mail_via_Mail_Mailer"
if $cannot_send_mail_via_Mail_Mailer;

0 comments on commit 7a4092a

Please sign in to comment.
Something went wrong with that request. Please try again.