Code Search for Developers
 
 
  

address_mail.html from AlphaMail at Krugle


Show address_mail.html syntax highlighted

% # vim:set syntax=mason:
<%args>
@tolist => ()
@cclist => ()
@bcclist => ()
</%args>
<%init>
my $user = Apache::SiteControl->getCurrentUser($r);
my $book = new AlphaMail::AddressBook($user->getUsername(), $user->getAttribute('imap'), $config);
my $composition = load_composition($r, $user);

my (@tl, @cl, @bl);
my ($k, $a);

{ 
   local $" = ", ";

   for $k (@tolist) {
      $a = $book->get($k);
      push @tl, "@{$a}";
   }
   for $k (@cclist) {
      $a = $book->get($k);
      push @cl, "@{$a}";
   }
   for $k (@bcclist) {
      $a = $book->get($k);
      push @bl, "@{$a}";
   }

   # Add in the old addresses, if they are not duplicates:
   my (@addrs, @old);

   @old = Email::Address->parse($composition->{to});
   @addrs = Email::Address->parse("@tl");
   for my $a (@old) {
      if(!grep { $a->address eq $_->address } @addrs) {
         push @tl, $a->format;
      }
   }
   @old = Email::Address->parse($composition->{cc});
   @addrs = Email::Address->parse("@cl");
   for my $a (@old) {
      if(!grep { $a->address eq $_->address } @addrs) {
         push @cl, $a->format;
      }
   }
   @old = Email::Address->parse($composition->{bcc});
   @addrs = Email::Address->parse("@bl");
   for my $a (@old) {
      if(!grep { $a->address eq $_->address } @addrs) {
         push @bl, $a->format;
      }
   }
   $composition->{to} = "@tl";
   $composition->{cc} = "@cl";
   $composition->{bcc} = "@bl";
}

save_composition($r, $user, $composition->{to}, $composition->{cc}, 
   $composition->{bcc}, $composition->{subject}, $composition->{message},
   $composition->{replyflag}, $composition->{forwardflag}, 
   $composition->{"ref"}, $composition->{attachments}, $composition->{sizes},
   $composition->{richtext});

$m->redirect("/mail/compose.html");
</%init>
<%once>
use AlphaMail::SessionUtil qw(load_composition save_composition);
our $logger = Log::Log4perl->get_logger('alphamail');
</%once>




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  addressbook/
    edit.mhtml
    import.mhtml
    import_alias.html
    import_complete.html
    import_csv.html
    import_csv_save.html
    import_fname.html
    import_imho.html
    import_lname.html
    index.html
    process_edit.html
    take.html
  settings/
    altfolder_update.html
    edit_folders.html
    folders.mhtml
    general.mhtml
    index.html
    share.mhtml
    sharing_agree.html
    signatures.mhtml
    update_folderlist.html
    update_general.html
    update_signatures.html
  viewers/
    excel.html
    html.html
    targz.html
    word.html
    zip.html
  address_mail.html
  addresslist.mhtml
  autohandler
  check_spelling.html
  compose.html
  filevault.html
  first_login.html
  fix_spelling.html
  folderlist.mhtml
  footer.mhtml
  get_attachment.html
  header.mhtml
  index.html
  logout.html
  menu.mhtml
  other_folders.html
  print.html
  process_compose.html
  process_first_login.html
  process_messages.html
  read.html
  remove_attachment.html
  renew_session.html
  share_options.html
  share_upload.html
  verify_password.html
  view_attachment.html