<html><head><title>Re: [linux] Postfix + mysql+dovecot a autoreply</title>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
</head>
<body>
<span style=" font-family:'Courier New'; font-size: 9pt;">Ano, problem je v tom ze v db mas adresu v normalnom formate </span><a style=" font-family:'Courier New'; font-size: 9pt;" href="mailto:martin@YYY.eu">martin@YYY.eu</a><span style=" font-family:'Courier New'; font-size: 9pt;"> ale YAA dostane request na </span><a style=" font-family:'courier new'; font-size: 9pt;" href="mailto:martin@autoreply.yyy.eu">martin@autoreply.yyy.eu</a><span style=" font-family:'courier new'; font-size: 9pt;"> a nevie co s tym.<br>
Ja som ten subor mal default v instalacii, je tam aj presne example pre tvoj pripad.<br>
'recipient_pcre' treba vlozit medzi $lookup_maps a potom ho nastavit pre rewrite_recipient.<br>
<br>
Obsahom suboru /usr/local/yaa/conf/recipient.pcre je (zmen si to na svoju domenu):<br>
<br>
# This is sample map file for PCRE lookup map driver<br>
# PCRE driver can use and parse any postfix pcre tables<br>
# AS LONG PATTERN, FLAGS and RESULT ARE IN THE SAME LINE.<br>
#<br>
# if /pattern/flags, endif macros ARE NOT SUPPORTED<br>
<br>
# sample:<br>
# rewrite recipient *@autoreply.domain.tld to *@domain.tld<br>
# (handy for 'rewrite_recipient' autoresponse attribute)<br>
<br>
#/^([\w\-\.]+)@autoreply\.domain\.tld/i                 $1@domain.tld<br>
<br>
<br>
Friday, November 8, 2013, 12:01:44, Martin Plch wrote:<br>
<br>
<a name="_MailEndCompose"></a>
</span><table>
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'calibri'; font-size: 11pt; color: #1f497d;">Ahoj,<br>
V konfigu mam toto zmenene oproti original:<br>
 <br>
# run as daemon?<br>
# type: boolean<br>
# default: 0, do not run as daemon<br>
# this setting enables daemon mode operation.<br>
$daemon = 0;<br>
 <br>
 <br>
$lookup_maps = {<br>
'my_sql_map' => {<br>
                'driver' => 'SQL',<br>
                'sql_dsn' => 'dbi:mysql:database=mailserver;host=127.0.0.1',<br>
                'sql_username' => "user",<br>
                'sql_password' => "passwd",<br>
                'sql_select' => "select active,message,subject,charset,forward,address,local_domains from autoresponder where address = %m and active='1'",<br>
                },<br>
<u>};<br>
</u>$lookup_map_query_order = {<br>
active => [ 'my_sql_map:active'<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                subject => ['my_sql_map:subject'<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                message => ['my_sql_map:message'<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                charset => ['my_sql_map:charset'<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                forward => ['my_sql_map:forward'<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                rewrite_sender => [<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                rewrite_recipient => [<br>
                               # 'map_name:result', 'map_name2:result'<br>
                ],<br>
                'local_domains' => ['my_sql_map:local_domains'<br>
                               # 'map_name:result', 'map_name2:result'...<br>
                ],<br>
};<br>
 <br>
<span style=" font-family:'courier new'; font-size: 9pt; color: #000000;">'file'   => '/usr/local/yaa/conf/recipient.pcre' <span style=" font-family:'calibri'; font-size: 11pt; color: #1f497d;">,takyto subor nemam co je vo vnutri?<br>
 <br>
Asi mi to preto nefunguje lebo to neprepise.<br>
 <br>
V databaze mam<br>
Tabulku autoresponder:<br>
Polozky:<br>
active    message                             subject charset forward                               address                               local_domains                  tstart                                tfinish<br>
obsah:<br>
1             Message Body                  Message Subject                                           martin@YYY.eu                YYY.eu                                 0                                0<br>
 <br>
Tabulku transport:<br>
Polozky:<br>
domain                transport<br>
obsah:<br>
autoreply.YYY.eu            yaa<br>
 <br>
 <br>
Martin <br>
 <br>
<span style=" font-family:'tahoma'; font-size: 10pt; color: #000000;"><b>From:</b> linux [mailto:linux-bounces@lists.linux.sk] <b>On Behalf Of </b>Marek Podmaka<br>
<b>Sent:</b> Friday, November 08, 2013 11:22 AM<br>
<b>To:</b> Vseobecna diskusia o Linuxe<br>
<b>Subject:</b> Re: [linux] Postfix + mysql+dovecot a autoreply<br>
<span style=" font-family:'times new roman'; font-size: 12pt;"> <br>
<span style=" font-family:'courier new'; font-size: 9pt;">Cau,<br>
<br>
Ja pouzivam YAA uz niekolko rokov. Podla tych logov to vyzera ze<br>
postfix je nastaveny OK. Len zrejme v YAA musis nastavit<br>
rewrite_recipient, aby vedel pre koho ma autoodpovedac hladat.<br>
<br>
Odkial tahas info o tom ze autoodpovedac je zapnuty a aky ma byt obsah<br>
odpovede? Ja to mam v MySQL podla prijemcu, cize musim z<br>
</span></span></span></span></span></span><a style=" font-family:'courier new'; font-size: 9pt;" href="mailto:abc@autoreply.domena.sk">abc@autoreply.domena.sk</a><span style=" font-family:'courier new'; font-size: 9pt;"> to v YAA prepisat na </span><a style=" font-family:'courier new'; font-size: 9pt;" href="mailto:abc@domena.sk">abc@domena.sk</a><span style=" font-family:'courier new'; font-size: 9pt;">, aby to<br>
vedel v db najst. Pokial mas v db priamo </span><a style=" font-family:'courier new'; font-size: 9pt;" href="mailto:martin@autoreply.yyy.eu">martin@autoreply.yyy.eu</a><span style=" font-family:'courier new'; font-size: 9pt;">, tak<br>
by to mal vediet najst priamo.<br>
A nastav si $daemon_tcpserver_loglevel aspon na notice (2), vtedy by mal pisat<br>
aj info tom ci nasiel v db zaznam pre daneho cloveka a ci mu posiela odpoved.<br>
<br>
To prepisovanie prijemcu sa robi cez:<br>
rewrite_recipient => [ 'recipient_pcre:result' ],<br>
<br>
'recipient_pcre' => {<br>
    'driver' => 'PCRE',<br>
    'file'   => '/usr/local/yaa/conf/recipient.pcre',<br>
    'replacement_num' => 2<br>
},<br>
<br>
<br>
Friday, November 8, 2013, 8:16:41, Martin Plch wrote:<br>
</span><table>
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'calibri'; font-size: 11pt;">Ahojte,<br>
Mam Debian a na nom rozbehany postfix + mysql +dovecot +amavis+ spamassasin v style vmail teraz sa tam snazim rozchodit automaticku odpoved pouzil som na to YAA-0.3.1. podla navodu<br>
 <br>
</span><a style=" font-family:'calibri'; font-size: 11pt;" href="http://www.howtoforge.com/autoresponders_for_virtual_postfix_users">http://www.howtoforge.com/autoresponders_for_virtual_postfix_users</a><br>
<span style=" font-family:'calibri'; font-size: 11pt;"> <br>
aj po “odladeny” configu na moj server a odstraneny vsetkych chyb podla logov  sa mi to nepodarilo rozchodit do zdarneho konca aj ked v logoch uz nie je ziadny error a vsetko sa tvari ze prebehne. <br>
YAA script prebehne ale neodosle spat spravu.<br>
 <br>
Nov  8 08:02:20 server postfix/smtpd[20128]: disconnect from localhost[127.0.0.1]<br>
Nov  8 08:02:20 server postfix/qmgr[11057]: E40904C098: from=<</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin.plch@xxx.sk">martin.plch@xxx.sk</a><span style=" font-family:'calibri'; font-size: 11pt;">>, size=3879, nrcpt=2 (queue active)<br>
Nov  8 08:02:20 server amavis[17317]: (17317-19) Passed CLEAN, [123.456.137.194] [123.456.137.194] <</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin.plch@xxx.sk">martin.plch@xxx.sk</a><span style=" font-family:'calibri'; font-size: 11pt;">> -> <</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin@yyy.eu">martin@yyy.eu</a><span style=" font-family:'calibri'; font-size: 11pt;">>, Message-ID: <</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:01c301cedc50$719297d0$54b7c770$@xxx.sk">01c301cedc50$719297d0$54b7c770$@xxx.sk</a><span style=" font-family:'calibri'; font-size: 11pt;">>, mail_id: Nr1eYgtcrVlm, Hits: -1.471, size: 3239, queued_as: E40904C098, 4942 ms<br>
Nov  8 08:02:20 server postfix/smtp[20077]: 071CE4C097: to=<</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin@yyy.eu">martin@yyy.eu</a><span style=" font-family:'calibri'; font-size: 11pt;">>, relay=127.0.0.1[127.0.0.1]:10024, delay=5, delays=0.05/0/0/4.9, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=17317-19, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as E40904C098)<br>
Nov  8 08:02:20 server postfix/qmgr[11057]: 071CE4C097: removed<br>
Nov  8 08:02:20 server postfix/pipe[20130]: E40904C098: to=<</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin@yyy.eu">martin@yyy.eu</a><span style=" font-family:'calibri'; font-size: 11pt;">>, relay=dovecot, delay=0.15, delays=0.08/0/0/0.07, dsn=2.0.0, status=sent (delivered via dovecot service)<br>
Nov  8 08:02:20 server yaa.pl[20166]: Warning: setting empty lookup query order for attribute 'rewrite_recipient'.<br>
Nov  8 08:02:20 server yaa.pl[20166]: Warning: setting empty lookup query order for attribute 'rewrite_sender'.<br>
Nov  8 08:02:20 server yaa.pl[20166]: 2419904: Processing new request, id 2419904<br>
Nov  8 08:02:20 server yaa.pl[20166]: 2419904: Message sender: </span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin.plch@xxx.sk">martin.plch@xxx.sk</a><span style=" font-family:'calibri'; font-size: 11pt;">, recipients: </span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin@autoreply.yyy.eu">martin@autoreply.yyy.eu</a><br>
<span style=" font-family:'calibri'; font-size: 11pt;">Nov  8 08:02:20 server yaa.pl[20166]: 2419904: Processing complete.<br>
Nov  8 08:02:20 server postfix/pipe[20131]: E40904C098: to=<</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin@autoreply.yyy.eu">martin@autoreply.yyy.eu</a><span style=" font-family:'calibri'; font-size: 11pt;">>, orig_to=<</span><a style=" font-family:'calibri'; font-size: 11pt;" href="mailto:martin@yyy.eu">martin@yyy.eu</a><span style=" font-family:'calibri'; font-size: 11pt;">>, relay=yaa, delay=0.21, delays=0.08/0/0/0.13, dsn=2.0.0, status=sent (delivered via yaa service)<br>
Nov  8 08:02:20 server postfix/qmgr[11057]: E40904C098: removed<br>
 <br>
 <br>
 <br>
Prosim vas pouziva niekto YAA script ako autoreply? <br>
 <br>
Pripadne ma prosim nasmerujte k nejakemu skriptu ktory mate vyskusany.<br>
 <br>
Schema podla ktorej sa to snazim rozbehat: <br>
</span><a style=" font-family:'calibri'; font-size: 11pt;" href="http://unwin.org/postfix/vda-autoresponder.html">http://unwin.org/postfix/vda-autoresponder.html</a><br>
<span style=" font-family:'calibri'; font-size: 11pt;"> <br>
S pozdravom<br>
 <br>
Martin Plch</td>
</tr>
</table>
<br><br>
<br>
<br>
<br>
<span style=" font-family:'arial'; font-size: 12pt; color: #c0c0c0;"><i>-- <br>
  bYE, Marki</td>
</tr>
</table>
<br><br>
<br>
<br>
<span style=" font-family:'arial'; color: #c0c0c0;"><i>-- <br>
  bYE, Marki</body></html>