problems with body and subject with Autoresponders to accompany Virtual Users guide

Discussion in 'HOWTO-Related Questions' started by shark_tico, Dec 19, 2006.

  1. shark_tico

    shark_tico New Member

    Hello

    I followed the guide:

    http://www.howtoforge.com/autoresponders_for_virtual_postfix_users

    I have some questions:

    Do the file email_subject.patch must be created in this directory? (I did it here... is this ok?): /usr/local/postfix-tools/yaa-0.3/lib/ ?


    When I enter this command:
    patch -p0 <email-subject.patch (Check the name, in the step before the file name is: email_subject.patch and not: email-subject.patch)

    Then i got the following message:
    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |--- Autoresponse.pm 2004-08-19 20:35:28.000000000 +0200
    |+++ Autoresponse.pm 2005-07-14 13:16:03.000000000 +0200
    --------------------------
    File to patch:


    I don't know what file I have to patch.

    With this problem, the autoresponder worked, but with gmail a got this subject:
    =?us-ascii?Q?subject=

    Where subject is the text I putted at DB.

    With Hotmail the subjects looks fine

    With Hotmail and Gmail at the body I can see:
    ?=
    MIME-Version: 1.0
    Content-Type: text/plain;
    charset="us-ascii"
    Content-Transfer-Encoding: Quoted-Printable

    body

    Where body is the text I putted at DB.

    This mail system is configurate with: http://www.howtoforge.com/virtual_postfix_mysql_quota_courier

    Any ideas?

    Thanks in advance.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please create a new file with:

    vi /usr/local/postfix-tools/yaa-0.3/lib/email_subject.patch

    containing the following lines:

    Code:
    --- Autoresponse.pm     2004-08-19 20:35:28.000000000 +0200
    +++ Autoresponse.pm     2005-07-14 13:16:03.000000000 +0200
    @@ -182,7 +182,11 @@
            push(@headers, "Precedence: bulk");
    
            # Subject
    -       push(@headers, "Subject: =?" . (($self->{charset}) ? $self->{charset} : $self->{default_charset}) . "?Q?" . encode_qp($subject) . "?=");
    +       #
    +       # Fixes the strange subjects that email clients don't understand
    +       # (second argument on encode_qp should be "")
    +       push(@headers, "Subject: =?" . (($self->{charset}) ? $self->{charset} : $self->{default_charset}) . "?Q?" . encode_qp($subject,"") . "?=");
    
    
            push(@headers, "MIME-Version: 1.0"); 
    then proceed with the commands:

    cd /usr/local/postfix-tools/yaa-0.3/lib/
    patch -p0 <email-subject.patch
     
  3. shark_tico

    shark_tico New Member

    thanks but didn't work

    Hello Till

    I did exactly what you post, but when i did:
    sudo patch -p0 <email-subject.patch

    I got:
    -bash: email-subject.patch: No such file or directory

    I did with the name: email_subject.patch but I got:
    sudo patch -p0 <email_subject.patch
    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |--- Autoresponse.pm 2004-08-19 20:35:28.000000000 +0200
    |+++ Autoresponse.pm 2005-07-14 13:16:03.000000000 +0200
    --------------------------
    File to patch:

    I created the file with copy and paste using vim.

    Thanks for your help
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Are you sure you created the file /usr/local/postfix-tools/yaa-0.3/lib/email_subject.patch?

    What's the output of
    Code:
    updatedb
    locate email_subject.patch
    ?
     
  5. shark_tico

    shark_tico New Member

    in answer to

    Hello Falko

    At: /usr/local/postfix-tools/yaa-0.3/lib
    I made "ls" and I got:
    email_subject.patch email_subject.patch~ Yaa Yaa.pm

    (Please look files names: The how-to said:
    "patch -p0 <email-subject.patch" but before we made the file with this name:
    email_subject.patch *with underscore between email and subject*)

    The output of locate email_subject.patch is:
    /usr/local/postfix-tools/yaa-0.3/lib/email_subject.patch


    Thanks for your help!
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Then the correct command is
    Code:
    patch -p0 <email[B][COLOR="Red"]_[/COLOR][/B]subject.patch
     
  7. Slicer

    Slicer New Member

    What file are we patching?

    I am having issues understanding this as well. While the new command works, I still do not understand what information needs to be provided when I try to run the script.

    Here is the output.

    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |--- Autoresponse.pm 2004-08-19 20:35:28.000000000 +0200
    |+++ Autoresponse.pm 2005-07-14 13:16:03.000000000 +0200
    --------------------------
    File to patch:

    Thanks!!

    Slicer
     
    Last edited: Dec 24, 2006
  8. falko

    falko Super Moderator ISPConfig Developer

    Did you run this from the correct directory?

    What's the output of
    Code:
    updatedb
    locate Autoresponse.pm
    ?
     
  9. todgerme

    todgerme Member

    Sorry guys about the "-" and the "_" mixup in the guide! Hopefully you're all now sorted with working autoresponders!

    Merry Christmas, now for some tv and a large satisfying but ultimately glutonous dinner :)
     
  10. shark_tico

    shark_tico New Member

    same problem that Slicer

    Hello falko

    Thanks for your help

    When I made:
    sudo patch -p0 <email_subject.patch
    I got:


    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |--- Autoresponse.pm 2004-08-19 20:35:28.000000000 +0200
    |+++ Autoresponse.pm 2005-07-14 13:16:03.000000000 +0200
    --------------------------
    File to patch:

    I made:
    updatedb
    locate Autoresponse.pm

    And I got:
    /usr/local/postfix-tools/yaa-0.3/lib/Yaa/Autoresponse.pm

    And I was excecuting the patch at:
    /usr/local/postfix-tools/yaa-0.3/lib/

    I executed the patch at:
    /usr/local/postfix-tools/yaa-0.3/lib/Yaa/

    But now I got:
    patching file Autoresponse.pm
    patch unexpectedly ends in middle of line
    patch: **** malformed patch at line 13:

    My File is:

    --- Autoresponse.pm 2004-08-19 20:35:28.000000000 +0200
    +++ Autoresponse.pm 2005-07-14 13:16:03.000000000 +0200
    @@ -182,7 +182,11 @@
    push(@headers, "Precedence: bulk");

    # Subject
    - push(@headers, "Subject: =?" . (($self->{charset}) ? $self->{charset} : $self->{default_charset}) . "?Q?" . encode_qp($subject) . "?=");
    + #
    + # Fixes the strange subjects that email clients don't understand
    + # (second argument on encode_qp should be "")
    + push(@headers, "Subject: =?" . (($self->{charset}) ? $self->{charset} : $self->{default_charset}) . "?Q?" . encode_qp($subject,"") . "?=");


    push(@headers, "MIME-Version: 1.0");

    Thanks.
     
  11. falko

    falko Super Moderator ISPConfig Developer

    I think you should start over with Yaa. Maybe your previous problems with the patch are causing the current problems...
     
  12. shark_tico

    shark_tico New Member

    other problem

    Hello

    I stared over Yaa, but when I did:

    /usr/local/postfix-tools/yaa-0.3/lib/Yaa$ sudo patch -p0 <email_subject.patch
    I got:
    ---------------------------------------------------
    patching file Autoresponse.pm
    patch unexpectedly ends in middle of line
    patch: **** malformed patch at line 13:

    ----------------------------------------------------

    Thanks for help
     
  13. falko

    falko Super Moderator ISPConfig Developer

    Maybe your Yaa version does not match the patch or something like that. :confused:
     
  14. shark_tico

    shark_tico New Member

    Resolved

    Hello

    I found this archive:
    http://www.howtoforge.com/forums/archive/index.php/t-9542.html

    I made the change manually at the file:
    /usr/local/postfix-tools/yaa-0.3/lib/Yaa/Autoresponse.pm

    I changed:
    push(@headers, "Subject: =?" . (($self->{charset}) ? $self->{charset} : $self->{default_charset}) . "?Q?" . encode_qp($subject) . "?=");

    For this:
    push(@headers, "Subject: =?" . (($self->{charset}) ? $self->{charset} : $self->{default_charset}) . "?Q?" . encode_qp($subject,"") . "?="); (that's all the patch does).

    And now all is OK!!

    Thanks for all the help!
     
  15. Isterklister

    Isterklister New Member

    Thank you! - Ordinary users?

    I had the same problem with patch and now it is working.

    I have another question about this topic - how can the ordinary users change there autorespond message? Have you done some admn page for them?

    _____________
    Pelle Hanses
     
    Last edited: Apr 1, 2007
  16. Isterklister

    Isterklister New Member

    Port 81 - ...

    Thanks for very fast reply till!

    I have messed something up - I can't connect to port 81. Everything else are working correct. Do you have a clou where I can start locking?
    I have installed my system after "Virtual Users And Domains With Postfix, Courier And MySQL (Ubuntu 6.10 Edgy Eft)". It's maybe because that I do not have anything answering to port 81?
     
    Last edited: Apr 4, 2007
  17. falko

    falko Super Moderator ISPConfig Developer

    Did you install ISPConfig? ISPConfig is incompatible with the virtual user Postfix setup.
     
  18. Isterklister

    Isterklister New Member

    No, I did not install (I have tested but I have started over without it when I discovered I can not login whit my users in SQL DB).

    (I ment "port 81" not "port 80" in my last reply).

    till wrote as answer
    "They can change them trough the mailuser login:

    http://www.yourdomain.com:81/mailuser/ "

    How should I config apache to answer on port 81 and let the users log in whitout ISPConfig?
     
  19. falko

    falko Super Moderator ISPConfig Developer

    This doesn't work without ISPConfig.

    So you cannot connect to port 80, right? What's the output of
    Code:
    netstat -tap
    ?
     
  20. Isterklister

    Isterklister New Member

    Excuse me - I ment I can not connect to port 81. Port 80 works fine.:eek:

    Output from netstat -tap
    _______________________________________________________
    mail04:/usr/local/postfix-tools# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 localhost.localdo:10024 *:* LISTEN 1937/amavisd (maste
    tcp 0 0 localhost.localdo:10025 *:* LISTEN 2618/master
    tcp 0 0 *:778 *:* LISTEN 2292/rpc.statd
    tcp 0 0 localhost.localdo:mysql *:* LISTEN 2125/mysqld
    tcp 0 0 *:sunrpc *:* LISTEN 1590/portmap
    tcp 0 0 *:www *:* LISTEN 2305/apache
    tcp 0 0 *:auth *:* LISTEN 2069/inetd
    tcp 0 0 *:smtp *:* LISTEN 2618/master

    _______________________________________________________

    The only thing that I now have problem with are how can my users change the autoreply message and turn it on/off?

    Do I have to make my own script in php or something to let the users to change this? My php-skill are not the best but I probably can manage it. My question are how to login and how to only give users permission on there own post in the " autoresponder"-table. But I will probably solve that sometime...
     
    Last edited: Apr 6, 2007

Share This Page