GithubHelp home page GithubHelp logo

Wrong subject field folding about mail HOT 26 CLOSED

IvanUkhov avatar IvanUkhov commented on July 16, 2024
Wrong subject field folding

from mail.

Comments (26)

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Does anyone have the same problem?

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

It looks like it is an abandoned gem, but it definitely is not. So why there is no any feed back from the auther? ((

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

I use this http://gist.github.com/310222 as workaround, suppose the algorithm of field folding is broken.

from mail.

mikel avatar mikel commented on July 16, 2024

Hi Ivan,

No the gem is not abandoned. You are getting no feed back because I also have a job, and I work to earn a living and I give you mail for free, which took me hundreds of hours of my time to develop.

If you would like instant service to your problem, you are more than welcome to hire me for the time to fix it and I will handle it instantly, or alternatively write a passing spec and patch and send it in, and I'll apply it, or, just donate to the project via the pledgie link.

Having said all that, yes, this is broken, I'll be pushing a patch today.

Mikel

from mail.

mikel avatar mikel commented on July 16, 2024

Ivan, please post how you made the email that ended up having this subject?

And did you use the latest version of Mail?

Mikel

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

First of all, I want to apologize. Sorry if I hurt your feelings, didn't mean to. I understand that you have a job, and I do appreciate what your are doing for free. Thank you!
About Mail, when I wrote this issue, I used 2.1.2. Today I mentioned 2.1.3, installed it - the same error. I use Rails3 and the devise gem for authentication, account confirmation, password restoring, etc

from mail.

mikel avatar mikel commented on July 16, 2024

No problem.
Question though, how are you making the email? Is the devise gem doing it for you?

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Yes, it is. And here is how http://github.com/plataformatec/devise/blob/v1.1.pre2/app/models/devise/mailer.rb (I'm using v1.1.pre2).

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Here is what I see in the console http://gist.github.com/310958, decoded subject should be "Восстановление Вашего пароля" (Russian).

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

And this works fine http://gist.github.com/310968 ... Dont understand what is wrong with Rails3 + Devise

from mail.

mikel avatar mikel commented on July 16, 2024

ok, it is ActionMailer not auto encoding... it's because I didn't remove this from ActionMailer during the rewrite for Mail.

I'll see if I can attack ActionMailer over the weekend and fix this.

Mikel

from mail.

yzhang avatar yzhang commented on July 16, 2024

Hi, mikel, I encountered this problem too, and I just submitted a patch to remove quote_fields from ActionMailer base: https://rails.lighthouseapp.com/projects/8994/tickets/4294-patch-remove-quote_fields-from-actionmailer

from mail.

mikel avatar mikel commented on July 16, 2024

Yes, thanks. Except that won't work until mail is fixed (which it almost is).

Unfortunately I had already written the patches for ActionMailer in my fork... but thanks for the attempt :)

Mikel

from mail.

mikel avatar mikel commented on July 16, 2024

OK please try again with Mail 2.2.0, I have now release the auto encoding updates for header fields and this should resolve these issues, please let me know if it doesn't.

from mail.

yzhang avatar yzhang commented on July 16, 2024

I got error:

Conflict on: "mail":
* mail (2.2.0) activated by mail (= 2.2.0, runtime)
* mail (~> 2.1.2, runtime) required by rails (= 3.0.0.beta, runtime)
All possible versions of origin requirements conflict.

do you know how to resolve the conflict?

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

About encoding, I still have the same issue with subject field... Rails 2.3.5, Ruby 1.9.2 (head)

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Here what I'm doing. So TMail is not compatible with Ruby 1.9, therefore I'm trying to use Mail instead. I've wrote a simple class and inherit my mailers from it instead of ActionMailer::Base. Here is the code of the class http://gist.github.com/363416. Usage example:

class Notifier < Mailer

  FROM = '[email protected]'

  def new_feedback_message feedback_message
    users = User.all
    time = Time.now

    recipients    users.map(&:email)
    from          FROM
    subject       I18n.t('notifier.new_feedback_message.subject', :date => I18n.l(time.to_date))
    body          :feedback_message => feedback_message, :time => time
  end

end

I hope, it will help to figure out the problem.

PS I18n.t('notifier.new_feedback_message.subject', ...) in Russian

Ivan.

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

And here is my new workaround =)

module Mail
  class SubjectField
    def encode value
      Encodings.b_value_encode value, 'utf-8'
    end
  end
end

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Ohh, spaces between some(!) words have disappeared ((( wtf...

from mail.

mikel avatar mikel commented on July 16, 2024

OK, there should not be spaces missing at all.

Can you send me a failing test case?

Thanks

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Will this script be enough or I should write some test case? http://gist.github.com/363531

from mail.

mikel avatar mikel commented on July 16, 2024

Failing specs get fixed faster :)

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

To write a test, I should know corrent folded and encoded subject field contents... but I dont have even the slightest idea about it...((

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Ohhh... Any news? I've got stuck with porting my application, because of mailing...

from mail.

IvanUkhov avatar IvanUkhov commented on July 16, 2024

Thanks! 2.2.1 fixed the problem =)

from mail.

mikel avatar mikel commented on July 16, 2024

Great :)

from mail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.