Autoresponder configuration with Postfix (virtual users, virtual domains and driven by mysql DB) OS: Debian Sarge 3.1 (testing) 1. Get and unpack yaa (Yet Another Autoresponder) wget http://frost.ath.cx/software/yaa/dist/yaa-0.3.tar.bz2 (most current version in that moment) tar jxvf yaa-0.3.tar.bz2 2. Make real system user for yaa useradd yaa -s /bin/false -d /dev/null chown -R yaa:root yaa-0.3 3. Put files in right places cd yaa-0.3 cp bin/yaa /usr/sbin cp conf/yaa.conf.sample /etc mv /etc/yaa.conf.sample /etc/yaa.conf cp lib/* /usr/lib/perl5/ 4. Prepare postfix to handle new transport Postfix will use yaa to handle some specific emails adressed to user@reply.your_domain.tld and yaa will generate reply email to sender. reply.your_domain.tld is a fake! DONT add new virtual domain in your mysql domains table! If you did not used transports yet: touch /etc/postfix/transport echo "transport_maps = hash:/etc/postfix/transport" >> /etc/postfix/main.cf .. echo "reply.your_domain.tld yaa" > /etc/postfix/transport postmap /etc/postfix/transport add proper pipe interface to handle yaa edit your /etc/postfix/master.cf and add yaa unix - n n - - pipe user=yaa argv=/usr/sbin/yaa.pl --config-file=/etc/yaa.conf 5. Yaa config file Edit and read.. Most of default values will do for you but pay attention to mysql map if want to use mysql to store your reply emails. I'm using sendmail as a sending method 'coz it's nice and simple. I've also hardtyped some string in $lookup_map_query_order like charset and local_domains - all else (unused things) could be commented out. Now for $lookup_map_query_order in /etc/yaa.conf: active => ['my_sql_map:active'], message => ['my_sql_map:body'], charset => ['your_charset'], 'local_domains' => ['your_domain.tld'], And for $lookup_maps 'my_sql_map' => { 'driver' => 'SQL', 'sql_dsn' => 'dbi:mysql:database=db;host=host', 'sql_username' => "user", 'sql_password' => "pass", 'sql_select' => "select active,body from yaa where email = %m and active = 1", }, You can use some better sql queries but this one do fine :) 6. Yaa table in yor favourite DB CREATE TABLE `yaa` ( `id` int(11) NOT NULL auto_increment, `body` text NOT NULL, `active` tinyint(4) NOT NULL default '0', `email` varchar(100) NOT NULL default '' PRIMARY KEY (`id`) ) TYPE=MyISAM; id - no comment body - reply email body active - is that reply on|off email - recipients email 7. Get this all stuff to work postfix reload Now your MTA is ready and waiting.. 8. Adding new autoreply to some alias You probobly are using alias mapping for your email accounts (if not.. change it! :) Alias to some user looks like: alias_user@your_domain.tld real_account@your_domain.tld You have to change it to: alias_user@your_domain.tld real_account@your_domain.tld, alias_user@reply.your_domain.tld and insert proper row in yaa table: insert into yaa (active, body, email) values (1, 'Hello, it is YAA test reply', 'alias_user@your_domain.tld'); 9. Testing If you are using syslog and mail facility you can do: tail -f /var/log/mail.log | grep yaa Now send some email to alias_user@your_domain.tld and you should see something like this: May 31 20:01:23 serv yaa.pl[31959]: 4235543: Processing new request, id 4235543 May 31 20:01:23 serv yaa.pl[31959]: 4235543: Message sender: you@domain.tld, recipients: alias_user@your_domain.tld May 31 20:01:23 serv yaa.pl[31959]: 4235543: Recipient alias_user@your_domain.tld has autoresponder turned on. May 31 20:01:26 serv yaa.pl[31959]: 4235543: Successfuly sent autoresponse from alias_user@your_domain.tld to you@domain.tld. May 31 20:01:26 serv yaa.pl[31959]: 4235543: Processing complete. May 31 20:01:26 serv postfix/pipe[30420]: E9996E4324: to=, relay=yaa, delay=8, status=sent (reply.your_domain.tld) 10. Useful links http://unwin.org/postfix/ http://postfix.org >>>>>>> cml at xiaoka.com / (_a/\/\e|_ <<<<<<<