THINK

that’s how i naturally know

Archive for the ‘Web’ Category

PTR, rDNS, SPF, DKIM, DomainKeys and SMTP set up for sending emails

leave a comment

The DNS records related to sending emails has to be set correctly according to prevailing standards otherwise you will get into various non-delivery issues.

PTR and rDNS

When the sender server (S) email arrives at the recipient server (R), R will do a rDNS check and this sequence of events will happen:

  1. R will check the IP that S is connected on
  2. R will check the IP for a valid hostname by doing a DNS lookup for the PTR record for the IP. This PTR record is recorded in the ISP zone for S.
  3. S’s ISP will return a hostname to R.
  4. R will check the hostname for an IP by doing a DNS lookup for the A record for the hostname. This A record is recorded in the zone of the hostname’s domain.
  5. R will compare the IP in step 1 and 4 to make sure it is the same.

Additionally, R may require that the hostname in step 2 be the same as the sender email domain’s MX and be the same as the hostname in the HELO/EHLO command sent by S. Although this will be over doing it.

SPF

R may also check whether S implements the Sender Policy Framework (SPF) in the DNS by looking up the TXT record in the email domain zone. Typically, an SPF TXT looks like:

  • “v=spf1 mx a ~all”

This will tell R that emails originating from the MX server and the Web Server (specified at the A record for the domain) are allowed to send emails for the email domain.

DomainKeys, DKIM

S can also implement a “signature” protocol where every email sent out will be signed by the it. Then when R recieves the email, it will look up TXT record in the DNS zone of the email domain for the DomainKey and DKIM rules to parse and determine if the signature on the email is valid.

 

 

Written by Jake

December 1st, 2011 at 3:13 pm

Posted in Networking,Web

Bottom margin or spacing in an inline img

one comment

Inline img tags by default is positioned such that it has an additional bottom spacing relative to its parent block element. If the parent block element e.g. div have zero padding and the img have zero margin, the img height will not equal to the div height as the additional spacing will push the parent border further downwards.

This is because the inline img tries to compensates for character decendants when positioned inline with adjacent text. charater decendants are the “tails” in “g”, “j”, “p”, “q” and “y” that extend downwards.

To remove the spacing, set the img vertical-align to bottom. In the absence of adjacent text, this would make img ignore the compensation, resulting in equal-height div and img.

Written by Jake

October 22nd, 2011 at 3:09 pm

Posted in Web

Tagged with ,

XHTML gives way for HTML 5

leave a comment

When XHTML finally begins to unify the browsers and internet experience, the WC3 decides to kill it. The official annoucement as qouted here:

XHTML 2 Working Group Expected to Stop Work End of 2009, W3C to Increase Resources on HTML 5
2009-07-02: Today the Director announces that when the XHTML 2 Working Group charter expires as scheduled at the end of 2009, the charter will not be renewed. By doing so, and by increasing resources in the HTML Working Group, W3C hopes to accelerate the progress of HTML 5 and clarify W3C’s position regarding the future of HTML.

Early adopters are already eargerly testing the new capabilities on Opera browsers. When IE8 decided to implement parts of HTML5, I didn’t actually put much thoguht to it except for the fact that it will take a couple more years before it becomes widespread like XHTML is now (actually, different browser still behave slightly differently under XHTML). But back tracking abit, Google is already very excited about their “Unbelievable product”, Google Wave, being an HTML5 app.

Now, all these early hype is getting me more and more excited about the new offerings, pakaged as HTML 5 APIs that are coming our way. We have some cool Drag and Drop, Geolocation stuff which could bring about even more inventive applications, and finally <video> and <audio> tags that I always wanted.

Written by Jake

July 31st, 2009 at 9:10 am

Posted in Web

Tagged with ,

IE8 sure knows how to push the blame

leave a comment

I was watching some Adobe Acrobat videos over the internet when suddenly IE8 crashed and the tabbed window just closed. Immediately after, a yellow speech bubble (or tooltip box) pops up, pointing at that tab with the following text (roughly).

This tab has been recovered (yes we are the hero)
A problem with the web page CAUSED Internet Explorer to crash!”

Then I switched over to FireFox. The same error happened, but at least FF3 is more modest.

We’re Sorry (don’t worry, it’s ok, foxy)
Firefox had a problem and crashed (not blaming the web page, Adobe, at all). We’ll try to restore your tabs and windows when it restarts.
To help us diagnose and fix the problem, you can send us a crash report.”

So at least FireFox is going to fix the problem for us. Nice work.

Written by Jake

July 29th, 2009 at 3:38 pm

Posted in Web

Tagged with ,

Firefox Flash height:100% DocType bug

leave a comment

As much as some FF fanboy is going to defend and deny, and putting the blame on the coder, this is still going to be a BUG!

When an HTML document includes the doctype declaration at the top of the page, the swf embeded in the document will not render properly when the its height is set to 100%. The result is an swf rendered beyond the top border of the window as though the CSS top attribute has been set to a negative value. However, when the doctype is removed, the swf will render correctly just as IE does.

I only realised this issue after serveral hours of debugging and totally hate it when its not my fault. So I went ahead to search online to confirm if it is a bug indeed. I came across a forum (which I will not point out) where another poor victim posted this same issue. One guy came along, whom I presume is an FF fanboy, and replied along the lines of “its your own fault” without proposing any solutions! I totally hate this kind of posters who just come along to insult you on something irrelevant to the issue at hand.

After the poor guy replied, the FF fanboy went on to argue that without specifying the container’s width and height, firefox (or the swf) is not going to know how big is 100%. So you need to set the width and height for all the parent and grandparent containers including the body and html tag!

Well, so that is the solution in overcoming the BUG! And yes, it’s a bug because if you just removed the doctype, everything renders fine.

Written by Jake

May 2nd, 2009 at 5:18 am

Posted in Programming,Web

Tagged with , ,

Entering Web 2.0 world

leave a comment

So much for recommending web2.0 technologies to all my clients but not having the chance to seriously look into building my business around it.

By chance, I just did an in depth review on the latest applications that the web 2.0 community has been developing and realized how much it has evolve since its coming not many years ago. I must say I am totally amazed at the rate things are developing and the ever increasing ways implemented to keep people networked together to create a uniform marketplace.

The result is a whole new paradigm shift in the marketing perspective. Everything we do now is highly customer oriented and marketing needs to be focused on answering the wants of these feature-hungering people. Businesses can no longer hide negative comments from the community, instead, must learn to embrace them gracefully and work towards appeasing the users.

Gaining and an internet presence is much more easier today, the real challenge is whether or not businesses can stand up to the scrutiny of the vast community, not forgetting that it is also a breeding ground for competition.

Written by Jake

April 29th, 2009 at 9:09 am

Posted in Philosophy,Web

Tagged with