atesin Posted March 5 Share Posted March 5 hi... new user here... i am very glad to be here imagine a story... you are a volunteer of a non-profit organization that helps people in africa (animal conservation, find water, child healthcare or some like) ... but your talent is to build computers and run servers, so you offer them to develop a website to spread the cause so, as they have no money (and you either) you go to some junkyards and build a pc from scraps, and install linux, and http server, and colocate the server in your house, connect to internet using your home connection, configure router for outside reachability (by port forwarding, dmz or whatever), install dynamic dns... and put a website with information about your work and some contact info soon you realize that a better way to being contacted (besides publishing your oranization phone number, email address or physical address) is to put a contact form page, faster and more comfortable for who wants contact to offer/search for help... you contact a couple people a week, but is very important for everyone but mail servers costs money and your people dont have it (like you), they are poor farmers so they have no even banks... so you search and find some free email services that can also send email by smtp (gmail, hotmail, yahoo, yandex, etc), so you pick and configure one of them.... this is when your problems start you quickly learn that to make the system work is not so easy because of the SPAMMERS... they previously paved your road full of obstacles, so now everyone are paranoid about spam, and now mail delivery systems are very very restrictive... so you have to think in develop something anti-spam system first you have to design some bulletproof contact form with many anti-spam protection measures like captchas, unique hidden codes, referer checkings, short live tokens, time synchronization, timeouts, ip/cookies lookups, browsing sessions, etc etc etc.. so your PUBLICLY ACCESIBLE contact form wont be found and exploited by spammers with bots or anyway next step is make php mail() function work in php, next step is sendmail (or similar) work in linux, next step is to make your mta (outgoing mail program) and your external mail delivery service talk each other, next step is ensure you wont be blocked by your external service ..... i read that heliohost also offer mail delivery service, but is also put in blacklists because of some spammers (ex?) members... so i think maybe the best option is to rely in some external mail delivery service using smtp, and use php mail() function to give them the mails to be sent... but mail() function is also blocked here due bad experiences with (fcking) spammers... so i was thinking, what way could we enable and make use of mail() function safely? certainly in my website (currently hosted on my house, searching a free and more reliable webhosting... my isp scratches his back and my websites go to hell) i use mail() function sometimes to send important messages like account creation validation or some desperate people looking for help (our real website is more related to women and alcoholism) and i am interested in make it work by give users mail() function access BUT forcing them using an external smtp server, heliohost frees the responsibility and risk of being blacklisted (anyway the system wont work other way because are already blacklisted)... so.. how this could be done??, i started by doing some research to write a /bin/sendmail wrapper i was thinking many ideas to be implemented on my home server, one of them are sending quotas in a certain amount of time.. say 12 mails/hour, that is not the same as 12 mails each clock hour... think on a database that take note the time each time you send a mail, and calculate the time difference between this mail and the 12th last sent email wont be more than 1 hour, so this way you can safely send an email each 5min, or if you prefer send all 12 mails at once having to wait 1 hour STARTING FROM NOW to send mails again another system i actually implemented in my server is a /bin/sendmail wrapper that accepts an additional parameter, so if some hacker/spammer accesed my filesystem and manages to inject some script with mail() function, it wont work because he doesnt know the additional parameter code.... before this i had to do some tests/research to make it work to know EXACTLY how mail() function and /bin/sendmail works together internally going further, i imagine a send mail code generator in admin panel, that accepts the path where the mail sending script (the one containing the mail() function) is located, that generates a unique additional parameter code depending the location of the script, that you have to put in your actual script code... maybe this could be done and would be fantastic but if mail() function doesnt/wont work, maybe this could be made work with some external php mail library like PHPmailer or SwiftMailer... i never tried before (remember you cant send email directly and have to use an external smtp server, because of heliohost ip blacklisting) ... i found this related page = https://forum.infinityfree.net/t/how-to-send-email-with-gmail-smtp/49239 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.