Firstly thanks for the great work on http://www.linuxmail.info, its been a real life saver when i was setting up a mail server from scratch.
I now have a functioning mail server but i am having problems with the vacation.pl, i have also tried using usermin as well as autoresponder but for some reason they all do not seem to work.
My mail server has no virtual users, they are all local.
The Postfix vacation autoresponder is really my toughest article. There is no perfect solution available out of the box. To make it work, I had to customize almost every component related to it. Anyway, I've now completely overhauled the Postfix Autoresponder article, please try it again.
I´m also having some trouble to set up my vacation/auto-reply feature on my webmail. I´ve tried lots of different solutions and still not achieving success.
My environment is set: postfix + dovecot + squirreloutlook (it´s a "fork" of squirrelmail) +Win2k3 AD authentication.
That means I have only virtual users in the AD and one local user vmail. The users´ homes are in /home/vmail/USER and the permissions to everything is set to owner vmail:vmail and access permission is 700.
The architecture is somewhat complex, since I got kerberos configured, Samba/Winbind, dovecot-ldap.cf
I´ve tried the Postifx Autoresponder article, but no success…
My postfix 2.3 (provided by RedHat) gives this error: "fatal: unsupported dictionary type: mysql"
RHEL 5.4 doesn't have the package postfix-mysql… Now what? I don't want to recompile postfix to work with mysql, because of the support contract.
I thought about instead of using a mysql database, I could use something that postfix can work with, like a hashed text database, then I would have to change the vacation.pl script to work with that.
Is there any other option? I thought about LDAP, but I don't know if thats a good idea, since I used to use ldap for authenticating and for mailbox lookups and I had problems. And since I alrealdy have an AD user base, why would I want to have another user base? In the case of using LDAP, what would the configuration file contain?
In that case use LDAP. Active Directory also has an LDAP feature so you so can use your existing user base. Check out the Active Directory/LDAP Postfix Virtual Users article read the comments posted by CJ at the bottom of the page. He used Gnarwl for the vacation script and Active Directory UserMod Assistant for end user updating of the vacation fields.
Now i'm concentrated on autoreply. I decided to recompile postfix on a lab environment to work with mysql.
I followed everything at the article Postfix Vacation Autoresponder and it looks like it is all ok. BUT it doesn't seem to be working… I send the e-mail, I see that mesage in maillog being relayed to the vacation "method" but I get no auto-reply message.
Set test_mode to 1 in the file /home/vacation/vacation.conf, then try sending a mail. Test mode does not check the if the recipient has a vacation message.
Consultant, I was specifying the full email address. I even tried a combination of sender, recipient etc. But it didnt work.
I found out that it wasn't working because something was missing! I read the documentation form postfixadmin's vacation and found out I had to put some more stuff into master.cf:
vacation unix - n n - - pipe flags=Rq user=vacation argv=/home/vacation/vacation.pl -f ${sender} — ${recipient}
And it started to work. BUT, there is a problem. Although it works, it will send the wrong reply!
Say user1@domain sent an email to user2@domain, whom has autoreply activated. user1 willl receive an autoreply from user2 but with the subject and body of user1. So the sender receives an his own autoreply message.
I don't know, but maybe this version of vacation.pl has different parameters etc.
Consultant, there is a problem in vacation.pl for a determined condition.
I use Postfix 2.3 and I already use a virtual_alias_maps in main.cf. So I did as described in the how_to:
If adding the vacation domain conflicts with your existing virtual_alias_maps, use recipient_bcc_maps instead and replace /etc/postfix/mysql-aliases.cf with the lines below.
host = localhost user = postfix password = your_password dbname = postfix table = vacation select_field = email where_field = email additional_conditions = and active = '1' result_format = %u@vacation.invalid
When the above is used, vacation.pl won't work correctly. Exactly here (lines 307 to 312):
As you can see, the split function will only return what we want with the first mysql-aliases.cf. Since I'am using the second (alternate) mysql-aliases.cf, the content of "result_format" (from the vacation table from postfixadmin) will not apply to the split function. Therefore, $delivery_to is formed only with the username, without the domain part.
Right after, since I'm not using Postifx 2.5 with {original_recipient} in master.cf (only {recipient}) my ARGV[1] doesn exist, then $email will be the username without domain, causing the rest of the script not to work correctly.
So what I did actually was update vacation.pl. I added the functionality to work with the alternative mysql_aliases.cf, and the script still works fine in other conditions.
That's it! Vacation with virtual users is working just fine now!