Bugs item #2818228, was opened at 2009-07-07 21:18
Message generated for change (Comment added) made by gingerdog
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2818228&group_id=191583
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Vacation
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stevan Bajic (sbajic)
Assigned to: Nobody/Anonymous (nobody)
Summary: Virtual Vacation and alias lookups don't work as expected
Initial Comment:
The current implementation in Virtual Vacation is from my viewpoint not taking full advantage of Postfix.Admin. Assuming the following scenario:
domain: bajic.ch
mailbox user: st...@ba...
aliases for mailbox user: @bajic.ch -> st...@ba..., st...@ba... -> st...@ba...
Now if I go and enable Virtual Vacation in Postfix.Admin a sender sending a mail to wha...@ba... will not get a vacation message. In the log I would see something like that (Postfix log):
-----
Jul 7 20:54:06 theia /var/spool/vacation/vacation.pl: DEBUG - Script argument SMTP recipient is : 'stevan#baj...@au...' and smtp_sender : 're...@do...'
Jul 7 20:54:06 theia /var/spool/vacation/vacation.pl: DEBUG - Converted autoreply mailbox back to normal style - from stevan#baj...@au... to st...@ba...
Jul 7 20:54:06 theia /var/spool/vacation/vacation.pl: DEBUG - Email headers have to: 'wha...@ba...' and From: '"Just some user" <re...@do...>'
Jul 7 20:54:06 theia /var/spool/vacation/vacation.pl: DEBUG - smtp envelope recipient st...@ba... not found in the header recipients (wha...@ba... & ) (therefore they were bcc'ed, so won't send vacation message)
Jul 7 20:54:06 theia postfix/pipe[15257]: ADF79823C02: to=<stevan#baj...@au...>, orig_to=<st...@ba...>, relay=vacation, delay=0.57, delays=0.13/0/0/0.43, dsn=2.0.0, status=sent (delivered via vacation service
-----
That debug message is wrong. One reason why it is wrong:
BCC: If wha...@ba... would be a BCC recipient then wha...@ba... would automatically be moved to the TO header field on MY server. When I get the message I don't have a BCC header field. The SENDER however should see on his copy (in the send folder) that he BCC'ed me. But I should not see it. So the error message is wrong.
The second issue is that it is true that stevan#baj...@au... (autoreply.vunet.local is my vacation domain) does not match wha...@ba... (stevan#baj...@au... => st...@ba... != wha...@ba...) in the headers. BUT how useful is Virtual Vacation if I have to enter for each and every alias I have in Postfix.Admin a new vacation? Beside that I can NOT add it (since I only can login with my real destination address (st...@ba...)) I find it unpractical do add multiple vacation messages for each and every alias.
Virtual Vacation should from my viewpoint try harder to resolve an alias. All the information is there and just a bunch of additional lookups are needed to really resolve wha...@ba... to st...@ba... and then see that st...@ba... has a vacation active.
On my older Postfix.Admin setup I have extended Virtual Vacation to offer more functionality the the original edition. For my new Postfix.Admin 2.3 installation I am probably not going again to add those features to Postfix.Admin but I need the alias lookup to work right. So I went and checked out the latest SVN today and changed Virtual Vacation to do proper alias lookups. All the things I mentioned above to not work have been fixed in the included Virtual Vacation Perl script. Additionally I did the following things as well:
* fixed a bug/typo in the new Mail::Sender call (it's "$sender->SendLineEnc($body);" and not "$sender->SentLineEnc($body);". See the senD instead of senT?)
* added lookups for "Alias Domains"
* optimized alias lookup SQL clause
* added code to deal with the case that a user can have:
- mail address: "us...@do..."
- alias/goto: "us...@do..., us...@gm..." or "us...@do..., us...@do..., us...@do..."
=> Virtual Vacation should (the attached one does) send a vacation message if some one would address us...@do... and us...@do... has vacation active
* added some more mail headers to be checked (headers produced by common used Anti-Virus and Anti-Spam tools)
* changed some comments (especially the one above strip_address)
* removed the code responsible for the above (2nd paragraph) mentioned error condition (see the Postfix log above)
* CC needs to be stripped as well else a CC recipient "1,2,3" <12...@do...> would wrongly be expanded/split to:
* "1
* 2
* 3" <12...@do...>
* Changed strip_address() to return RFC 821 style emails to be all in lowercase
* Fixed all dash in a regexp to be escaped
* Extended regexp in strip_address to match more valid characters:
* Added some characters (except the # since it is used for the Virtual Vacation alias) mentioned in RFCs to the regexp
=> There are still cases not captured by the new regexp. Capturing them would be possible but I don't know how well Email::Valid would validate them?
I have not spend time to look inside Email::Valid to see if it validates emails the right way. If some one has time then try to validate the following emails with Email::Valid:
"me\@home"@domain.com
"me@home"@domain.com
you(firstname).there(lastname)@domain(secondlevel).com(topelevel) -> (everything in parentheses are comments. So the real recipient here would be "you...@do...". I know it's wicked but an absolutely valid email address (according to the RFCs))
"me\"myself"@domain.com
"me\\myelf"@domain.com
me.myself@[12.34.56.78]
me.myself@[IPv6:::12.34.56.78]
me+...@do...
me/hom...@do...
!me!home%th...@do...
"John \"Doe\" Junior"@domain.com
me*ho...@do...
+3~3+...@do...
{_iamcool_}@domain.com
etc... I am probably pulling hairs here with the above examples. Probably most users will never use the possibilities offered by the RFCs? Anyway... I just wanted to include the most obvious characters for the local part when stripping email addresses in Virtual Vacation. If it is really needed then I happy to extend the regexp/code to include more valid emails. But one needs first to check if Email::Valid is able to validate them.
Kind Regards
Stevan Bajic
----------------------------------------------------------------------
>Comment By: GingerDog (gingerdog)
Date: 2009-07-10 21:14
Message:
Hi,
changes merged; testing feedback welcome... I'm not using the vacation.pl
script in production so don't really get to test it.
David
----------------------------------------------------------------------
Comment By: Stevan Bajic (sbajic)
Date: 2009-07-10 12:44
Message:
Hello gingerdog
Anything else you want me to include into Virtual Vacation?
Kind Regards from Switzerland
Stevan Bajic
----------------------------------------------------------------------
Comment By: GingerDog (gingerdog)
Date: 2009-07-09 19:59
Message:
"Hi,
Patch much appreciated; will merge when I get time... hopefully before the
end of the weekend.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2818228&group_id=191583
|