SCHAPPY — 29. January 2006, 21:31

On vacation…

What would you expect, when reading a article with the given title? Yeah, you are right, summer, sun, long walks on the beach and so on. However, this produces for ME work. Because people are important, really important, thus they want to let know each of its people in the daily mail correspondence that they are on vacations. That’s the only reason, why Microsoft invented Exchange server on vacation messages. But, that also means, that you have to support such senseless messages if you are driving a postfix.
I’ve decided to use the vacation script which is part of the postfix admin tool.
Be prepared, that this script is not parameterized, i.e. the whole database structure is static, thus you’ve to change it a bit for your individual preferences.

Furthermore, you have to check your (I’ve used version from 2004/11/09) for some minor fixes.
Replace the first lines of your method do_mail in the with the following. It solves a problem with names in the recipient address which has prevented sendmail from sending correct mail answers. Sometimes Names are encapsulated withing angle brackets, which will be misinterprated by sendmail as a linebreak in the inputstream.

my ($from, $from_ext, $to, $subject, $body) = @_;
open (MAIL, "| $sendmail -t -f $from") or die ("Unable to open sendmail");
print MAIL "From: $from_ext\n";

The only corresponding do_mail call has to be extended by the parameter “email” as follows

do_mail ($email, $orig_to, $orig_from, $row[0], $row[1]);

To integrate the script into postfix, add the following line to your

vacation unix - n n - - pipe
flags=Rhu user=vacation argv=/var/spool/vacation/

It offers an additional transport mechanism with the name vacation, which will repeat with a corresponding answer.

For some more tips read Postfix, Courier, MySQL, Vacation mini-HOWTO.

No Comments »

RSS feed for comments on this post.

Bisher noch keine Kommentare.

Kommentare verfassen

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>