SMTP直接到主机的MX记录(SMTP directly to a host's MX record)
我曾尝试在python中玩游戏以了解有关smtp协议的更多信息。 更准确地说,我一直试图直接向主机的smtp服务器发送邮件,但收效甚微。
例如,假设我想发送邮件到gmail.com地址,我查找gmail.com的mx记录:
>> nslookup -type=MX gmail.com gmail.com MX preference = 40, mail exchanger = alt4.gmail-smtp-in.l.google.com gmail.com MX preference = 5, mail exchanger = gmail-smtp-in.l.google.com gmail.com MX preference = 10, mail exchanger = alt1.gmail-smtp-in.l.google.com
然后我在python中执行以下操作:
import smtplib # Tried both port 465 and 587 (can't test port 25 since it's blocked by my ISP) s = smtplib.SMTP("alt1.gmail-smtp-in.l.google.com", 587)
我尝试了几个,除了一个,我总是得到一个:
“[Errno 10051]尝试对无法访问的网络进行套接字操作”或
“[Errno 10060]连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能响应”异常。我在某处读到某些邮件服务器对您的IP进行反向查找,如果没有域,则拒绝该连接。 他们是怎么做到的?
我还在某处读到许多邮件服务器拒绝来自动态IP地址的传入邮件(我显然将其作为私人客户提供给我的ISP)。 他们如何检查IP地址是动态的还是静态的?这些是大多数服务器似乎拒绝我的连接的原因吗? 或者还有更多的东西吗?
I've tried playing around in python to learn more about the smtp protocol. More precisely I'm been trying to send a mail straight to a host's smtp server, but with little success.
For example, say I want to send a mail to a gmail.com address, I lookup the mx record for gmail.com:
>> nslookup -type=MX gmail.com gmail.com MX preference = 40, mail exchanger = alt4.gmail-smtp-in.l.google.com gmail.com MX preference = 5, mail exchanger = gmail-smtp-in.l.google.com gmail.com MX preference = 10, mail exchanger = alt1.gmail-smtp-in.l.google.com
Then I do the following in python:
import smtplib # Tried both port 465 and 587 (can't test port 25 since it's blocked by my ISP) s = smtplib.SMTP("alt1.gmail-smtp-in.l.google.com", 587)
I tried several, and for everyone but one I always got a:
"[Errno 10051] A socket operation was attempted to an unreachable network" or
"[Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because conneted host has failed to respond" exception.I read somewhere that some mail servers do a reverse lookup on your IP, and rejecting the connection if it hasn't got a domain. How do they do that?
I also read somewhere that many mail servers reject incoming mails from dynamic IP addresses (which I obviously have as a private customer to my ISP). How can they check if an IP address is dynamic or static?Are these the reasons most servers seem to reject my connection? Or is there something more to it?
原文:https://stackoverflow.com/questions/7297373
最满意答案
而不是使用setTimeout使用delay()
语法是这样的
$('.partB').show().delay(50).css('left', '200px');
或者如果你想在show事件结束时触发它,请查看show()的文档,它接受一个“完整”的回调参数。
在那种情况下你会使用
$('.partB').show(0, function() { $('.partb').css('left', '200px'); });
其中0是持续时间,函数参数是“完整”回调。
Instead of using setTimeout use delay()
The syntax is something like this
$('.partB').show().delay(50).css('left', '200px');
Or if you want it to fire when the show event is finished look at the documentation for show() it accepts a "complete" callback parameter.
In that case you would use
$('.partB').show(0, function() { $('.partb').css('left', '200px'); });
where 0 is the duration and the function parameter is the "complete" callback.
相关问答
更多-
我不知道有任何纯粹的CSS解决方案 - 将值过渡到auto是规范没有包含的内容; 我认为这甚至是一个明确的决定,因为可能存在执行问题。 但对于一个“简单”的jQuery解决方案,我只是将段落内容封装在一个额外的范围内,将初始段落高度设置为0并溢出:隐藏,保留高度的转换 - 然后让jQuery只做一个请阅读span元素的高度,为段落设置高度,然后再次将其设置为0,以再次淡出文本。 .details { height: 0; margin: 0; overflow: hidden; trans ...
-
CSS-转换不起作用(CSS- Transition not working)[2023-05-23]
把它们放在a(不是悬停)上,如果你想要多次转换,你必须将它们一起声明。 -webkit-transition: color 1000ms linear, background-color 1000ms linear; http://jsfiddle.net/4zhnP/1/ Put them on the a (not the hover) AND if you want multiple transitions you have to declare them together. -webkit-tra ... -
CSS3过渡不起作用(CSS3 transition does not work)[2023-09-23]
只需添加 width: 100%; 你的div p { } ,它会工作。 您需要提供CSS开始和结束值。 所以,你的最终CSS将是: div p { -webkit-transition: width 2s; /* For Safari 3.1 to 6.0 */ transition: width 2s; width: 100%; } div:hover p { width: 200px; } Just add width: 100%; to your div p ... -
尝试使用.animate()而不是.css()。 $('#foo').animate({'height': '100%'}, 500); 如果你想包含一些easing效果,你还需要包含jQueryUI效果,然后代码将是: $('#foo').animate({'height': '100%'}, {easing: 'easeInOutCirc', duration: 500}); 编辑:好的,然后为元素创建一个类,比如说.in-transition ,它将是: .in-transition{ - ...
-
您需要在更改类后重新/重新绘制,否则浏览器将优化并直接跳到结束状态(基本上,浏览器将不会更新UI,直到所有功能都运行完毕)。 你可以使用setTimeout ,但是如果你觉得它过于膨胀(并且setTimeout实际上并不总是可靠),你可以通过访问元素的.offsetHeight属性来触发/强制重.offsetHeight : element.classList.add('highlight') element.offsetHeight element.classList.remove('highlight' ...
-
如果你在你的textarea中添加required属性,你可以使用:invalid伪类来定位一个空的textarea: textarea { height: 100px; margin: 20px; width: 585px; resize: vertical; overflow: hidden; vertical-align: top; -webkit-transition: height .3s; -moz-transition: heig ...
-
为什么css转换不起作用(why css transition doesn't work)[2023-12-03]
一个简单的错误: -webkit-transition: all, 0.2s, ease-in; -moz-transition: all, 0.2s, ease-in; -o-transition: all, 0.2s, ease-in; transition: all, 0.2s, ease-in; 改成: -webkit-transition: all 0.2s ease-in; -moz-transition: all 0.2s ease-in; -o-transition: all 0.2s e ... -
如果将方法.switchClass()更改为.removeClass()和.addClass() ,它将起作用。 看看这个jsFiddle 。 有两个函数,一个名为.hidepage() ,它是.removeClass和.addClass ,第二个函数是.hidepagetwo() ,它使用.switchClass() 真正的错误是:有一个}); 在最后丢失,至少在jsFiddle中你添加了这个代码后工作。 If you change your method .switchClass() to .remov ...
-
从javascript更改css时,CSS转换不起作用(CSS transition not working when changing css from javascript)[2021-10-30]
根据谷歌过渡是: 从一种状态或条件转变为另一种状态或状态的过程或过程。 要进行转换,您必须从一个状态开始,并将其更改为另一个状态。 但是,状态需要是渐进的,这意味着在设置第一状态后你必须稍等一下。 执行此操作时,将top和left设置为开始,然后使用visible类立即覆盖它们。 注意 - 我已经改变了一些尺寸,以适应SO示例区域。 您可以在此处找到具有原始尺寸的示例。 $(".popup").css("left", offset.left); $(".popup").addClass("visible" ... -
而不是使用setTimeout使用delay() 语法是这样的 $('.partB').show().delay(50).css('left', '200px'); 或者如果你想在show事件结束时触发它,请查看show()的文档,它接受一个“完整”的回调参数。 在那种情况下你会使用 $('.partB').show(0, function() { $('.partb').css('left', '200px'); }); 其中0是持续时间,函数参数是“完整”回调。 Instead of usin ...