Re: Looping through the gmail dot trick

2008-01-21 Thread Martin Marcher
Steven D'Aprano wrote:
> Postfix, I think, interpets "foo+bar" the same as "foo".

yup it does, but "foo" has to be a valid localpart so

"foo+bar" -> foo
foo+baz -> foo
f+oobar -> f - which is a different user (aliases set aside)

famous call on plus addressing, and you it's just a default you can specify
anything you want but it has to be _after_ the full localpart without
address extensions.

-- 
http://noneisyours.marcher.name
http://feeds.feedburner.com/NoneIsYours

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


[OT] Valid Mail addresses modifications (WAS: Re: Looping through the gmail dot trick)

2008-01-21 Thread Martin Marcher
Martin Vilcans wrote:

> Try the SMTP spec. IIRC there's a passage there that says that the
> server should try to make sense of addresses that don't map directly
> to a user name. Specifically, it says that firstname.lastname should
> be mapped to the user with those first and last names.

Short story long:

there aren't any!

FYI:

https://mail.google.com/support/bin/answer.py?answer=10313&topic=1564

that was the only reference i found, http://www.ietf.org/rfc/rfc0821.txt
doesn't mention anything beside EXPN which still treats the localpart
literally and checks for a mailbox (or alias) as literally found in the
localpart.

Personally I think google's doing wrong here. Just don't do it anywhere
else, as it's unlikely your mail will reach the person you intended to send
it.

-- 
http://noneisyours.marcher.name
http://feeds.feedburner.com/NoneIsYours

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looping through the gmail dot trick

2008-01-20 Thread Martin Vilcans
On Jan 20, 2008 8:58 PM, Martin Marcher <[EMAIL PROTECTED]> wrote:
> are you saying that when i have 2 gmail addresses
>
> "[EMAIL PROTECTED]" and
> "[EMAIL PROTECTED]"
>
> they are actually treated the same? That is plain wrong and would break a
> lot of mail addresses as I have 2 that follow just this pattern and they
> are delivered correctly!
>
> Do you have any reference on that where one could read up why gmail would
> have such a behaviour?

Try the SMTP spec. IIRC there's a passage there that says that the
server should try to make sense of addresses that don't map directly
to a user name. Specifically, it says that firstname.lastname should
be mapped to the user with those first and last names.

-- 
[EMAIL PROTECTED]
http://www.librador.com
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Looping through the gmail dot trick

2008-01-20 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote:

> Postfix, I think, interpets "foo+bar" the same as "foo".

Gmail does the same. It's quite useful - apart from using it to
determine which site I signed up to has sent me mail, I also use it so I
can have multiple Guild Wars accounts using the same email account e.g.

[EMAIL PROTECTED]
[EMAIL PROTECTED]

All resolve to @gmail.com. I have a couple of spare accounts so when
friends or relative visit we can all play together ...

Tim Delaney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looping through the gmail dot trick

2008-01-20 Thread Steven D'Aprano
On Sun, 20 Jan 2008 21:13:03 +, Neil Hodgson wrote:

> Martin Marcher:
> 
>> are you saying that when i have 2 gmail addresses
>> 
>> "[EMAIL PROTECTED]" and
>> "[EMAIL PROTECTED]"
>> 
>> they are actually treated the same? That is plain wrong and would break
>> a lot of mail addresses as I have 2 that follow just this pattern and
>> they are delivered correctly!
> 
> This is a feature of some mail services such as Gmail, not of email
> addresses generically. One use is to provide a set of addresses given
> one base address. '+' works as well as '.' so when I sign up to service
> monty I give them the address [EMAIL PROTECTED] Then when I
> receive spam at nyamatongwe+monty, I know who to blame and what to
> block.

Technically, everything in the local part of the address (the bit before 
the @ sign) is supposed to be interpreted *only* by the host given in the 
domain (the bit after the @ sign). So if Gmail wants to interpret 
"[EMAIL PROTECTED]" and "[EMAIL PROTECTED]" the same, they can.

Or for that matter, "[EMAIL PROTECTED]". Although that would be silly.

Postfix, I think, interpets "foo+bar" the same as "foo".


-- 
Steven


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looping through the gmail dot trick

2008-01-20 Thread Neil Hodgson
Martin Marcher:

> are you saying that when i have 2 gmail addresses
> 
> "[EMAIL PROTECTED]" and
> "[EMAIL PROTECTED]"
> 
> they are actually treated the same? That is plain wrong and would break a
> lot of mail addresses as I have 2 that follow just this pattern and they
> are delivered correctly!

This is a feature of some mail services such as Gmail, not of email 
addresses generically. One use is to provide a set of addresses given 
one base address. '+' works as well as '.' so when I sign up to service 
monty I give them the address [EMAIL PROTECTED] Then when I 
receive spam at nyamatongwe+monty, I know who to blame and what to block.

Neil
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looping through the gmail dot trick

2008-01-20 Thread Gabriel Genellina
En Sun, 20 Jan 2008 14:38:06 -0200, Joshua Gilman <[EMAIL PROTECTED]>  
escribi�:

> My task is this: Loop through an email and create as many combinations of
> periods as possible. So all the combinations for blah would be:
>
> b.lah
> bl.ah
> bla.h
> b.l.ah
> b.la.h
> bl.a.h

I'd use a recursive generator (the divide-and-conquer approach):

def genalldots(txt):
   if len(txt)<=1:
 yield txt
   else:
 head, tail = txt[0], txt[1:]
 for item in genalldots(tail):
 yield head+item
 yield head+'.'+item

print sorted(genalldots('blah'))

(I got your six spellings above, plus 'blah' and 'b.l.a.h')

> I'm still rather new to python so this is turning out to be rather  
> tricky.
> My current code is as follows:
>
> for d in range(1, len(email)):
>> for i in range(1, len(email)):
>> y = i
>> temail = email
>> for x in range(d):
>> if email[y] == '.': break
>> temail = temail.replace(email[y], '.' + email[y])
>> if not y > len(email) - 2: y += 1
>> print temail

The replace function is dangerous, in case a letter appears more than  
once, you are replacing all instances. Anyway, since you *know* you want  
to replace the y-th item, just do:
temail = temail[:y] + '.' + temail[y:]

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Looping through the gmail dot trick

2008-01-20 Thread Martin Marcher
On Sunday 20 January 2008 17:38 Joshua Gilman wrote:

> So I have a very interesting task ahead of me and it is to loop through an
> email using the 'gmail dot trick'. Essentially this trick puts periods
> throughout your email to make it look different. Even though it has
> periods gmail will replace them all and send it to that email.

are you saying that when i have 2 gmail addresses

"[EMAIL PROTECTED]" and
"[EMAIL PROTECTED]"

they are actually treated the same? That is plain wrong and would break a
lot of mail addresses as I have 2 that follow just this pattern and they
are delivered correctly!

Do you have any reference on that where one could read up why gmail would
have such a behaviour?

> So [EMAIL PROTECTED] is the same as [EMAIL PROTECTED]

To my best knowledge it is not the same and must not be the same. The
localpart of an email is entirely up to the receiving mailserver and cannot
be tempered with without risking misdelivery (at least). If I'm wrong I'd
be gladly corrected, just point me to the references.

/martin


-- 
http://noneisyours.marcher.name
http://feeds.feedburner.com/NoneIsYours

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


Looping through the gmail dot trick

2008-01-20 Thread Joshua Gilman
So I have a very interesting task ahead of me and it is to loop through an
email using the 'gmail dot trick'. Essentially this trick puts periods
throughout your email to make it look different. Even though it has periods
gmail will replace them all and send it to that email.

So [EMAIL PROTECTED] is the same as [EMAIL PROTECTED]

My task is this: Loop through an email and create as many combinations of
periods as possible. So all the combinations for blah would be:

b.lah
bl.ah
bla.h
b.l.ah
b.la.h
bl.a.h

I'm still rather new to python so this is turning out to be rather tricky.
My current code is as follows:

for d in range(1, len(email)):
> for i in range(1, len(email)):
> y = i
> temail = email
> for x in range(d):
> if email[y] == '.': break
> temail = temail.replace(email[y], '.' + email[y])
> if not y > len(email) - 2: y += 1
> print temail
>

It's not looking too bad except for some reason it's making emails like
bl..ah which is invalid. So can anyone help me out with getting this to
work? Thanks.

Cheers,
Josh
-- 
http://mail.python.org/mailman/listinfo/python-list