{"id":353,"date":"2006-03-14T16:59:26","date_gmt":"2006-03-14T15:59:26","guid":{"rendered":"http:\/\/wp.devco.net\/?p=353"},"modified":"2009-10-09T16:53:10","modified_gmt":"2009-10-09T15:53:10","slug":"exim_vacation_messages","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2006\/03\/14\/exim_vacation_messages.php","title":{"rendered":"Exim Vacation Messages"},"content":{"rendered":"

I hate vacation messages but business people tend to want them. They’re easy to do by the user on Exchange but it’s a bit harder on pure IMAP\/POP based services since it’s not all integrated into one with the mail client.<\/p>\n

Exim<\/a> can do vacation messages using its Autoreply Transport<\/a>. It supports all the usual stuff like only notifying a specific sender once every couple of days etc.<\/p>\n

To get this going requires two bits of config, first you need a router. Routers in the exim configuration is processed top-down as they appear in the config file, so you’ll want to put the vacation handling above any localuser handling, virtual hosting etc.<\/p>\n

A sample router is shown below, it’s for local users and they just have to put a .vacation file in their home directory to activate the functionality, the .vacation file should contain the text they want mailed. You can easily adapt the location of this to be in your virtual mail hierarchy by changing the file locations below:<\/p>\n

\n
\nuservacation:\ndriver = accept\ndomains = +local_domains\nrequire_files = $home\/.vacation\n# do not reply to errors or lists\ncondition =  ${if or { \\\n{match {$h_precedence:} {(?i)junk|bulk|list}} \\\n{eq {$sender_address} {}} \\\n} {no} {yes}}\n# do not reply to errors or bounces or lists\nsenders = ! ^.*-request@.*:\\\n! ^bounce-.*@.*:\\\n! ^.*-bounce@.*:\\\n! ^owner-.*@.*:\\\n! ^postmaster@.*:\\\n! ^webmaster@.*:\\\n! ^listmaster@.*:\\\n! ^mailer-daemon@.*:\\\n! ^root@.*\nno_expn\ntransport = uservacation_transport\nunseen\nno_verify\n<\/pre>\n<\/blockquote>\n

You’ll notice that it does not autoreply to certain people, the kind of from addresses that mailing lists typically use, it will also ignore bounce messages.<\/p>\n

Once you have the router configured you’ll need a transport, this will call the autoreply transport and do the hard work. It will use a Berkley style database in ~\/.vacation.db to store the list of people it has contacted in the last 14 days. Users can just delete this file if they want to reset it all.<\/p>\n

\n
\nuservacation_transport:\ndriver = autoreply\nfile = $home\/.vacation\nfile_expand\nonce = $home\/.vacation.db\n# to use a flat file instead of a db specify once_file_size\n#once_file_size = 2K\nonce_repeat = 14d\nfrom = $local_part@$domain\nto = $sender_address\nsubject = \"Re: $h_subject\"\n<\/pre>\n<\/blockquote>\n

That should do it, in a virtual domain setup you could easily integrate this into a web interface that maintains the text files required, there are other features like a standard prefix before each vacation message etc, refer to the Exim Documentation<\/a> for details on these.<\/p>\n","protected":false},"excerpt":{"rendered":"

I hate vacation messages but business people tend to want them. They’re easy to do by the user on Exchange but it’s a bit harder on pure IMAP\/POP based services since it’s not all integrated into one with the mail client. Exim can do vacation messages using its Autoreply Transport. It supports all the usual […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[30,19,33],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/353"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":1,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/353\/revisions\/613"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}