QSocket & smtp



  • Hallo,

    habe immer noch extrem Schwierigkeiten mit dem QSocket.
    Derzeit möchte ich mich mit meinen Postfix Mail auf Port 25 unterhalten.
    Leider bekomme ich aber kein connected Signal, obwohl das mail log:
    postfix/smtpd[4691]: connect from localhost[127.0.0.1]
    bringt.
    Nach Abbruch der Applikation:
    lost connection after CONNECT from localhost[127.0.0.1]

    Verbindung ist also da. Warum kein Signal connected()?
    Hostfound bekomme ich noch.

    _socket = new QSocket(this);
    connect(_socket, SIGNAL(hostFound()), this, SLOT(hostFound()));
    connect(_socket, SIGNAL(connected()), this, SLOT(connected()));
    connect(_socket, SIGNAL(readyRead()), this, SLOT(readyRead())); 
    connect(_socket, SIGNAL(connectionClosed ()), this, SLOT(connectionClosed ()));
    connect(_socket, SIGNAL(error(int)), this, SLOT(errorHandling(int)));
    
    _socket->connectToHost("localhost", 25);
    cout << "Looking up host..." << endl;
    

    dies soll ausgeführt werden:

    void connected()
    {
       cout << QString("Connected to %1").arg(_socket->peerName() << endl;
    }
    

    Das ganze wird aus einer Klasse darüber aufgerufen

    (void)  new SmtpHandler(header, subject, "from@localhost", "to@locahost");
    

    Danke Buggykite


Anmelden zum Antworten