Menu

#15 from address not being handled correctly in some cases

open
None
7
2014-01-21
2012-04-23
Brian Gold
No

I am currently running RHEL6 using 1.2.7.1 compiled locally. For the most part, using vacation is working very well. Every once in a while though, I get a bounceback due to vacation sending a response to an incorrect address. This appears to happen when a header contains a From or Reply-To formatted as follows.

From: Testy McGee <username@testdomain.com>
Reply-To: Testy McGee <username@testdomain.com>
To: bgold@simons-rock.edu

I then get a bounce like the following:
This is the mail system at host mail.simons-rock.edu.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<"Testy McGee"@simons-rock.edu> (expanded from <"Testy McGee">): unknown
user: "testy mcgee"

Any idea what might cause this behavior?

Discussion

  • Chris Samuel

    Chris Samuel - 2012-05-09
    • priority: 5 --> 7
    • assigned_to: nobody --> chrissamuel
     
  • Chris Samuel

    Chris Samuel - 2012-05-09

    Sounds like a possible bug to me, I'll investigate. Moving this to the bug tracker instead of support requests.

     
  • Chris Samuel

    Chris Samuel - 2012-05-09

    I've been trying to reproduce this with no luck I'm afraid, I've tested the address parsing code with those examples and it always pulls out the right thing. It's really odd.

    Using strace on my test laptop (no MTA installed) I see:

    [pid 1400] execve("/usr/sbin/sendmail", ["sendmail", "-f", "chris", "-F", "Chris Samuel", "--", "username@testdomain.com"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)

    So that's all fine.

    You could try doing a "make debug", that will create a /tmp/vacation.log (you can change that by modifying the file name in printd() in vacation.c) which records what it has pulled out thus:

    Wed May 9 21:49:41 2012 next message
    Wed May 9 21:49:41 2012 From: >username@testdomain.com<
    Wed May 9 21:49:41 2012 From: now: >username@testdomain.com<
    Wed May 9 21:49:41 2012 Reply-To: >username@testdomain.com<
    Wed May 9 21:49:41 2012 From: username@testdomain.com Reply-To: username@testdomain.com

    Wed May 9 21:49:41 2012 sendmessage: using realname >Chris Samuel<

    How's that ?

     
  • Chris Samuel

    Chris Samuel - 2012-05-09

    CAVEAT: The printd() code is part of the code I inherited and is not enabled by default, a cursory scan seems to show it's not particularly safe from a security point of view (it blindly opens /tmp/vacation.log for appending).

    I'd suggest that before you try a debug build of vacation you do (as root):

    touch /tmp/vacation.log
    chmod 666 /tmp/vacation.log

    Horrible I know, but at least then any attacker won't be able to do a symlink redirection attack on a non-existant file..

     
  • Jacek Kalinski

    Jacek Kalinski - 2012-09-11

    Hi Chris,

    I'm not sure if this bug is already fixed, but I know where is a problem with vacation 1.2.7.0.
    2 cases:
    1. if a source email contains a header:
    From: "Clare Kemp, Citrix"
    <uk@citrixonline.com>
    (yes, 2 lines)
    than I got:
    ==========
    The mail system

    <"Clare Kemp, Citrix"@mydomain.pl> (expanded from <"Clare Kemp, Citrix">):
    unknown user: "clare kemp, citrix"

    ==========

    I'm not sure it is RFC compliant, but I can see it quite often. I think because 1 address is in 2 lines.

    2. second case - if source email have a header:
    From: =?UTF-8?B?Q2VudHJ1bSBEcnVrdSAtIFphbcOzd2llbmlh?=
    <zamowienia@x.pl>
    (yes, 2 lines)
    than I got an error:
    ==========
    The mail system

    <=?UTF-8?B?Q2VudHJ1bSBEcnVrdSAtIFphbcOzd2llbmlh?=@mydomain.pl> (expanded from
    <=?UTF-8?B?Q2VudHJ1bSBEcnVrdSAtIFphbcOzd2llbmlh?=>): unknown user:
    "=?utf-8?b?q2vudhj1bsbecnvrdsatifphbcozd2llbmlh?="

    ==========

    I think it is the same as case 1, but please check it.

     
  • Jacek Kalinski

    Jacek Kalinski - 2013-01-07

    Ok, I have already fixed this. Can I attach here a patch (or send via email)?

     
  • Chris Samuel

    Chris Samuel - 2013-07-28

    Hi Jacek, sorry for the delay, but please do feel welcome to attach a patch!

     
  • Chris Samuel

    Chris Samuel - 2014-01-21

    I believe that wrapped headers should now be treated correctly in 1.2.8.0 beta 1, please test and let me know!

     

Log in to post a comment.