M
Marco Mastrodonato
Sometimes i need to specify a name to show it when email is received.
Into "from" field i use this format:
addresser <[email protected]>
To do this i have to update smtp.rb file:
#C:\ruby\ruby-187p330\lib\ruby\1.8\net\smtp.rb
def mailfrom(from_addr)
if $SAFE > 0
raise SecurityError, 'tainted from_addr' if from_addr.tainted?
end
#getok("MAIL FROM:<#{from_addr}>") #before
str = from_addr.to_s =~ /<.+>/ ? from_addr.to_s.match(/<.+>/).to_s
: "<#{from_addr}>" #marcomd
getok("MAIL FROM:#{str}") #marcomd
end
Into "from" field i use this format:
addresser <[email protected]>
To do this i have to update smtp.rb file:
#C:\ruby\ruby-187p330\lib\ruby\1.8\net\smtp.rb
def mailfrom(from_addr)
if $SAFE > 0
raise SecurityError, 'tainted from_addr' if from_addr.tainted?
end
#getok("MAIL FROM:<#{from_addr}>") #before
str = from_addr.to_s =~ /<.+>/ ? from_addr.to_s.match(/<.+>/).to_s
: "<#{from_addr}>" #marcomd
getok("MAIL FROM:#{str}") #marcomd
end