From c261267f4654c9ad5c51bb27309eb7edf15857f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 15 Jul 2003 16:23:44 +0000 Subject: [PATCH] Removed Mail duplicate git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3985 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bin/Jamfile | 1 - src/apps/bin/mail/Jamfile | 8 -- src/apps/bin/mail/mail.cpp | 137 ---------------------------------- src/apps/bin/mail/mailApp.cpp | 40 ---------- src/apps/bin/mail/mailApp.h | 17 ----- 5 files changed, 203 deletions(-) delete mode 100644 src/apps/bin/mail/Jamfile delete mode 100644 src/apps/bin/mail/mail.cpp delete mode 100644 src/apps/bin/mail/mailApp.cpp delete mode 100644 src/apps/bin/mail/mailApp.h diff --git a/src/apps/bin/Jamfile b/src/apps/bin/Jamfile index 886b2f894a..ebb822c124 100644 --- a/src/apps/bin/Jamfile +++ b/src/apps/bin/Jamfile @@ -55,7 +55,6 @@ SubInclude OBOS_TOP src apps bin listdev ; SubInclude OBOS_TOP src apps bin mkdos ; SubInclude OBOS_TOP src apps bin pc ; SubInclude OBOS_TOP src apps bin sed ; -SubInclude OBOS_TOP src apps bin mail ; # RCS commands SubInclude OBOS_TOP src apps bin rcs ; diff --git a/src/apps/bin/mail/Jamfile b/src/apps/bin/mail/Jamfile deleted file mode 100644 index af29b2ac16..0000000000 --- a/src/apps/bin/mail/Jamfile +++ /dev/null @@ -1,8 +0,0 @@ -SubDir OBOS_TOP src apps bin mail ; - -BinCommand mail : - mail.cpp - mailApp.cpp -; - -LinkSharedOSLibs mail : be mail ; diff --git a/src/apps/bin/mail/mail.cpp b/src/apps/bin/mail/mail.cpp deleted file mode 100644 index 170c1721a4..0000000000 --- a/src/apps/bin/mail/mail.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -// -// Copyright (c) 2003, OpenBeOS -// -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. -// -// -// File: mail.cpp -// Author: Santiago (Jacques) Lema -// Description: sends an e-mail from the command-line -// Created : May 23, 2003 -// -// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - -#include -#include -#include -#include - -#include "mailApp.h" - -int main( int argc, char* argv[] ) -{ - - // No arguments, show usage - if (argc==1) { - fprintf(stdout,"[OBOS-mail] Sorry: This program can only send mail, not read it.\n"); - fprintf(stdout,"usage: /bin/mail [-v] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n"); - fflush(stdout); - return B_OK; - } - - char *subject ="No title"; - char *cc = ""; - char *bcc = ""; - BString to = ""; - BString body=""; - - bool verbose =false; - //parse arguments - for (int i=1; i \n",to.String()); - fprintf(stdout,"Cc:\t<%s> \n",cc); - fprintf(stdout,"Bcc:\t<%s> \n",bcc); - fprintf(stdout,"Subj:\t<%s> \n",subject); - fprintf(stdout,"Body:\t<%s> \n",body.String()); - fprintf(stdout,"\n"); - } - //read each line until we get a single dot "." on a line - - - //check if valid recipients - if( - strcmp (to.String(), "") == 0 - && strcmp (cc, "") == 0 - && strcmp (bcc, "") == 0 - ) - { - fprintf(stdout,"[Error]\nYou must specify at least one recipient in to,cc or bcc fields.\n"); - return B_ERROR; - } - - char line[32768] =""; - - printf("Now type your message.\nType '.' alone on a line to send it.\n"); - do - { - gets(line); - - if(strcmp (line, ".") != 0) - { - body.Append(line); - body.Append("\n"); - } - //fprintf(stdout,"Line: %s \n",line); - }while (strcmp (line, ".") != 0); - - - if (verbose) - fprintf(stdout,"\nBody:\n%s\n",body.String()); - - if (verbose) - fprintf(stdout,"\nSending E-mail...\n"); - - - fflush(stdout); - - mailApp *be_app = new mailApp(); -// be_app->Run(); - be_app->sendMail(subject, body.String(),to.String(),cc,bcc); - delete be_app; - - -} diff --git a/src/apps/bin/mail/mailApp.cpp b/src/apps/bin/mail/mailApp.cpp deleted file mode 100644 index 45ffd1a999..0000000000 --- a/src/apps/bin/mail/mailApp.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include - -#include "mailApp.h" -#include -#include -#include - - - -#define APP_SIG "application/x-vnd.OBos-cmd-mail" - - -mailApp :: mailApp() : BApplication(APP_SIG) -{ -} - -mailApp :: ~mailApp() -{ - // empty -} - -void mailApp :: sendMail(const char *subject, const char*body, const char *to, const char *cc, const char *bcc) -{ - BMailMessage *mail; - mail = new BMailMessage(); - mail->AddHeaderField(B_MAIL_TO, to); - mail->AddHeaderField(B_MAIL_CC, cc); - mail->AddHeaderField(B_MAIL_BCC, bcc); - mail->AddHeaderField(B_MAIL_SUBJECT, subject); - mail->AddContent(body,strlen(body)); - status_t result = mail->Send(); - - if (result==B_OK) - fprintf(stdout, "\nMessage was sent successfully."); -} - - \ No newline at end of file diff --git a/src/apps/bin/mail/mailApp.h b/src/apps/bin/mail/mailApp.h deleted file mode 100644 index 44dc312c74..0000000000 --- a/src/apps/bin/mail/mailApp.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef MAILAPP_H -#define MAILAPP_H - -#include - -class mailApp : public BApplication -{ - public: - mailApp(void); - ~mailApp(); - - virtual void sendMail(const char *subject, const char*body, const char *to, const char *cc, const char *bcc); -//private: - -}; - -#endif