Re: Simple Python script as SMTP server for outgoing e-mails?
On Sat, 3 Aug 2013 06:47:07 -0500 (CDT), Wayne Werner wa...@waynewerner.com wrote: Have you checked Kenneth Rietz's inbox.py[1]? It's fairly simple to use/extend and might fit your modest needs. -W [1]:https://crate.io/packages/inbox/ Thanks. I'll check it out. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Sat, 03 Aug 2013 21:41:16 -0400, Kevin Walzer k...@codebykevin.com wrote: For what it's worth, that hasn't been my experience. Thanks for the feedback. I'll experiment and see how it goes. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 2:49 PM, Chris Angelico ros...@gmail.com wrote: Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. Forwarding and using the original sender's address in the SMTP 'MAIL FROM' command is forging mail from them, so it is correct for that to be thrown out. The mail is coming from your own account, so you put your address in it, and you might even be able to put an uber-strict SPF record like v=spf1 ip4:1.2.3.4 -all which is quick to process and guarantees that nobody can pretend to forward mail on your behalf. The checks are for the *current connection*, not anything earlier. ChrisA Bit Late, but do check out http://www.openspf.org/FAQ/Forwarding Forwarding does get broken, but a partial solution in whitelisting is there, though too manual therefore cumbersome. Another option http://www.openspf.org/SRS is there to be worked in conjunction with spf. There is a best spf practices guide on the site. And all this email authentication issue given on openspf.org makes an interesting read. Ciao. Sanjay. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Thu, 1 Aug 2013, Gilles wrote: On Wed, 24 Jul 2013 10:38:52 -0400, Kevin Walzer k...@codebykevin.com wrote: Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Have you checked Kenneth Rietz's inbox.py[1]? It's fairly simple to use/extend and might fit your modest needs. -W [1]:https://crate.io/packages/inbox/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 8/1/13 10:15 AM, Gilles wrote: I already have a static IP, so the issue is more that remote MTAs might not accept connections from MTAs running on users' PC instead of ISP's. For what it's worth, that hasn't been my experience. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Wed, 24 Jul 2013 10:38:52 -0400, Kevin Walzer k...@codebykevin.com wrote: Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Regardless, because of the SPAM anti-measures mentioned above, it seems like I was over-optimistic about running an MTA and sending e-mails from my home computer :-/ The reason I mentioned hMailServer is that I host my own mail server for my business--I have a static IP address, and correctly configured DNS--and so I'm able to send out large batches of e-mails to customers from my network without being blocked by my ISP. I'm running a Mac server so my mail system is the typical Unix setup (Postfix, etc.), but hMailServer was the closest thing I've found for Windows. Configuring your own server isn't cheap in terms of time even if you use FOSS components, and your ISP may charge more for a static IP, so I completely understand if you don't want to go that route. Thanks for the infos. Indeed, it seems like hMailServer is one of the few good MTAs for Windows. I already have a static IP, so the issue is more that remote MTAs might not accept connections from MTAs running on users' PC instead of ISP's. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 7/23/13 5:53 PM, Gilles wrote: On Mon, 22 Jul 2013 10:14:15 -0400, Kevin Walzer k...@codebykevin.com wrote: http://www.hmailserver.com Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Regardless, because of the SPAM anti-measures mentioned above, it seems like I was over-optimistic about running an MTA and sending e-mails from my home computer :-/ The reason I mentioned hMailServer is that I host my own mail server for my business--I have a static IP address, and correctly configured DNS--and so I'm able to send out large batches of e-mails to customers from my network without being blocked by my ISP. I'm running a Mac server so my mail system is the typical Unix setup (Postfix, etc.), but hMailServer was the closest thing I've found for Windows. Configuring your own server isn't cheap in terms of time even if you use FOSS components, and your ISP may charge more for a static IP, so I completely understand if you don't want to go that route. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 8:06 PM, Duncan Booth duncan.booth@invalid.invalid wrote: Excellent idea, I'll tell the email forwarding service to rewrite their system immediately. Yes. If they are using your domain in the MAIL FROM command and not using your mail servers, then yes, you should tell them, and use a different service until they fix that. It is not SPF's fault. It is a fundamental error of protocol, which SPF checks are highlighting. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT] SPF - was Re: Simple Python script as SMTP server for outgoing e-mails?
On Wed, Jul 24, 2013 at 1:12 AM, Michael Torrie torr...@gmail.com wrote: On 07/23/2013 03:30 AM, Chris Angelico wrote: On Tue, Jul 23, 2013 at 7:19 PM, Chris Angelico ros...@gmail.com wrote: Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. There's an example, by the way, of this exact technique right here - python-list@python.org sends mail to me with an envelope-from of python-list-bounces+rosuav=gmail@python.org - which passes SPF, since python.org has a TXT record designating the sending IP as one of theirs. It doesn't matter that invalid.invalid (your supposed domain) doesn't have an SPF record, nor would it be a problem if it had one that said v=spf1 -all, because that domain wasn't checked. Mailing lists are doing the same sort of forwarding that you're doing. This is good and all, and I think I will modify my local postfix mail server I use for personal stuff, just for correctness' sake. Correctness is a worthwhile reason to do something :) I hadn't spent much time studying SPF in depth before, but after reading your comments (which were insightful) I'm now more convinced that SPF is worthless than ever, at least as a spam prevention mechanism. Spammers can use throwaway domains that publish very non-strict SPF records, and spam to their hearts content with random forged from addresses and SPF checks pass. The only way around that is to enforce SPF on the From: header in the e-mail itself, which we all agree is broken. I've been reading this: http://www.openspf.org/FAQ/SPF_is_not_about_spam There are several things that SPF achieves, but mainly it's a measure of trust. If you receive email from a domain I run, and the SPF record permits the IP that sent it to you, you can have a high degree of confidence that it really is from that domain. Suppose, for instance, that (pick a bank, any bank) has a strict SPF record. Someone tries to send a phishing email purporting to be from that bank. They then have to use a different envelope-from address, which instantly marks the mail as suspicious to anyone who's checking. But more likely, what they'll do is simply ignore SPF and send it anyway. That means that any MTA that checks SPF records is immediately freed of all that bad mail - which is more than just spam, it's a major vulnerability (thinking here of corporate networks where all the company's mail goes through a central server, and then a whole lot of non-technical people read it). In the same way that banks assure us that they will *never* ask for your password, they could also assure us that they will *never* send account information from any other domain. Spammers look for the easy pickings. If your X million addresses become (X-1),999,900 because a few servers are rejecting their mail, what do they care? But those hundred people now haven't seen that spam. Sure, spammers can easily get around SPF checks... but that won't get all that likely until the bulk of MTAs start checking. For now, we can take all the benefit. Later on, the world can look to other solutions. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 08:54:11 -0400, Eric S. Johansson e...@harvee.org wrote: try http://emailrelay.sourceforge.net/ Thanks. I did find it, but it says it's not a full MTA: E-MailRelay is not a routing MTA. It forwards e-mail to a pre-configured SMTP server, regardless of any message addressing or DNS redirects. http://emailrelay.sourceforge.net/userguide.html#SH_1_2 IOW, it'll just send outbound e-mails to my ISP's MTA, so I'm back at square one. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 08:10:10 -0600, Michael Torrie torr...@gmail.com wrote: Where did you look? Here's one I found. It's not the real sendmail program, but it implements the interface which is all you need: http://glob.com.au/sendmail/ I just googled for sendmail win32 Thanks, but I need an MTA, not just a command-line app, so I can send e-mails from my e-mail client and just change the SMTP line in the configuration. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 10:14:15 -0400, Kevin Walzer k...@codebykevin.com wrote: http://www.hmailserver.com Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Regardless, because of the SPAM anti-measures mentioned above, it seems like I was over-optimistic about running an MTA and sending e-mails from my home computer :-/ -- http://mail.python.org/mailman/listinfo/python-list
Re: non sequitur: [OT] SPF - was Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, 23 Jul 2013 19:59:01 -0400, Dennis Lee Bieber wrote: {Liaden culture seems heavy on personal honor, and comments tend (to me) be worded to avoid any chance of being interpreted as disparaging of the person with whom one is speaking... Hmmm, pity such modes can't be enforced on the newsgroups G} Are you implying that failure to avoid disparaging others in newsgroups is harmful? That disparages me. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
Chris Angelico ros...@gmail.com wrote: On Tue, Jul 23, 2013 at 12:08 AM, Michael Torrie torr...@gmail.com wrote: On 07/22/2013 06:51 AM, Chris Angelico wrote: Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework It's a great way of detecting legit vs forged mail. If anyone tries to send mail purporting to be from anyth...@kepl.com.au and the receiving mail server is checking SPF records, it'll be rejected after one cheap DNS lookup. It's a simple and cacheable way to ask the owning server, Is this guy allowed to send mail for you?. (The 192.168 block in my SPF record above is permitted to allow some intranet conveniences; omit it unless you need it.) Yes setting SPF records will help your mail be accepted by other servers, but I disagree with your appeal to make mail server SPF handling as strict as your server does. SPF has problems in a number of situations which could cause legitimate mail to be rejected. In my last job I could only use SPF as one spam factor, not as a basis for rejection. If legit mail is rejected for failing an SPF check, it's the sending admin's problem, not yours. You should never have problems with it if it's set up correctly. And since rejected mail gets reported to the transmitting MTA, you don't need to drop it in a spambox or anything. It's not spam, it's simply invalid mail (equivalent to something sent to a dud address). If you want your emails to have the best chance of arriving your SPF should list servers you use but not deny that there might be others. I have a very common situation where an overly strict SPF may cause problems: Like many people I have multiple email addresses which all end up in the same inbox. The one I most commonly give out to businesses bounces the email unchanged to the gmail inbox that I use. That means all emails I receive through that email address appear to Google to have originated from the forwarding servers. An SPF record from the original sender that claims to have a complete list of originating servers will therefore fail validation. It isn't Google's fault: they can't ignore the forwarding step otherwise spammers could bypass SPF simply by claiming to be forwarding the emails. It is simply a limitation of the SPF protocol. Fortunately they only use SPF as one indicator so real messages still get through. -- Duncan Booth -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 6:06 PM, Duncan Booth duncan.booth@invalid.invalid wrote: Chris Angelico ros...@gmail.com wrote: On Tue, Jul 23, 2013 at 12:08 AM, Michael Torrie torr...@gmail.com wrote: On 07/22/2013 06:51 AM, Chris Angelico wrote: Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework It's a great way of detecting legit vs forged mail. If anyone tries to send mail purporting to be from anyth...@kepl.com.au and the receiving mail server is checking SPF records, it'll be rejected after one cheap DNS lookup. It's a simple and cacheable way to ask the owning server, Is this guy allowed to send mail for you?. (The 192.168 block in my SPF record above is permitted to allow some intranet conveniences; omit it unless you need it.) Yes setting SPF records will help your mail be accepted by other servers, but I disagree with your appeal to make mail server SPF handling as strict as your server does. SPF has problems in a number of situations which could cause legitimate mail to be rejected. In my last job I could only use SPF as one spam factor, not as a basis for rejection. If legit mail is rejected for failing an SPF check, it's the sending admin's problem, not yours. You should never have problems with it if it's set up correctly. And since rejected mail gets reported to the transmitting MTA, you don't need to drop it in a spambox or anything. It's not spam, it's simply invalid mail (equivalent to something sent to a dud address). If you want your emails to have the best chance of arriving your SPF should list servers you use but not deny that there might be others. That usually makes the SPF record completely useless. The whole point is to say that random addresses on the internet _will not_ send mail from you. I have a very common situation where an overly strict SPF may cause problems: Like many people I have multiple email addresses which all end up in the same inbox. The one I most commonly give out to businesses bounces the email unchanged to the gmail inbox that I use. That means all emails I receive through that email address appear to Google to have originated from the forwarding servers. An SPF record from the original sender that claims to have a complete list of originating servers will therefore fail validation. Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. Forwarding and using the original sender's address in the SMTP 'MAIL FROM' command is forging mail from them, so it is correct for that to be thrown out. The mail is coming from your own account, so you put your address in it, and you might even be able to put an uber-strict SPF record like v=spf1 ip4:1.2.3.4 -all which is quick to process and guarantees that nobody can pretend to forward mail on your behalf. The checks are for the *current connection*, not anything earlier. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 7:19 PM, Chris Angelico ros...@gmail.com wrote: Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. There's an example, by the way, of this exact technique right here - python-list@python.org sends mail to me with an envelope-from of python-list-bounces+rosuav=gmail@python.org - which passes SPF, since python.org has a TXT record designating the sending IP as one of theirs. It doesn't matter that invalid.invalid (your supposed domain) doesn't have an SPF record, nor would it be a problem if it had one that said v=spf1 -all, because that domain wasn't checked. Mailing lists are doing the same sort of forwarding that you're doing. (Apologies to those who read this as a newsgroup, for whom this won't be as parallel an example. But it's still the case, just not for the posts you receive.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
Chris Angelico ros...@gmail.com wrote: On Tue, Jul 23, 2013 at 6:06 PM, Duncan Booth duncan.booth@invalid.invalid wrote: I have a very common situation where an overly strict SPF may cause problems: Like many people I have multiple email addresses which all end up in the same inbox. The one I most commonly give out to businesses bounces the email unchanged to the gmail inbox that I use. That means all emails I receive through that email address appear to Google to have originated from the forwarding servers. An SPF record from the original sender that claims to have a complete list of originating servers will therefore fail validation. Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. Forwarding and using the original sender's address in the SMTP 'MAIL FROM' command is forging mail from them, so it is correct for that to be thrown out. The mail is coming from your own account, so you put your address in it, and you might even be able to put an uber-strict SPF record like v=spf1 ip4:1.2.3.4 -all which is quick to process and guarantees that nobody can pretend to forward mail on your behalf. The checks are for the *current connection*, not anything earlier. sarcasm Excellent idea, I'll tell the email forwarding service to rewrite their system immediately. Or I could just tell Google to rewrite their email system to know about and strip off the forwarding service's headers: that's probably about as easy. Or maybe I could just ask you to add the forwarder's SPF record into your own? /sarcasm I know that I could arrange things so that my emails don't trigger this situation, but that isn't the point. The point is that this situation happens quite commonly, therefore you as the sender of an email with a strict SPF are going to find systems rejecting emails you send that would get through if you have a less strict one. That is of course your choice, but many users of email would prefer to maximise the chance of the email they send arriving rather than reducing slightly the chance of people they may not even know receiving spam. You could also try combining SPF with DKIM although that has its own, different failure scenarios. -- Duncan Booth -- http://mail.python.org/mailman/listinfo/python-list
[OT] SPF - was Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/23/2013 03:30 AM, Chris Angelico wrote: On Tue, Jul 23, 2013 at 7:19 PM, Chris Angelico ros...@gmail.com wrote: Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. There's an example, by the way, of this exact technique right here - python-list@python.org sends mail to me with an envelope-from of python-list-bounces+rosuav=gmail@python.org - which passes SPF, since python.org has a TXT record designating the sending IP as one of theirs. It doesn't matter that invalid.invalid (your supposed domain) doesn't have an SPF record, nor would it be a problem if it had one that said v=spf1 -all, because that domain wasn't checked. Mailing lists are doing the same sort of forwarding that you're doing. This is good and all, and I think I will modify my local postfix mail server I use for personal stuff, just for correctness' sake. I hadn't spent much time studying SPF in depth before, but after reading your comments (which were insightful) I'm now more convinced that SPF is worthless than ever, at least as a spam prevention mechanism. Spammers can use throwaway domains that publish very non-strict SPF records, and spam to their hearts content with random forged from addresses and SPF checks pass. The only way around that is to enforce SPF on the From: header in the e-mail itself, which we all agree is broken. I've been reading this: http://www.openspf.org/FAQ/SPF_is_not_about_spam Not very encouraging. When the other expensive options for going after spammers who have valid SPF records, they propose domain blacklists as a solution. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie torr...@gmail.com wrote: The Sendmail MTA has been ported to many platforms including windows. But... Thanks for the tip. Since I couldn't find a good, basic, native Windows app, I was indeed about to look at eg. Exim + Cygwin, and resort to a Linux appliance if none footed the bill. I'm not sure my ISP blocks outbound port 25 connections. I'll experiment with a small Linux box. Having spent a long time managing e-mail servers, everything Ivan said in his reply is true as well. I had forgotten a lot of that since I haven't been running my own mail server (MTA or server part) in a while. Indeed, I had forgotten about some MTAs refusing incoming e-mails from other ISP's customer hosts. I'll experiment. But then how would it know that legit-looking e-mails aren't in fact SPAM? It generally does a good job, but every once in a while, some perfectly good e-mail I'm sending is flagged as SPAM. To keep all my e-mails in the same client, I'd rather use a local MTA than sending the e-mail from Gmail. Thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server. Most other SMTP servers are probably going to ignore or reject your attempts to transfer mail from your own SMTP server. I had forgotten about this. I'll give a try, and see how it goes. I'd recommend postfix or exim if I was going to try to do it, but I think they're Unix-only. Thanks for the tip. Looks like Exim is available on Windows through Cygwin http://blogostuffivelearnt.blogspot.fr/2012/07/smtp-mail-server-with-windows.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server. Most other SMTP servers are probably going to ignore or reject your attempts to transfer mail from your own SMTP server. Incidently, how do ISP MTAs find whether the remote MTA is legit or running on some regular user's computer? 1. Query Reverse DNS for IP 2. Find domain 3. Query DNS for MX 4. ? -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, Jul 22, 2013 at 10:11 PM, Gilles nos...@nospam.com wrote: On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie torr...@gmail.com wrote: Having spent a long time managing e-mail servers, everything Ivan said in his reply is true as well. I had forgotten a lot of that since I haven't been running my own mail server (MTA or server part) in a while. Indeed, I had forgotten about some MTAs refusing incoming e-mails from other ISP's customer hosts. I'll experiment. One thing to check when you change how you send mail is your SPF record. I run the mail server for kepl.com.au and have set its SPF to: v=spf1 ip4:122.107.147.136 ip4:203.214.67.43 ip4:192.168.0.0/16 -all If your SPF is as strict as mine (and if it's not, please make it so, for the sake of the rest of the world!), you'll want to check it before you start sending mail directly from your own computer. Otherwise your mail _will_ be rejected as spam. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 22:29:42 +1000, Chris Angelico ros...@gmail.com wrote: One thing to check when you change how you send mail is your SPF record. I run the mail server for kepl.com.au and have set its SPF to: v=spf1 ip4:122.107.147.136 ip4:203.214.67.43 ip4:192.168.0.0/16 -all If your SPF is as strict as mine (and if it's not, please make it so, for the sake of the rest of the world!), you'll want to check it before you start sending mail directly from your own computer. Otherwise your mail _will_ be rejected as spam. Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, Jul 22, 2013 at 10:38 PM, Gilles nos...@nospam.com wrote: On Mon, 22 Jul 2013 22:29:42 +1000, Chris Angelico ros...@gmail.com wrote: One thing to check when you change how you send mail is your SPF record. I run the mail server for kepl.com.au and have set its SPF to: v=spf1 ip4:122.107.147.136 ip4:203.214.67.43 ip4:192.168.0.0/16 -all If your SPF is as strict as mine (and if it's not, please make it so, for the sake of the rest of the world!), you'll want to check it before you start sending mail directly from your own computer. Otherwise your mail _will_ be rejected as spam. Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework It's a great way of detecting legit vs forged mail. If anyone tries to send mail purporting to be from anyth...@kepl.com.au and the receiving mail server is checking SPF records, it'll be rejected after one cheap DNS lookup. It's a simple and cacheable way to ask the owning server, Is this guy allowed to send mail for you?. (The 192.168 block in my SPF record above is permitted to allow some intranet conveniences; omit it unless you need it.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 08:11:25 -0400, Gilles nos...@nospam.com wrote: On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie torr...@gmail.com wrote: The Sendmail MTA has been ported to many platforms including windows. But... Thanks for the tip. Since I couldn't find a good, basic, native Windows app, I was indeed about to look at eg. Exim + Cygwin, and resort to a Linux appliance if none footed the bill. try http://emailrelay.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/22/2013 06:51 AM, Chris Angelico wrote: Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework It's a great way of detecting legit vs forged mail. If anyone tries to send mail purporting to be from anyth...@kepl.com.au and the receiving mail server is checking SPF records, it'll be rejected after one cheap DNS lookup. It's a simple and cacheable way to ask the owning server, Is this guy allowed to send mail for you?. (The 192.168 block in my SPF record above is permitted to allow some intranet conveniences; omit it unless you need it.) Yes setting SPF records will help your mail be accepted by other servers, but I disagree with your appeal to make mail server SPF handling as strict as your server does. SPF has problems in a number of situations which could cause legitimate mail to be rejected. In my last job I could only use SPF as one spam factor, not as a basis for rejection. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 12:08 AM, Michael Torrie torr...@gmail.com wrote: On 07/22/2013 06:51 AM, Chris Angelico wrote: Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework It's a great way of detecting legit vs forged mail. If anyone tries to send mail purporting to be from anyth...@kepl.com.au and the receiving mail server is checking SPF records, it'll be rejected after one cheap DNS lookup. It's a simple and cacheable way to ask the owning server, Is this guy allowed to send mail for you?. (The 192.168 block in my SPF record above is permitted to allow some intranet conveniences; omit it unless you need it.) Yes setting SPF records will help your mail be accepted by other servers, but I disagree with your appeal to make mail server SPF handling as strict as your server does. SPF has problems in a number of situations which could cause legitimate mail to be rejected. In my last job I could only use SPF as one spam factor, not as a basis for rejection. If legit mail is rejected for failing an SPF check, it's the sending admin's problem, not yours. You should never have problems with it if it's set up correctly. And since rejected mail gets reported to the transmitting MTA, you don't need to drop it in a spambox or anything. It's not spam, it's simply invalid mail (equivalent to something sent to a dud address). ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 2013-07-22, Gilles nos...@nospam.com wrote: On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server. Most other SMTP servers are probably going to ignore or reject your attempts to transfer mail from your own SMTP server. Incidently, how do ISP MTAs find whether the remote MTA is legit or running on some regular user's computer? 1. Query Reverse DNS for IP 2. Find domain 3. Query DNS for MX 4. ? There are a variety of things they check. They've got lists of IP address blocks that they know are residential DSL/cable customers, and sometimes they'll reject mail from those regardless of what you do. Some will compare the reverse-DNS lookup with the headers to make sure you're being honest about things like return-path, some will compare the IP address with the MX record for the domain they got when they did the reverse-lookup-DNS, and they've all probably got a variety of other secret heuristics they use to generate a SPAM score. For many years I ran my own SMTP server and had it configured to deliver mail directly to recipients. About 10 years, I had to give up on that because so many SMTP servers were rejecting/ignoring mail I sent. And I did have a static IP with a valid domain and MX record. But it was a residential DSL IP address, and I suspect that was enough to get mail rejected by some servers. -- Grant Edwards grant.b.edwardsYow! Well, O.K. at I'll compromise with my gmail.comprinciples because of EXISTENTIAL DESPAIR! -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/22/2013 06:19 AM, Gilles wrote: On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server. Most other SMTP servers are probably going to ignore or reject your attempts to transfer mail from your own SMTP server. Incidently, how do ISP MTAs find whether the remote MTA is legit or running on some regular user's computer? 1. Query Reverse DNS for IP 2. Find domain 3. Query DNS for MX 4. ? My mail server did a number of things: 1. ensure IP address of sending server has a reverse name (domain didn't particularly matter) 2. ensure the HELO address in SMTP matches IP address of sending server 3. check sender IP address against spam blacklists, which includes netblocks of home ISPs, some entire countries, flagged subnets 4. greylist sender IP if the recipient requested it. First connection always fails with a nonfatal server error, next connection must wait at least 5 minutes. If a reconnection happened too quickly, the IP was temporarily black listed. After success, IP address is whitelisted for a time. A commandline MTA will not be able to get through greylisting; only a mail server with queuing could. Spambots tend to give up on the first error, even now. Cheaper targets I guess. 5. spamassassin checked SPF (DNS) and domainkeys (message itself) and weighted the spam factor accordingly I think there were other basic rules that sendmail applied to the sender, but I can't remember all of what they are. This is well and truly off topic now for the python list, though. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 12:21 AM, Michael Torrie torr...@gmail.com wrote: My mail server did a number of things: 1. ensure IP address of sending server has a reverse name (domain didn't particularly matter) 2. ensure the HELO address in SMTP matches IP address of sending server 3. check sender IP address against spam blacklists, which includes netblocks of home ISPs, some entire countries, flagged subnets 4. greylist sender IP if the recipient requested it. First connection always fails with a nonfatal server error, next connection must wait at least 5 minutes. If a reconnection happened too quickly, the IP was temporarily black listed. After success, IP address is whitelisted for a time. A commandline MTA will not be able to get through greylisting; only a mail server with queuing could. Spambots tend to give up on the first error, even now. Cheaper targets I guess. 5. spamassassin checked SPF (DNS) and domainkeys (message itself) and weighted the spam factor accordingly I think there were other basic rules that sendmail applied to the sender, but I can't remember all of what they are. This is well and truly off topic now for the python list, though. And yet off-topic does happen... For what it's worth, here's how my server is set up: 1. A variety of protocol-level checks. If you don't say HELO, for instance, you get rejected. Surprisingly, these simple checks actually keep out a lot of spam - but I've yet to see any legiit mail blocked by them. (Not that I keep logs of these any more. I stopped watching after it looked clean for a while.) And if legit mail is rejected, it'll be resent or bounced by the sending MTA anyway. 2. SPF checks on the MAIL FROM: address. Again, if legit mail gets rejected (which would be the fault of the sending domain owner), the server at the previous hop will deal with it. Only hard failures get thrown out; anything else just gets marked (which we usually ignore) and delivered as normal, not even spam-scored. 3. Bayesian spam filter, set very conservatively so we get false negatives but (almost) no false positives. Any spam that gets through these three checks gets delivered, and then the users will drop it in their junk folder. Every week I do a train-and-wipe run across all junk folders, which logs spam counts from our primary mailboxes. Last week's run was 228 spam across the six logged accounts (some of those accounts collect from many addresses), or an average of five false negatives per account per day, and false positives are almost completely unheard-of. Considering how much spam assaults the outside of my fortress's walls, that's a fairly good ratio, I think. SPF for the win. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Tue, Jul 23, 2013 at 2:25 AM, Michael Torrie torr...@gmail.com wrote: On 07/22/2013 08:15 AM, Chris Angelico wrote: If legit mail is rejected for failing an SPF check, it's the sending admin's problem, not yours. You should never have problems with it if it's set up correctly. And since rejected mail gets reported to the transmitting MTA, you don't need to drop it in a spambox or anything. It's not spam, it's simply invalid mail (equivalent to something sent to a dud address). Sure. Tell that to the people you work for who depend on e-mail. When I was a sysadmin (quite recently), I'd have gotten fired for enforcing such an arbitrary policy. Indeed when mail wasn't coming through that someone in the organization was expecting and wanting, regardless of SPF, it was indeed *my* problem and my job was on the line. BOFH attitudes simply aren't going to change that reality. Is your job on the line if the sender of that email got the recipient's address right? Is your job on the line if the sender mucked up his SMTP settings and the message didn't even get to your server? Is your job on the line if the email never even got sent? Then why should your job be on the line if the sender violates his own declared protocol? Remember, if you don't publish an SPF record, your emails will be accepted regardless. It's only if you explicitly create that DNS record that ends with -all that any of this will happen - which means you *asked* for that mail to be rejected. If you do that and then send mail from a different IP, then I *will* reject it. Accepting mail and just giving it a spam score is *worse*, because the sender won't even know why it didn't get through (what if most of his mail gets accepted, but that one email when he sent a blank body, subject RE: your invoice, and a zip file attachment, managed to trip the spam cutoff and get dumped?), whereas rejecting will result in a quick and easy bounce, probably within seconds (minutes maybe). I stand by SPF checking. It has never been a problem. If you don't stand by protocols, you weaken those protocols. And speaking of protocols, I'm now going to have to follow the I'm on an airliner and mobile phones have to be turned off protocol, as the flight's due to depart shortly. Ah, protocols... some you love, some not so much. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 7/21/13 10:42 AM, Gilles wrote: Hello Every once in a while, my ISP's SMTP server refuses to send perfectly legit e-mails because it considers them as SPAM. So I'd like to install a dead-simple SMTP server on my XP computer just to act as SMTP backup server. All I'd need is to change the SMTP address in my e-mail client, and off they go. No need for anything else like user authentication or SPAM control. Is there a no-brainer, ready-to-use solution in Python that I could use for this? Thank you. http://www.hmailserver.com -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/22/2013 06:11 AM, Gilles wrote: On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie torr...@gmail.com wrote: The Sendmail MTA has been ported to many platforms including windows. But... Thanks for the tip. Since I couldn't find a good, basic, native Windows app, I was indeed about to look at eg. Exim + Cygwin, and resort to a Linux appliance if none footed the bill. Where did you look? Here's one I found. It's not the real sendmail program, but it implements the interface which is all you need: http://glob.com.au/sendmail/ I just googled for sendmail win32 -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/22/2013 08:15 AM, Chris Angelico wrote: If legit mail is rejected for failing an SPF check, it's the sending admin's problem, not yours. You should never have problems with it if it's set up correctly. And since rejected mail gets reported to the transmitting MTA, you don't need to drop it in a spambox or anything. It's not spam, it's simply invalid mail (equivalent to something sent to a dud address). Sure. Tell that to the people you work for who depend on e-mail. When I was a sysadmin (quite recently), I'd have gotten fired for enforcing such an arbitrary policy. Indeed when mail wasn't coming through that someone in the organization was expecting and wanting, regardless of SPF, it was indeed *my* problem and my job was on the line. BOFH attitudes simply aren't going to change that reality. SPF is just one more of the many things that are contributing overall to absolutely breaking and demise of SMTP. I'm afraid when it does finally cease to work, it's going to be replaced with less open, centrally-controlled messaging systems like facebook. Which is unfortunate. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 14:19:57 +0200, Gilles wrote: Incidently, how do ISP MTAs find whether the remote MTA is legit or running on some regular user's computer? Look up the IP address in a database. If they don't have a database, perform a reverse DNS lookup and reject anything which looks like a typical auto-generated name for a consumer DSL/cable connection. FWIW, I've been running sendmail on my home system (ADSL with static IP) for years, and have had very few problems with mail being rejected. -- http://mail.python.org/mailman/listinfo/python-list
Simple Python script as SMTP server for outgoing e-mails?
Hello Every once in a while, my ISP's SMTP server refuses to send perfectly legit e-mails because it considers them as SPAM. So I'd like to install a dead-simple SMTP server on my XP computer just to act as SMTP backup server. All I'd need is to change the SMTP address in my e-mail client, and off they go. No need for anything else like user authentication or SPAM control. Is there a no-brainer, ready-to-use solution in Python that I could use for this? Thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, Jul 22, 2013 at 12:42 AM, Gilles nos...@nospam.com wrote: Hello Every once in a while, my ISP's SMTP server refuses to send perfectly legit e-mails because it considers them as SPAM. So I'd like to install a dead-simple SMTP server on my XP computer just to act as SMTP backup server. All I'd need is to change the SMTP address in my e-mail client, and off they go. No need for anything else like user authentication or SPAM control. Is there a no-brainer, ready-to-use solution in Python that I could use for this? Rather than write something from scratch, I'd look at deploying something out-of-the-box - Postfix, for instance - which you will be able to configure much faster than writing your own. And then you could have it either send via your ISP or send directly to the receiving MTA, without much extra effort. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Mon, 22 Jul 2013 00:48:29 +1000, Chris Angelico ros...@gmail.com wrote: Rather than write something from scratch, I'd look at deploying something out-of-the-box - Postfix, for instance - which you will be able to configure much faster than writing your own. And then you could have it either send via your ISP or send directly to the receiving MTA, without much extra effort. Thank you but precisely, I was looking for a ready-to-use solution in Python so that I wouldn't have to write it myself. Also, I don't need a full-fledged SMTP server, just a tiny script that will let me send the occasional e-mails from my e-mail client that my ISP wrongly considers as SPAM. So, does someone know of a good, SMTP server just to send e-mails? Thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/21/2013 10:19 AM, Gilles wrote: So, does someone know of a good, SMTP server just to send e-mails? What you're looking for is not an SMTP server but a Mail Transfer Agent, called an MTA. Pretty much all distros ship with an MTA by default, even if the SMTP server part of it isn't installed or running. And often the MTA is, for compatibility reasons, /usr/sbin/sendmail. http://stackoverflow.com/questions/73781/sending-mail-via-sendmail-from-python I'm sure there are MTA's implemented in python. Now that you know what they are called (not SMTP servers!) you can search for them. Dennis is correct, though, that most ISPs do block outbound port 25 connections for security and spam reasons, and require you to use their SMTP server, which precludes the use of the local MTA. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On Sun, 21 Jul 2013 11:46:52 -0600, Michael Torrie torr...@gmail.com wrote: What you're looking for is not an SMTP server but a Mail Transfer Agent, called an MTA. Pretty much all distros ship with an MTA by default, even if the SMTP server part of it isn't installed or running. And often the MTA is, for compatibility reasons, /usr/sbin/sendmail. http://stackoverflow.com/questions/73781/sending-mail-via-sendmail-from-python I'm sure there are MTA's implemented in python. Now that you know what they are called (not SMTP servers!) you can search for them. Dennis is correct, though, that most ISPs do block outbound port 25 connections for security and spam reasons, and require you to use their SMTP server, which precludes the use of the local MTA. Thanks for the infos. Ideally, I was looking for a simple Windows app as MTA, but a Python script is OK. I'm not sure my ISP blocks outbound port 25 connections. I'll experiment with a small Linux box. I wist they would use a smarter SPAM filter that wouldn't flag perfectly legit-looking outgoing e-mails. -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
Gilles nos...@nospam.com writes: On Sun, 21 Jul 2013 11:46:52 -0600, Michael Torrie wrote: [Cross-posting to news:comp.mail.misc.] What you're looking for is not an SMTP server but a Mail Transfer Agent, called an MTA. [...] Dennis is correct, though, that most ISPs do block outbound port 25 connections for security and spam reasons, and require you to use their SMTP server, which precludes the use of the local MTA. I'm not sure my ISP blocks outbound port 25 connections. I'll experiment with a small Linux box. There's yet another issue: certain email operators may block /inbound/ port 25 connections from ISP customer networks. I wist they would use a smarter SPAM filter that wouldn't flag perfectly legit-looking outgoing e-mails. FWIW, it may also be possible to use an email service (such as Google Mail) provided by a third-party. -- FSF associate member #7257 -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 2013-07-21, Gilles nos...@nospam.com wrote: Every once in a while, my ISP's SMTP server refuses to send perfectly legit e-mails because it considers them as SPAM. So I'd like to install a dead-simple SMTP server on my XP computer just to act as SMTP backup server. All I'd need is to change the SMTP address in my e-mail client, and off they go. No need for anything else like user authentication or SPAM control. Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going to have much luck running an SMTP server. Most other SMTP servers are probably going to ignore or reject your attempts to transfer mail from your own SMTP server. Is there a no-brainer, ready-to-use solution in Python that I could use for this? I'd recommend postfix or exim if I was going to try to do it, but I think they're Unix-only. -- Grant -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple Python script as SMTP server for outgoing e-mails?
On 07/21/2013 02:34 PM, Gilles wrote: Thanks for the infos. Ideally, I was looking for a simple Windows app as MTA, but a Python script is OK. The Sendmail MTA has been ported to many platforms including windows. But... I'm not sure my ISP blocks outbound port 25 connections. I'll experiment with a small Linux box. Having spent a long time managing e-mail servers, everything Ivan said in his reply is true as well. I had forgotten a lot of that since I haven't been running my own mail server (MTA or server part) in a while. I've sold my soul to Google for e-mail now with Google Apps for my domain. I wist they would use a smarter SPAM filter that wouldn't flag perfectly legit-looking outgoing e-mails. But then how would it know that legit-looking e-mails aren't in fact SPAM? E-mail is starting to be an almost intractable problem. No wonder the younger generations are just abandoning it entirely in favor of centralized, cathedral-style messaging systems such as facebook. -- http://mail.python.org/mailman/listinfo/python-list