Hello everyone,
I'm working since one month on a wired home security system project based on Arduino and Network (routers only, no computers).
As I learned a bit late that my Mega2560 could not work with SSL, and of course that email providers do not allow anymore SMTP connections on port 25, I've been disappointed on the first shot while I was reaching the end of my project, until I've heard about Postfix.
This part of my project is essential as it is made to receive email alerts when the Arduino makes detection.
As I use a Gli-net AR750S built on Openwrt in my project, essentially as a VPN gateway, it can also for sure provide sending emails implementing SSL to satisfy Gmail by forwarding an email sent from my LAN Arduino on SMTP 25 port to 587 port.
So I've been installing and configuring the plugin and that is what is does...quite...
I've been following a tuto (I will put the link at the end) from someone that had a similar idea...but I cannot reach the end.
For now I can connect from my PC with putty to my router and using sendmail I can receive email from my Gmail address 1 (sender) to my Gmail address 2 (recipient) and I receive perfectly the email with the certificate on address 2, and I can see in my sender mailbox the email sent also.
So, that it seems that on Wan side things are set up correctly.
Then I'm blocked with what seems to be a simple forward to my ISP box here...
I've checked everywhere on the net with the main.cf and master.cf different explanation and configuration. Thought it was firewall blocking and add some iptables rules. Thought it was maybe root access not allowed from my Arduino. Changed postfix transport file to nexthop...
Really, I'm turning around since two days. I have always the same result with the ino file from the tuto showing that gateway is reachable on port 25, but the email is not sent. Postfix seems to end the connection. I got this issue but I do not just know where to look !!!
I will appreciate your kind help here as I've been working really hard on my own on this project since a lot of time.
I will for sure give you all the information you need step by step.
For now, here is the link of the tuto followed. Actually I had to change little things to make it work.
I've changed also this:
</>
bool checkResponseCode(EthernetClient ethclient) {
/
* Check if connection to mta is still active
*/
char responseCode;
if (!(*ethclient).available()) {
// terminate connection and return error
(*ethclient).stop();
Serial.println(F("FAILED"));
return false;
}
else if ((*ethclient).available()) {
// check response code from mta
responseCode = (*ethclient).peek(); // just read first byte
if (responseCode >= '4') {
(*ethclient).println(F("QUIT)"));
Serial.println(F("FAILED"));
return false;
}
else {
return true;
}
}
}
</>
By putting in first Serial.println "Failed - unavailable" and in the second "Failed - Code >=4".
The serial monitor returns the first Failed (unavailable) after saying MTA OK, showing the MTA connection is OK but not the MTA communication...
Thank you for your help again.
Best regards.