首页 \ 问答 \ SMTP直接到主机的MX记录(SMTP directly to a host's MX record)

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
更新时间:2023-02-04 11:02

最满意答案

而不是使用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 ...
  • 把它们放在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 ...
  • 只需添加 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 ...
  • 一个简单的错误: -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 ...
  • 根据谷歌过渡是: 从一种状态或条件转变为另一种状态或状态的过程或过程。 要进行转换,您必须从一个状态开始,并将其更改为另一个状态。 但是,状态需要是渐进的,这意味着在设置第一状态后你必须稍等一下。 执行此操作时,将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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。