[SOLVED] message-id customstr

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
japanitrat
Forum Newbie
Posts: 12
Joined: Sat May 12, 2007 10:34 pm

[SOLVED] message-id customstr

Post by japanitrat »

hello again!

i wonder, why Swift_Message::generateId ($idstring) does only allow characters and numbers?
even dots are not allowed, while swift is gerenating dots itself.

i wanna ask, if it is rfc-compliant to add "_-" to the regexp ?

(i need this, to differentiate two variables in the message-id)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

No underscores would be permitted but hyphens and dots are. It's dot-atomic which basically means this:

[a-zA-Z0-9\.-]

I'll ammend the pattern to:

/^(?<!\.)[A-Za-z0-9\.-]+(?!\.)$/

Your parameter will simply appear as the last dot-atomic part of the string before the @ sign.

Cheers,

d11
japanitrat
Forum Newbie
Posts: 12
Joined: Sat May 12, 2007 10:34 pm

Post by japanitrat »

okay, so using dots to distinguish to or more variables in the individual message-id-string makes no sense, since swift is using them by itself and i dont wanna search by the dot no. x.

this is why i will search for the last dot in the local-part and then explode by the hyphen.

i nearly used underscores, thanks for the hint!
Post Reply