Search code examples
javac++linuxdigital-certificate

SMTP/POP3 client in linux


I want to develop a STMP/POP3 client in linux (only client side). I want to encrypt the data using digital certificates (i will try to provide end-to-end security). I also want to create a simple interface (with a text field,send button,inbox etc.). My question is: should i do this in java(if it's possible) or C/C++ (in this case i must use some tools for the interface->QT for example). What do you think? And my second question: if you have any ideas/recommendation or helpful links (or anything that would help me) i would appreciate it.


Solution

  • About your first question

    should i do this in java(if it's possible) or C/C++

    You can use any language you feel confortable with, and if you want my suggestion I suggest you use java because it's so easy to create graphic interfaces using Swing or Javafx and there is a lot of libraires that can help to achieve your goal.

    And about your second question

    if you have any ideas/recommendation or helpful links

    You can find a useful Tutorial that will guide you from the beginning tell the end in this website: JavaMail API Tutorial - Tutorialspoint

    Here is a simple Application Interface To start with your project created using JavaFx.

    Simple Application UI Using JavaFX Desktop Screen-shot

    Main.java

    package application;
    
    import javafx.application.Application;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.layout.AnchorPane;
    import javafx.fxml.FXMLLoader;
    
    
    public class Main extends Application {
        @Override
        public void start(Stage primaryStage) {
            try {
                AnchorPane root = (AnchorPane)FXMLLoader.load(getClass().getResource("Email.fxml"));
                Scene scene = new Scene(root,400,400);
                scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
                primaryStage.setScene(scene);
                primaryStage.show();
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
    
        public static void main(String[] args) {
            launch(args);
        }
    }
    

    EmailController.java

    package application;
    
    import java.net.URL;
    import java.util.ResourceBundle;
    import javafx.fxml.FXML;
    import javafx.scene.control.Button;
    import javafx.scene.control.PasswordField;
    import javafx.scene.control.TextArea;
    import javafx.scene.control.TextField;
    
    public class EmailController {
    
        @FXML
        private ResourceBundle resources;
    
        @FXML
        private URL location;
    
        @FXML
        private TextField fromField;
    
        @FXML
        private TextField toField;
    
        @FXML
        private TextField loginField;
    
        @FXML
        private PasswordField passwordField;
    
        @FXML
        private TextField subjectField;
    
        @FXML
        private TextArea messageField;
    
        @FXML
        private Button deleteButton;
    
        @FXML
        private Button sendButton;
    
        @FXML
        void initialize() {
    
    
        }
    }
    

    Email.fxml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <?import javafx.geometry.Insets?>
    <?import javafx.scene.control.Button?>
    <?import javafx.scene.control.Label?>
    <?import javafx.scene.control.PasswordField?>
    <?import javafx.scene.control.TextArea?>
    <?import javafx.scene.control.TextField?>
    <?import javafx.scene.layout.AnchorPane?>
    <?import javafx.scene.layout.ColumnConstraints?>
    <?import javafx.scene.layout.GridPane?>
    <?import javafx.scene.layout.Pane?>
    <?import javafx.scene.layout.RowConstraints?>
    <?import javafx.scene.layout.VBox?>
    <?import javafx.scene.text.Font?>
    
    
    <fx:root type="AnchorPane" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.111" fx:controller="application.EmailController">
       <children>
          <Pane prefHeight="522.0" prefWidth="761.0">
             <children>
                <VBox prefHeight="522.0" prefWidth="761.0">
                   <children>
                      <GridPane gridLinesVisible="true">
                        <columnConstraints>
                          <ColumnConstraints hgrow="SOMETIMES" maxWidth="328.0" minWidth="10.0" prefWidth="131.0" />
                          <ColumnConstraints hgrow="SOMETIMES" maxWidth="635.0" minWidth="10.0" prefWidth="630.0" />
                        </columnConstraints>
                        <rowConstraints>
                          <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                          <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                          <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                        </rowConstraints>
                         <children>
                            <Label alignment="CENTER_RIGHT" prefHeight="23.0" prefWidth="136.0" text="From : ">
                               <font>
                                  <Font name="Segoe UI" size="18.0" />
                               </font>
                            </Label>
                            <TextField fx:id="fromField" GridPane.columnIndex="1" />
                            <Label alignment="CENTER_RIGHT" prefHeight="17.0" prefWidth="134.0" text="To : " textAlignment="CENTER" GridPane.rowIndex="1">
                               <font>
                                  <Font name="Segoe UI" size="18.0" />
                               </font>
                            </Label>
                            <Label alignment="CENTER_RIGHT" prefHeight="17.0" prefWidth="134.0" text="Login : " textAlignment="CENTER" GridPane.rowIndex="2">
                               <font>
                                  <Font name="Segoe UI" size="18.0" />
                               </font>
                            </Label>
                            <TextField fx:id="toField" GridPane.columnIndex="1" GridPane.rowIndex="1" />
                            <TextField fx:id="loginField" GridPane.columnIndex="1" GridPane.rowIndex="2" />
                            <Label alignment="CENTER_RIGHT" prefHeight="17.0" prefWidth="134.0" text="Password : " textAlignment="CENTER" GridPane.rowIndex="3">
                               <font>
                                  <Font name="Segoe UI" size="18.0" />
                               </font>
                            </Label>
                            <PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="3" />
                         </children>
                      </GridPane>
                      <GridPane prefHeight="240.0" prefWidth="681.0">
                        <columnConstraints>
                          <ColumnConstraints hgrow="SOMETIMES" maxWidth="659.0" minWidth="10.0" prefWidth="152.0" />
                          <ColumnConstraints hgrow="SOMETIMES" maxWidth="722.0" minWidth="10.0" prefWidth="609.0" />
                        </columnConstraints>
                        <rowConstraints>
                          <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                          <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                            <RowConstraints />
                            <RowConstraints minHeight="10.0" prefHeight="30.0" />
                        </rowConstraints>
                         <children>
                            <Label alignment="CENTER_RIGHT" prefHeight="23.0" prefWidth="150.0" text="Subject : ">
                               <font>
                                  <Font name="Segoe UI" size="18.0" />
                               </font>
                            </Label>
                            <TextField fx:id="subjectField" GridPane.columnIndex="1" />
                            <Label alignment="CENTER_RIGHT" prefHeight="23.0" prefWidth="150.0" text="Message : " GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
                               <font>
                                  <Font name="Segoe UI" size="18.0" />
                               </font>
                            </Label>
                            <TextArea fx:id="messageField" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.rowSpan="2">
                               <GridPane.margin>
                                  <Insets top="10.0" />
                               </GridPane.margin>
                            </TextArea>
                         </children>
                         <VBox.margin>
                            <Insets left="30.0" right="30.0" top="20.0" />
                         </VBox.margin>
                      </GridPane>
                      <Pane prefHeight="200.0" prefWidth="200.0">
                         <children>
                            <Button fx:id="deleteButton" layoutX="220.0" layoutY="30.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="150.0" text="Delete">
                               <font>
                                  <Font name="Segoe UI" size="24.0" />
                               </font>
                            </Button>
                            <Button fx:id="sendButton" layoutX="450.0" layoutY="30.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="150.0" text="SEND">
                               <font>
                                  <Font name="Segoe UI" size="24.0" />
                               </font>
                            </Button>
                         </children>
                      </Pane>
                   </children>
                </VBox>
             </children>
          </Pane>
       </children>
    </fx:root>