masqmail

changeset 0:08114f7dcc23 0.2.21

this is masqmail-0.2.21 from oliver kurth
author meillo@marmaro.de
date Fri, 26 Sep 2008 17:05:23 +0200
parents
children af25f5c39d90
files AUTHORS COPYING ChangeLog INSTALL INSTALL.agenda INSTALL.ipaq Makefile.am Makefile.in NEWS README TODO acconfig.h aclocal.m4 agenda-config.site config.guess config.h.in config.sub configure configure.ac debian/Makefile.am debian/Makefile.in debian/README.Debian debian/README.online debian/TODO debian/changelog debian/control debian/copyright debian/dirs debian/docs debian/mailq.8 debian/mailrm.8 debian/masqmail.config debian/masqmail.init debian/masqmail.ip-up debian/masqmail.links debian/masqmail.lintian debian/masqmail.logrotate debian/masqmail.templates debian/newaliases debian/newaliases.8 debian/postinst debian/postrm debian/preinst debian/rules debian/sendmail.8 depcomp docs/Makefile.am docs/Makefile.in docs/README docs/man/Makefile.am docs/man/Makefile.in docs/man/masqmail.8 docs/man/masqmail.aliases.5 docs/man/masqmail.conf.5 docs/man/masqmail.get.5 docs/man/masqmail.route.5 docs/man/mservdetect.8 docs/xml/Makefile.am docs/xml/Makefile.in docs/xml/masqmail.8.xml docs/xml/masqmail.aliases.5.xml docs/xml/masqmail.conf.5.xml docs/xml/masqmail.get.5.xml docs/xml/masqmail.route.5.xml docs/xml/mservdetect.8.xml examples/example.get examples/example.route examples/masqmail.conf install-sh missing mkinstalldirs redhat/masqmail redhat/masqmail.spec redhat/masqmail.spec.in src/Makefile.am src/Makefile.in src/accept.c src/address.c src/alias.c src/base64/Makefile.am src/base64/Makefile.in src/base64/base64.c src/base64/base64.h src/base64/base64dec.c src/base64/base64enc.c src/child.c src/conf.c src/connect.c src/deliver.c src/dotlock.c src/dotlock.h src/expand.c src/fail_msg.c src/get.c src/header.c src/interface.c src/libident/INSTALL src/libident/Makefile.am src/libident/Makefile.in src/libident/README src/libident/README_MASQMAIL src/libident/id_close.c src/libident/id_open.c src/libident/id_parse.c src/libident/id_query.c src/libident/ident.c src/libident/ident.h src/libident/support.c src/libident/version.c src/listen.c src/local.c src/log.c src/lookup.c src/lookup.h src/masqmail.c src/masqmail.h src/md5/Makefile.am src/md5/Makefile.in src/md5/global.h src/md5/hmac_md5.c src/md5/hmac_md5.h src/md5/hmactest.c src/md5/md5.h src/md5/md5c.c src/message.c src/mservdetect.c src/mserver.c src/mserver.h src/online.c src/parse.c src/peopen.c src/peopen.h src/permissions.c src/pop3_in.c src/pop3_in.h src/queue.c src/readsock.c src/readsock.h src/readtest.c src/rewrite.c src/route.c src/smtp_in.c src/smtp_out.c src/smtp_out.h src/smtpsend.c src/spool.c src/tables.c src/timeival.c suse/masqmail suse/masqmail.spec suse/masqmail.spec.in tests/Makefile.am tests/Makefile.in tests/README tests/conf.templ tests/test.templ tpl/failmsg.tpl tpl/failmsg.tpl.de tpl/failmsg.tpl.fr tpl/failmsg.tpl.it tpl/warnmsg.tpl tpl/warnmsg.tpl.de tpl/warnmsg.tpl.fr
diffstat 163 files changed, 38071 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/AUTHORS	Fri Sep 26 17:05:23 2008 +0200
     1.3 @@ -0,0 +1,2 @@
     1.4 +Project Maintainer and ~99% of coding done by:
     1.5 +Oliver Kurth <oku@masqmail.cx>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/COPYING	Fri Sep 26 17:05:23 2008 +0200
     2.3 @@ -0,0 +1,340 @@
     2.4 +		    GNU GENERAL PUBLIC LICENSE
     2.5 +		       Version 2, June 1991
     2.6 +
     2.7 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     2.8 +     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     2.9 + Everyone is permitted to copy and distribute verbatim copies
    2.10 + of this license document, but changing it is not allowed.
    2.11 +
    2.12 +			    Preamble
    2.13 +
    2.14 +  The licenses for most software are designed to take away your
    2.15 +freedom to share and change it.  By contrast, the GNU General Public
    2.16 +License is intended to guarantee your freedom to share and change free
    2.17 +software--to make sure the software is free for all its users.  This
    2.18 +General Public License applies to most of the Free Software
    2.19 +Foundation's software and to any other program whose authors commit to
    2.20 +using it.  (Some other Free Software Foundation software is covered by
    2.21 +the GNU Library General Public License instead.)  You can apply it to
    2.22 +your programs, too.
    2.23 +
    2.24 +  When we speak of free software, we are referring to freedom, not
    2.25 +price.  Our General Public Licenses are designed to make sure that you
    2.26 +have the freedom to distribute copies of free software (and charge for
    2.27 +this service if you wish), that you receive source code or can get it
    2.28 +if you want it, that you can change the software or use pieces of it
    2.29 +in new free programs; and that you know you can do these things.
    2.30 +
    2.31 +  To protect your rights, we need to make restrictions that forbid
    2.32 +anyone to deny you these rights or to ask you to surrender the rights.
    2.33 +These restrictions translate to certain responsibilities for you if you
    2.34 +distribute copies of the software, or if you modify it.
    2.35 +
    2.36 +  For example, if you distribute copies of such a program, whether
    2.37 +gratis or for a fee, you must give the recipients all the rights that
    2.38 +you have.  You must make sure that they, too, receive or can get the
    2.39 +source code.  And you must show them these terms so they know their
    2.40 +rights.
    2.41 +
    2.42 +  We protect your rights with two steps: (1) copyright the software, and
    2.43 +(2) offer you this license which gives you legal permission to copy,
    2.44 +distribute and/or modify the software.
    2.45 +
    2.46 +  Also, for each author's protection and ours, we want to make certain
    2.47 +that everyone understands that there is no warranty for this free
    2.48 +software.  If the software is modified by someone else and passed on, we
    2.49 +want its recipients to know that what they have is not the original, so
    2.50 +that any problems introduced by others will not reflect on the original
    2.51 +authors' reputations.
    2.52 +
    2.53 +  Finally, any free program is threatened constantly by software
    2.54 +patents.  We wish to avoid the danger that redistributors of a free
    2.55 +program will individually obtain patent licenses, in effect making the
    2.56 +program proprietary.  To prevent this, we have made it clear that any
    2.57 +patent must be licensed for everyone's free use or not licensed at all.
    2.58 +
    2.59 +  The precise terms and conditions for copying, distribution and
    2.60 +modification follow.
    2.61 +
    2.62 +		    GNU GENERAL PUBLIC LICENSE
    2.63 +   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    2.64 +
    2.65 +  0. This License applies to any program or other work which contains
    2.66 +a notice placed by the copyright holder saying it may be distributed
    2.67 +under the terms of this General Public License.  The "Program", below,
    2.68 +refers to any such program or work, and a "work based on the Program"
    2.69 +means either the Program or any derivative work under copyright law:
    2.70 +that is to say, a work containing the Program or a portion of it,
    2.71 +either verbatim or with modifications and/or translated into another
    2.72 +language.  (Hereinafter, translation is included without limitation in
    2.73 +the term "modification".)  Each licensee is addressed as "you".
    2.74 +
    2.75 +Activities other than copying, distribution and modification are not
    2.76 +covered by this License; they are outside its scope.  The act of
    2.77 +running the Program is not restricted, and the output from the Program
    2.78 +is covered only if its contents constitute a work based on the
    2.79 +Program (independent of having been made by running the Program).
    2.80 +Whether that is true depends on what the Program does.
    2.81 +
    2.82 +  1. You may copy and distribute verbatim copies of the Program's
    2.83 +source code as you receive it, in any medium, provided that you
    2.84 +conspicuously and appropriately publish on each copy an appropriate
    2.85 +copyright notice and disclaimer of warranty; keep intact all the
    2.86 +notices that refer to this License and to the absence of any warranty;
    2.87 +and give any other recipients of the Program a copy of this License
    2.88 +along with the Program.
    2.89 +
    2.90 +You may charge a fee for the physical act of transferring a copy, and
    2.91 +you may at your option offer warranty protection in exchange for a fee.
    2.92 +
    2.93 +  2. You may modify your copy or copies of the Program or any portion
    2.94 +of it, thus forming a work based on the Program, and copy and
    2.95 +distribute such modifications or work under the terms of Section 1
    2.96 +above, provided that you also meet all of these conditions:
    2.97 +
    2.98 +    a) You must cause the modified files to carry prominent notices
    2.99 +    stating that you changed the files and the date of any change.
   2.100 +
   2.101 +    b) You must cause any work that you distribute or publish, that in
   2.102 +    whole or in part contains or is derived from the Program or any
   2.103 +    part thereof, to be licensed as a whole at no charge to all third
   2.104 +    parties under the terms of this License.
   2.105 +
   2.106 +    c) If the modified program normally reads commands interactively
   2.107 +    when run, you must cause it, when started running for such
   2.108 +    interactive use in the most ordinary way, to print or display an
   2.109 +    announcement including an appropriate copyright notice and a
   2.110 +    notice that there is no warranty (or else, saying that you provide
   2.111 +    a warranty) and that users may redistribute the program under
   2.112 +    these conditions, and telling the user how to view a copy of this
   2.113 +    License.  (Exception: if the Program itself is interactive but
   2.114 +    does not normally print such an announcement, your work based on
   2.115 +    the Program is not required to print an announcement.)
   2.116 +
   2.117 +These requirements apply to the modified work as a whole.  If
   2.118 +identifiable sections of that work are not derived from the Program,
   2.119 +and can be reasonably considered independent and separate works in
   2.120 +themselves, then this License, and its terms, do not apply to those
   2.121 +sections when you distribute them as separate works.  But when you
   2.122 +distribute the same sections as part of a whole which is a work based
   2.123 +on the Program, the distribution of the whole must be on the terms of
   2.124 +this License, whose permissions for other licensees extend to the
   2.125 +entire whole, and thus to each and every part regardless of who wrote it.
   2.126 +
   2.127 +Thus, it is not the intent of this section to claim rights or contest
   2.128 +your rights to work written entirely by you; rather, the intent is to
   2.129 +exercise the right to control the distribution of derivative or
   2.130 +collective works based on the Program.
   2.131 +
   2.132 +In addition, mere aggregation of another work not based on the Program
   2.133 +with the Program (or with a work based on the Program) on a volume of
   2.134 +a storage or distribution medium does not bring the other work under
   2.135 +the scope of this License.
   2.136 +
   2.137 +  3. You may copy and distribute the Program (or a work based on it,
   2.138 +under Section 2) in object code or executable form under the terms of
   2.139 +Sections 1 and 2 above provided that you also do one of the following:
   2.140 +
   2.141 +    a) Accompany it with the complete corresponding machine-readable
   2.142 +    source code, which must be distributed under the terms of Sections
   2.143 +    1 and 2 above on a medium customarily used for software interchange; or,
   2.144 +
   2.145 +    b) Accompany it with a written offer, valid for at least three
   2.146 +    years, to give any third party, for a charge no more than your
   2.147 +    cost of physically performing source distribution, a complete
   2.148 +    machine-readable copy of the corresponding source code, to be
   2.149 +    distributed under the terms of Sections 1 and 2 above on a medium
   2.150 +    customarily used for software interchange; or,
   2.151 +
   2.152 +    c) Accompany it with the information you received as to the offer
   2.153 +    to distribute corresponding source code.  (This alternative is
   2.154 +    allowed only for noncommercial distribution and only if you
   2.155 +    received the program in object code or executable form with such
   2.156 +    an offer, in accord with Subsection b above.)
   2.157 +
   2.158 +The source code for a work means the preferred form of the work for
   2.159 +making modifications to it.  For an executable work, complete source
   2.160 +code means all the source code for all modules it contains, plus any
   2.161 +associated interface definition files, plus the scripts used to
   2.162 +control compilation and installation of the executable.  However, as a
   2.163 +special exception, the source code distributed need not include
   2.164 +anything that is normally distributed (in either source or binary
   2.165 +form) with the major components (compiler, kernel, and so on) of the
   2.166 +operating system on which the executable runs, unless that component
   2.167 +itself accompanies the executable.
   2.168 +
   2.169 +If distribution of executable or object code is made by offering
   2.170 +access to copy from a designated place, then offering equivalent
   2.171 +access to copy the source code from the same place counts as
   2.172 +distribution of the source code, even though third parties are not
   2.173 +compelled to copy the source along with the object code.
   2.174 +
   2.175 +  4. You may not copy, modify, sublicense, or distribute the Program
   2.176 +except as expressly provided under this License.  Any attempt
   2.177 +otherwise to copy, modify, sublicense or distribute the Program is
   2.178 +void, and will automatically terminate your rights under this License.
   2.179 +However, parties who have received copies, or rights, from you under
   2.180 +this License will not have their licenses terminated so long as such
   2.181 +parties remain in full compliance.
   2.182 +
   2.183 +  5. You are not required to accept this License, since you have not
   2.184 +signed it.  However, nothing else grants you permission to modify or
   2.185 +distribute the Program or its derivative works.  These actions are
   2.186 +prohibited by law if you do not accept this License.  Therefore, by
   2.187 +modifying or distributing the Program (or any work based on the
   2.188 +Program), you indicate your acceptance of this License to do so, and
   2.189 +all its terms and conditions for copying, distributing or modifying
   2.190 +the Program or works based on it.
   2.191 +
   2.192 +  6. Each time you redistribute the Program (or any work based on the
   2.193 +Program), the recipient automatically receives a license from the
   2.194 +original licensor to copy, distribute or modify the Program subject to
   2.195 +these terms and conditions.  You may not impose any further
   2.196 +restrictions on the recipients' exercise of the rights granted herein.
   2.197 +You are not responsible for enforcing compliance by third parties to
   2.198 +this License.
   2.199 +
   2.200 +  7. If, as a consequence of a court judgment or allegation of patent
   2.201 +infringement or for any other reason (not limited to patent issues),
   2.202 +conditions are imposed on you (whether by court order, agreement or
   2.203 +otherwise) that contradict the conditions of this License, they do not
   2.204 +excuse you from the conditions of this License.  If you cannot
   2.205 +distribute so as to satisfy simultaneously your obligations under this
   2.206 +License and any other pertinent obligations, then as a consequence you
   2.207 +may not distribute the Program at all.  For example, if a patent
   2.208 +license would not permit royalty-free redistribution of the Program by
   2.209 +all those who receive copies directly or indirectly through you, then
   2.210 +the only way you could satisfy both it and this License would be to
   2.211 +refrain entirely from distribution of the Program.
   2.212 +
   2.213 +If any portion of this section is held invalid or unenforceable under
   2.214 +any particular circumstance, the balance of the section is intended to
   2.215 +apply and the section as a whole is intended to apply in other
   2.216 +circumstances.
   2.217 +
   2.218 +It is not the purpose of this section to induce you to infringe any
   2.219 +patents or other property right claims or to contest validity of any
   2.220 +such claims; this section has the sole purpose of protecting the
   2.221 +integrity of the free software distribution system, which is
   2.222 +implemented by public license practices.  Many people have made
   2.223 +generous contributions to the wide range of software distributed
   2.224 +through that system in reliance on consistent application of that
   2.225 +system; it is up to the author/donor to decide if he or she is willing
   2.226 +to distribute software through any other system and a licensee cannot
   2.227 +impose that choice.
   2.228 +
   2.229 +This section is intended to make thoroughly clear what is believed to
   2.230 +be a consequence of the rest of this License.
   2.231 +
   2.232 +  8. If the distribution and/or use of the Program is restricted in
   2.233 +certain countries either by patents or by copyrighted interfaces, the
   2.234 +original copyright holder who places the Program under this License
   2.235 +may add an explicit geographical distribution limitation excluding
   2.236 +those countries, so that distribution is permitted only in or among
   2.237 +countries not thus excluded.  In such case, this License incorporates
   2.238 +the limitation as if written in the body of this License.
   2.239 +
   2.240 +  9. The Free Software Foundation may publish revised and/or new versions
   2.241 +of the General Public License from time to time.  Such new versions will
   2.242 +be similar in spirit to the present version, but may differ in detail to
   2.243 +address new problems or concerns.
   2.244 +
   2.245 +Each version is given a distinguishing version number.  If the Program
   2.246 +specifies a version number of this License which applies to it and "any
   2.247 +later version", you have the option of following the terms and conditions
   2.248 +either of that version or of any later version published by the Free
   2.249 +Software Foundation.  If the Program does not specify a version number of
   2.250 +this License, you may choose any version ever published by the Free Software
   2.251 +Foundation.
   2.252 +
   2.253 +  10. If you wish to incorporate parts of the Program into other free
   2.254 +programs whose distribution conditions are different, write to the author
   2.255 +to ask for permission.  For software which is copyrighted by the Free
   2.256 +Software Foundation, write to the Free Software Foundation; we sometimes
   2.257 +make exceptions for this.  Our decision will be guided by the two goals
   2.258 +of preserving the free status of all derivatives of our free software and
   2.259 +of promoting the sharing and reuse of software generally.
   2.260 +
   2.261 +			    NO WARRANTY
   2.262 +
   2.263 +  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
   2.264 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
   2.265 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
   2.266 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
   2.267 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   2.268 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
   2.269 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
   2.270 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
   2.271 +REPAIR OR CORRECTION.
   2.272 +
   2.273 +  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
   2.274 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
   2.275 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
   2.276 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
   2.277 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
   2.278 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
   2.279 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
   2.280 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
   2.281 +POSSIBILITY OF SUCH DAMAGES.
   2.282 +
   2.283 +		     END OF TERMS AND CONDITIONS
   2.284 +
   2.285 +	    How to Apply These Terms to Your New Programs
   2.286 +
   2.287 +  If you develop a new program, and you want it to be of the greatest
   2.288 +possible use to the public, the best way to achieve this is to make it
   2.289 +free software which everyone can redistribute and change under these terms.
   2.290 +
   2.291 +  To do so, attach the following notices to the program.  It is safest
   2.292 +to attach them to the start of each source file to most effectively
   2.293 +convey the exclusion of warranty; and each file should have at least
   2.294 +the "copyright" line and a pointer to where the full notice is found.
   2.295 +
   2.296 +    <one line to give the program's name and a brief idea of what it does.>
   2.297 +    Copyright (C) <year>  <name of author>
   2.298 +
   2.299 +    This program is free software; you can redistribute it and/or modify
   2.300 +    it under the terms of the GNU General Public License as published by
   2.301 +    the Free Software Foundation; either version 2 of the License, or
   2.302 +    (at your option) any later version.
   2.303 +
   2.304 +    This program is distributed in the hope that it will be useful,
   2.305 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   2.306 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   2.307 +    GNU General Public License for more details.
   2.308 +
   2.309 +    You should have received a copy of the GNU General Public License
   2.310 +    along with this program; if not, write to the Free Software
   2.311 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   2.312 +
   2.313 +
   2.314 +Also add information on how to contact you by electronic and paper mail.
   2.315 +
   2.316 +If the program is interactive, make it output a short notice like this
   2.317 +when it starts in an interactive mode:
   2.318 +
   2.319 +    Gnomovision version 69, Copyright (C) year  name of author
   2.320 +    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
   2.321 +    This is free software, and you are welcome to redistribute it
   2.322 +    under certain conditions; type `show c' for details.
   2.323 +
   2.324 +The hypothetical commands `show w' and `show c' should show the appropriate
   2.325 +parts of the General Public License.  Of course, the commands you use may
   2.326 +be called something other than `show w' and `show c'; they could even be
   2.327 +mouse-clicks or menu items--whatever suits your program.
   2.328 +
   2.329 +You should also get your employer (if you work as a programmer) or your
   2.330 +school, if any, to sign a "copyright disclaimer" for the program, if
   2.331 +necessary.  Here is a sample; alter the names:
   2.332 +
   2.333 +  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
   2.334 +  `Gnomovision' (which makes passes at compilers) written by James Hacker.
   2.335 +
   2.336 +  <signature of Ty Coon>, 1 April 1989
   2.337 +  Ty Coon, President of Vice
   2.338 +
   2.339 +This General Public License does not permit incorporating your program into
   2.340 +proprietary programs.  If your program is a subroutine library, you may
   2.341 +consider it more useful to permit linking proprietary applications with the
   2.342 +library.  If this is what you want to do, use the GNU Library General
   2.343 +Public License instead of this License.
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/ChangeLog	Fri Sep 26 17:05:23 2008 +0200
     3.3 @@ -0,0 +1,440 @@
     3.4 +0.2.20	Mon, 19 May 2003 21:14:06 +0200
     3.5 +	* fixed a segfaulting bug in spool.c caused by folded headers
     3.6 +	* regard connect_error_fail when failing for pipes (Debian Bug #186364)
     3.7 +	* hopefully fixed uid/gid problem in peidopen.c
     3.8 +0.2.19  Wed, 12 Mar 2003 21:33:53 +0100
     3.9 +	* fixed a bug in addr_string (set buffer = NULL if g_free'd buffer)
    3.10 +0.2.18	Fri, 06 Dec 2002 14:57:41 +0100
    3.11 +	* new option connect_error_fail
    3.12 +	* install /var/{log,spool} before subdirs, so
    3.13 +	they get correct ownerships, if installing to a tmp. directory
    3.14 +	Thx to Juergen Daubert.
    3.15 +	* failure notices and warnings also if connection fails
    3.16 +0.2.17  Thu, 28 Nov 2002 14:59:24 +0100
    3.17 +	* fixed errors in man page masqmail.conf.5 about online_detect
    3.18 +	Thx to Juergen Daubert.
    3.19 +	* fixed a segfaulting bug in accept.c on pop retrieval, if there
    3.20 +	is no return_path in the mail and Sender: is empty.
    3.21 +	Thx to Olaf Buddenhagen for debug information.
    3.22 +	* implemented 'last_route' option
    3.23 +	* moved *.tpl to /usr/share/masqmail/tpl (from /etc/masqmail/tpl)
    3.24 +	* french translation of warnmsg.tpl by Rémi Denis-Courmont
    3.25 +	* added delivery warn messages for deferals
    3.26 +	new options: 'warn_intervals', 'warnmsg_file', 'max_defer_time'
    3.27 +	* warn/fail also if remote SMTP server replies with 4xx or 5xx
    3.28 +	just after EHLO/HELO (yes, that was a bug)
    3.29 +	* removed a few -Wall warnings. Thanks to Juergen Daubert.
    3.30 +0.2.16  Tue, 12 Nov 2002 17:27:13 +0100
    3.31 +	* fixed debugging, which has been broken in 0.2.15
    3.32 +0.2.15  Wed, 06 Nov 2002 12:19:55 +0100
    3.33 +	* added french translation of delivery failure message template.
    3.34 +	Thanks to Rémi Denis-Courmont
    3.35 +	* accept -f "" without segfaulting. Thanks to Ralf Friedl.
    3.36 +	* fixed buffer overflows in conf.c. Thanks to Damian M Gryski.
    3.37 +	* read conf file _after_ dropping privileges
    3.38 +0.2.14	Sat, 26 Oct 2002 14:40:49 +0200
    3.39 +	* corrected html version of documentation
    3.40 +	* include masqmail.8 man page (was garbled in 0.2.13)
    3.41 +	* small lintian fixes for Debian
    3.42 +0.2.13	Wed, 23 Oct 2002 20:54:39 +0200
    3.43 +	* fixed a possible buffer overflow (IMHO not exploitable) Thanks to Anonymous.
    3.44 +0.2.12	Wed, 23 Oct 2002 18:57:42 +0200
    3.45 +	* new do_pipelining option (to switch it off if necessary)
    3.46 +	* new helo_name option for route
    3.47 +	* fixed remote_port option (but marked it as deprecated)
    3.48 +	* swapped setegid/seteuid in maildir_out()
    3.49 +	* try again on EAGAIN failure for local delivery via mbox
    3.50 +0.2.11:
    3.51 +	* make it possible for *.route file to have mode 600, owned by root.
    3.52 +	Thx to Juergen Daubert for noticing.
    3.53 +	* do not choke on trailing blanks after comments in conf file. Anonymous
    3.54 +	again.
    3.55 +	* try again on EAGAIN failure for local delivery via mda
    3.56 +	* fixed a potential buffer overflow in conf.c. Thanks to Anonymous
    3.57 +	again.
    3.58 +	* set umask 066 for log files. Thanks to Anonymous.
    3.59 +	* implemented map_h_mail_followup_to_addresses
    3.60 +	* fixed a bug: masqmail -t with empty body caused weird
    3.61 +	errors. Thanks to Anonymous.
    3.62 +	* added do_save_envelope_to option
    3.63 +0.2.10:
    3.64 +	* fixed a small bug in mserver.c (atoi) (Thanks to Gert Ohme)
    3.65 +	* allow ';' in rval also if rval is unqoted
    3.66 +	* write pidfiles to /var/run/masqmail{,-get}.pid
    3.67 +	* now runs on freebsd without leaving zombies
    3.68 +	* use setjmp() in readsock.c for timeouts
    3.69 +0.2.9:
    3.70 +	* attempts to make it compile on freebsd
    3.71 +	- works, but leaves zombies behind (will be done next release, I hope)
    3.72 +	* removed some bashisms from configure.ac
    3.73 +	* fixed segfault when called with -t under some circumstances
    3.74 +	* some fixes about locking when fetching mail (yes, 0 _is_ a valid fd...)
    3.75 +	* some speedups for uidl handling, and do not bloat log files any more
    3.76 +0.2.8:
    3.77 +	* use flock() for locking in retrieving mails (get.c)
    3.78 +	* can use /etc/mailname as host_name (for Debian)
    3.79 +	* added ESMTP LOGIN
    3.80 +	* made uidl handling even more safe
    3.81 +0.2.7:
    3.82 +	* fixed stupid locking bug
    3.83 +	* do not complain about 'unknown mode' when getting mail
    3.84 +	* added italian version of failmsg.tpl (by Paolo)
    3.85 +	* changed MIME boundaries in failmsg.tpl (Paolo)
    3.86 +	* applied patches from Paolo (Gabel - ):
    3.87 +	mostly replacing g_strdup_printf() with g_strdup(), a few ticks ('),
    3.88 +	changed SENDER_LOCAL environment variable and fixed missing '\' in
    3.89 +	debian/masqmail.ip-up
    3.90 +0.2.6:
    3.91 +	* rediscovered previously undocumented allowed_return_paths option for
    3.92 +	routes and made it usable for null sender addresses.
    3.93 +	* added mbox_default, and {mbox,mda,maildir}_users options
    3.94 +	* changes to vsnprintf function use in pop3_in.c and smtp_in.c (by egp)
    3.95 +	* fixes to ip-up/ip-down scripts (by Ben Low)
    3.96 +	* ENABLE_SMTP_SERVER define was incorrectly written as
    3.97 +	ENABLE_MODE_SMTP (by Ben Low)
    3.98 +	* fixed bug in get_header() in src/header.c (by egp)
    3.99 +0.2.5:
   3.100 +	* PowerPC fix for varargs functions
   3.101 +	* relay checking: if do_relay is set to false, do not allow non local
   3.102 +	to non local addresses
   3.103 +	* alias is always caseless for postmaster (disregarding
   3.104 +	alias_local_caseless option)
   3.105 +	* do not rebounce to postmaster
   3.106 +	* implemented Maildir support
   3.107 +	* rearranged append_file in local.c
   3.108 +	* use sysexits.h for correct error reply for failure messages (mda only)
   3.109 +0.2.4:
   3.110 +	* fixed uidl bug: uidl list was not written if a mail was not
   3.111 +	fetched because it was in the list
   3.112 +	* fixed bug in src/conf.c: g_free'd twice in destroy_route()
   3.113 +	* security fix, Debian Bug#102092: 'Privilege escalation in masqmail
   3.114 +	piped alias handling': fixed by using set[ug]id instead of sete[ug]id
   3.115 +	in peopen.c (noted by Colin Phipps)
   3.116 +	* limit count of children in pop3_in.c and wait for them
   3.117 +	* ignore SIGPIPE signal
   3.118 +	* docu updates by Uli Funcke
   3.119 +	* find path to masqmail via --prefix or --exec-prefix option for configure
   3.120 +	* implemented -v (log to stdout) option
   3.121 +0.2.3:
   3.122 +	* local_addresses and not_local_addreses option (patch by Uli Funcke)
   3.123 +	* replaced /usr/sbin/masqmail in fail_msg.c with /usr/sbin/sendmail
   3.124 +	* typo in man pages (noted by Sebastian Inacker)
   3.125 +	* hostnames can now begin with a digit (noted by CatcherInTheRye)
   3.126 +	* chdir to '/' (on some systems getcwd() failes when changing uid)
   3.127 +	* implemented lock_dir option
   3.128 +	* ignore EINVAL after fdatasync
   3.129 +	* configure option to link with libcrypto
   3.130 +	* configure option to disable resolver support
   3.131 +	* configure option to enable mserver support
   3.132 +	* configure option to disable smtp server
   3.133 +	* configure option to link glib statically
   3.134 +	* msg_count option for get configuration
   3.135 +	* bug fix: do not terminate if accept() return
   3.136 +	error (patch by Edouard G. Parmelan)
   3.137 +	* removed some files from package in
   3.138 +	debian (by Edouard G. Parmelan))
   3.139 +	* mailrm alias (by Edouard G. Parmelan)
   3.140 +	* bug fix: removed superfluous g_free from
   3.141 +	dot_unlock() (by Edouard G. Parmelan)
   3.142 +	* write uidl list to temporary file first
   3.143 +	* write uidl list each time a message was retrieved
   3.144 +	(avoid duplicate mails when interupted)
   3.145 +0.2.2:
   3.146 +	* fix of Debian Bug#92894 by Gregor Hoffleit
   3.147 +	(correct error reply for lacking permissions)
   3.148 +	* fixed 'last line missing' bug
   3.149 +	* fixed spool locking bug: lock was deleted
   3.150 +	if unsuccessful (unlocking it)
   3.151 +	* added patch from Uli Funcke for log_user
   3.152 +	(user getting all delivered mail)
   3.153 +	* implemented get daemon
   3.154 +	* create lock file when getting mail
   3.155 +	* use tables for finding route and get lists
   3.156 +0.2.1:
   3.157 +	* expand_h_sender_address now defaults to true (as described in docs)
   3.158 +	* included documentation patch by Marc Herbert (masqmail call in ifup configuration)
   3.159 +	* complain to log if failure message template cannot be opened
   3.160 +	* errmsg_file defaults to /etc/masqmail/tpl/failmsg.tpl
   3.161 +	* corrected error message for insufficient permissions (Debian Bug #92894)
   3.162 +	* get mail depending on connection: -go option and online_get
   3.163 +0.2.0:
   3.164 +	* included the debian/ directory from the debian package.
   3.165 +	* added return_path option for get configuration
   3.166 +	* added max_messages option for get configuration
   3.167 +	* added independent program 'mservdetect', which can be used with
   3.168 +	online_detect=pipe as replacement for online_detect=mserver
   3.169 +	* added online detection method 'pipe'
   3.170 +	* replaced configure option --with-conffile with --with-confdir, default
   3.171 +	is now /etc/masqmail/ (/etc/masqmail/masqmail.conf for the conf file).
   3.172 +	* added do_uidl_dele option (delete messages in uid listing on server)
   3.173 +	* qualify address for get configuration.
   3.174 +	* better checking for valid From: address when retrieving mail via pop3
   3.175 +	and this is used as the return path.
   3.176 +	* port number for mail_host in routes possible
   3.177 +	* introduce delivery failue notices
   3.178 +	* added addr_string() function for easy output of addresses
   3.179 +	* expire spool lock files after a while (currently 300s)
   3.180 +	* started development branch 0.2.x
   3.181 +	
   3.182 +0.1.12:
   3.183 +	* previous fix auf AUTH broke it - reverted it partially and fixed it again
   3.184 +	* bug fix in get.c: retrieval via pop from different server could cause mail to be lost
   3.185 +0.1.11:
   3.186 +	* bug fix in smtp_out.c: of AUTH methods supplied by server, only the first was recognized
   3.187 +0.1.10:
   3.188 +	* added support for IP address as mail_host in routes
   3.189 +	* include <time.h> in masqmail.h to make it compile with glibc 2.2.2
   3.190 +0.1.9:
   3.191 +	* fixed a few typos in man pages
   3.192 +	* ignore -v option
   3.193 +	* added patch from Bernhard Ehlers to program aliases runq, rmail, smtpd and in.smtpd
   3.194 +	* added patch from Edouard G. Parmelan to correct default directories to install
   3.195 +	* implemtented pipe, pipe_fromhack and pipe_fromline options
   3.196 +	for routes (for protocol 'pipe')
   3.197 +	* implememted 'pipe' protocol for routes
   3.198 +	* memset to 0 of configuration structures (it is safer and easier)
   3.199 +	* list of routes for each connection
   3.200 +	* do not be picky about EOF if locally received message is not terminated by a dot
   3.201 +	* speeded up accept.c for large messages (noted by Falko Flessner)
   3.202 +0.1.8:
   3.203 +	* security bug fix (Debian Bug#81079): if local address cannot be
   3.204 +	resolved, masqmail listened on an arbitrary port (fixed by Adel
   3.205 +	Belhouane)
   3.206 +	* bug fix: -d without argument caused segfault (Thanks to Jan Setzer)
   3.207 +	* added more help for configure
   3.208 +	* Iain Lea sent a spec file for Redhat. Thanks!
   3.209 +	* lines can now be indefinetely long for mail acception (well, nearly...)
   3.210 +	* implemented 'wrapper' options for routes and get configurations for ssl and maybe other purposes
   3.211 +	* unified read_sockline() for smtp_out.c, smtp_in.c, pop3_in.c, accept.c and mserver.c
   3.212 +	* escaping of quotes in configuration now possible and now works
   3.213 +	correctly in alias file (Edouard G. Parmelan sent a patch, but I fixed it differently)
   3.214 +	* kill -HUP seems to work now.
   3.215 +	* close all file descriptors >= 3 on start (patch by Edouard G. Parmelan)
   3.216 +	* replaced exit() with _exit where appropriate (children)
   3.217 +	* added pipe_fromhack and pipe_fromline options
   3.218 +	* added mda support and mda_fromhack and mda_fromline options
   3.219 +	* user can delete his own mail if received via smtp from one of ident_trusted_nets
   3.220 +	* bug fix in lookup.c: if the name that an MX points could not be resolved, delete entry
   3.221 +	* added expand_h_sender_address option. expend_h_sender_domain should be obsolete now.
   3.222 +	* unprivileged user can delete his own mail from queue if received locally
   3.223 +	* replaced popen() in local.c with peopen() from snippet from sourceforge. Fixed a bug there.
   3.224 +0.1.7:
   3.225 +	* debug option can be changed for privileged users only
   3.226 +	* fixed a security hole: -C option for unprivileged users now implies
   3.227 +	run_as_user and drops _all_ privileges
   3.228 +	* environment variables for pipe transport
   3.229 +	* wildcards for map_* options
   3.230 +	* rearranged interface handling, IP addresses now possible for
   3.231 +	listen_addresses and mserver_iface
   3.232 +	* beautified masqmail.c
   3.233 +	* revised uid and gid settings in spool.c and local.c (pipe transport)
   3.234 +	* optionally use ident protocol (RFC 1413) and store user id in spool file
   3.235 +	* proper spool file locking
   3.236 +0.1.6:
   3.237 +	* record user id in spool file (though it is not used anywhere)
   3.238 +	* command line option to remove messages from queue (-Mrm)
   3.239 +	* command line option for version information (-bV)
   3.240 +0.1.5:
   3.241 +	* implemented -F option
   3.242 +	* removed bug in accept.c (dot bug, noted by Andre Masloch)
   3.243 +	* location of main conf is now configurable with ./configure
   3.244 +	(suggested by Greger Hoffleit). Default is /etc/masqmail.conf.
   3.245 +	* remote_port defaults to 25 (noted by Andre Masloch)
   3.246 +	* docu fixes: remote_port documented and typo fix (noted by Andre Masloch. Again :-))
   3.247 +	* do not return failure on exit on delivery if mail queue was empty (noted by Andre Masloch)
   3.248 +	* qualify -f address with host_name if unqualified (noted by Andre Masloch)
   3.249 +0.1.4:
   3.250 +	* Jens Askengren discovered a segfaulting bug when parsing headers.
   3.251 +0.1.3:
   3.252 +	* warn if pop/auth options are given, but compiled without support
   3.253 +	* fixed allowed_rcpt_domains option (was broken since 0.1.0, but nobody noticed)
   3.254 +	* exit with 1 if queue run fails for any reason (not for daemon)
   3.255 +	* fail if alias file cannot be read
   3.256 +	* better handling of SMTP SIZE error
   3.257 +	* implemented alias_local_caseless option (suggestion by Andre Masloch)
   3.258 +	* case insensitive domain matching (noted by Andre Masloch)
   3.259 +	* removed nearly all warnings if compiled with -Wall
   3.260 +0.1.2:
   3.261 +	* some changes in configure.in
   3.262 +	* continue if get conf could not be read. Thanks to Edouard G. Parmelan!
   3.263 +	* fixed another bug on pipe addresses in spool.c
   3.264 +	* Andre Masloch found a bug in spool.c which caused a segfault on pipe addresses. Thanks!
   3.265 +0.1.1:
   3.266 +	* Edouard G. Parmelan sent a patch for starting a queue run on start of daemon. Thanks!
   3.267 +	* rpm packages for SuSE
   3.268 +	* regard CFLAGS in Makefile.am
   3.269 +	* implemtented -g <name> option
   3.270 +	* be more verbose in pop3_get.c
   3.271 +	* implemented -f option (set return path)
   3.272 +	* fixed bug: "no debug file, msg was:" in smtp_out.c when debugging was off
   3.273 +	* internal changes of smtp_out_log_failure()
   3.274 +	* removed 'no log file' error
   3.275 +	* complain if host name could not be resolved in connect.c
   3.276 +	* added option resolve_list for route and get configurations
   3.277 +	* removed bug in rcptlist_with_one_of_hostlist(): exited when
   3.278 +	list was empty
   3.279 +0.1.0:
   3.280 +	* included ESMTP AUTH support (as client), CRAM-MD5 only
   3.281 +	* included pop3 client support, with UIDL and APOP, single drop only
   3.282 +	* rearranged routing code:
   3.283 +	  - messages will be deleted from spool earlier, as soon as they are delivered
   3.284 +	  - unified online/offline delivery, making it more simple
   3.285 +	
   3.286 +0.0.13:
   3.287 +        * ignore set_h_{from,reply_to}_domain if map_h_{from,reply_to}_addresses
   3.288 +        is set and warn in logs about misconfiguration.
   3.289 +        * fail if there are no recipients
   3.290 +        * fixed bug: if called with -t, qualify recipient address with host_name
   3.291 +        * fixed bug: if called with -bi, no longer wait for message on stdin
   3.292 +0.0.12:
   3.293 +        * warn if spool file could not be deleted (Thanks to Alberto González
   3.294 +        Palomo)
   3.295 +        * fixed bug: set len for getsockname
   3.296 +        * fixed bug: set local_net_routes to NULL if there is no local net
   3.297 +        (noted by Frank Schnekenbuehl)
   3.298 +        * say 'mail queue is empty' if mail queue is empty (Thanks to
   3.299 +        Frank Schnekenbuehl)
   3.300 +        * fixed bug: setegid in local.c (was noted by both Michael Piefel and
   3.301 +        Alberto González Palomo)
   3.302 +0.0.11:
   3.303 +        * if Bcc: headers have been removed (-t option), and there is no To:
   3.304 +        or Cc: header,an empty Bcc: header will be created (RFC 822
   3.305 +        compliance!)
   3.306 +        * fixed bug: if rcpts are given on command line To: headers were
   3.307 +        created, even if they already existed. This caused Bcc: recipient
   3.308 +        addresses to be revealed if they were given on the cmd line.
   3.309 +        Now a To: header is only created if there is no To:, Cc: or Bcc:
   3.310 +        header. Thanks to Richard Clamp for pointing this out.
   3.311 +        * fixed bug: segfault when -d option was given without arguments
   3.312 +        * fixed bug: segfault when configuration file not found
   3.313 +0.0.10:
   3.314 +	* removed -g option from Makefile
   3.315 +	* fixed bug: -odq did not work, was broken in some earlier version
   3.316 +	* addresses with leading '\' will not be expanded any further in aliases
   3.317 +	* pipe transport implemented
   3.318 +	* alias support implemented.
   3.319 +	* changed permissions for queue runs again: got to be root,
   3.320 +	mail or in group trusted.
   3.321 +	* some configuration parameters can be read from files
   3.322 +	* internal changes in routing logics/deliver code, preparing for
   3.323 +	aliases support.
   3.324 +	* Gregor Hoffleit sent another patch: use liblockfile if available
   3.325 +	(Debian!) and DESTDIR will be used. Also updated the NEWS file. Thanks
   3.326 +	again!
   3.327 +	* define fdatasync to fsync if not available.
   3.328 +	* lookup.c includes sys/types.h, some environments need this
   3.329 +	* fixed bug in RFC 822 parsing: name in brackets after address
   3.330 +	caused problems. Thanks to David Maslen.
   3.331 +	* values in tables without leading spaces
   3.332 +0.0.9:
   3.333 +	* anyone in group 'trusted' is now allowed to do queue runs. Thanks to
   3.334 +	Alberto Gonzalez Palomo for the suggestion.
   3.335 +	* changed umask for spool writing to 026.
   3.336 +	* removed silly 'no rcpt domain for this route' message
   3.337 +	* there is now a mailing list
   3.338 +	(see http://www.innominate.org/mailman/listinfo/masqmail)
   3.339 +	* Gregor Hoffleit sent a patch to make masqmail work with mutt (and
   3.340 +	balsa and any other MUA that uses the mutt libs): it now supports
   3.341 +	'--' in options. Thanks!
   3.342 +	* accept_message() supports flag ACC_NO_RECVD_HDR (but this is not
   3.343 +	used in masqmail).
   3.344 +	* accept_message() is no longer responsible for queuing, makes it
   3.345 +	easier to recycle the code for other projects (eg. jpilot-Mail)
   3.346 +0.0.8:
   3.347 +	* added a FAQ page.
   3.348 +	* removed all warnings, at least for egcs. Output of make looks
   3.349 +	pretty now ;-)
   3.350 +	* added allowed_mail_locals and not_allowed_mail_locals options for
   3.351 +	routes.
   3.352 +	* implemented folding und unfolding of headers (but currently used
   3.353 +	for the Received: header only).
   3.354 +	* corrected docs: should be 'online_detect', NOT 'detect_online'.
   3.355 +	* mailq now gives information about the time mails spent in the queue,
   3.356 +	the message size and the received host.
   3.357 +	* added allowed_rcpt_domains option for routes.
   3.358 +	* increased buffer size to 1024 for SMTP responses when delivering.
   3.359 +	* fixed minor bug: slash in unquoted strings in conf parsing was not
   3.360 +	allowed.
   3.361 +0.0.7:
   3.362 +	* fixed a bug in smtp_out.c: sock was tested before it was initialized.
   3.363 +	* fixed a bug in the configuration code: for statements in two
   3.364 +	adjacent lines, the second was not recognized.
   3.365 +0.0.6:
   3.366 +	* rewrote part of the configuration parsing code because it caused
   3.367 +	problems with reading config statements on multiple lines.
   3.368 +	* added a LF after each mail local mail spool file, as this
   3.369 +	seems to be required for some MUAs and especially cucipop when
   3.370 +	it reads mails. Otherwise mails seem to be concatenated. Thanks
   3.371 +	to Dale Perkel for pointing this out.
   3.372 +0.0.5:
   3.373 +	* added  expand_h_sender_domain option (boolean, default: true)
   3.374 +	because some clients use the Sender: address as the sender address
   3.375 +	(though it should be the From: address).
   3.376 +	* changed configure script to better recognize whether libresolv
   3.377 +	should be linked or not.
   3.378 +	* fixed a nasty bug: if masqmail -q was called (or qo <name>
   3.379 + 	and a mail was not delivered), the headers were lost! Problem was an
   3.380 + 	additional LF after received_host in the spool file.
   3.381 +0.0.4:
   3.382 +	* 'From' hack is now a 'From ' hack.
   3.383 +	* configure now accepts options --with-logdir=LOGDIR and
   3.384 +	--with-spooldir=SPOOLDIR.
   3.385 +	* the directories /var/masqmail and /var/spool/masqmail will now be
   3.386 +	created with make install; user and group will be set appropriately
   3.387 +	* configure now accepts options --with-user=USER and --with-group=GROUP
   3.388 +	* dove into autoconf: configure now recognizes libc5 and links with
   3.389 +	libresolv only for libc6 and defines getline for libc5
   3.390 +	* fixed timeout code when sending. This was broken in some earlier
   3.391 +	version.
   3.392 +0.0.3:
   3.393 +	* fixed bug in spool write code: rcpt address was written incorrectly
   3.394 +	to spool file under some circumstances (with a LF).
   3.395 +	* added methods for online detection (file and mserver) and added code
   3.396 +	to deliver immediately when mail is received at online time.
   3.397 +	* too many changes to list: rearranged routing code, unified smtp
   3.398 +	deliveries to the local net with online deliveries, so now route
   3.399 +	configurations can be used for the local net. Also multiple messages
   3.400 +	per connection for the local net possible. And reduced code size.
   3.401 +	* fixed bug: if server does not use neither the esmtp size extension
   3.402 +	nor pipelining, output after MAIL FROM was not flushed. So MM waited
   3.403 +	forever for a response...
   3.404 +0.0.2:
   3.405 +	* fixed bug: euid was not set properly for local delivery
   3.406 +	* when debugging, it does not write the whole message to the log
   3.407 +	any more.
   3.408 +	* added 'From' hack
   3.409 +	* qualified address for return path and recipients is now required
   3.410 +	if not accepted locally, if locally accepted the addresses will be
   3.411 +	qualified with host_name. (Thereby fixed a seg fault bug)
   3.412 +	* added -i option (same as -oi)
   3.413 +	* added more header rewriting (set_ and map_ options)
   3.414 +	* fixed bug: potential seg fault when writing spool files because it
   3.415 +	was not read properly
   3.416 +	* multiple messages per connection now also if mail is sent directly
   3.417 +	(same for local_nets is still missing, but I will use routes for these
   3.418 +	anyway in the future)
   3.419 +	* the queue will now be read in random order
   3.420 +	* implemented multiple messages per connection (but only online
   3.421 +	and if mail_host is defined)
   3.422 +	* implemented rewriting of local parts in return path for online
   3.423 +	delivery
   3.424 +	* domain matching is no longer case sensitive (had to define
   3.425 +	_GNU_SOURCE so that I could use FNM_CASEFOLD for fnmatch)
   3.426 +	* added do_correct_helo option for routes
   3.427 +	* fixed bug: corrected retrying hosts if one failed (connect.c).
   3.428 +0.0.1:
   3.429 +	* fixed bug: seg fault when delivering online directly and there was
   3.430 +	more than one rcpt to a single host.
   3.431 +	* fixed bug: if mail was succesfully delivered in online mode to all
   3.432 +	rcpts, and if there were additional (local) rcpts for which the mail
   3.433 +	was not	yet delivered, the mail was deleted from spool.
   3.434 +	* rearranged smtp_out.c to prepare for multiple messages per connection
   3.435 +	* log now shows the real host a message is sent to by SMTP (previously
   3.436 +	it was the one looked for, now it is the one that was found by DNS)
   3.437 +	* added NOOP, HELP and not recognized replies in smtp_in
   3.438 +	* fixed bug: forgot to close dup_sock in accept_connect (listen.c)
   3.439 +	* can now list the queue with the -bp option or when called as mailq
   3.440 +	* debug_level is now configurable and -d option added
   3.441 +	* corrected rfc821 address parsing and rearranged code
   3.442 +0.0.0:
   3.443 +	* initial release
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/INSTALL	Fri Sep 26 17:05:23 2008 +0200
     4.3 @@ -0,0 +1,135 @@
     4.4 +simple installation instructions, see docs/install.html for more.
     4.5 +
     4.6 +To compile MasqMail you need glib 1.2 (http://www.gtk.org).
     4.7 +
     4.8 +You need a user and a group for masqmail to run, I suggest user
     4.9 +'mail' and group 'trusted'. Say:
    4.10 +
    4.11 +groupadd -g 42 trusted
    4.12 +useradd -u 42 -g 42 -d / -s /bin/sh -c "Mail Transfer Agent" mail
    4.13 +
    4.14 +If you use other names than 'mail' and 'trusted' use the options
    4.15 +described below for configure. The 42 is just a suggestion, you can
    4.16 +use any number you like, but preferably one < 100. It does not have
    4.17 +to be the same for the user 'mail' and the group 'trusted'.
    4.18 +
    4.19 +Then do:
    4.20 +
    4.21 +./configure
    4.22 +make
    4.23 +make install
    4.24 +
    4.25 +Debian:
    4.26 +If you compile for Debian, do the configure with at least these options,
    4.27 +this makes it compatible with the official debian package:
    4.28 +./configure --with-liblockfile --with-group=mail
    4.29 +you do not need the group 'trusted', use 'mail' instead.
    4.30 +
    4.31 +You can also build your own Debian package with
    4.32 +dpkg-buildpackage -rfakeroot
    4.33 +You need to have fakeroot installed to do this. Or, as root, do:
    4.34 +dpkg-buildpackage
    4.35 +
    4.36 +SuSE/Redhat:
    4.37 +There are spec files for rpm creation in suse/ or redhat/. You may have to adjust these files.
    4.38 +
    4.39 +
    4.40 +Sorry, but after that you are not yet finished. For instruction on how
    4.41 +to deliver mail using a connection to your ISP see
    4.42 +docs/install.html. It is probably a good idea to copy the files
    4.43 +docs/*.html to a directory where you can access them with a browser.
    4.44 +
    4.45 +additional options for configure:
    4.46 +---------------------------------
    4.47 +
    4.48 +--with-user=USER sets the user as which MasqMail will run. Default is
    4.49 +'mail'. USER has to exist before you 'make install'.
    4.50 +
    4.51 +--with-group=GROUP sets the group as which MasqMail will run. Default
    4.52 +is 'trusted'. GROUP has to exist before you 'make install'.
    4.53 +
    4.54 +--with-logdir=LOGDIR sets the directory where MasqMail stores its log
    4.55 +files. It will be created if it does not exist. Default is /var/masqmail/.
    4.56 +
    4.57 +--with-spooldir=SPOOLDIR sets the directory where MasqMail stores its
    4.58 +spool files. It will be created if it does not exist. Default is
    4.59 +/var/spool/masqmail/.
    4.60 +
    4.61 +--with-confdir=CONFDIR sets the default configuration directory to
    4.62 +CONFDIR, in case you prefer another location than /etc/masqmail/.
    4.63 +
    4.64 +--enable-auth enables ESMTP AUTH support (disabled by default)
    4.65 +
    4.66 +--disable-pop3 disables pop3 support (enabled by default)
    4.67 +
    4.68 +--enable-maildir enables qmail style Maildir support (disabled by default)
    4.69 +
    4.70 +--enable-ident enable RFC 1413 support. If you have the libident
    4.71 +dynamic library installed, this will be linked, otherwise it will be
    4.72 +statically linked using the sources included in the package.
    4.73 +
    4.74 +--disable-resolver disable resolver support. Without the resolver functions,
    4.75 +masqmail uses only gethostbyname() to resolve DNS names, and you cannot send
    4.76 +mail without a smart host. Not recommended. You save 3K at most.
    4.77 +
    4.78 +--disable-smtp-server disable SMTP server support. You may want this if you do
    4.79 +not need masqmail to listen. In this case, you cannot use masqmail as a smart
    4.80 +host for other hosts on your LAN, you cannot use mail clients that send SMTP,
    4.81 +you cannot even use pine. In short, use of this option is discouraged unless
    4.82 +your resources are extremely limited.
    4.83 +
    4.84 +--enable-mserver enable online detection by connecting to the mserver
    4.85 +(masqdialer system).
    4.86 +
    4.87 +--with-libcryto instead of using the md5 and hmac functions within the package,
    4.88 +link dynamically with libcrypto. This applies only if you have pop3 or SMTP
    4.89 +AUTH enabled. Makes only sense if your resources are limited and you have
    4.90 +libcrypto installed. Untested.
    4.91 +
    4.92 +--with-glib-static link with glib statically. This makes the binary larger
    4.93 +by around 30K (i386 architecture), but if masqmail is the only binary using
    4.94 +glib, you save some space in total, because you do not need the shared glib
    4.95 +library installed.
    4.96 +
    4.97 +--disable-debug disable debugging, setting it on by command line or configuration
    4.98 +has no effect. Strongly discouraged, since you miss valuable information if something
    4.99 +goes wrong. You save 6K.
   4.100 +
   4.101 +BTW, to get 3K of space, call
   4.102 +strip --remove-section=.comment --remove-section=.note --strip-unneeded src/masqmail
   4.103 +
   4.104 +after make install:
   4.105 +-------------------
   4.106 +
   4.107 +You can also use these instructions to omit 'make install' if you do
   4.108 +not want to use it.
   4.109 +
   4.110 +Check that 'make install' worked correctly. The following command:
   4.111 +
   4.112 +ls -ld /usr/sbin/masqmail /var/masqmail/ /var/spool/masqmail /var/spool/masqmail/input
   4.113 +
   4.114 +should give output similar to
   4.115 +
   4.116 +-rwsr-xr-x   1 root     root        86955 Oct 14 14:27 /usr/sbin/masqmail
   4.117 +drwxr-xr-x   2 mail     trusted      1024 Oct 14 14:29 /var/masqmail/
   4.118 +drwxr-xr-x   3 mail     trusted      1024 Oct 14 14:27 /var/spool/masqmail
   4.119 +drwxr-xr-x   2 mail     trusted      1024 Oct 14 18:32 /var/spool/masqmail/input
   4.120 +drwxr-xr-x   2 mail     trusted      1024 Oct 14 18:32 /var/spool/masqmail/lock
   4.121 +drwxr-xr-x   2 mail     trusted      1024 Oct 14 18:32 /var/spool/masqmail/popuidl
   4.122 +
   4.123 +(important is the set-user-id bit for /usr/sbin/masqmail and the
   4.124 +ownership of all items).
   4.125 +
   4.126 +Use the example configuration files in examples/ to edit your own. The
   4.127 +main configuration should go to /etc/masqmail.conf. I recommend to
   4.128 +make a directory /etc/masqmail for the *.route amd *.get files.
   4.129 +
   4.130 +The default destination for the executable 'masqmail' is
   4.131 +/usr/sbin. Check that it has the set user id bit set. (chmod u+s
   4.132 +/usr/sbin/masqmail does no harm in any case).
   4.133 +
   4.134 +If you want to replace sendmail, move your old sendmail binary to
   4.135 +another name and make a symbolic link /usr/sbin/sendmail ->
   4.136 +/usr/sbin/masqmail.
   4.137 +
   4.138 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/INSTALL.agenda	Fri Sep 26 17:05:23 2008 +0200
     5.3 @@ -0,0 +1,37 @@
     5.4 +
     5.5 +prerequesites:
     5.6 +--------------
     5.7 +cp /usr/lib/glib-config /usr/mipsel-linux/bin
     5.8 +and apply this patch:
     5.9 +
    5.10 +3c3
    5.11 +< prefix=/usr
    5.12 +---
    5.13 +> prefix=/usr/mipsel-linux/
    5.14 +
    5.15 +
    5.16 +compile
    5.17 +-------
    5.18 +export CONFIG_SITE=./agenda-config.site
    5.19 +
    5.20 +./configure --prefix=/usr/local/ --with-spooldir=/flash/spool/masqmail/ --with-glib-prefix=/usr/mipsel-linux/ --disable-smtp-server --disable-resolver --with-group=mail --disable-debug --enable-auth
    5.21 +make
    5.22 +
    5.23 +mipsel-linux-strip --remove-section=.comment --remove-section=.note --strip-unneeded src/masqmail
    5.24 +
    5.25 +install
    5.26 +-------
    5.27 +
    5.28 +# Become root and do:
    5.29 +make DESTDIR=/tmp/agenda-masqmail/ install
    5.30 +
    5.31 +# make the configuration directory writable for user mail
    5.32 +# (this is needed for sqilconf)
    5.33 +chown mail.mail /tmp/agenda-masqmail/etc/masqmail/
    5.34 +chmod g+rw /tmp/agenda-masqmail/etc/masqmail/
    5.35 +
    5.36 +# delete man pages and unneeded binaries:
    5.37 +rm -rf /tmp/agenda-masqmail/usr/local/man/ /tmp/agenda-masqmail/usr/local/bin/
    5.38 +
    5.39 +You can now rsync the files you need to your agenda from DESTDIR.
    5.40 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/INSTALL.ipaq	Fri Sep 26 17:05:23 2008 +0200
     6.3 @@ -0,0 +1,15 @@
     6.4 +For a cross compiler:
     6.5 +
     6.6 +Download ipaq-config.site from http://masqmail.cx/ipaq/cross/. There
     6.7 +are also some more instructions.
     6.8 +
     6.9 +export CONFIG_SITE=./ipaq-config.site
    6.10 +
    6.11 +./configure --with-glib-prefix=/skiff/local/ \
    6.12 +	--disable-smtp-server --disable-resolver \
    6.13 +	--with-group=mail --disable-debug --enable-auth
    6.14 +make
    6.15 +
    6.16 +su
    6.17 +make DESTDIR=/tmp/masqmail install
    6.18 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
     7.3 @@ -0,0 +1,50 @@
     7.4 +EXTRA_DIST = \
     7.5 +examples/example.get examples/example.route examples/masqmail.conf \
     7.6 +docs/README docs/man/m*.[0-9] \
     7.7 +suse/masqmail suse/masqmail.spec suse/masqmail.spec.in \
     7.8 +redhat/masqmail redhat/masqmail.spec redhat/masqmail.spec.in \
     7.9 +tpl/failmsg.tpl tpl/failmsg.tpl.de tpl/failmsg.tpl.fr tpl/failmsg.tpl.it \
    7.10 +tpl/warnmsg.tpl tpl/warnmsg.tpl.de tpl/warnmsg.tpl.fr \
    7.11 +INSTALL.agenda INSTALL.ipaq agenda-config.site
    7.12 +
    7.13 +SUBDIRS = src tests docs debian
    7.14 +
    7.15 +install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir
    7.16 +
    7.17 +conf_dir: $(DESTDIR)@with_confdir@
    7.18 +
    7.19 +$(DESTDIR)@with_confdir@:
    7.20 +	install -d $(DESTDIR)@with_confdir@
    7.21 +
    7.22 +tpl_dir: $(DESTDIR)@datadir@/tpl
    7.23 +
    7.24 +$(DESTDIR)@datadir@/tpl: conf_dir
    7.25 +	install -d $(DESTDIR)@datadir@/masqmail/tpl
    7.26 +	install -m 644 tpl/failmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl
    7.27 +	install -m 644 tpl/failmsg.tpl.{de,fr,it} $(DESTDIR)@datadir@/masqmail/tpl
    7.28 +	install -m 644 tpl/warnmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl
    7.29 +	install -m 644 tpl/warnmsg.tpl.{de,fr} $(DESTDIR)@datadir@/masqmail/tpl
    7.30 +
    7.31 +log_dir: $(DESTDIR)@with_logdir@
    7.32 +
    7.33 +spool_dir: $(DESTDIR)@with_spooldir@
    7.34 +
    7.35 +uid_bit: $(DESTDIR)@prefix@/sbin/masqmail
    7.36 +	chmod u+s $(DESTDIR)@prefix@/sbin/masqmail
    7.37 +
    7.38 +run_dir:
    7.39 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail
    7.40 +
    7.41 +$(DESTDIR)@with_logdir@:
    7.42 +	[ -d `dirname $(DESTDIR)@with_logdir@` ] || \
    7.43 +		install -d `dirname $(DESTDIR)@with_logdir@`
    7.44 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@
    7.45 +
    7.46 +$(DESTDIR)@with_spooldir@:
    7.47 +	[ -d `dirname $(DESTDIR)@with_spooldir@` ] || \
    7.48 +		install -d `dirname $(DESTDIR)@with_spooldir@`
    7.49 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@
    7.50 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/lock
    7.51 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/input
    7.52 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/popuidl
    7.53 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
     8.3 @@ -0,0 +1,581 @@
     8.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
     8.5 +# @configure_input@
     8.6 +
     8.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
     8.8 +# Free Software Foundation, Inc.
     8.9 +# This Makefile.in is free software; the Free Software Foundation
    8.10 +# gives unlimited permission to copy and/or distribute it,
    8.11 +# with or without modifications, as long as this notice is preserved.
    8.12 +
    8.13 +# This program is distributed in the hope that it will be useful,
    8.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    8.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    8.16 +# PARTICULAR PURPOSE.
    8.17 +
    8.18 +@SET_MAKE@
    8.19 +
    8.20 +srcdir = @srcdir@
    8.21 +top_srcdir = @top_srcdir@
    8.22 +VPATH = @srcdir@
    8.23 +pkgdatadir = $(datadir)/@PACKAGE@
    8.24 +pkglibdir = $(libdir)/@PACKAGE@
    8.25 +pkgincludedir = $(includedir)/@PACKAGE@
    8.26 +top_builddir = .
    8.27 +
    8.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    8.29 +INSTALL = @INSTALL@
    8.30 +install_sh_DATA = $(install_sh) -c -m 644
    8.31 +install_sh_PROGRAM = $(install_sh) -c
    8.32 +install_sh_SCRIPT = $(install_sh) -c
    8.33 +INSTALL_HEADER = $(INSTALL_DATA)
    8.34 +transform = $(program_transform_name)
    8.35 +NORMAL_INSTALL = :
    8.36 +PRE_INSTALL = :
    8.37 +POST_INSTALL = :
    8.38 +NORMAL_UNINSTALL = :
    8.39 +PRE_UNINSTALL = :
    8.40 +POST_UNINSTALL = :
    8.41 +ACLOCAL = @ACLOCAL@
    8.42 +AMDEP_FALSE = @AMDEP_FALSE@
    8.43 +AMDEP_TRUE = @AMDEP_TRUE@
    8.44 +AMTAR = @AMTAR@
    8.45 +AUTOCONF = @AUTOCONF@
    8.46 +AUTOHEADER = @AUTOHEADER@
    8.47 +AUTOMAKE = @AUTOMAKE@
    8.48 +AWK = @AWK@
    8.49 +BASE64_LIBS = @BASE64_LIBS@
    8.50 +CC = @CC@
    8.51 +CCDEPMODE = @CCDEPMODE@
    8.52 +CFLAGS = @CFLAGS@
    8.53 +CPP = @CPP@
    8.54 +CPPFLAGS = @CPPFLAGS@
    8.55 +CYGPATH_W = @CYGPATH_W@
    8.56 +DEFS = @DEFS@
    8.57 +DEPDIR = @DEPDIR@
    8.58 +ECHO_C = @ECHO_C@
    8.59 +ECHO_N = @ECHO_N@
    8.60 +ECHO_T = @ECHO_T@
    8.61 +EGREP = @EGREP@
    8.62 +EXEEXT = @EXEEXT@
    8.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
    8.64 +GLIB_LIBS = @GLIB_LIBS@
    8.65 +IDENT_LIBS = @IDENT_LIBS@
    8.66 +INSTALL_DATA = @INSTALL_DATA@
    8.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
    8.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
    8.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
    8.70 +LDFLAGS = @LDFLAGS@
    8.71 +LIBOBJS = @LIBOBJS@
    8.72 +LIBS = @LIBS@
    8.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
    8.74 +LTLIBOBJS = @LTLIBOBJS@
    8.75 +MAKEINFO = @MAKEINFO@
    8.76 +MD5_LIBS = @MD5_LIBS@
    8.77 +OBJEXT = @OBJEXT@
    8.78 +PACKAGE = @PACKAGE@
    8.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
    8.80 +PACKAGE_NAME = @PACKAGE_NAME@
    8.81 +PACKAGE_STRING = @PACKAGE_STRING@
    8.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
    8.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
    8.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
    8.85 +PKG_CONFIG = @PKG_CONFIG@
    8.86 +RANLIB = @RANLIB@
    8.87 +RESOLV_LIBS = @RESOLV_LIBS@
    8.88 +SET_MAKE = @SET_MAKE@
    8.89 +SHELL = @SHELL@
    8.90 +STRIP = @STRIP@
    8.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
    8.92 +VERSION = @VERSION@
    8.93 +ac_ct_CC = @ac_ct_CC@
    8.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
    8.95 +ac_ct_STRIP = @ac_ct_STRIP@
    8.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
    8.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
    8.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
    8.99 +am__include = @am__include@
   8.100 +am__leading_dot = @am__leading_dot@
   8.101 +am__quote = @am__quote@
   8.102 +bindir = @bindir@
   8.103 +build_alias = @build_alias@
   8.104 +datadir = @datadir@
   8.105 +exec_prefix = @exec_prefix@
   8.106 +has_ident = @has_ident@
   8.107 +host_alias = @host_alias@
   8.108 +includedir = @includedir@
   8.109 +infodir = @infodir@
   8.110 +install_sh = @install_sh@
   8.111 +libdir = @libdir@
   8.112 +libexecdir = @libexecdir@
   8.113 +localstatedir = @localstatedir@
   8.114 +mandir = @mandir@
   8.115 +oldincludedir = @oldincludedir@
   8.116 +prefix = @prefix@
   8.117 +program_transform_name = @program_transform_name@
   8.118 +sbindir = @sbindir@
   8.119 +sharedstatedir = @sharedstatedir@
   8.120 +sysconfdir = @sysconfdir@
   8.121 +target_alias = @target_alias@
   8.122 +with_confdir = @with_confdir@
   8.123 +with_group = @with_group@
   8.124 +with_logdir = @with_logdir@
   8.125 +with_spooldir = @with_spooldir@
   8.126 +with_user = @with_user@
   8.127 +EXTRA_DIST = \
   8.128 +examples/example.get examples/example.route examples/masqmail.conf \
   8.129 +docs/README docs/man/m*.[0-9] \
   8.130 +suse/masqmail suse/masqmail.spec suse/masqmail.spec.in \
   8.131 +redhat/masqmail redhat/masqmail.spec redhat/masqmail.spec.in \
   8.132 +tpl/failmsg.tpl tpl/failmsg.tpl.de tpl/failmsg.tpl.fr tpl/failmsg.tpl.it \
   8.133 +tpl/warnmsg.tpl tpl/warnmsg.tpl.de tpl/warnmsg.tpl.fr \
   8.134 +INSTALL.agenda INSTALL.ipaq agenda-config.site
   8.135 +
   8.136 +
   8.137 +SUBDIRS = src tests docs debian
   8.138 +subdir = .
   8.139 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
   8.140 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
   8.141 +CONFIG_HEADER = config.h
   8.142 +CONFIG_CLEAN_FILES = suse/masqmail.spec redhat/masqmail.spec
   8.143 +DIST_SOURCES =
   8.144 +
   8.145 +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
   8.146 +	ps-recursive install-info-recursive uninstall-info-recursive \
   8.147 +	all-recursive install-data-recursive install-exec-recursive \
   8.148 +	installdirs-recursive install-recursive uninstall-recursive \
   8.149 +	check-recursive installcheck-recursive
   8.150 +DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \
   8.151 +	COPYING ChangeLog INSTALL Makefile.am NEWS TODO acconfig.h \
   8.152 +	aclocal.m4 config.guess config.h.in config.sub configure \
   8.153 +	configure.ac depcomp install-sh missing mkinstalldirs
   8.154 +DIST_SUBDIRS = $(SUBDIRS)
   8.155 +all: config.h
   8.156 +	$(MAKE) $(AM_MAKEFLAGS) all-recursive
   8.157 +
   8.158 +.SUFFIXES:
   8.159 +
   8.160 +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
   8.161 + configure.lineno
   8.162 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
   8.163 +	cd $(top_srcdir) && \
   8.164 +	  $(AUTOMAKE) --gnu  Makefile
   8.165 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
   8.166 +	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
   8.167 +
   8.168 +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   8.169 +	$(SHELL) ./config.status --recheck
   8.170 +$(srcdir)/configure:  $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
   8.171 +	cd $(srcdir) && $(AUTOCONF)
   8.172 +
   8.173 +$(ACLOCAL_M4):  configure.ac 
   8.174 +	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
   8.175 +
   8.176 +config.h: stamp-h1
   8.177 +	@if test ! -f $@; then \
   8.178 +	  rm -f stamp-h1; \
   8.179 +	  $(MAKE) stamp-h1; \
   8.180 +	else :; fi
   8.181 +
   8.182 +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
   8.183 +	@rm -f stamp-h1
   8.184 +	cd $(top_builddir) && $(SHELL) ./config.status config.h
   8.185 +
   8.186 +$(srcdir)/config.h.in:  $(top_srcdir)/configure.ac $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
   8.187 +	cd $(top_srcdir) && $(AUTOHEADER)
   8.188 +	touch $(srcdir)/config.h.in
   8.189 +
   8.190 +distclean-hdr:
   8.191 +	-rm -f config.h stamp-h1
   8.192 +suse/masqmail.spec: $(top_builddir)/config.status $(top_srcdir)/suse/masqmail.spec.in
   8.193 +	cd $(top_builddir) && $(SHELL) ./config.status $@
   8.194 +redhat/masqmail.spec: $(top_builddir)/config.status $(top_srcdir)/redhat/masqmail.spec.in
   8.195 +	cd $(top_builddir) && $(SHELL) ./config.status $@
   8.196 +uninstall-info-am:
   8.197 +
   8.198 +# This directory's subdirectories are mostly independent; you can cd
   8.199 +# into them and run `make' without going through this Makefile.
   8.200 +# To change the values of `make' variables: instead of editing Makefiles,
   8.201 +# (1) if the variable is set in `config.status', edit `config.status'
   8.202 +#     (which will cause the Makefiles to be regenerated when you run `make');
   8.203 +# (2) otherwise, pass the desired values on the `make' command line.
   8.204 +$(RECURSIVE_TARGETS):
   8.205 +	@set fnord $$MAKEFLAGS; amf=$$2; \
   8.206 +	dot_seen=no; \
   8.207 +	target=`echo $@ | sed s/-recursive//`; \
   8.208 +	list='$(SUBDIRS)'; for subdir in $$list; do \
   8.209 +	  echo "Making $$target in $$subdir"; \
   8.210 +	  if test "$$subdir" = "."; then \
   8.211 +	    dot_seen=yes; \
   8.212 +	    local_target="$$target-am"; \
   8.213 +	  else \
   8.214 +	    local_target="$$target"; \
   8.215 +	  fi; \
   8.216 +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
   8.217 +	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
   8.218 +	done; \
   8.219 +	if test "$$dot_seen" = "no"; then \
   8.220 +	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
   8.221 +	fi; test -z "$$fail"
   8.222 +
   8.223 +mostlyclean-recursive clean-recursive distclean-recursive \
   8.224 +maintainer-clean-recursive:
   8.225 +	@set fnord $$MAKEFLAGS; amf=$$2; \
   8.226 +	dot_seen=no; \
   8.227 +	case "$@" in \
   8.228 +	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
   8.229 +	  *) list='$(SUBDIRS)' ;; \
   8.230 +	esac; \
   8.231 +	rev=''; for subdir in $$list; do \
   8.232 +	  if test "$$subdir" = "."; then :; else \
   8.233 +	    rev="$$subdir $$rev"; \
   8.234 +	  fi; \
   8.235 +	done; \
   8.236 +	rev="$$rev ."; \
   8.237 +	target=`echo $@ | sed s/-recursive//`; \
   8.238 +	for subdir in $$rev; do \
   8.239 +	  echo "Making $$target in $$subdir"; \
   8.240 +	  if test "$$subdir" = "."; then \
   8.241 +	    local_target="$$target-am"; \
   8.242 +	  else \
   8.243 +	    local_target="$$target"; \
   8.244 +	  fi; \
   8.245 +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
   8.246 +	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
   8.247 +	done && test -z "$$fail"
   8.248 +tags-recursive:
   8.249 +	list='$(SUBDIRS)'; for subdir in $$list; do \
   8.250 +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
   8.251 +	done
   8.252 +ctags-recursive:
   8.253 +	list='$(SUBDIRS)'; for subdir in $$list; do \
   8.254 +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
   8.255 +	done
   8.256 +
   8.257 +ETAGS = etags
   8.258 +ETAGSFLAGS =
   8.259 +
   8.260 +CTAGS = ctags
   8.261 +CTAGSFLAGS =
   8.262 +
   8.263 +tags: TAGS
   8.264 +
   8.265 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   8.266 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   8.267 +	unique=`for i in $$list; do \
   8.268 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   8.269 +	  done | \
   8.270 +	  $(AWK) '    { files[$$0] = 1; } \
   8.271 +	       END { for (i in files) print i; }'`; \
   8.272 +	mkid -fID $$unique
   8.273 +
   8.274 +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
   8.275 +		$(TAGS_FILES) $(LISP)
   8.276 +	tags=; \
   8.277 +	here=`pwd`; \
   8.278 +	if (etags --etags-include --version) >/dev/null 2>&1; then \
   8.279 +	  include_option=--etags-include; \
   8.280 +	else \
   8.281 +	  include_option=--include; \
   8.282 +	fi; \
   8.283 +	list='$(SUBDIRS)'; for subdir in $$list; do \
   8.284 +	  if test "$$subdir" = .; then :; else \
   8.285 +	    test -f $$subdir/TAGS && \
   8.286 +	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
   8.287 +	  fi; \
   8.288 +	done; \
   8.289 +	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
   8.290 +	unique=`for i in $$list; do \
   8.291 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   8.292 +	  done | \
   8.293 +	  $(AWK) '    { files[$$0] = 1; } \
   8.294 +	       END { for (i in files) print i; }'`; \
   8.295 +	test -z "$(ETAGS_ARGS)$$tags$$unique" \
   8.296 +	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   8.297 +	     $$tags $$unique
   8.298 +
   8.299 +ctags: CTAGS
   8.300 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
   8.301 +		$(TAGS_FILES) $(LISP)
   8.302 +	tags=; \
   8.303 +	here=`pwd`; \
   8.304 +	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
   8.305 +	unique=`for i in $$list; do \
   8.306 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   8.307 +	  done | \
   8.308 +	  $(AWK) '    { files[$$0] = 1; } \
   8.309 +	       END { for (i in files) print i; }'`; \
   8.310 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   8.311 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   8.312 +	     $$tags $$unique
   8.313 +
   8.314 +GTAGS:
   8.315 +	here=`$(am__cd) $(top_builddir) && pwd` \
   8.316 +	  && cd $(top_srcdir) \
   8.317 +	  && gtags -i $(GTAGS_ARGS) $$here
   8.318 +
   8.319 +distclean-tags:
   8.320 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   8.321 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   8.322 +
   8.323 +top_distdir = .
   8.324 +distdir = $(PACKAGE)-$(VERSION)
   8.325 +
   8.326 +am__remove_distdir = \
   8.327 +  { test ! -d $(distdir) \
   8.328 +    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
   8.329 +         && rm -fr $(distdir); }; }
   8.330 +
   8.331 +GZIP_ENV = --best
   8.332 +distuninstallcheck_listfiles = find . -type f -print
   8.333 +distcleancheck_listfiles = find . -type f -print
   8.334 +
   8.335 +distdir: $(DISTFILES)
   8.336 +	$(am__remove_distdir)
   8.337 +	mkdir $(distdir)
   8.338 +	$(mkinstalldirs) $(distdir)/docs $(distdir)/docs/man $(distdir)/examples $(distdir)/redhat $(distdir)/suse $(distdir)/tpl
   8.339 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
   8.340 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
   8.341 +	list='$(DISTFILES)'; for file in $$list; do \
   8.342 +	  case $$file in \
   8.343 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
   8.344 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
   8.345 +	  esac; \
   8.346 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   8.347 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
   8.348 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
   8.349 +	    dir="/$$dir"; \
   8.350 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
   8.351 +	  else \
   8.352 +	    dir=''; \
   8.353 +	  fi; \
   8.354 +	  if test -d $$d/$$file; then \
   8.355 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   8.356 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   8.357 +	    fi; \
   8.358 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   8.359 +	  else \
   8.360 +	    test -f $(distdir)/$$file \
   8.361 +	    || cp -p $$d/$$file $(distdir)/$$file \
   8.362 +	    || exit 1; \
   8.363 +	  fi; \
   8.364 +	done
   8.365 +	list='$(SUBDIRS)'; for subdir in $$list; do \
   8.366 +	  if test "$$subdir" = .; then :; else \
   8.367 +	    test -d $(distdir)/$$subdir \
   8.368 +	    || mkdir $(distdir)/$$subdir \
   8.369 +	    || exit 1; \
   8.370 +	    (cd $$subdir && \
   8.371 +	      $(MAKE) $(AM_MAKEFLAGS) \
   8.372 +	        top_distdir="$(top_distdir)" \
   8.373 +	        distdir=../$(distdir)/$$subdir \
   8.374 +	        distdir) \
   8.375 +	      || exit 1; \
   8.376 +	  fi; \
   8.377 +	done
   8.378 +	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
   8.379 +	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
   8.380 +	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
   8.381 +	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
   8.382 +	|| chmod -R a+r $(distdir)
   8.383 +dist-gzip: distdir
   8.384 +	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
   8.385 +	$(am__remove_distdir)
   8.386 +
   8.387 +dist dist-all: distdir
   8.388 +	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
   8.389 +	$(am__remove_distdir)
   8.390 +
   8.391 +# This target untars the dist file and tries a VPATH configuration.  Then
   8.392 +# it guarantees that the distribution is self-contained by making another
   8.393 +# tarfile.
   8.394 +distcheck: dist
   8.395 +	$(am__remove_distdir)
   8.396 +	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
   8.397 +	chmod -R a-w $(distdir); chmod a+w $(distdir)
   8.398 +	mkdir $(distdir)/_build
   8.399 +	mkdir $(distdir)/_inst
   8.400 +	chmod a-w $(distdir)
   8.401 +	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
   8.402 +	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
   8.403 +	  && cd $(distdir)/_build \
   8.404 +	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
   8.405 +	    $(DISTCHECK_CONFIGURE_FLAGS) \
   8.406 +	  && $(MAKE) $(AM_MAKEFLAGS) \
   8.407 +	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
   8.408 +	  && $(MAKE) $(AM_MAKEFLAGS) check \
   8.409 +	  && $(MAKE) $(AM_MAKEFLAGS) install \
   8.410 +	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
   8.411 +	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
   8.412 +	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
   8.413 +	        distuninstallcheck \
   8.414 +	  && chmod -R a-w "$$dc_install_base" \
   8.415 +	  && ({ \
   8.416 +	       (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
   8.417 +	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
   8.418 +	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
   8.419 +	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
   8.420 +	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
   8.421 +	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
   8.422 +	  && rm -rf "$$dc_destdir" \
   8.423 +	  && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
   8.424 +	  && rm -f $(distdir).tar.gz \
   8.425 +	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
   8.426 +	$(am__remove_distdir)
   8.427 +	@echo "$(distdir).tar.gz is ready for distribution" | \
   8.428 +	  sed 'h;s/./=/g;p;x;p;x'
   8.429 +distuninstallcheck:
   8.430 +	@cd $(distuninstallcheck_dir) \
   8.431 +	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
   8.432 +	   || { echo "ERROR: files left after uninstall:" ; \
   8.433 +	        if test -n "$(DESTDIR)"; then \
   8.434 +	          echo "  (check DESTDIR support)"; \
   8.435 +	        fi ; \
   8.436 +	        $(distuninstallcheck_listfiles) ; \
   8.437 +	        exit 1; } >&2
   8.438 +distcleancheck: distclean
   8.439 +	@if test '$(srcdir)' = . ; then \
   8.440 +	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
   8.441 +	  exit 1 ; \
   8.442 +	fi
   8.443 +	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
   8.444 +	  || { echo "ERROR: files left in build directory after distclean:" ; \
   8.445 +	       $(distcleancheck_listfiles) ; \
   8.446 +	       exit 1; } >&2
   8.447 +check-am: all-am
   8.448 +check: check-recursive
   8.449 +all-am: Makefile config.h
   8.450 +installdirs: installdirs-recursive
   8.451 +installdirs-am:
   8.452 +
   8.453 +install: install-recursive
   8.454 +install-exec: install-exec-recursive
   8.455 +install-data: install-data-recursive
   8.456 +uninstall: uninstall-recursive
   8.457 +
   8.458 +install-am: all-am
   8.459 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   8.460 +
   8.461 +installcheck: installcheck-recursive
   8.462 +install-strip:
   8.463 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   8.464 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   8.465 +	  `test -z '$(STRIP)' || \
   8.466 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   8.467 +mostlyclean-generic:
   8.468 +
   8.469 +clean-generic:
   8.470 +
   8.471 +distclean-generic:
   8.472 +	-rm -f $(CONFIG_CLEAN_FILES)
   8.473 +
   8.474 +maintainer-clean-generic:
   8.475 +	@echo "This command is intended for maintainers to use"
   8.476 +	@echo "it deletes files that may require special tools to rebuild."
   8.477 +clean: clean-recursive
   8.478 +
   8.479 +clean-am: clean-generic mostlyclean-am
   8.480 +
   8.481 +distclean: distclean-recursive
   8.482 +	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
   8.483 +	-rm -f Makefile
   8.484 +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
   8.485 +
   8.486 +dvi: dvi-recursive
   8.487 +
   8.488 +dvi-am:
   8.489 +
   8.490 +info: info-recursive
   8.491 +
   8.492 +info-am:
   8.493 +
   8.494 +install-data-am: install-data-local
   8.495 +
   8.496 +install-exec-am:
   8.497 +
   8.498 +install-info: install-info-recursive
   8.499 +
   8.500 +install-man:
   8.501 +
   8.502 +installcheck-am:
   8.503 +
   8.504 +maintainer-clean: maintainer-clean-recursive
   8.505 +	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
   8.506 +	-rm -rf $(top_srcdir)/autom4te.cache
   8.507 +	-rm -f Makefile
   8.508 +maintainer-clean-am: distclean-am maintainer-clean-generic
   8.509 +
   8.510 +mostlyclean: mostlyclean-recursive
   8.511 +
   8.512 +mostlyclean-am: mostlyclean-generic
   8.513 +
   8.514 +pdf: pdf-recursive
   8.515 +
   8.516 +pdf-am:
   8.517 +
   8.518 +ps: ps-recursive
   8.519 +
   8.520 +ps-am:
   8.521 +
   8.522 +uninstall-am: uninstall-info-am
   8.523 +
   8.524 +uninstall-info: uninstall-info-recursive
   8.525 +
   8.526 +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
   8.527 +	clean-generic clean-recursive ctags ctags-recursive dist \
   8.528 +	dist-all dist-gzip distcheck distclean distclean-generic \
   8.529 +	distclean-hdr distclean-recursive distclean-tags distcleancheck \
   8.530 +	distdir distuninstallcheck dvi dvi-am dvi-recursive info \
   8.531 +	info-am info-recursive install install-am install-data \
   8.532 +	install-data-am install-data-local install-data-recursive \
   8.533 +	install-exec install-exec-am install-exec-recursive \
   8.534 +	install-info install-info-am install-info-recursive install-man \
   8.535 +	install-recursive install-strip installcheck installcheck-am \
   8.536 +	installdirs installdirs-am installdirs-recursive \
   8.537 +	maintainer-clean maintainer-clean-generic \
   8.538 +	maintainer-clean-recursive mostlyclean mostlyclean-generic \
   8.539 +	mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
   8.540 +	ps-recursive tags tags-recursive uninstall uninstall-am \
   8.541 +	uninstall-info-am uninstall-info-recursive uninstall-recursive
   8.542 +
   8.543 +
   8.544 +install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir
   8.545 +
   8.546 +conf_dir: $(DESTDIR)@with_confdir@
   8.547 +
   8.548 +$(DESTDIR)@with_confdir@:
   8.549 +	install -d $(DESTDIR)@with_confdir@
   8.550 +
   8.551 +tpl_dir: $(DESTDIR)@datadir@/tpl
   8.552 +
   8.553 +$(DESTDIR)@datadir@/tpl: conf_dir
   8.554 +	install -d $(DESTDIR)@datadir@/masqmail/tpl
   8.555 +	install -m 644 tpl/failmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl
   8.556 +	install -m 644 tpl/failmsg.tpl.{de,fr,it} $(DESTDIR)@datadir@/masqmail/tpl
   8.557 +	install -m 644 tpl/warnmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl
   8.558 +	install -m 644 tpl/warnmsg.tpl.{de,fr} $(DESTDIR)@datadir@/masqmail/tpl
   8.559 +
   8.560 +log_dir: $(DESTDIR)@with_logdir@
   8.561 +
   8.562 +spool_dir: $(DESTDIR)@with_spooldir@
   8.563 +
   8.564 +uid_bit: $(DESTDIR)@prefix@/sbin/masqmail
   8.565 +	chmod u+s $(DESTDIR)@prefix@/sbin/masqmail
   8.566 +
   8.567 +run_dir:
   8.568 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail
   8.569 +
   8.570 +$(DESTDIR)@with_logdir@:
   8.571 +	[ -d `dirname $(DESTDIR)@with_logdir@` ] || \
   8.572 +		install -d `dirname $(DESTDIR)@with_logdir@`
   8.573 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@
   8.574 +
   8.575 +$(DESTDIR)@with_spooldir@:
   8.576 +	[ -d `dirname $(DESTDIR)@with_spooldir@` ] || \
   8.577 +		install -d `dirname $(DESTDIR)@with_spooldir@`
   8.578 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@
   8.579 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/lock
   8.580 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/input
   8.581 +	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/popuidl
   8.582 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
   8.583 +# Otherwise a system limit (for SysV at least) may be exceeded.
   8.584 +.NOEXPORT:
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/NEWS	Fri Sep 26 17:05:23 2008 +0200
     9.3 @@ -0,0 +1,263 @@
     9.4 +Here I add changes which may be important for you. See ChangeLog for more
     9.5 +details and the manual pages for a more complete description
     9.6 +of added options.
     9.7 +
     9.8 +0.2.18
     9.9 +
    9.10 +- delivery warnings and failures are now also implermented if the
    9.11 +connection to a server fails. Because masqmail is designed for dialup
    9.12 +networks, a connection failure will merely generate a warning by default.
    9.13 +If you deliver in a local network and use the default local_net route,
    9.14 +this would generte a failure. You can change this behaviour by setting
    9.15 +connect_error_fail
    9.16 +to either true or false in the route configurations.
    9.17 +
    9.18 +0.2.17
    9.19 +
    9.20 +- delivery warnings have been finally implemented: if delivery of a mail
    9.21 +fails temporarily, warning mail will be generated, informing the sender
    9.22 +of the problem. After some time, the mail will be handled as failing
    9.23 +permanently, and be bounced. New options: 'warn_intervals',
    9.24 +'max_defer_time' and 'warnmsg_file'.
    9.25 +
    9.26 +- the message templates for failures and warnings will now be installed
    9.27 +into /usr/share/masqmail/tpl/, and no longer to /etc/masqmail/tpl/. The
    9.28 +default for the search path (options 'errmsg_file' and 'warnmsg_file'
    9.29 +has been changed accordingly.
    9.30 +
    9.31 +- new option 'last_route'. See man 5 masqmail.route.
    9.32 +
    9.33 +0.2.12
    9.34 +two new options have been added:
    9.35 +- do_pipelining will be used only in broken mail setups. Actually, I
    9.36 +implemented it only to test such a setup.
    9.37 +
    9.38 +- helo_name for routes sets the helo_name. This may be useful for
    9.39 +eg. ssh tunneling, or if do_correcthelo does not work, because you are
    9.40 +behind a firewall.
    9.41 +
    9.42 +- the old 'remote_port' option should not be used any more. Set the
    9.43 +port with mail_host="foo.bar.com:1234" in the route file instead.
    9.44 +
    9.45 +0.2.11
    9.46 +
    9.47 +- two new options have been added: do_save_envelope_to for the main
    9.48 +configuration and map_h_mail_followup_to_addresses for the route
    9.49 +files. See the man pages on purpose and usage.
    9.50 +
    9.51 +- the route files can now be mode 0400, owned by root. Previous
    9.52 +versions had problems when sendmail was called directly by a
    9.53 +non-priviledged user, because the route files could not be read.
    9.54 +
    9.55 +0.2.10
    9.56 +
    9.57 +- this version should work on FreeBSD. At least I care now if it does not.
    9.58 +
    9.59 +- masqmail now writes pid files to /var/run/, one for the smtp/queue
    9.60 +daemon and one for the get daemon. So you now know whom to kill ;-)
    9.61 +
    9.62 +- much effort has been put into the Debian package, which now uses debconf.
    9.63 +
    9.64 +0.2.7
    9.65 +
    9.66 +- sorry for my reluctany in the last months...
    9.67 +- my email address is oku@masqmail.cx. I hope that I keep this for the rest
    9.68 +of my life...
    9.69 +
    9.70 +0.2.6
    9.71 +
    9.72 +- you can configure the prefered local delivery mechanism for each user. See
    9.73 +man page masqmail.conf (5), options mbox_default, mbox_users, mda_users and
    9.74 +maildir_users. BIT FAT NOTE: if you used an mda, set mbox_default = "mda"
    9.75 +(or use the mda_users option). Just setting mda is not enough any more.
    9.76 +
    9.77 +- there are the allowed_return_paths and not_allowed_return_paths for the
    9.78 +route configurations, this enables better checking for return path addresses
    9.79 +than allowed_mail_locals. You can also use this to enable or disable messages
    9.80 +from null sender addresses (<>) using "<>".
    9.81 +note: this option has been there for quite a time... I just forgot to document it.
    9.82 +
    9.83 +0.2.5
    9.84 +
    9.85 +- simple relay checking: if you set do_relay=false in masqmail.conf, users
    9.86 +with a return path that is not local will get a 550 reply if they try to
    9.87 +deliver to a not local address. This is for users to force them to have a
    9.88 +proper configuration. It is _not_ to prevent spammers from using your MTA
    9.89 +as a relay, it can be easily forged! masqmail is not designed to be an always
    9.90 +accessible MTA for an internet site.
    9.91 +
    9.92 +- added Maildir support. To use it, add --enable-maildir as ./configure
    9.93 +optiom. Currently, if enabled, all local deliveries are to Maildir
    9.94 +(in ~user/Maildir), and none to mailbox. This is preliminary, future versions
    9.95 +will be configurable (probably together with mda delivery).
    9.96 +
    9.97 +0.2.4 
    9.98 +
    9.99 +- added -v option, this logs to stdout, so you see what happens when
   9.100 +calling masqmail from command line. This is not yet finished, and only
   9.101 +for fetching mails completed.
   9.102 +
   9.103 +0.2.3
   9.104 +
   9.105 +- new option lock_dir where locks will be put to. Defaults to the spool
   9.106 +dir with '/lock/' appended (if spool_dir is /var/spool/masqmail/, lock_dir
   9.107 +is /var/spool/masqmail/lock/).
   9.108 +
   9.109 +- You can use the 'do_uidl_dele' option more reliably. The uidl list
   9.110 +will be written immediately after a message was fetched, so if you use the
   9.111 +do_uidl and do_uidl_dele option you can safely interrupt masqmail when it is
   9.112 +getting mail via pop3, and do not get the message again next time.
   9.113 +
   9.114 +- there are a lot of new options for ./configure to customize masqmail
   9.115 +to your needs. See INSTALL.
   9.116 +
   9.117 +- Uli Funcke sent a patch with the new options 'local_addresses' and
   9.118 +'not_local_addresses' for masqmail.conf. With these, you can declare single
   9.119 +email addresses as local, though they normally are not, and vice versa,
   9.120 +declare addresses as not local though normally they are (determined with
   9.121 +local_hosts). These options are not yet documented.
   9.122 +
   9.123 +0.2.2
   9.124 +- with -go5m you can now run a get daemon, the command 'masqmail -go5m' will fetch
   9.125 +mail every five minutes, using the detected online configuration.
   9.126 +
   9.127 +0.2.1
   9.128 +
   9.129 +- there is a new option for the main conf: online_gets. Using this option,
   9.130 +you can retrieve mail with just calling masqmail -go, masqmail will detect
   9.131 +whether it is online (similar to conect_routes (which is now called
   9.132 +online_routes)).
   9.133 +
   9.134 +0.2.0
   9.135 +
   9.136 +This is the first release of he development branch of masqmail
   9.137 +
   9.138 +- the default configuration is now /etc/masqmail/masqmail.conf
   9.139 +  (as it already was for the debian package). The --with-conffile
   9.140 +  option for configure has been replaced by the --with-confdir option.
   9.141 +
   9.142 +- added delivery failure notices:
   9.143 +  o you can customize your own delivery failure report, its
   9.144 +    default location is /etc/masqmail/tpl/failmsg.tpl
   9.145 +  o if a delivery via a route fails permanently (the server replied with a 5xx status)
   9.146 +    the message will be bounced, if it is bounced, no further delivery will be attempted.
   9.147 +    This is different to previous versions, where failed messages were kept in the queue until
   9.148 +    it was finally delivered, deleted or forever.
   9.149 +
   9.150 +- there is a new online detection method: pipe. This allows you more
   9.151 +  flexibility to detect the current online status, eg. the DHCP status on notebooks.
   9.152 +
   9.153 +This method will once replace the 'mserver' option,
   9.154 +you can already use the program mservdetect to use it:
   9.155 +
   9.156 +online_method=pipe
   9.157 +online_pipe="/usr/bin/mservdetect localhost 222"
   9.158 +
   9.159 +instead of
   9.160 +
   9.161 +online_etect=mserver
   9.162 +mserver_iface="localhost:222"
   9.163 +
   9.164 +0.1.9
   9.165 +
   9.166 +- you can use pipes in routes to implement gateways to uucp, fax, sms etc.
   9.167 +The setup is similar to mda transport. See man pages.
   9.168 +
   9.169 +- for each connection (connect_routes), you can now give a list of
   9.170 +route files, which will be used in the order given. You can use the
   9.171 +filter rules (allowed_* and not_allowed_* rules) within each route.
   9.172 +
   9.173 +0.1.8
   9.174 +
   9.175 +- for pop retrieval and smtp sending you can use a wrapper for eg. ssl
   9.176 +tunneling. See man pages.
   9.177 +
   9.178 +- a user can delete his mail from the spool with -Mrm if received
   9.179 +locally, and if you configure with --enable-ident and set
   9.180 +ident_trusted_nets also if received via smtp.
   9.181 +
   9.182 +- a backslash now works to escape characters in the configuration, so
   9.183 +you can now use quotes inside quotes. All other characters with a
   9.184 +leading backslash will be converted to itself (\a becomes a, \\
   9.185 +becomes \).
   9.186 +
   9.187 +- you can now use an mda for local mails. The mda will be called
   9.188 +*after* alias expansion. See documentation for more.
   9.189 +
   9.190 +0.1.0
   9.191 +- masqmail can now retrieve mail with pop3. See the manual on how to do that.
   9.192 +- supports now ESMTP AUTH as a client.
   9.193 +- when called with -qo (without a connection name), the online status
   9.194 +will be checked with the configured method.
   9.195 +
   9.196 +0.0.10
   9.197 +- there is now alias support. Give the location of the alias file (usually /etc/aliases) with eg.
   9.198 +alias_file = "/etc/aliases"
   9.199 +- delivery to pipes is now possible, but only if it appears in an alias file. Example:
   9.200 +pipe: |/usr/bin/command
   9.201 +will expand the address pipe to "|/usr/bin/command" which invokes '/usr/bin/command'
   9.202 +as the user and group masqmail is running as.
   9.203 +- entries starting with '\' in alias files will not be exanded further
   9.204 +
   9.205 +- changed permissions for queue runs again: got to be root, mail or in group trusted.
   9.206 +
   9.207 +- some configuration parameters can be read from files, these are
   9.208 +allowed_mail_locals, not_allowed_mail_locals, allowed_rcpt_domains, not_allowed_rcpt_domains,
   9.209 +map_return_path_addresses, map_h_from_addresses, map_h_reply_to_addresses
   9.210 +any entry in these list beginning with a '/' are regarded as
   9.211 +filenames, the content of these will be put at that location. Entries
   9.212 +in these files are separated by new lines.  Example:
   9.213 +in the route file you have:
   9.214 +map_h_from_addresses = "/etc/masqmail/hfrom.map"
   9.215 +and hfrom.map contains:
   9.216 +
   9.217 +john: John Smith <jsmith@mail.academic.edu>
   9.218 +cmiller: "Charlie Miller" <cmiller@foo.com>
   9.219 +
   9.220 +UPDATE (Jan 2000): The new home location of MasqMail is
   9.221 +http://www.innominate.org/~oku/masqmail/, the new email adress of the
   9.222 +author is Oliver Kurth <kurth@innominate.de>.
   9.223 +
   9.224 +0.0.9
   9.225 +- see ChangeLog.
   9.226 +
   9.227 +NOTE: The home location of MasqMail at
   9.228 +http://merlin.uni-sw.gwdg.de/~okurth/masqmail/ is uncertain from the
   9.229 +beginning of Nov. 1999! See http://www.freshmeat.net for new
   9.230 +announcements. I leave the university and begin a new job on Nov. 1st 1999
   9.231 +in Berlin :-).
   9.232 +
   9.233 +0.0.8:
   9.234 +- there is now a FAQ page. See docs/faq.html.
   9.235 +- added allowed_rcpt_domains option for routes.
   9.236 +- added allowed_mail_locals and not_allowed_mail_locals options for routes.
   9.237 +- mailq now gives information about the time mails spent in the queue,
   9.238 +the message size and the received host.
   9.239 +
   9.240 +0.0.7:
   9.241 +-bug fix release: for statements in two	adjacent lines, the second was not recognized.
   9.242 +
   9.243 +0.0.6:
   9.244 +- bug fix release: some MUAs (cucipop) saw the locally delivered mails
   9.245 +concatenated. (cucipop is not a MUA  but a pop server, but it has to read the
   9.246 +mails).
   9.247 +
   9.248 +0.0.5:
   9.249 +- fixed a bug that caused the headers to be lost under some circumstances.
   9.250 +- added expand_h_sender_domain option for routes.
   9.251 +- rewrote the libresolv part in configure. Should work better now.
   9.252 +
   9.253 +0.0.4:
   9.254 +- MM should now recognize whether libresolv should be linked.
   9.255 +- added --with-logdir=LOGDIR and --with-spooldir=SPOOLDIR to set directories.
   9.256 +  These will be created if not already existent.
   9.257 +- added --with-user=USER, --with-group=GROUP options to set user and group id
   9.258 +  for MasqMail.
   9.259 +
   9.260 +0.0.3:
   9.261 +- MasqMail can now deliver mails that are received at online
   9.262 +  time immediately to the internet. See the options detect_online,
   9.263 +  mserver_iface and online_file.
   9.264 +- You can define a route configuration for the local net. See option
   9.265 +  local_net_route.
   9.266 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/README	Fri Sep 26 17:05:23 2008 +0200
    10.3 @@ -0,0 +1,82 @@
    10.4 +MasqMail README
    10.5 +
    10.6 +MasqMail is a mail server designed for hosts that are not permanently
    10.7 +connected to the internet. It handles outgoing messages, i.e. those
    10.8 +that are to be sent over the non-permanent link (usually a ppp or slip
    10.9 +connection over a modem or ISDN adapter) specially and delivers them
   10.10 +only when explicitely told to do so. There is support for multiple
   10.11 +providers, it is possible to write different configurations for each
   10.12 +one. The configuration chosen is selected at delivery time, so that if
   10.13 +for example a delivery of a message failed while connected with
   10.14 +provider 1, it may be delivered when connected to provider 2. For each
   10.15 +provider another mail host (or none) can be specified.
   10.16 +
   10.17 +MasqMail provides (a yet simple) mechanism to rewrite headers, also
   10.18 +depending on the current connection. This makes it possible to deliver
   10.19 +messages with a return address on the local network which will be
   10.20 +rewitten at delivery time. The purpose of this is:
   10.21 +
   10.22 +- to allow delivery failure messages that are produced on the local
   10.23 +network to be delivered immediately, while those that are produced
   10.24 +outside can be delivered to a mailbox on the internet, to be retrieved
   10.25 +later.
   10.26 +
   10.27 +- to give mail servers a return address which they can accept if they
   10.28 +check for spam mail. Many mail servers require a return address which
   10.29 +has the same domain as the server it is getting the message from. If
   10.30 +you normally connect to only one provider, this is usually not a
   10.31 +problem as you can configure your mailer to a fixed address (but then
   10.32 +there is still the problem with the failure messages...), but it is a
   10.33 +problem if you use different ones from time to time.
   10.34 +
   10.35 +MasqMail shall once be a complete replacement for sendmail (or other
   10.36 +MTAs such as exim, qmail or smail) on a local network, but it is NOT
   10.37 +supposed to be installed in a network with a permanent internet
   10.38 +connection (at least if it is not behind a secure firewall) because
   10.39 +it has no ability to check for undesired relaying or spam filtering.
   10.40 +
   10.41 +Missing, but soon to be realized features:
   10.42 +
   10.43 +- .forward file support (alias file is supported)
   10.44 +- mailer demon messages (mail from the server in cases of delivery failures
   10.45 +or malformed addresses)
   10.46 +
   10.47 +Future plans are:
   10.48 +
   10.49 +- initiate connections on its own
   10.50 +- integration to the masqdialer system (mserver) as an option
   10.51 +- possibly a pop3 server
   10.52 +
   10.53 +For installation instructions, see INSTALL.
   10.54 +
   10.55 +Bugs: MasqMail is still very young, and there are probably at lot of
   10.56 +bugs in it. I need every bug reported to me! If you do, please send me
   10.57 +the configuration files, the logs, the version, and a good description
   10.58 +on how to reproduce the error. The more bug reports I get, the better
   10.59 +masqmail will get!
   10.60 +
   10.61 +CREDITS:
   10.62 +--------
   10.63 +
   10.64 +I would like to thank everyone who has submitted suggestions and bug
   10.65 +reports. Special thanks to:
   10.66 +
   10.67 +Gregor Hoffleit for beta testing and his suggestions for delivering
   10.68 +mail immediately when online.
   10.69 +Gregor Hoffleit again for supplying a patch which made maqmail work with mutt.
   10.70 +And again for making the Debian package. And more patches.
   10.71 +
   10.72 +Dale Perkel for patiently trying to make MM compile and run with libc5 and
   10.73 +various bug reports.
   10.74 +
   10.75 +Andre Masloch for finding most bugs.
   10.76 +
   10.77 +Edouard G. Parmelan for many patches and bug reports
   10.78 +
   10.79 +Iain Lea for the Redhat spec file
   10.80 +
   10.81 +...and many others
   10.82 +--
   10.83 +Oliver Kurth <oku@masqmail.cx>
   10.84 +http://masqmail.cx/
   10.85 +last change: Feb. 3, 2000
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/TODO	Fri Sep 26 17:05:23 2008 +0200
    11.3 @@ -0,0 +1,21 @@
    11.4 +general:
    11.5 +- look carefully were memory is not freed
    11.6 +- add forwarding support
    11.7 +- improve Mailer-Daemon error messages
    11.8 +- ODMR support
    11.9 +- temporary delivery delay notifications
   11.10 +
   11.11 +conf:
   11.12 +- more configuration options
   11.13 +- make conf more fool proof
   11.14 +
   11.15 +pop:
   11.16 +- multidrop support
   11.17 +
   11.18 +lookup:
   11.19 +- optimize MX lookup
   11.20 +
   11.21 +...update this file from time to time...
   11.22 +
   11.23 +...and (you guessed it):
   11.24 +- bug fixing
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/acconfig.h	Fri Sep 26 17:05:23 2008 +0200
    12.3 @@ -0,0 +1,29 @@
    12.4 +#undef DEF_MAIL_GROUP
    12.5 +#undef DEF_MAIL_USER
    12.6 +
    12.7 +/* Define if you want to use lockfile library.  */
    12.8 +#undef USE_LIBLOCKFILE
    12.9 +
   12.10 +#undef ENABLE_DEBUG
   12.11 +
   12.12 +#undef ENABLE_RESOLVER
   12.13 +
   12.14 +#undef ENABLE_SMTP_SERVER
   12.15 +
   12.16 +#undef ENABLE_POP3
   12.17 +
   12.18 +#undef ENABLE_AUTH
   12.19 +
   12.20 +#undef ENABLE_MAILDIR
   12.21 +
   12.22 +#undef USE_LIB_CRYPTO
   12.23 +
   12.24 +#undef ENABLE_IDENT
   12.25 +
   12.26 +#undef ENABLE_MSERVER
   12.27 +
   12.28 +#undef CONF_DIR
   12.29 +
   12.30 +#undef DATA_DIR
   12.31 +
   12.32 +#undef SBINDIR
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/aclocal.m4	Fri Sep 26 17:05:23 2008 +0200
    13.3 @@ -0,0 +1,1018 @@
    13.4 +# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
    13.5 +
    13.6 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
    13.7 +# Free Software Foundation, Inc.
    13.8 +# This file is free software; the Free Software Foundation
    13.9 +# gives unlimited permission to copy and/or distribute it,
   13.10 +# with or without modifications, as long as this notice is preserved.
   13.11 +
   13.12 +# This program is distributed in the hope that it will be useful,
   13.13 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   13.14 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   13.15 +# PARTICULAR PURPOSE.
   13.16 +
   13.17 +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
   13.18 +
   13.19 +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
   13.20 +
   13.21 +# This program is free software; you can redistribute it and/or modify
   13.22 +# it under the terms of the GNU General Public License as published by
   13.23 +# the Free Software Foundation; either version 2, or (at your option)
   13.24 +# any later version.
   13.25 +
   13.26 +# This program is distributed in the hope that it will be useful,
   13.27 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.28 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13.29 +# GNU General Public License for more details.
   13.30 +
   13.31 +# You should have received a copy of the GNU General Public License
   13.32 +# along with this program; if not, write to the Free Software
   13.33 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   13.34 +# 02111-1307, USA.
   13.35 +
   13.36 +AC_PREREQ([2.52])
   13.37 +
   13.38 +# serial 6
   13.39 +
   13.40 +# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
   13.41 +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
   13.42 +
   13.43 +# Do all the work for Automake.                            -*- Autoconf -*-
   13.44 +
   13.45 +# This macro actually does too much some checks are only needed if
   13.46 +# your package does certain things.  But this isn't really a big deal.
   13.47 +
   13.48 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
   13.49 +# Free Software Foundation, Inc.
   13.50 +
   13.51 +# This program is free software; you can redistribute it and/or modify
   13.52 +# it under the terms of the GNU General Public License as published by
   13.53 +# the Free Software Foundation; either version 2, or (at your option)
   13.54 +# any later version.
   13.55 +
   13.56 +# This program is distributed in the hope that it will be useful,
   13.57 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.58 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13.59 +# GNU General Public License for more details.
   13.60 +
   13.61 +# You should have received a copy of the GNU General Public License
   13.62 +# along with this program; if not, write to the Free Software
   13.63 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   13.64 +# 02111-1307, USA.
   13.65 +
   13.66 +# serial 10
   13.67 +
   13.68 +AC_PREREQ([2.54])
   13.69 +
   13.70 +# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
   13.71 +# the ones we care about.
   13.72 +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
   13.73 +
   13.74 +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
   13.75 +# AM_INIT_AUTOMAKE([OPTIONS])
   13.76 +# -----------------------------------------------
   13.77 +# The call with PACKAGE and VERSION arguments is the old style
   13.78 +# call (pre autoconf-2.50), which is being phased out.  PACKAGE
   13.79 +# and VERSION should now be passed to AC_INIT and removed from
   13.80 +# the call to AM_INIT_AUTOMAKE.
   13.81 +# We support both call styles for the transition.  After
   13.82 +# the next Automake release, Autoconf can make the AC_INIT
   13.83 +# arguments mandatory, and then we can depend on a new Autoconf
   13.84 +# release and drop the old call support.
   13.85 +AC_DEFUN([AM_INIT_AUTOMAKE],
   13.86 +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
   13.87 + AC_REQUIRE([AC_PROG_INSTALL])dnl
   13.88 +# test to see if srcdir already configured
   13.89 +if test "`cd $srcdir && pwd`" != "`pwd`" &&
   13.90 +   test -f $srcdir/config.status; then
   13.91 +  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
   13.92 +fi
   13.93 +
   13.94 +# test whether we have cygpath
   13.95 +if test -z "$CYGPATH_W"; then
   13.96 +  if (cygpath --version) >/dev/null 2>/dev/null; then
   13.97 +    CYGPATH_W='cygpath -w'
   13.98 +  else
   13.99 +    CYGPATH_W=echo
  13.100 +  fi
  13.101 +fi
  13.102 +AC_SUBST([CYGPATH_W])
  13.103 +
  13.104 +# Define the identity of the package.
  13.105 +dnl Distinguish between old-style and new-style calls.
  13.106 +m4_ifval([$2],
  13.107 +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  13.108 + AC_SUBST([PACKAGE], [$1])dnl
  13.109 + AC_SUBST([VERSION], [$2])],
  13.110 +[_AM_SET_OPTIONS([$1])dnl
  13.111 + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  13.112 + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  13.113 +
  13.114 +_AM_IF_OPTION([no-define],,
  13.115 +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  13.116 + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
  13.117 +
  13.118 +# Some tools Automake needs.
  13.119 +AC_REQUIRE([AM_SANITY_CHECK])dnl
  13.120 +AC_REQUIRE([AC_ARG_PROGRAM])dnl
  13.121 +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
  13.122 +AM_MISSING_PROG(AUTOCONF, autoconf)
  13.123 +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
  13.124 +AM_MISSING_PROG(AUTOHEADER, autoheader)
  13.125 +AM_MISSING_PROG(MAKEINFO, makeinfo)
  13.126 +AM_MISSING_PROG(AMTAR, tar)
  13.127 +AM_PROG_INSTALL_SH
  13.128 +AM_PROG_INSTALL_STRIP
  13.129 +# We need awk for the "check" target.  The system "awk" is bad on
  13.130 +# some platforms.
  13.131 +AC_REQUIRE([AC_PROG_AWK])dnl
  13.132 +AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  13.133 +AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  13.134 +
  13.135 +_AM_IF_OPTION([no-dependencies],,
  13.136 +[AC_PROVIDE_IFELSE([AC_PROG_CC],
  13.137 +                  [_AM_DEPENDENCIES(CC)],
  13.138 +                  [define([AC_PROG_CC],
  13.139 +                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
  13.140 +AC_PROVIDE_IFELSE([AC_PROG_CXX],
  13.141 +                  [_AM_DEPENDENCIES(CXX)],
  13.142 +                  [define([AC_PROG_CXX],
  13.143 +                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
  13.144 +])
  13.145 +])
  13.146 +
  13.147 +
  13.148 +# When config.status generates a header, we must update the stamp-h file.
  13.149 +# This file resides in the same directory as the config header
  13.150 +# that is generated.  The stamp files are numbered to have different names.
  13.151 +
  13.152 +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  13.153 +# loop where config.status creates the headers, so we can generate
  13.154 +# our stamp files there.
  13.155 +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  13.156 +[# Compute $1's index in $config_headers.
  13.157 +_am_stamp_count=1
  13.158 +for _am_header in $config_headers :; do
  13.159 +  case $_am_header in
  13.160 +    $1 | $1:* )
  13.161 +      break ;;
  13.162 +    * )
  13.163 +      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  13.164 +  esac
  13.165 +done
  13.166 +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
  13.167 +
  13.168 +# Copyright 2002  Free Software Foundation, Inc.
  13.169 +
  13.170 +# This program is free software; you can redistribute it and/or modify
  13.171 +# it under the terms of the GNU General Public License as published by
  13.172 +# the Free Software Foundation; either version 2, or (at your option)
  13.173 +# any later version.
  13.174 +
  13.175 +# This program is distributed in the hope that it will be useful,
  13.176 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.177 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.178 +# GNU General Public License for more details.
  13.179 +
  13.180 +# You should have received a copy of the GNU General Public License
  13.181 +# along with this program; if not, write to the Free Software
  13.182 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.183 +
  13.184 +# AM_AUTOMAKE_VERSION(VERSION)
  13.185 +# ----------------------------
  13.186 +# Automake X.Y traces this macro to ensure aclocal.m4 has been
  13.187 +# generated from the m4 files accompanying Automake X.Y.
  13.188 +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
  13.189 +
  13.190 +# AM_SET_CURRENT_AUTOMAKE_VERSION
  13.191 +# -------------------------------
  13.192 +# Call AM_AUTOMAKE_VERSION so it can be traced.
  13.193 +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
  13.194 +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  13.195 +	 [AM_AUTOMAKE_VERSION([1.7.9])])
  13.196 +
  13.197 +# Helper functions for option handling.                    -*- Autoconf -*-
  13.198 +
  13.199 +# Copyright 2001, 2002  Free Software Foundation, Inc.
  13.200 +
  13.201 +# This program is free software; you can redistribute it and/or modify
  13.202 +# it under the terms of the GNU General Public License as published by
  13.203 +# the Free Software Foundation; either version 2, or (at your option)
  13.204 +# any later version.
  13.205 +
  13.206 +# This program is distributed in the hope that it will be useful,
  13.207 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.208 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.209 +# GNU General Public License for more details.
  13.210 +
  13.211 +# You should have received a copy of the GNU General Public License
  13.212 +# along with this program; if not, write to the Free Software
  13.213 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.214 +# 02111-1307, USA.
  13.215 +
  13.216 +# serial 2
  13.217 +
  13.218 +# _AM_MANGLE_OPTION(NAME)
  13.219 +# -----------------------
  13.220 +AC_DEFUN([_AM_MANGLE_OPTION],
  13.221 +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  13.222 +
  13.223 +# _AM_SET_OPTION(NAME)
  13.224 +# ------------------------------
  13.225 +# Set option NAME.  Presently that only means defining a flag for this option.
  13.226 +AC_DEFUN([_AM_SET_OPTION],
  13.227 +[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
  13.228 +
  13.229 +# _AM_SET_OPTIONS(OPTIONS)
  13.230 +# ----------------------------------
  13.231 +# OPTIONS is a space-separated list of Automake options.
  13.232 +AC_DEFUN([_AM_SET_OPTIONS],
  13.233 +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  13.234 +
  13.235 +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  13.236 +# -------------------------------------------
  13.237 +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  13.238 +AC_DEFUN([_AM_IF_OPTION],
  13.239 +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  13.240 +
  13.241 +#
  13.242 +# Check to make sure that the build environment is sane.
  13.243 +#
  13.244 +
  13.245 +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
  13.246 +
  13.247 +# This program is free software; you can redistribute it and/or modify
  13.248 +# it under the terms of the GNU General Public License as published by
  13.249 +# the Free Software Foundation; either version 2, or (at your option)
  13.250 +# any later version.
  13.251 +
  13.252 +# This program is distributed in the hope that it will be useful,
  13.253 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.254 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.255 +# GNU General Public License for more details.
  13.256 +
  13.257 +# You should have received a copy of the GNU General Public License
  13.258 +# along with this program; if not, write to the Free Software
  13.259 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.260 +# 02111-1307, USA.
  13.261 +
  13.262 +# serial 3
  13.263 +
  13.264 +# AM_SANITY_CHECK
  13.265 +# ---------------
  13.266 +AC_DEFUN([AM_SANITY_CHECK],
  13.267 +[AC_MSG_CHECKING([whether build environment is sane])
  13.268 +# Just in case
  13.269 +sleep 1
  13.270 +echo timestamp > conftest.file
  13.271 +# Do `set' in a subshell so we don't clobber the current shell's
  13.272 +# arguments.  Must try -L first in case configure is actually a
  13.273 +# symlink; some systems play weird games with the mod time of symlinks
  13.274 +# (eg FreeBSD returns the mod time of the symlink's containing
  13.275 +# directory).
  13.276 +if (
  13.277 +   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
  13.278 +   if test "$[*]" = "X"; then
  13.279 +      # -L didn't work.
  13.280 +      set X `ls -t $srcdir/configure conftest.file`
  13.281 +   fi
  13.282 +   rm -f conftest.file
  13.283 +   if test "$[*]" != "X $srcdir/configure conftest.file" \
  13.284 +      && test "$[*]" != "X conftest.file $srcdir/configure"; then
  13.285 +
  13.286 +      # If neither matched, then we have a broken ls.  This can happen
  13.287 +      # if, for instance, CONFIG_SHELL is bash and it inherits a
  13.288 +      # broken ls alias from the environment.  This has actually
  13.289 +      # happened.  Such a system could not be considered "sane".
  13.290 +      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
  13.291 +alias in your environment])
  13.292 +   fi
  13.293 +
  13.294 +   test "$[2]" = conftest.file
  13.295 +   )
  13.296 +then
  13.297 +   # Ok.
  13.298 +   :
  13.299 +else
  13.300 +   AC_MSG_ERROR([newly created file is older than distributed files!
  13.301 +Check your system clock])
  13.302 +fi
  13.303 +AC_MSG_RESULT(yes)])
  13.304 +
  13.305 +#  -*- Autoconf -*-
  13.306 +
  13.307 +
  13.308 +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
  13.309 +
  13.310 +# This program is free software; you can redistribute it and/or modify
  13.311 +# it under the terms of the GNU General Public License as published by
  13.312 +# the Free Software Foundation; either version 2, or (at your option)
  13.313 +# any later version.
  13.314 +
  13.315 +# This program is distributed in the hope that it will be useful,
  13.316 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.317 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.318 +# GNU General Public License for more details.
  13.319 +
  13.320 +# You should have received a copy of the GNU General Public License
  13.321 +# along with this program; if not, write to the Free Software
  13.322 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.323 +# 02111-1307, USA.
  13.324 +
  13.325 +# serial 3
  13.326 +
  13.327 +# AM_MISSING_PROG(NAME, PROGRAM)
  13.328 +# ------------------------------
  13.329 +AC_DEFUN([AM_MISSING_PROG],
  13.330 +[AC_REQUIRE([AM_MISSING_HAS_RUN])
  13.331 +$1=${$1-"${am_missing_run}$2"}
  13.332 +AC_SUBST($1)])
  13.333 +
  13.334 +
  13.335 +# AM_MISSING_HAS_RUN
  13.336 +# ------------------
  13.337 +# Define MISSING if not defined so far and test if it supports --run.
  13.338 +# If it does, set am_missing_run to use it, otherwise, to nothing.
  13.339 +AC_DEFUN([AM_MISSING_HAS_RUN],
  13.340 +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  13.341 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
  13.342 +# Use eval to expand $SHELL
  13.343 +if eval "$MISSING --run true"; then
  13.344 +  am_missing_run="$MISSING --run "
  13.345 +else
  13.346 +  am_missing_run=
  13.347 +  AC_MSG_WARN([`missing' script is too old or missing])
  13.348 +fi
  13.349 +])
  13.350 +
  13.351 +# AM_AUX_DIR_EXPAND
  13.352 +
  13.353 +# Copyright 2001 Free Software Foundation, Inc.
  13.354 +
  13.355 +# This program is free software; you can redistribute it and/or modify
  13.356 +# it under the terms of the GNU General Public License as published by
  13.357 +# the Free Software Foundation; either version 2, or (at your option)
  13.358 +# any later version.
  13.359 +
  13.360 +# This program is distributed in the hope that it will be useful,
  13.361 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.362 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.363 +# GNU General Public License for more details.
  13.364 +
  13.365 +# You should have received a copy of the GNU General Public License
  13.366 +# along with this program; if not, write to the Free Software
  13.367 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.368 +# 02111-1307, USA.
  13.369 +
  13.370 +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  13.371 +# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
  13.372 +# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
  13.373 +#
  13.374 +# Of course, Automake must honor this variable whenever it calls a
  13.375 +# tool from the auxiliary directory.  The problem is that $srcdir (and
  13.376 +# therefore $ac_aux_dir as well) can be either absolute or relative,
  13.377 +# depending on how configure is run.  This is pretty annoying, since
  13.378 +# it makes $ac_aux_dir quite unusable in subdirectories: in the top
  13.379 +# source directory, any form will work fine, but in subdirectories a
  13.380 +# relative path needs to be adjusted first.
  13.381 +#
  13.382 +# $ac_aux_dir/missing
  13.383 +#    fails when called from a subdirectory if $ac_aux_dir is relative
  13.384 +# $top_srcdir/$ac_aux_dir/missing
  13.385 +#    fails if $ac_aux_dir is absolute,
  13.386 +#    fails when called from a subdirectory in a VPATH build with
  13.387 +#          a relative $ac_aux_dir
  13.388 +#
  13.389 +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  13.390 +# are both prefixed by $srcdir.  In an in-source build this is usually
  13.391 +# harmless because $srcdir is `.', but things will broke when you
  13.392 +# start a VPATH build or use an absolute $srcdir.
  13.393 +#
  13.394 +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  13.395 +# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
  13.396 +#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  13.397 +# and then we would define $MISSING as
  13.398 +#   MISSING="\${SHELL} $am_aux_dir/missing"
  13.399 +# This will work as long as MISSING is not called from configure, because
  13.400 +# unfortunately $(top_srcdir) has no meaning in configure.
  13.401 +# However there are other variables, like CC, which are often used in
  13.402 +# configure, and could therefore not use this "fixed" $ac_aux_dir.
  13.403 +#
  13.404 +# Another solution, used here, is to always expand $ac_aux_dir to an
  13.405 +# absolute PATH.  The drawback is that using absolute paths prevent a
  13.406 +# configured tree to be moved without reconfiguration.
  13.407 +
  13.408 +# Rely on autoconf to set up CDPATH properly.
  13.409 +AC_PREREQ([2.50])
  13.410 +
  13.411 +AC_DEFUN([AM_AUX_DIR_EXPAND], [
  13.412 +# expand $ac_aux_dir to an absolute path
  13.413 +am_aux_dir=`cd $ac_aux_dir && pwd`
  13.414 +])
  13.415 +
  13.416 +# AM_PROG_INSTALL_SH
  13.417 +# ------------------
  13.418 +# Define $install_sh.
  13.419 +
  13.420 +# Copyright 2001 Free Software Foundation, Inc.
  13.421 +
  13.422 +# This program is free software; you can redistribute it and/or modify
  13.423 +# it under the terms of the GNU General Public License as published by
  13.424 +# the Free Software Foundation; either version 2, or (at your option)
  13.425 +# any later version.
  13.426 +
  13.427 +# This program is distributed in the hope that it will be useful,
  13.428 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.429 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.430 +# GNU General Public License for more details.
  13.431 +
  13.432 +# You should have received a copy of the GNU General Public License
  13.433 +# along with this program; if not, write to the Free Software
  13.434 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.435 +# 02111-1307, USA.
  13.436 +
  13.437 +AC_DEFUN([AM_PROG_INSTALL_SH],
  13.438 +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  13.439 +install_sh=${install_sh-"$am_aux_dir/install-sh"}
  13.440 +AC_SUBST(install_sh)])
  13.441 +
  13.442 +# AM_PROG_INSTALL_STRIP
  13.443 +
  13.444 +# Copyright 2001 Free Software Foundation, Inc.
  13.445 +
  13.446 +# This program is free software; you can redistribute it and/or modify
  13.447 +# it under the terms of the GNU General Public License as published by
  13.448 +# the Free Software Foundation; either version 2, or (at your option)
  13.449 +# any later version.
  13.450 +
  13.451 +# This program is distributed in the hope that it will be useful,
  13.452 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.453 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.454 +# GNU General Public License for more details.
  13.455 +
  13.456 +# You should have received a copy of the GNU General Public License
  13.457 +# along with this program; if not, write to the Free Software
  13.458 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.459 +# 02111-1307, USA.
  13.460 +
  13.461 +# One issue with vendor `install' (even GNU) is that you can't
  13.462 +# specify the program used to strip binaries.  This is especially
  13.463 +# annoying in cross-compiling environments, where the build's strip
  13.464 +# is unlikely to handle the host's binaries.
  13.465 +# Fortunately install-sh will honor a STRIPPROG variable, so we
  13.466 +# always use install-sh in `make install-strip', and initialize
  13.467 +# STRIPPROG with the value of the STRIP variable (set by the user).
  13.468 +AC_DEFUN([AM_PROG_INSTALL_STRIP],
  13.469 +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  13.470 +# Installed binaries are usually stripped using `strip' when the user
  13.471 +# run `make install-strip'.  However `strip' might not be the right
  13.472 +# tool to use in cross-compilation environments, therefore Automake
  13.473 +# will honor the `STRIP' environment variable to overrule this program.
  13.474 +dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
  13.475 +if test "$cross_compiling" != no; then
  13.476 +  AC_CHECK_TOOL([STRIP], [strip], :)
  13.477 +fi
  13.478 +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
  13.479 +AC_SUBST([INSTALL_STRIP_PROGRAM])])
  13.480 +
  13.481 +#                                                          -*- Autoconf -*-
  13.482 +# Copyright (C) 2003  Free Software Foundation, Inc.
  13.483 +
  13.484 +# This program is free software; you can redistribute it and/or modify
  13.485 +# it under the terms of the GNU General Public License as published by
  13.486 +# the Free Software Foundation; either version 2, or (at your option)
  13.487 +# any later version.
  13.488 +
  13.489 +# This program is distributed in the hope that it will be useful,
  13.490 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.491 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.492 +# GNU General Public License for more details.
  13.493 +
  13.494 +# You should have received a copy of the GNU General Public License
  13.495 +# along with this program; if not, write to the Free Software
  13.496 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.497 +# 02111-1307, USA.
  13.498 +
  13.499 +# serial 1
  13.500 +
  13.501 +# Check whether the underlying file-system supports filenames
  13.502 +# with a leading dot.  For instance MS-DOS doesn't.
  13.503 +AC_DEFUN([AM_SET_LEADING_DOT],
  13.504 +[rm -rf .tst 2>/dev/null
  13.505 +mkdir .tst 2>/dev/null
  13.506 +if test -d .tst; then
  13.507 +  am__leading_dot=.
  13.508 +else
  13.509 +  am__leading_dot=_
  13.510 +fi
  13.511 +rmdir .tst 2>/dev/null
  13.512 +AC_SUBST([am__leading_dot])])
  13.513 +
  13.514 +# serial 5						-*- Autoconf -*-
  13.515 +
  13.516 +# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
  13.517 +
  13.518 +# This program is free software; you can redistribute it and/or modify
  13.519 +# it under the terms of the GNU General Public License as published by
  13.520 +# the Free Software Foundation; either version 2, or (at your option)
  13.521 +# any later version.
  13.522 +
  13.523 +# This program is distributed in the hope that it will be useful,
  13.524 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.525 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.526 +# GNU General Public License for more details.
  13.527 +
  13.528 +# You should have received a copy of the GNU General Public License
  13.529 +# along with this program; if not, write to the Free Software
  13.530 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.531 +# 02111-1307, USA.
  13.532 +
  13.533 +
  13.534 +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  13.535 +# written in clear, in which case automake, when reading aclocal.m4,
  13.536 +# will think it sees a *use*, and therefore will trigger all it's
  13.537 +# C support machinery.  Also note that it means that autoscan, seeing
  13.538 +# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  13.539 +
  13.540 +
  13.541 +
  13.542 +# _AM_DEPENDENCIES(NAME)
  13.543 +# ----------------------
  13.544 +# See how the compiler implements dependency checking.
  13.545 +# NAME is "CC", "CXX", "GCJ", or "OBJC".
  13.546 +# We try a few techniques and use that to set a single cache variable.
  13.547 +#
  13.548 +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  13.549 +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  13.550 +# dependency, and given that the user is not expected to run this macro,
  13.551 +# just rely on AC_PROG_CC.
  13.552 +AC_DEFUN([_AM_DEPENDENCIES],
  13.553 +[AC_REQUIRE([AM_SET_DEPDIR])dnl
  13.554 +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  13.555 +AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  13.556 +AC_REQUIRE([AM_DEP_TRACK])dnl
  13.557 +
  13.558 +ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
  13.559 +       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
  13.560 +       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  13.561 +       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
  13.562 +                   [depcc="$$1"   am_compiler_list=])
  13.563 +
  13.564 +AC_CACHE_CHECK([dependency style of $depcc],
  13.565 +               [am_cv_$1_dependencies_compiler_type],
  13.566 +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  13.567 +  # We make a subdir and do the tests there.  Otherwise we can end up
  13.568 +  # making bogus files that we don't know about and never remove.  For
  13.569 +  # instance it was reported that on HP-UX the gcc test will end up
  13.570 +  # making a dummy file named `D' -- because `-MD' means `put the output
  13.571 +  # in D'.
  13.572 +  mkdir conftest.dir
  13.573 +  # Copy depcomp to subdir because otherwise we won't find it if we're
  13.574 +  # using a relative directory.
  13.575 +  cp "$am_depcomp" conftest.dir
  13.576 +  cd conftest.dir
  13.577 +  # We will build objects and dependencies in a subdirectory because
  13.578 +  # it helps to detect inapplicable dependency modes.  For instance
  13.579 +  # both Tru64's cc and ICC support -MD to output dependencies as a
  13.580 +  # side effect of compilation, but ICC will put the dependencies in
  13.581 +  # the current directory while Tru64 will put them in the object
  13.582 +  # directory.
  13.583 +  mkdir sub
  13.584 +
  13.585 +  am_cv_$1_dependencies_compiler_type=none
  13.586 +  if test "$am_compiler_list" = ""; then
  13.587 +     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  13.588 +  fi
  13.589 +  for depmode in $am_compiler_list; do
  13.590 +    # Setup a source with many dependencies, because some compilers
  13.591 +    # like to wrap large dependency lists on column 80 (with \), and
  13.592 +    # we should not choose a depcomp mode which is confused by this.
  13.593 +    #
  13.594 +    # We need to recreate these files for each test, as the compiler may
  13.595 +    # overwrite some of them when testing with obscure command lines.
  13.596 +    # This happens at least with the AIX C compiler.
  13.597 +    : > sub/conftest.c
  13.598 +    for i in 1 2 3 4 5 6; do
  13.599 +      echo '#include "conftst'$i'.h"' >> sub/conftest.c
  13.600 +      : > sub/conftst$i.h
  13.601 +    done
  13.602 +    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  13.603 +
  13.604 +    case $depmode in
  13.605 +    nosideeffect)
  13.606 +      # after this tag, mechanisms are not by side-effect, so they'll
  13.607 +      # only be used when explicitly requested
  13.608 +      if test "x$enable_dependency_tracking" = xyes; then
  13.609 +	continue
  13.610 +      else
  13.611 +	break
  13.612 +      fi
  13.613 +      ;;
  13.614 +    none) break ;;
  13.615 +    esac
  13.616 +    # We check with `-c' and `-o' for the sake of the "dashmstdout"
  13.617 +    # mode.  It turns out that the SunPro C++ compiler does not properly
  13.618 +    # handle `-M -o', and we need to detect this.
  13.619 +    if depmode=$depmode \
  13.620 +       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
  13.621 +       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  13.622 +       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
  13.623 +         >/dev/null 2>conftest.err &&
  13.624 +       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  13.625 +       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
  13.626 +       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  13.627 +      # icc doesn't choke on unknown options, it will just issue warnings
  13.628 +      # (even with -Werror).  So we grep stderr for any message
  13.629 +      # that says an option was ignored.
  13.630 +      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
  13.631 +        am_cv_$1_dependencies_compiler_type=$depmode
  13.632 +        break
  13.633 +      fi
  13.634 +    fi
  13.635 +  done
  13.636 +
  13.637 +  cd ..
  13.638 +  rm -rf conftest.dir
  13.639 +else
  13.640 +  am_cv_$1_dependencies_compiler_type=none
  13.641 +fi
  13.642 +])
  13.643 +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  13.644 +AM_CONDITIONAL([am__fastdep$1], [
  13.645 +  test "x$enable_dependency_tracking" != xno \
  13.646 +  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  13.647 +])
  13.648 +
  13.649 +
  13.650 +# AM_SET_DEPDIR
  13.651 +# -------------
  13.652 +# Choose a directory name for dependency files.
  13.653 +# This macro is AC_REQUIREd in _AM_DEPENDENCIES
  13.654 +AC_DEFUN([AM_SET_DEPDIR],
  13.655 +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  13.656 +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  13.657 +])
  13.658 +
  13.659 +
  13.660 +# AM_DEP_TRACK
  13.661 +# ------------
  13.662 +AC_DEFUN([AM_DEP_TRACK],
  13.663 +[AC_ARG_ENABLE(dependency-tracking,
  13.664 +[  --disable-dependency-tracking Speeds up one-time builds
  13.665 +  --enable-dependency-tracking  Do not reject slow dependency extractors])
  13.666 +if test "x$enable_dependency_tracking" != xno; then
  13.667 +  am_depcomp="$ac_aux_dir/depcomp"
  13.668 +  AMDEPBACKSLASH='\'
  13.669 +fi
  13.670 +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  13.671 +AC_SUBST([AMDEPBACKSLASH])
  13.672 +])
  13.673 +
  13.674 +# Generate code to set up dependency tracking.   -*- Autoconf -*-
  13.675 +
  13.676 +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
  13.677 +
  13.678 +# This program is free software; you can redistribute it and/or modify
  13.679 +# it under the terms of the GNU General Public License as published by
  13.680 +# the Free Software Foundation; either version 2, or (at your option)
  13.681 +# any later version.
  13.682 +
  13.683 +# This program is distributed in the hope that it will be useful,
  13.684 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.685 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.686 +# GNU General Public License for more details.
  13.687 +
  13.688 +# You should have received a copy of the GNU General Public License
  13.689 +# along with this program; if not, write to the Free Software
  13.690 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.691 +# 02111-1307, USA.
  13.692 +
  13.693 +#serial 2
  13.694 +
  13.695 +# _AM_OUTPUT_DEPENDENCY_COMMANDS
  13.696 +# ------------------------------
  13.697 +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  13.698 +[for mf in $CONFIG_FILES; do
  13.699 +  # Strip MF so we end up with the name of the file.
  13.700 +  mf=`echo "$mf" | sed -e 's/:.*$//'`
  13.701 +  # Check whether this is an Automake generated Makefile or not.
  13.702 +  # We used to match only the files named `Makefile.in', but
  13.703 +  # some people rename them; so instead we look at the file content.
  13.704 +  # Grep'ing the first line is not enough: some people post-process
  13.705 +  # each Makefile.in and add a new line on top of each file to say so.
  13.706 +  # So let's grep whole file.
  13.707 +  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
  13.708 +    dirpart=`AS_DIRNAME("$mf")`
  13.709 +  else
  13.710 +    continue
  13.711 +  fi
  13.712 +  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
  13.713 +  # Extract the definition of DEP_FILES from the Makefile without
  13.714 +  # running `make'.
  13.715 +  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
  13.716 +  test -z "$DEPDIR" && continue
  13.717 +  # When using ansi2knr, U may be empty or an underscore; expand it
  13.718 +  U=`sed -n -e '/^U = / s///p' < "$mf"`
  13.719 +  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
  13.720 +  # We invoke sed twice because it is the simplest approach to
  13.721 +  # changing $(DEPDIR) to its actual value in the expansion.
  13.722 +  for file in `sed -n -e '
  13.723 +    /^DEP_FILES = .*\\\\$/ {
  13.724 +      s/^DEP_FILES = //
  13.725 +      :loop
  13.726 +	s/\\\\$//
  13.727 +	p
  13.728 +	n
  13.729 +	/\\\\$/ b loop
  13.730 +      p
  13.731 +    }
  13.732 +    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
  13.733 +       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
  13.734 +    # Make sure the directory exists.
  13.735 +    test -f "$dirpart/$file" && continue
  13.736 +    fdir=`AS_DIRNAME(["$file"])`
  13.737 +    AS_MKDIR_P([$dirpart/$fdir])
  13.738 +    # echo "creating $dirpart/$file"
  13.739 +    echo '# dummy' > "$dirpart/$file"
  13.740 +  done
  13.741 +done
  13.742 +])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  13.743 +
  13.744 +
  13.745 +# AM_OUTPUT_DEPENDENCY_COMMANDS
  13.746 +# -----------------------------
  13.747 +# This macro should only be invoked once -- use via AC_REQUIRE.
  13.748 +#
  13.749 +# This code is only required when automatic dependency tracking
  13.750 +# is enabled.  FIXME.  This creates each `.P' file that we will
  13.751 +# need in order to bootstrap the dependency handling code.
  13.752 +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  13.753 +[AC_CONFIG_COMMANDS([depfiles],
  13.754 +     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  13.755 +     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  13.756 +])
  13.757 +
  13.758 +# Check to see how 'make' treats includes.	-*- Autoconf -*-
  13.759 +
  13.760 +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  13.761 +
  13.762 +# This program is free software; you can redistribute it and/or modify
  13.763 +# it under the terms of the GNU General Public License as published by
  13.764 +# the Free Software Foundation; either version 2, or (at your option)
  13.765 +# any later version.
  13.766 +
  13.767 +# This program is distributed in the hope that it will be useful,
  13.768 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.769 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.770 +# GNU General Public License for more details.
  13.771 +
  13.772 +# You should have received a copy of the GNU General Public License
  13.773 +# along with this program; if not, write to the Free Software
  13.774 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.775 +# 02111-1307, USA.
  13.776 +
  13.777 +# serial 2
  13.778 +
  13.779 +# AM_MAKE_INCLUDE()
  13.780 +# -----------------
  13.781 +# Check to see how make treats includes.
  13.782 +AC_DEFUN([AM_MAKE_INCLUDE],
  13.783 +[am_make=${MAKE-make}
  13.784 +cat > confinc << 'END'
  13.785 +am__doit:
  13.786 +	@echo done
  13.787 +.PHONY: am__doit
  13.788 +END
  13.789 +# If we don't find an include directive, just comment out the code.
  13.790 +AC_MSG_CHECKING([for style of include used by $am_make])
  13.791 +am__include="#"
  13.792 +am__quote=
  13.793 +_am_result=none
  13.794 +# First try GNU make style include.
  13.795 +echo "include confinc" > confmf
  13.796 +# We grep out `Entering directory' and `Leaving directory'
  13.797 +# messages which can occur if `w' ends up in MAKEFLAGS.
  13.798 +# In particular we don't look at `^make:' because GNU make might
  13.799 +# be invoked under some other name (usually "gmake"), in which
  13.800 +# case it prints its new name instead of `make'.
  13.801 +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
  13.802 +   am__include=include
  13.803 +   am__quote=
  13.804 +   _am_result=GNU
  13.805 +fi
  13.806 +# Now try BSD make style include.
  13.807 +if test "$am__include" = "#"; then
  13.808 +   echo '.include "confinc"' > confmf
  13.809 +   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
  13.810 +      am__include=.include
  13.811 +      am__quote="\""
  13.812 +      _am_result=BSD
  13.813 +   fi
  13.814 +fi
  13.815 +AC_SUBST([am__include])
  13.816 +AC_SUBST([am__quote])
  13.817 +AC_MSG_RESULT([$_am_result])
  13.818 +rm -f confinc confmf
  13.819 +])
  13.820 +
  13.821 +# AM_CONDITIONAL                                              -*- Autoconf -*-
  13.822 +
  13.823 +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
  13.824 +
  13.825 +# This program is free software; you can redistribute it and/or modify
  13.826 +# it under the terms of the GNU General Public License as published by
  13.827 +# the Free Software Foundation; either version 2, or (at your option)
  13.828 +# any later version.
  13.829 +
  13.830 +# This program is distributed in the hope that it will be useful,
  13.831 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.832 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.833 +# GNU General Public License for more details.
  13.834 +
  13.835 +# You should have received a copy of the GNU General Public License
  13.836 +# along with this program; if not, write to the Free Software
  13.837 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  13.838 +# 02111-1307, USA.
  13.839 +
  13.840 +# serial 5
  13.841 +
  13.842 +AC_PREREQ(2.52)
  13.843 +
  13.844 +# AM_CONDITIONAL(NAME, SHELL-CONDITION)
  13.845 +# -------------------------------------
  13.846 +# Define a conditional.
  13.847 +AC_DEFUN([AM_CONDITIONAL],
  13.848 +[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
  13.849 +        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  13.850 +AC_SUBST([$1_TRUE])
  13.851 +AC_SUBST([$1_FALSE])
  13.852 +if $2; then
  13.853 +  $1_TRUE=
  13.854 +  $1_FALSE='#'
  13.855 +else
  13.856 +  $1_TRUE='#'
  13.857 +  $1_FALSE=
  13.858 +fi
  13.859 +AC_CONFIG_COMMANDS_PRE(
  13.860 +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  13.861 +  AC_MSG_ERROR([conditional "$1" was never defined.
  13.862 +Usually this means the macro was only invoked conditionally.])
  13.863 +fi])])
  13.864 +
  13.865 +# isc-posix.m4 serial 2 (gettext-0.11.2)
  13.866 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
  13.867 +dnl This file is free software; the Free Software Foundation
  13.868 +dnl gives unlimited permission to copy and/or distribute it,
  13.869 +dnl with or without modifications, as long as this notice is preserved.
  13.870 +
  13.871 +# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
  13.872 +
  13.873 +# This test replaces the one in autoconf.
  13.874 +# Currently this macro should have the same name as the autoconf macro
  13.875 +# because gettext's gettext.m4 (distributed in the automake package)
  13.876 +# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
  13.877 +# give these diagnostics:
  13.878 +#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
  13.879 +#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
  13.880 +
  13.881 +undefine([AC_ISC_POSIX])
  13.882 +
  13.883 +AC_DEFUN([AC_ISC_POSIX],
  13.884 +  [
  13.885 +    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
  13.886 +    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
  13.887 +  ]
  13.888 +)
  13.889 +
  13.890 +# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
  13.891 +# 
  13.892 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  13.893 +#
  13.894 +# This program is free software; you can redistribute it and/or modify
  13.895 +# it under the terms of the GNU General Public License as published by
  13.896 +# the Free Software Foundation; either version 2 of the License, or
  13.897 +# (at your option) any later version.
  13.898 +#
  13.899 +# This program is distributed in the hope that it will be useful, but
  13.900 +# WITHOUT ANY WARRANTY; without even the implied warranty of
  13.901 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.902 +# General Public License for more details.
  13.903 +#
  13.904 +# You should have received a copy of the GNU General Public License
  13.905 +# along with this program; if not, write to the Free Software
  13.906 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  13.907 +#
  13.908 +# As a special exception to the GNU General Public License, if you
  13.909 +# distribute this file as part of a program that contains a
  13.910 +# configuration script generated by Autoconf, you may include it under
  13.911 +# the same distribution terms that you use for the rest of that program.
  13.912 +
  13.913 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])
  13.914 +# ----------------------------------
  13.915 +AC_DEFUN([PKG_PROG_PKG_CONFIG],
  13.916 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  13.917 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
  13.918 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
  13.919 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  13.920 +	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  13.921 +fi
  13.922 +if test -n "$PKG_CONFIG"; then
  13.923 +	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
  13.924 +	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  13.925 +	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  13.926 +		AC_MSG_RESULT([yes])
  13.927 +	else
  13.928 +		AC_MSG_RESULT([no])
  13.929 +		PKG_CONFIG=""
  13.930 +	fi
  13.931 +		
  13.932 +fi[]dnl
  13.933 +])# PKG_PROG_PKG_CONFIG
  13.934 +
  13.935 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  13.936 +#
  13.937 +# Check to see whether a particular set of modules exists.  Similar
  13.938 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.
  13.939 +#
  13.940 +#
  13.941 +# Similar to PKG_CHECK_MODULES, make sure that the first instance of
  13.942 +# this or PKG_CHECK_MODULES is called, or make sure to call
  13.943 +# PKG_CHECK_EXISTS manually
  13.944 +# --------------------------------------------------------------
  13.945 +AC_DEFUN([PKG_CHECK_EXISTS],
  13.946 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  13.947 +if test -n "$PKG_CONFIG" && \
  13.948 +    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  13.949 +  m4_ifval([$2], [$2], [:])
  13.950 +m4_ifvaln([$3], [else
  13.951 +  $3])dnl
  13.952 +fi])
  13.953 +
  13.954 +
  13.955 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  13.956 +# ---------------------------------------------
  13.957 +m4_define([_PKG_CONFIG],
  13.958 +[if test -n "$PKG_CONFIG"; then
  13.959 +        PKG_CHECK_EXISTS([$3],
  13.960 +                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
  13.961 +			 [pkg_failed=yes])
  13.962 +else
  13.963 +	pkg_failed=untried
  13.964 +fi[]dnl
  13.965 +])# _PKG_CONFIG
  13.966 +
  13.967 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  13.968 +# [ACTION-IF-NOT-FOUND])
  13.969 +#
  13.970 +#
  13.971 +# Note that if there is a possibility the first call to
  13.972 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
  13.973 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  13.974 +#
  13.975 +#
  13.976 +# --------------------------------------------------------------
  13.977 +AC_DEFUN([PKG_CHECK_MODULES],
  13.978 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  13.979 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  13.980 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  13.981 +
  13.982 +pkg_failed=no
  13.983 +AC_MSG_CHECKING([for $1])
  13.984 +
  13.985 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  13.986 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
  13.987 +
  13.988 +if test $pkg_failed = yes; then
  13.989 +	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
  13.990 +	# Put the nasty error message in config.log where it belongs
  13.991 +	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
  13.992 +
  13.993 +	ifelse([$4], , [AC_MSG_ERROR(dnl
  13.994 +[Package requirements ($2) were not met.
  13.995 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
  13.996 +installed software in a non-standard prefix.
  13.997 +
  13.998 +Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
  13.999 +to avoid the need to call pkg-config.  See the pkg-config man page for
 13.1000 +more details.])],
 13.1001 +		[$4])
 13.1002 +elif test $pkg_failed = untried; then
 13.1003 +	ifelse([$4], , [AC_MSG_FAILURE(dnl
 13.1004 +[The pkg-config script could not be found or is too old.  Make sure it
 13.1005 +is in your PATH or set the PKG_CONFIG environment variable to the full
 13.1006 +path to pkg-config.
 13.1007 +
 13.1008 +Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
 13.1009 +to avoid the need to call pkg-config.  See the pkg-config man page for
 13.1010 +more details.
 13.1011 +
 13.1012 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
 13.1013 +		[$4])
 13.1014 +else
 13.1015 +	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 13.1016 +	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 13.1017 +        AC_MSG_RESULT([yes])
 13.1018 +	ifelse([$3], , :, [$3])
 13.1019 +fi[]dnl
 13.1020 +])# PKG_CHECK_MODULES
 13.1021 +
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/agenda-config.site	Fri Sep 26 17:05:23 2008 +0200
    14.3 @@ -0,0 +1,71 @@
    14.4 +# config.site for configure
    14.5 +# Agenda Vr3 TARGET
    14.6 +
    14.7 +# You could put this file to /usr/local/mipsel-linux/etc/agenda-config.site
    14.8 +
    14.9 +# run with
   14.10 +#   CONFIG_SITE=/wherever/you/store/it/agenda-config.site ./configure
   14.11 +# or
   14.12 +#   export CONFIG_SITE=/wherever/you/store/it/agenda-config.site
   14.13 +# if this is going to be a whole compilation orgy
   14.14 +
   14.15 +# Modified from the one provided by Bradley D. LaRonde
   14.16 +
   14.17 +# Edited by Andrej Cedilnik <acedil1@csee.umbc.edu>
   14.18 +
   14.19 +# Used some of solutions by Tilman Vogel <Tilman.Vogel@web.de>
   14.20 +
   14.21 +HOSTCC=gcc
   14.22 +
   14.23 +# Names of the cross-compilers
   14.24 +CC=mipsel-linux-gcc
   14.25 +CXX=mipsel-linux-gcc
   14.26 +
   14.27 +# The cross compiler specific options
   14.28 +CFLAGS="-s -mips2 -O2 -fno-exceptions"
   14.29 +CXXFLAGS="-s -mips2 -O2 -fno-exceptions -I/usr/mipsel-linux/include/g++"
   14.30 +CPPFLAGS="-s -mips2 -O2 -fno-exceptions -I/usr/mipsel-linux/include/g++"
   14.31 +LDFLAGS="-s -mips2"
   14.32 +
   14.33 +# Some other programs
   14.34 +AR=mipsel-linux-ar
   14.35 +RANLIB=mipsel-linux-ranlib
   14.36 +NM=mipsel-linux-nm
   14.37 +ac_cv_path_NM=mipsel-linux-nm
   14.38 +ac_cv_func_setpgrp_void=yes
   14.39 +host=mipsel-linux
   14.40 +#prefix=/usr/mipsel-linux
   14.41 +x_includes=/usr/mipsel-linux/include
   14.42 +x_libraries=/usr/mipsel-linux/X11R6/lib
   14.43 +
   14.44 +# These are for GNU shellutils
   14.45 +jm_cv_have_proc_uptime=yes
   14.46 +jm_cv_func_working_gnu_strftime=yes
   14.47 +
   14.48 +# Some options for ease of compiling python 
   14.49 +ac_cv_sizeof_int=4
   14.50 +ac_cv_sizeof_char=1
   14.51 +ac_cv_sizeof_short=2
   14.52 +ac_cv_sizeof_float=4
   14.53 +ac_cv_sizeof_double=8
   14.54 +ac_cv_sizeof_pthread_t=4
   14.55 +ac_cv_sizeof_long=4
   14.56 +ac_cv_sizeof_void_p=4
   14.57 +ac_cv_sizeof_long_long=8
   14.58 +ac_cv_sizeof_off_t=4
   14.59 +ac_cv_sizeof_fpos_t=4
   14.60 +ac_cv_sizeof_time_t=4
   14.61 +
   14.62 +# Some other stuff nobody knows why
   14.63 +bad_forward=no
   14.64 +LDSHARED='mipsel-linux-gcc -msoft-float -shared'
   14.65 +ac_cv_malloc_zero=nonnull
   14.66 +
   14.67 +# squeak wants this
   14.68 +# can't do misaligned access to doubles
   14.69 +ac_cv_double_align=no
   14.70 +# dunno what order doubles are in
   14.71 +ac_cv_double_order=no
   14.72 +
   14.73 +ac_cv_header_wchar_h=no
   14.74 +
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/config.guess	Fri Sep 26 17:05:23 2008 +0200
    15.3 @@ -0,0 +1,1466 @@
    15.4 +#! /bin/sh
    15.5 +# Attempt to guess a canonical system name.
    15.6 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    15.7 +#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    15.8 +
    15.9 +timestamp='2005-08-03'
   15.10 +
   15.11 +# This file is free software; you can redistribute it and/or modify it
   15.12 +# under the terms of the GNU General Public License as published by
   15.13 +# the Free Software Foundation; either version 2 of the License, or
   15.14 +# (at your option) any later version.
   15.15 +#
   15.16 +# This program is distributed in the hope that it will be useful, but
   15.17 +# WITHOUT ANY WARRANTY; without even the implied warranty of
   15.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15.19 +# General Public License for more details.
   15.20 +#
   15.21 +# You should have received a copy of the GNU General Public License
   15.22 +# along with this program; if not, write to the Free Software
   15.23 +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
   15.24 +# 02110-1301, USA.
   15.25 +#
   15.26 +# As a special exception to the GNU General Public License, if you
   15.27 +# distribute this file as part of a program that contains a
   15.28 +# configuration script generated by Autoconf, you may include it under
   15.29 +# the same distribution terms that you use for the rest of that program.
   15.30 +
   15.31 +
   15.32 +# Originally written by Per Bothner <per@bothner.com>.
   15.33 +# Please send patches to <config-patches@gnu.org>.  Submit a context
   15.34 +# diff and a properly formatted ChangeLog entry.
   15.35 +#
   15.36 +# This script attempts to guess a canonical system name similar to
   15.37 +# config.sub.  If it succeeds, it prints the system name on stdout, and
   15.38 +# exits with 0.  Otherwise, it exits with 1.
   15.39 +#
   15.40 +# The plan is that this can be called by configure scripts if you
   15.41 +# don't specify an explicit build system type.
   15.42 +
   15.43 +me=`echo "$0" | sed -e 's,.*/,,'`
   15.44 +
   15.45 +usage="\
   15.46 +Usage: $0 [OPTION]
   15.47 +
   15.48 +Output the configuration name of the system \`$me' is run on.
   15.49 +
   15.50 +Operation modes:
   15.51 +  -h, --help         print this help, then exit
   15.52 +  -t, --time-stamp   print date of last modification, then exit
   15.53 +  -v, --version      print version number, then exit
   15.54 +
   15.55 +Report bugs and patches to <config-patches@gnu.org>."
   15.56 +
   15.57 +version="\
   15.58 +GNU config.guess ($timestamp)
   15.59 +
   15.60 +Originally written by Per Bothner.
   15.61 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
   15.62 +Free Software Foundation, Inc.
   15.63 +
   15.64 +This is free software; see the source for copying conditions.  There is NO
   15.65 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   15.66 +
   15.67 +help="
   15.68 +Try \`$me --help' for more information."
   15.69 +
   15.70 +# Parse command line
   15.71 +while test $# -gt 0 ; do
   15.72 +  case $1 in
   15.73 +    --time-stamp | --time* | -t )
   15.74 +       echo "$timestamp" ; exit ;;
   15.75 +    --version | -v )
   15.76 +       echo "$version" ; exit ;;
   15.77 +    --help | --h* | -h )
   15.78 +       echo "$usage"; exit ;;
   15.79 +    -- )     # Stop option processing
   15.80 +       shift; break ;;
   15.81 +    - )	# Use stdin as input.
   15.82 +       break ;;
   15.83 +    -* )
   15.84 +       echo "$me: invalid option $1$help" >&2
   15.85 +       exit 1 ;;
   15.86 +    * )
   15.87 +       break ;;
   15.88 +  esac
   15.89 +done
   15.90 +
   15.91 +if test $# != 0; then
   15.92 +  echo "$me: too many arguments$help" >&2
   15.93 +  exit 1
   15.94 +fi
   15.95 +
   15.96 +trap 'exit 1' 1 2 15
   15.97 +
   15.98 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
   15.99 +# compiler to aid in system detection is discouraged as it requires
  15.100 +# temporary files to be created and, as you can see below, it is a
  15.101 +# headache to deal with in a portable fashion.
  15.102 +
  15.103 +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
  15.104 +# use `HOST_CC' if defined, but it is deprecated.
  15.105 +
  15.106 +# Portable tmp directory creation inspired by the Autoconf team.
  15.107 +
  15.108 +set_cc_for_build='
  15.109 +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
  15.110 +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
  15.111 +: ${TMPDIR=/tmp} ;
  15.112 + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  15.113 + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  15.114 + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  15.115 + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
  15.116 +dummy=$tmp/dummy ;
  15.117 +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
  15.118 +case $CC_FOR_BUILD,$HOST_CC,$CC in
  15.119 + ,,)    echo "int x;" > $dummy.c ;
  15.120 +	for c in cc gcc c89 c99 ; do
  15.121 +	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
  15.122 +	     CC_FOR_BUILD="$c"; break ;
  15.123 +	  fi ;
  15.124 +	done ;
  15.125 +	if test x"$CC_FOR_BUILD" = x ; then
  15.126 +	  CC_FOR_BUILD=no_compiler_found ;
  15.127 +	fi
  15.128 +	;;
  15.129 + ,,*)   CC_FOR_BUILD=$CC ;;
  15.130 + ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
  15.131 +esac ; set_cc_for_build= ;'
  15.132 +
  15.133 +# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  15.134 +# (ghazi@noc.rutgers.edu 1994-08-24)
  15.135 +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  15.136 +	PATH=$PATH:/.attbin ; export PATH
  15.137 +fi
  15.138 +
  15.139 +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  15.140 +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  15.141 +UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
  15.142 +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  15.143 +
  15.144 +# Note: order is significant - the case branches are not exclusive.
  15.145 +
  15.146 +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  15.147 +    *:NetBSD:*:*)
  15.148 +	# NetBSD (nbsd) targets should (where applicable) match one or
  15.149 +	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
  15.150 +	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
  15.151 +	# switched to ELF, *-*-netbsd* would select the old
  15.152 +	# object file format.  This provides both forward
  15.153 +	# compatibility and a consistent mechanism for selecting the
  15.154 +	# object file format.
  15.155 +	#
  15.156 +	# Note: NetBSD doesn't particularly care about the vendor
  15.157 +	# portion of the name.  We always set it to "unknown".
  15.158 +	sysctl="sysctl -n hw.machine_arch"
  15.159 +	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
  15.160 +	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
  15.161 +	case "${UNAME_MACHINE_ARCH}" in
  15.162 +	    armeb) machine=armeb-unknown ;;
  15.163 +	    arm*) machine=arm-unknown ;;
  15.164 +	    sh3el) machine=shl-unknown ;;
  15.165 +	    sh3eb) machine=sh-unknown ;;
  15.166 +	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
  15.167 +	esac
  15.168 +	# The Operating System including object format, if it has switched
  15.169 +	# to ELF recently, or will in the future.
  15.170 +	case "${UNAME_MACHINE_ARCH}" in
  15.171 +	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
  15.172 +		eval $set_cc_for_build
  15.173 +		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  15.174 +			| grep __ELF__ >/dev/null
  15.175 +		then
  15.176 +		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  15.177 +		    # Return netbsd for either.  FIX?
  15.178 +		    os=netbsd
  15.179 +		else
  15.180 +		    os=netbsdelf
  15.181 +		fi
  15.182 +		;;
  15.183 +	    *)
  15.184 +	        os=netbsd
  15.185 +		;;
  15.186 +	esac
  15.187 +	# The OS release
  15.188 +	# Debian GNU/NetBSD machines have a different userland, and
  15.189 +	# thus, need a distinct triplet. However, they do not need
  15.190 +	# kernel version information, so it can be replaced with a
  15.191 +	# suitable tag, in the style of linux-gnu.
  15.192 +	case "${UNAME_VERSION}" in
  15.193 +	    Debian*)
  15.194 +		release='-gnu'
  15.195 +		;;
  15.196 +	    *)
  15.197 +		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  15.198 +		;;
  15.199 +	esac
  15.200 +	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  15.201 +	# contains redundant information, the shorter form:
  15.202 +	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  15.203 +	echo "${machine}-${os}${release}"
  15.204 +	exit ;;
  15.205 +    *:OpenBSD:*:*)
  15.206 +	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
  15.207 +	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
  15.208 +	exit ;;
  15.209 +    *:ekkoBSD:*:*)
  15.210 +	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
  15.211 +	exit ;;
  15.212 +    macppc:MirBSD:*:*)
  15.213 +	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
  15.214 +	exit ;;
  15.215 +    *:MirBSD:*:*)
  15.216 +	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
  15.217 +	exit ;;
  15.218 +    alpha:OSF1:*:*)
  15.219 +	case $UNAME_RELEASE in
  15.220 +	*4.0)
  15.221 +		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  15.222 +		;;
  15.223 +	*5.*)
  15.224 +	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
  15.225 +		;;
  15.226 +	esac
  15.227 +	# According to Compaq, /usr/sbin/psrinfo has been available on
  15.228 +	# OSF/1 and Tru64 systems produced since 1995.  I hope that
  15.229 +	# covers most systems running today.  This code pipes the CPU
  15.230 +	# types through head -n 1, so we only detect the type of CPU 0.
  15.231 +	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
  15.232 +	case "$ALPHA_CPU_TYPE" in
  15.233 +	    "EV4 (21064)")
  15.234 +		UNAME_MACHINE="alpha" ;;
  15.235 +	    "EV4.5 (21064)")
  15.236 +		UNAME_MACHINE="alpha" ;;
  15.237 +	    "LCA4 (21066/21068)")
  15.238 +		UNAME_MACHINE="alpha" ;;
  15.239 +	    "EV5 (21164)")
  15.240 +		UNAME_MACHINE="alphaev5" ;;
  15.241 +	    "EV5.6 (21164A)")
  15.242 +		UNAME_MACHINE="alphaev56" ;;
  15.243 +	    "EV5.6 (21164PC)")
  15.244 +		UNAME_MACHINE="alphapca56" ;;
  15.245 +	    "EV5.7 (21164PC)")
  15.246 +		UNAME_MACHINE="alphapca57" ;;
  15.247 +	    "EV6 (21264)")
  15.248 +		UNAME_MACHINE="alphaev6" ;;
  15.249 +	    "EV6.7 (21264A)")
  15.250 +		UNAME_MACHINE="alphaev67" ;;
  15.251 +	    "EV6.8CB (21264C)")
  15.252 +		UNAME_MACHINE="alphaev68" ;;
  15.253 +	    "EV6.8AL (21264B)")
  15.254 +		UNAME_MACHINE="alphaev68" ;;
  15.255 +	    "EV6.8CX (21264D)")
  15.256 +		UNAME_MACHINE="alphaev68" ;;
  15.257 +	    "EV6.9A (21264/EV69A)")
  15.258 +		UNAME_MACHINE="alphaev69" ;;
  15.259 +	    "EV7 (21364)")
  15.260 +		UNAME_MACHINE="alphaev7" ;;
  15.261 +	    "EV7.9 (21364A)")
  15.262 +		UNAME_MACHINE="alphaev79" ;;
  15.263 +	esac
  15.264 +	# A Pn.n version is a patched version.
  15.265 +	# A Vn.n version is a released version.
  15.266 +	# A Tn.n version is a released field test version.
  15.267 +	# A Xn.n version is an unreleased experimental baselevel.
  15.268 +	# 1.2 uses "1.2" for uname -r.
  15.269 +	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  15.270 +	exit ;;
  15.271 +    Alpha\ *:Windows_NT*:*)
  15.272 +	# How do we know it's Interix rather than the generic POSIX subsystem?
  15.273 +	# Should we change UNAME_MACHINE based on the output of uname instead
  15.274 +	# of the specific Alpha model?
  15.275 +	echo alpha-pc-interix
  15.276 +	exit ;;
  15.277 +    21064:Windows_NT:50:3)
  15.278 +	echo alpha-dec-winnt3.5
  15.279 +	exit ;;
  15.280 +    Amiga*:UNIX_System_V:4.0:*)
  15.281 +	echo m68k-unknown-sysv4
  15.282 +	exit ;;
  15.283 +    *:[Aa]miga[Oo][Ss]:*:*)
  15.284 +	echo ${UNAME_MACHINE}-unknown-amigaos
  15.285 +	exit ;;
  15.286 +    *:[Mm]orph[Oo][Ss]:*:*)
  15.287 +	echo ${UNAME_MACHINE}-unknown-morphos
  15.288 +	exit ;;
  15.289 +    *:OS/390:*:*)
  15.290 +	echo i370-ibm-openedition
  15.291 +	exit ;;
  15.292 +    *:z/VM:*:*)
  15.293 +	echo s390-ibm-zvmoe
  15.294 +	exit ;;
  15.295 +    *:OS400:*:*)
  15.296 +        echo powerpc-ibm-os400
  15.297 +	exit ;;
  15.298 +    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  15.299 +	echo arm-acorn-riscix${UNAME_RELEASE}
  15.300 +	exit ;;
  15.301 +    arm:riscos:*:*|arm:RISCOS:*:*)
  15.302 +	echo arm-unknown-riscos
  15.303 +	exit ;;
  15.304 +    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
  15.305 +	echo hppa1.1-hitachi-hiuxmpp
  15.306 +	exit ;;
  15.307 +    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  15.308 +	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  15.309 +	if test "`(/bin/universe) 2>/dev/null`" = att ; then
  15.310 +		echo pyramid-pyramid-sysv3
  15.311 +	else
  15.312 +		echo pyramid-pyramid-bsd
  15.313 +	fi
  15.314 +	exit ;;
  15.315 +    NILE*:*:*:dcosx)
  15.316 +	echo pyramid-pyramid-svr4
  15.317 +	exit ;;
  15.318 +    DRS?6000:unix:4.0:6*)
  15.319 +	echo sparc-icl-nx6
  15.320 +	exit ;;
  15.321 +    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
  15.322 +	case `/usr/bin/uname -p` in
  15.323 +	    sparc) echo sparc-icl-nx7; exit ;;
  15.324 +	esac ;;
  15.325 +    sun4H:SunOS:5.*:*)
  15.326 +	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  15.327 +	exit ;;
  15.328 +    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  15.329 +	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  15.330 +	exit ;;
  15.331 +    i86pc:SunOS:5.*:*)
  15.332 +	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  15.333 +	exit ;;
  15.334 +    sun4*:SunOS:6*:*)
  15.335 +	# According to config.sub, this is the proper way to canonicalize
  15.336 +	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
  15.337 +	# it's likely to be more like Solaris than SunOS4.
  15.338 +	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  15.339 +	exit ;;
  15.340 +    sun4*:SunOS:*:*)
  15.341 +	case "`/usr/bin/arch -k`" in
  15.342 +	    Series*|S4*)
  15.343 +		UNAME_RELEASE=`uname -v`
  15.344 +		;;
  15.345 +	esac
  15.346 +	# Japanese Language versions have a version number like `4.1.3-JL'.
  15.347 +	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  15.348 +	exit ;;
  15.349 +    sun3*:SunOS:*:*)
  15.350 +	echo m68k-sun-sunos${UNAME_RELEASE}
  15.351 +	exit ;;
  15.352 +    sun*:*:4.2BSD:*)
  15.353 +	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  15.354 +	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
  15.355 +	case "`/bin/arch`" in
  15.356 +	    sun3)
  15.357 +		echo m68k-sun-sunos${UNAME_RELEASE}
  15.358 +		;;
  15.359 +	    sun4)
  15.360 +		echo sparc-sun-sunos${UNAME_RELEASE}
  15.361 +		;;
  15.362 +	esac
  15.363 +	exit ;;
  15.364 +    aushp:SunOS:*:*)
  15.365 +	echo sparc-auspex-sunos${UNAME_RELEASE}
  15.366 +	exit ;;
  15.367 +    # The situation for MiNT is a little confusing.  The machine name
  15.368 +    # can be virtually everything (everything which is not
  15.369 +    # "atarist" or "atariste" at least should have a processor
  15.370 +    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
  15.371 +    # to the lowercase version "mint" (or "freemint").  Finally
  15.372 +    # the system name "TOS" denotes a system which is actually not
  15.373 +    # MiNT.  But MiNT is downward compatible to TOS, so this should
  15.374 +    # be no problem.
  15.375 +    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  15.376 +        echo m68k-atari-mint${UNAME_RELEASE}
  15.377 +	exit ;;
  15.378 +    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  15.379 +	echo m68k-atari-mint${UNAME_RELEASE}
  15.380 +        exit ;;
  15.381 +    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  15.382 +        echo m68k-atari-mint${UNAME_RELEASE}
  15.383 +	exit ;;
  15.384 +    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  15.385 +        echo m68k-milan-mint${UNAME_RELEASE}
  15.386 +        exit ;;
  15.387 +    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  15.388 +        echo m68k-hades-mint${UNAME_RELEASE}
  15.389 +        exit ;;
  15.390 +    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  15.391 +        echo m68k-unknown-mint${UNAME_RELEASE}
  15.392 +        exit ;;
  15.393 +    m68k:machten:*:*)
  15.394 +	echo m68k-apple-machten${UNAME_RELEASE}
  15.395 +	exit ;;
  15.396 +    powerpc:machten:*:*)
  15.397 +	echo powerpc-apple-machten${UNAME_RELEASE}
  15.398 +	exit ;;
  15.399 +    RISC*:Mach:*:*)
  15.400 +	echo mips-dec-mach_bsd4.3
  15.401 +	exit ;;
  15.402 +    RISC*:ULTRIX:*:*)
  15.403 +	echo mips-dec-ultrix${UNAME_RELEASE}
  15.404 +	exit ;;
  15.405 +    VAX*:ULTRIX*:*:*)
  15.406 +	echo vax-dec-ultrix${UNAME_RELEASE}
  15.407 +	exit ;;
  15.408 +    2020:CLIX:*:* | 2430:CLIX:*:*)
  15.409 +	echo clipper-intergraph-clix${UNAME_RELEASE}
  15.410 +	exit ;;
  15.411 +    mips:*:*:UMIPS | mips:*:*:RISCos)
  15.412 +	eval $set_cc_for_build
  15.413 +	sed 's/^	//' << EOF >$dummy.c
  15.414 +#ifdef __cplusplus
  15.415 +#include <stdio.h>  /* for printf() prototype */
  15.416 +	int main (int argc, char *argv[]) {
  15.417 +#else
  15.418 +	int main (argc, argv) int argc; char *argv[]; {
  15.419 +#endif
  15.420 +	#if defined (host_mips) && defined (MIPSEB)
  15.421 +	#if defined (SYSTYPE_SYSV)
  15.422 +	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
  15.423 +	#endif
  15.424 +	#if defined (SYSTYPE_SVR4)
  15.425 +	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
  15.426 +	#endif
  15.427 +	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  15.428 +	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
  15.429 +	#endif
  15.430 +	#endif
  15.431 +	  exit (-1);
  15.432 +	}
  15.433 +EOF
  15.434 +	$CC_FOR_BUILD -o $dummy $dummy.c &&
  15.435 +	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
  15.436 +	  SYSTEM_NAME=`$dummy $dummyarg` &&
  15.437 +	    { echo "$SYSTEM_NAME"; exit; }
  15.438 +	echo mips-mips-riscos${UNAME_RELEASE}
  15.439 +	exit ;;
  15.440 +    Motorola:PowerMAX_OS:*:*)
  15.441 +	echo powerpc-motorola-powermax
  15.442 +	exit ;;
  15.443 +    Motorola:*:4.3:PL8-*)
  15.444 +	echo powerpc-harris-powermax
  15.445 +	exit ;;
  15.446 +    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
  15.447 +	echo powerpc-harris-powermax
  15.448 +	exit ;;
  15.449 +    Night_Hawk:Power_UNIX:*:*)
  15.450 +	echo powerpc-harris-powerunix
  15.451 +	exit ;;
  15.452 +    m88k:CX/UX:7*:*)
  15.453 +	echo m88k-harris-cxux7
  15.454 +	exit ;;
  15.455 +    m88k:*:4*:R4*)
  15.456 +	echo m88k-motorola-sysv4
  15.457 +	exit ;;
  15.458 +    m88k:*:3*:R3*)
  15.459 +	echo m88k-motorola-sysv3
  15.460 +	exit ;;
  15.461 +    AViiON:dgux:*:*)
  15.462 +        # DG/UX returns AViiON for all architectures
  15.463 +        UNAME_PROCESSOR=`/usr/bin/uname -p`
  15.464 +	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
  15.465 +	then
  15.466 +	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
  15.467 +	       [ ${TARGET_BINARY_INTERFACE}x = x ]
  15.468 +	    then
  15.469 +		echo m88k-dg-dgux${UNAME_RELEASE}
  15.470 +	    else
  15.471 +		echo m88k-dg-dguxbcs${UNAME_RELEASE}
  15.472 +	    fi
  15.473 +	else
  15.474 +	    echo i586-dg-dgux${UNAME_RELEASE}
  15.475 +	fi
  15.476 + 	exit ;;
  15.477 +    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
  15.478 +	echo m88k-dolphin-sysv3
  15.479 +	exit ;;
  15.480 +    M88*:*:R3*:*)
  15.481 +	# Delta 88k system running SVR3
  15.482 +	echo m88k-motorola-sysv3
  15.483 +	exit ;;
  15.484 +    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  15.485 +	echo m88k-tektronix-sysv3
  15.486 +	exit ;;
  15.487 +    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  15.488 +	echo m68k-tektronix-bsd
  15.489 +	exit ;;
  15.490 +    *:IRIX*:*:*)
  15.491 +	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  15.492 +	exit ;;
  15.493 +    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  15.494 +	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
  15.495 +	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
  15.496 +    i*86:AIX:*:*)
  15.497 +	echo i386-ibm-aix
  15.498 +	exit ;;
  15.499 +    ia64:AIX:*:*)
  15.500 +	if [ -x /usr/bin/oslevel ] ; then
  15.501 +		IBM_REV=`/usr/bin/oslevel`
  15.502 +	else
  15.503 +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  15.504 +	fi
  15.505 +	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
  15.506 +	exit ;;
  15.507 +    *:AIX:2:3)
  15.508 +	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  15.509 +		eval $set_cc_for_build
  15.510 +		sed 's/^		//' << EOF >$dummy.c
  15.511 +		#include <sys/systemcfg.h>
  15.512 +
  15.513 +		main()
  15.514 +			{
  15.515 +			if (!__power_pc())
  15.516 +				exit(1);
  15.517 +			puts("powerpc-ibm-aix3.2.5");
  15.518 +			exit(0);
  15.519 +			}
  15.520 +EOF
  15.521 +		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
  15.522 +		then
  15.523 +			echo "$SYSTEM_NAME"
  15.524 +		else
  15.525 +			echo rs6000-ibm-aix3.2.5
  15.526 +		fi
  15.527 +	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  15.528 +		echo rs6000-ibm-aix3.2.4
  15.529 +	else
  15.530 +		echo rs6000-ibm-aix3.2
  15.531 +	fi
  15.532 +	exit ;;
  15.533 +    *:AIX:*:[45])
  15.534 +	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  15.535 +	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
  15.536 +		IBM_ARCH=rs6000
  15.537 +	else
  15.538 +		IBM_ARCH=powerpc
  15.539 +	fi
  15.540 +	if [ -x /usr/bin/oslevel ] ; then
  15.541 +		IBM_REV=`/usr/bin/oslevel`
  15.542 +	else
  15.543 +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  15.544 +	fi
  15.545 +	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  15.546 +	exit ;;
  15.547 +    *:AIX:*:*)
  15.548 +	echo rs6000-ibm-aix
  15.549 +	exit ;;
  15.550 +    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  15.551 +	echo romp-ibm-bsd4.4
  15.552 +	exit ;;
  15.553 +    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
  15.554 +	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
  15.555 +	exit ;;                             # report: romp-ibm BSD 4.3
  15.556 +    *:BOSX:*:*)
  15.557 +	echo rs6000-bull-bosx
  15.558 +	exit ;;
  15.559 +    DPX/2?00:B.O.S.:*:*)
  15.560 +	echo m68k-bull-sysv3
  15.561 +	exit ;;
  15.562 +    9000/[34]??:4.3bsd:1.*:*)
  15.563 +	echo m68k-hp-bsd
  15.564 +	exit ;;
  15.565 +    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  15.566 +	echo m68k-hp-bsd4.4
  15.567 +	exit ;;
  15.568 +    9000/[34678]??:HP-UX:*:*)
  15.569 +	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  15.570 +	case "${UNAME_MACHINE}" in
  15.571 +	    9000/31? )            HP_ARCH=m68000 ;;
  15.572 +	    9000/[34]?? )         HP_ARCH=m68k ;;
  15.573 +	    9000/[678][0-9][0-9])
  15.574 +		if [ -x /usr/bin/getconf ]; then
  15.575 +		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  15.576 +                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  15.577 +                    case "${sc_cpu_version}" in
  15.578 +                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
  15.579 +                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
  15.580 +                      532)                      # CPU_PA_RISC2_0
  15.581 +                        case "${sc_kernel_bits}" in
  15.582 +                          32) HP_ARCH="hppa2.0n" ;;
  15.583 +                          64) HP_ARCH="hppa2.0w" ;;
  15.584 +			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
  15.585 +                        esac ;;
  15.586 +                    esac
  15.587 +		fi
  15.588 +		if [ "${HP_ARCH}" = "" ]; then
  15.589 +		    eval $set_cc_for_build
  15.590 +		    sed 's/^              //' << EOF >$dummy.c
  15.591 +
  15.592 +              #define _HPUX_SOURCE
  15.593 +              #include <stdlib.h>
  15.594 +              #include <unistd.h>
  15.595 +
  15.596 +              int main ()
  15.597 +              {
  15.598 +              #if defined(_SC_KERNEL_BITS)
  15.599 +                  long bits = sysconf(_SC_KERNEL_BITS);
  15.600 +              #endif
  15.601 +                  long cpu  = sysconf (_SC_CPU_VERSION);
  15.602 +
  15.603 +                  switch (cpu)
  15.604 +              	{
  15.605 +              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  15.606 +              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  15.607 +              	case CPU_PA_RISC2_0:
  15.608 +              #if defined(_SC_KERNEL_BITS)
  15.609 +              	    switch (bits)
  15.610 +              		{
  15.611 +              		case 64: puts ("hppa2.0w"); break;
  15.612 +              		case 32: puts ("hppa2.0n"); break;
  15.613 +              		default: puts ("hppa2.0"); break;
  15.614 +              		} break;
  15.615 +              #else  /* !defined(_SC_KERNEL_BITS) */
  15.616 +              	    puts ("hppa2.0"); break;
  15.617 +              #endif
  15.618 +              	default: puts ("hppa1.0"); break;
  15.619 +              	}
  15.620 +                  exit (0);
  15.621 +              }
  15.622 +EOF
  15.623 +		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
  15.624 +		    test -z "$HP_ARCH" && HP_ARCH=hppa
  15.625 +		fi ;;
  15.626 +	esac
  15.627 +	if [ ${HP_ARCH} = "hppa2.0w" ]
  15.628 +	then
  15.629 +	    eval $set_cc_for_build
  15.630 +
  15.631 +	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
  15.632 +	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
  15.633 +	    # generating 64-bit code.  GNU and HP use different nomenclature:
  15.634 +	    #
  15.635 +	    # $ CC_FOR_BUILD=cc ./config.guess
  15.636 +	    # => hppa2.0w-hp-hpux11.23
  15.637 +	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
  15.638 +	    # => hppa64-hp-hpux11.23
  15.639 +
  15.640 +	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
  15.641 +		grep __LP64__ >/dev/null
  15.642 +	    then
  15.643 +		HP_ARCH="hppa2.0w"
  15.644 +	    else
  15.645 +		HP_ARCH="hppa64"
  15.646 +	    fi
  15.647 +	fi
  15.648 +	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  15.649 +	exit ;;
  15.650 +    ia64:HP-UX:*:*)
  15.651 +	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  15.652 +	echo ia64-hp-hpux${HPUX_REV}
  15.653 +	exit ;;
  15.654 +    3050*:HI-UX:*:*)
  15.655 +	eval $set_cc_for_build
  15.656 +	sed 's/^	//' << EOF >$dummy.c
  15.657 +	#include <unistd.h>
  15.658 +	int
  15.659 +	main ()
  15.660 +	{
  15.661 +	  long cpu = sysconf (_SC_CPU_VERSION);
  15.662 +	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  15.663 +	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
  15.664 +	     results, however.  */
  15.665 +	  if (CPU_IS_PA_RISC (cpu))
  15.666 +	    {
  15.667 +	      switch (cpu)
  15.668 +		{
  15.669 +		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  15.670 +		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  15.671 +		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  15.672 +		  default: puts ("hppa-hitachi-hiuxwe2"); break;
  15.673 +		}
  15.674 +	    }
  15.675 +	  else if (CPU_IS_HP_MC68K (cpu))
  15.676 +	    puts ("m68k-hitachi-hiuxwe2");
  15.677 +	  else puts ("unknown-hitachi-hiuxwe2");
  15.678 +	  exit (0);
  15.679 +	}
  15.680 +EOF
  15.681 +	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
  15.682 +		{ echo "$SYSTEM_NAME"; exit; }
  15.683 +	echo unknown-hitachi-hiuxwe2
  15.684 +	exit ;;
  15.685 +    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  15.686 +	echo hppa1.1-hp-bsd
  15.687 +	exit ;;
  15.688 +    9000/8??:4.3bsd:*:*)
  15.689 +	echo hppa1.0-hp-bsd
  15.690 +	exit ;;
  15.691 +    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  15.692 +	echo hppa1.0-hp-mpeix
  15.693 +	exit ;;
  15.694 +    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  15.695 +	echo hppa1.1-hp-osf
  15.696 +	exit ;;
  15.697 +    hp8??:OSF1:*:*)
  15.698 +	echo hppa1.0-hp-osf
  15.699 +	exit ;;
  15.700 +    i*86:OSF1:*:*)
  15.701 +	if [ -x /usr/sbin/sysversion ] ; then
  15.702 +	    echo ${UNAME_MACHINE}-unknown-osf1mk
  15.703 +	else
  15.704 +	    echo ${UNAME_MACHINE}-unknown-osf1
  15.705 +	fi
  15.706 +	exit ;;
  15.707 +    parisc*:Lites*:*:*)
  15.708 +	echo hppa1.1-hp-lites
  15.709 +	exit ;;
  15.710 +    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  15.711 +	echo c1-convex-bsd
  15.712 +        exit ;;
  15.713 +    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  15.714 +	if getsysinfo -f scalar_acc
  15.715 +	then echo c32-convex-bsd
  15.716 +	else echo c2-convex-bsd
  15.717 +	fi
  15.718 +        exit ;;
  15.719 +    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  15.720 +	echo c34-convex-bsd
  15.721 +        exit ;;
  15.722 +    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  15.723 +	echo c38-convex-bsd
  15.724 +        exit ;;
  15.725 +    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  15.726 +	echo c4-convex-bsd
  15.727 +        exit ;;
  15.728 +    CRAY*Y-MP:*:*:*)
  15.729 +	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  15.730 +	exit ;;
  15.731 +    CRAY*[A-Z]90:*:*:*)
  15.732 +	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
  15.733 +	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  15.734 +	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  15.735 +	      -e 's/\.[^.]*$/.X/'
  15.736 +	exit ;;
  15.737 +    CRAY*TS:*:*:*)
  15.738 +	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  15.739 +	exit ;;
  15.740 +    CRAY*T3E:*:*:*)
  15.741 +	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  15.742 +	exit ;;
  15.743 +    CRAY*SV1:*:*:*)
  15.744 +	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  15.745 +	exit ;;
  15.746 +    *:UNICOS/mp:*:*)
  15.747 +	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  15.748 +	exit ;;
  15.749 +    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  15.750 +	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  15.751 +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  15.752 +        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
  15.753 +        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  15.754 +        exit ;;
  15.755 +    5000:UNIX_System_V:4.*:*)
  15.756 +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  15.757 +        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
  15.758 +        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  15.759 +	exit ;;
  15.760 +    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  15.761 +	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
  15.762 +	exit ;;
  15.763 +    sparc*:BSD/OS:*:*)
  15.764 +	echo sparc-unknown-bsdi${UNAME_RELEASE}
  15.765 +	exit ;;
  15.766 +    *:BSD/OS:*:*)
  15.767 +	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
  15.768 +	exit ;;
  15.769 +    *:FreeBSD:*:*)
  15.770 +	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  15.771 +	exit ;;
  15.772 +    i*:CYGWIN*:*)
  15.773 +	echo ${UNAME_MACHINE}-pc-cygwin
  15.774 +	exit ;;
  15.775 +    i*:MINGW*:*)
  15.776 +	echo ${UNAME_MACHINE}-pc-mingw32
  15.777 +	exit ;;
  15.778 +    i*:windows32*:*)
  15.779 +    	# uname -m includes "-pc" on this system.
  15.780 +    	echo ${UNAME_MACHINE}-mingw32
  15.781 +	exit ;;
  15.782 +    i*:PW*:*)
  15.783 +	echo ${UNAME_MACHINE}-pc-pw32
  15.784 +	exit ;;
  15.785 +    x86:Interix*:[34]*)
  15.786 +	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
  15.787 +	exit ;;
  15.788 +    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
  15.789 +	echo i${UNAME_MACHINE}-pc-mks
  15.790 +	exit ;;
  15.791 +    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
  15.792 +	# How do we know it's Interix rather than the generic POSIX subsystem?
  15.793 +	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
  15.794 +	# UNAME_MACHINE based on the output of uname instead of i386?
  15.795 +	echo i586-pc-interix
  15.796 +	exit ;;
  15.797 +    i*:UWIN*:*)
  15.798 +	echo ${UNAME_MACHINE}-pc-uwin
  15.799 +	exit ;;
  15.800 +    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
  15.801 +	echo x86_64-unknown-cygwin
  15.802 +	exit ;;
  15.803 +    p*:CYGWIN*:*)
  15.804 +	echo powerpcle-unknown-cygwin
  15.805 +	exit ;;
  15.806 +    prep*:SunOS:5.*:*)
  15.807 +	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  15.808 +	exit ;;
  15.809 +    *:GNU:*:*)
  15.810 +	# the GNU system
  15.811 +	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  15.812 +	exit ;;
  15.813 +    *:GNU/*:*:*)
  15.814 +	# other systems with GNU libc and userland
  15.815 +	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
  15.816 +	exit ;;
  15.817 +    i*86:Minix:*:*)
  15.818 +	echo ${UNAME_MACHINE}-pc-minix
  15.819 +	exit ;;
  15.820 +    arm*:Linux:*:*)
  15.821 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.822 +	exit ;;
  15.823 +    cris:Linux:*:*)
  15.824 +	echo cris-axis-linux-gnu
  15.825 +	exit ;;
  15.826 +    crisv32:Linux:*:*)
  15.827 +	echo crisv32-axis-linux-gnu
  15.828 +	exit ;;
  15.829 +    frv:Linux:*:*)
  15.830 +    	echo frv-unknown-linux-gnu
  15.831 +	exit ;;
  15.832 +    ia64:Linux:*:*)
  15.833 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.834 +	exit ;;
  15.835 +    m32r*:Linux:*:*)
  15.836 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.837 +	exit ;;
  15.838 +    m68*:Linux:*:*)
  15.839 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.840 +	exit ;;
  15.841 +    mips:Linux:*:*)
  15.842 +	eval $set_cc_for_build
  15.843 +	sed 's/^	//' << EOF >$dummy.c
  15.844 +	#undef CPU
  15.845 +	#undef mips
  15.846 +	#undef mipsel
  15.847 +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  15.848 +	CPU=mipsel
  15.849 +	#else
  15.850 +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  15.851 +	CPU=mips
  15.852 +	#else
  15.853 +	CPU=
  15.854 +	#endif
  15.855 +	#endif
  15.856 +EOF
  15.857 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
  15.858 +	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
  15.859 +	;;
  15.860 +    mips64:Linux:*:*)
  15.861 +	eval $set_cc_for_build
  15.862 +	sed 's/^	//' << EOF >$dummy.c
  15.863 +	#undef CPU
  15.864 +	#undef mips64
  15.865 +	#undef mips64el
  15.866 +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  15.867 +	CPU=mips64el
  15.868 +	#else
  15.869 +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  15.870 +	CPU=mips64
  15.871 +	#else
  15.872 +	CPU=
  15.873 +	#endif
  15.874 +	#endif
  15.875 +EOF
  15.876 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
  15.877 +	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
  15.878 +	;;
  15.879 +    or32:Linux:*:*)
  15.880 +	echo or32-unknown-linux-gnu
  15.881 +	exit ;;
  15.882 +    ppc:Linux:*:*)
  15.883 +	echo powerpc-unknown-linux-gnu
  15.884 +	exit ;;
  15.885 +    ppc64:Linux:*:*)
  15.886 +	echo powerpc64-unknown-linux-gnu
  15.887 +	exit ;;
  15.888 +    alpha:Linux:*:*)
  15.889 +	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
  15.890 +	  EV5)   UNAME_MACHINE=alphaev5 ;;
  15.891 +	  EV56)  UNAME_MACHINE=alphaev56 ;;
  15.892 +	  PCA56) UNAME_MACHINE=alphapca56 ;;
  15.893 +	  PCA57) UNAME_MACHINE=alphapca56 ;;
  15.894 +	  EV6)   UNAME_MACHINE=alphaev6 ;;
  15.895 +	  EV67)  UNAME_MACHINE=alphaev67 ;;
  15.896 +	  EV68*) UNAME_MACHINE=alphaev68 ;;
  15.897 +        esac
  15.898 +	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
  15.899 +	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
  15.900 +	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
  15.901 +	exit ;;
  15.902 +    parisc:Linux:*:* | hppa:Linux:*:*)
  15.903 +	# Look for CPU level
  15.904 +	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  15.905 +	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
  15.906 +	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
  15.907 +	  *)    echo hppa-unknown-linux-gnu ;;
  15.908 +	esac
  15.909 +	exit ;;
  15.910 +    parisc64:Linux:*:* | hppa64:Linux:*:*)
  15.911 +	echo hppa64-unknown-linux-gnu
  15.912 +	exit ;;
  15.913 +    s390:Linux:*:* | s390x:Linux:*:*)
  15.914 +	echo ${UNAME_MACHINE}-ibm-linux
  15.915 +	exit ;;
  15.916 +    sh64*:Linux:*:*)
  15.917 +    	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.918 +	exit ;;
  15.919 +    sh*:Linux:*:*)
  15.920 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.921 +	exit ;;
  15.922 +    sparc:Linux:*:* | sparc64:Linux:*:*)
  15.923 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
  15.924 +	exit ;;
  15.925 +    x86_64:Linux:*:*)
  15.926 +	echo x86_64-unknown-linux-gnu
  15.927 +	exit ;;
  15.928 +    i*86:Linux:*:*)
  15.929 +	# The BFD linker knows what the default object file format is, so
  15.930 +	# first see if it will tell us. cd to the root directory to prevent
  15.931 +	# problems with other programs or directories called `ld' in the path.
  15.932 +	# Set LC_ALL=C to ensure ld outputs messages in English.
  15.933 +	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
  15.934 +			 | sed -ne '/supported targets:/!d
  15.935 +				    s/[ 	][ 	]*/ /g
  15.936 +				    s/.*supported targets: *//
  15.937 +				    s/ .*//
  15.938 +				    p'`
  15.939 +        case "$ld_supported_targets" in
  15.940 +	  elf32-i386)
  15.941 +		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
  15.942 +		;;
  15.943 +	  a.out-i386-linux)
  15.944 +		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
  15.945 +		exit ;;
  15.946 +	  coff-i386)
  15.947 +		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
  15.948 +		exit ;;
  15.949 +	  "")
  15.950 +		# Either a pre-BFD a.out linker (linux-gnuoldld) or
  15.951 +		# one that does not give us useful --help.
  15.952 +		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
  15.953 +		exit ;;
  15.954 +	esac
  15.955 +	# Determine whether the default compiler is a.out or elf
  15.956 +	eval $set_cc_for_build
  15.957 +	sed 's/^	//' << EOF >$dummy.c
  15.958 +	#include <features.h>
  15.959 +	#ifdef __ELF__
  15.960 +	# ifdef __GLIBC__
  15.961 +	#  if __GLIBC__ >= 2
  15.962 +	LIBC=gnu
  15.963 +	#  else
  15.964 +	LIBC=gnulibc1
  15.965 +	#  endif
  15.966 +	# else
  15.967 +	LIBC=gnulibc1
  15.968 +	# endif
  15.969 +	#else
  15.970 +	#ifdef __INTEL_COMPILER
  15.971 +	LIBC=gnu
  15.972 +	#else
  15.973 +	LIBC=gnuaout
  15.974 +	#endif
  15.975 +	#endif
  15.976 +	#ifdef __dietlibc__
  15.977 +	LIBC=dietlibc
  15.978 +	#endif
  15.979 +EOF
  15.980 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
  15.981 +	test x"${LIBC}" != x && {
  15.982 +		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
  15.983 +		exit
  15.984 +	}
  15.985 +	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
  15.986 +	;;
  15.987 +    i*86:DYNIX/ptx:4*:*)
  15.988 +	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  15.989 +	# earlier versions are messed up and put the nodename in both
  15.990 +	# sysname and nodename.
  15.991 +	echo i386-sequent-sysv4
  15.992 +	exit ;;
  15.993 +    i*86:UNIX_SV:4.2MP:2.*)
  15.994 +        # Unixware is an offshoot of SVR4, but it has its own version
  15.995 +        # number series starting with 2...
  15.996 +        # I am not positive that other SVR4 systems won't match this,
  15.997 +	# I just have to hope.  -- rms.
  15.998 +        # Use sysv4.2uw... so that sysv4* matches it.
  15.999 +	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 15.1000 +	exit ;;
 15.1001 +    i*86:OS/2:*:*)
 15.1002 +	# If we were able to find `uname', then EMX Unix compatibility
 15.1003 +	# is probably installed.
 15.1004 +	echo ${UNAME_MACHINE}-pc-os2-emx
 15.1005 +	exit ;;
 15.1006 +    i*86:XTS-300:*:STOP)
 15.1007 +	echo ${UNAME_MACHINE}-unknown-stop
 15.1008 +	exit ;;
 15.1009 +    i*86:atheos:*:*)
 15.1010 +	echo ${UNAME_MACHINE}-unknown-atheos
 15.1011 +	exit ;;
 15.1012 +    i*86:syllable:*:*)
 15.1013 +	echo ${UNAME_MACHINE}-pc-syllable
 15.1014 +	exit ;;
 15.1015 +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 15.1016 +	echo i386-unknown-lynxos${UNAME_RELEASE}
 15.1017 +	exit ;;
 15.1018 +    i*86:*DOS:*:*)
 15.1019 +	echo ${UNAME_MACHINE}-pc-msdosdjgpp
 15.1020 +	exit ;;
 15.1021 +    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 15.1022 +	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 15.1023 +	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
 15.1024 +		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 15.1025 +	else
 15.1026 +		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 15.1027 +	fi
 15.1028 +	exit ;;
 15.1029 +    i*86:*:5:[678]*)
 15.1030 +    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 15.1031 +	case `/bin/uname -X | grep "^Machine"` in
 15.1032 +	    *486*)	     UNAME_MACHINE=i486 ;;
 15.1033 +	    *Pentium)	     UNAME_MACHINE=i586 ;;
 15.1034 +	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 15.1035 +	esac
 15.1036 +	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 15.1037 +	exit ;;
 15.1038 +    i*86:*:3.2:*)
 15.1039 +	if test -f /usr/options/cb.name; then
 15.1040 +		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 15.1041 +		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 15.1042 +	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 15.1043 +		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 15.1044 +		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 15.1045 +		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
 15.1046 +			&& UNAME_MACHINE=i586
 15.1047 +		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
 15.1048 +			&& UNAME_MACHINE=i686
 15.1049 +		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 15.1050 +			&& UNAME_MACHINE=i686
 15.1051 +		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 15.1052 +	else
 15.1053 +		echo ${UNAME_MACHINE}-pc-sysv32
 15.1054 +	fi
 15.1055 +	exit ;;
 15.1056 +    pc:*:*:*)
 15.1057 +	# Left here for compatibility:
 15.1058 +        # uname -m prints for DJGPP always 'pc', but it prints nothing about
 15.1059 +        # the processor, so we play safe by assuming i386.
 15.1060 +	echo i386-pc-msdosdjgpp
 15.1061 +        exit ;;
 15.1062 +    Intel:Mach:3*:*)
 15.1063 +	echo i386-pc-mach3
 15.1064 +	exit ;;
 15.1065 +    paragon:*:*:*)
 15.1066 +	echo i860-intel-osf1
 15.1067 +	exit ;;
 15.1068 +    i860:*:4.*:*) # i860-SVR4
 15.1069 +	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 15.1070 +	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 15.1071 +	else # Add other i860-SVR4 vendors below as they are discovered.
 15.1072 +	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 15.1073 +	fi
 15.1074 +	exit ;;
 15.1075 +    mini*:CTIX:SYS*5:*)
 15.1076 +	# "miniframe"
 15.1077 +	echo m68010-convergent-sysv
 15.1078 +	exit ;;
 15.1079 +    mc68k:UNIX:SYSTEM5:3.51m)
 15.1080 +	echo m68k-convergent-sysv
 15.1081 +	exit ;;
 15.1082 +    M680?0:D-NIX:5.3:*)
 15.1083 +	echo m68k-diab-dnix
 15.1084 +	exit ;;
 15.1085 +    M68*:*:R3V[5678]*:*)
 15.1086 +	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
 15.1087 +    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
 15.1088 +	OS_REL=''
 15.1089 +	test -r /etc/.relid \
 15.1090 +	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 15.1091 +	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 15.1092 +	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 15.1093 +	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 15.1094 +	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
 15.1095 +    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 15.1096 +        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 15.1097 +          && { echo i486-ncr-sysv4; exit; } ;;
 15.1098 +    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 15.1099 +	echo m68k-unknown-lynxos${UNAME_RELEASE}
 15.1100 +	exit ;;
 15.1101 +    mc68030:UNIX_System_V:4.*:*)
 15.1102 +	echo m68k-atari-sysv4
 15.1103 +	exit ;;
 15.1104 +    TSUNAMI:LynxOS:2.*:*)
 15.1105 +	echo sparc-unknown-lynxos${UNAME_RELEASE}
 15.1106 +	exit ;;
 15.1107 +    rs6000:LynxOS:2.*:*)
 15.1108 +	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 15.1109 +	exit ;;
 15.1110 +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 15.1111 +	echo powerpc-unknown-lynxos${UNAME_RELEASE}
 15.1112 +	exit ;;
 15.1113 +    SM[BE]S:UNIX_SV:*:*)
 15.1114 +	echo mips-dde-sysv${UNAME_RELEASE}
 15.1115 +	exit ;;
 15.1116 +    RM*:ReliantUNIX-*:*:*)
 15.1117 +	echo mips-sni-sysv4
 15.1118 +	exit ;;
 15.1119 +    RM*:SINIX-*:*:*)
 15.1120 +	echo mips-sni-sysv4
 15.1121 +	exit ;;
 15.1122 +    *:SINIX-*:*:*)
 15.1123 +	if uname -p 2>/dev/null >/dev/null ; then
 15.1124 +		UNAME_MACHINE=`(uname -p) 2>/dev/null`
 15.1125 +		echo ${UNAME_MACHINE}-sni-sysv4
 15.1126 +	else
 15.1127 +		echo ns32k-sni-sysv
 15.1128 +	fi
 15.1129 +	exit ;;
 15.1130 +    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 15.1131 +                      # says <Richard.M.Bartel@ccMail.Census.GOV>
 15.1132 +        echo i586-unisys-sysv4
 15.1133 +        exit ;;
 15.1134 +    *:UNIX_System_V:4*:FTX*)
 15.1135 +	# From Gerald Hewes <hewes@openmarket.com>.
 15.1136 +	# How about differentiating between stratus architectures? -djm
 15.1137 +	echo hppa1.1-stratus-sysv4
 15.1138 +	exit ;;
 15.1139 +    *:*:*:FTX*)
 15.1140 +	# From seanf@swdc.stratus.com.
 15.1141 +	echo i860-stratus-sysv4
 15.1142 +	exit ;;
 15.1143 +    i*86:VOS:*:*)
 15.1144 +	# From Paul.Green@stratus.com.
 15.1145 +	echo ${UNAME_MACHINE}-stratus-vos
 15.1146 +	exit ;;
 15.1147 +    *:VOS:*:*)
 15.1148 +	# From Paul.Green@stratus.com.
 15.1149 +	echo hppa1.1-stratus-vos
 15.1150 +	exit ;;
 15.1151 +    mc68*:A/UX:*:*)
 15.1152 +	echo m68k-apple-aux${UNAME_RELEASE}
 15.1153 +	exit ;;
 15.1154 +    news*:NEWS-OS:6*:*)
 15.1155 +	echo mips-sony-newsos6
 15.1156 +	exit ;;
 15.1157 +    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 15.1158 +	if [ -d /usr/nec ]; then
 15.1159 +	        echo mips-nec-sysv${UNAME_RELEASE}
 15.1160 +	else
 15.1161 +	        echo mips-unknown-sysv${UNAME_RELEASE}
 15.1162 +	fi
 15.1163 +        exit ;;
 15.1164 +    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 15.1165 +	echo powerpc-be-beos
 15.1166 +	exit ;;
 15.1167 +    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 15.1168 +	echo powerpc-apple-beos
 15.1169 +	exit ;;
 15.1170 +    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 15.1171 +	echo i586-pc-beos
 15.1172 +	exit ;;
 15.1173 +    SX-4:SUPER-UX:*:*)
 15.1174 +	echo sx4-nec-superux${UNAME_RELEASE}
 15.1175 +	exit ;;
 15.1176 +    SX-5:SUPER-UX:*:*)
 15.1177 +	echo sx5-nec-superux${UNAME_RELEASE}
 15.1178 +	exit ;;
 15.1179 +    SX-6:SUPER-UX:*:*)
 15.1180 +	echo sx6-nec-superux${UNAME_RELEASE}
 15.1181 +	exit ;;
 15.1182 +    Power*:Rhapsody:*:*)
 15.1183 +	echo powerpc-apple-rhapsody${UNAME_RELEASE}
 15.1184 +	exit ;;
 15.1185 +    *:Rhapsody:*:*)
 15.1186 +	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
 15.1187 +	exit ;;
 15.1188 +    *:Darwin:*:*)
 15.1189 +	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 15.1190 +	case $UNAME_PROCESSOR in
 15.1191 +	    *86) UNAME_PROCESSOR=i686 ;;
 15.1192 +	    unknown) UNAME_PROCESSOR=powerpc ;;
 15.1193 +	esac
 15.1194 +	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 15.1195 +	exit ;;
 15.1196 +    *:procnto*:*:* | *:QNX:[0123456789]*:*)
 15.1197 +	UNAME_PROCESSOR=`uname -p`
 15.1198 +	if test "$UNAME_PROCESSOR" = "x86"; then
 15.1199 +		UNAME_PROCESSOR=i386
 15.1200 +		UNAME_MACHINE=pc
 15.1201 +	fi
 15.1202 +	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
 15.1203 +	exit ;;
 15.1204 +    *:QNX:*:4*)
 15.1205 +	echo i386-pc-qnx
 15.1206 +	exit ;;
 15.1207 +    NSE-?:NONSTOP_KERNEL:*:*)
 15.1208 +	echo nse-tandem-nsk${UNAME_RELEASE}
 15.1209 +	exit ;;
 15.1210 +    NSR-?:NONSTOP_KERNEL:*:*)
 15.1211 +	echo nsr-tandem-nsk${UNAME_RELEASE}
 15.1212 +	exit ;;
 15.1213 +    *:NonStop-UX:*:*)
 15.1214 +	echo mips-compaq-nonstopux
 15.1215 +	exit ;;
 15.1216 +    BS2000:POSIX*:*:*)
 15.1217 +	echo bs2000-siemens-sysv
 15.1218 +	exit ;;
 15.1219 +    DS/*:UNIX_System_V:*:*)
 15.1220 +	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
 15.1221 +	exit ;;
 15.1222 +    *:Plan9:*:*)
 15.1223 +	# "uname -m" is not consistent, so use $cputype instead. 386
 15.1224 +	# is converted to i386 for consistency with other x86
 15.1225 +	# operating systems.
 15.1226 +	if test "$cputype" = "386"; then
 15.1227 +	    UNAME_MACHINE=i386
 15.1228 +	else
 15.1229 +	    UNAME_MACHINE="$cputype"
 15.1230 +	fi
 15.1231 +	echo ${UNAME_MACHINE}-unknown-plan9
 15.1232 +	exit ;;
 15.1233 +    *:TOPS-10:*:*)
 15.1234 +	echo pdp10-unknown-tops10
 15.1235 +	exit ;;
 15.1236 +    *:TENEX:*:*)
 15.1237 +	echo pdp10-unknown-tenex
 15.1238 +	exit ;;
 15.1239 +    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 15.1240 +	echo pdp10-dec-tops20
 15.1241 +	exit ;;
 15.1242 +    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 15.1243 +	echo pdp10-xkl-tops20
 15.1244 +	exit ;;
 15.1245 +    *:TOPS-20:*:*)
 15.1246 +	echo pdp10-unknown-tops20
 15.1247 +	exit ;;
 15.1248 +    *:ITS:*:*)
 15.1249 +	echo pdp10-unknown-its
 15.1250 +	exit ;;
 15.1251 +    SEI:*:*:SEIUX)
 15.1252 +        echo mips-sei-seiux${UNAME_RELEASE}
 15.1253 +	exit ;;
 15.1254 +    *:DragonFly:*:*)
 15.1255 +	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 15.1256 +	exit ;;
 15.1257 +    *:*VMS:*:*)
 15.1258 +    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 15.1259 +	case "${UNAME_MACHINE}" in
 15.1260 +	    A*) echo alpha-dec-vms ; exit ;;
 15.1261 +	    I*) echo ia64-dec-vms ; exit ;;
 15.1262 +	    V*) echo vax-dec-vms ; exit ;;
 15.1263 +	esac ;;
 15.1264 +    *:XENIX:*:SysV)
 15.1265 +	echo i386-pc-xenix
 15.1266 +	exit ;;
 15.1267 +    i*86:skyos:*:*)
 15.1268 +	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
 15.1269 +	exit ;;
 15.1270 +esac
 15.1271 +
 15.1272 +#echo '(No uname command or uname output not recognized.)' 1>&2
 15.1273 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 15.1274 +
 15.1275 +eval $set_cc_for_build
 15.1276 +cat >$dummy.c <<EOF
 15.1277 +#ifdef _SEQUENT_
 15.1278 +# include <sys/types.h>
 15.1279 +# include <sys/utsname.h>
 15.1280 +#endif
 15.1281 +main ()
 15.1282 +{
 15.1283 +#if defined (sony)
 15.1284 +#if defined (MIPSEB)
 15.1285 +  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
 15.1286 +     I don't know....  */
 15.1287 +  printf ("mips-sony-bsd\n"); exit (0);
 15.1288 +#else
 15.1289 +#include <sys/param.h>
 15.1290 +  printf ("m68k-sony-newsos%s\n",
 15.1291 +#ifdef NEWSOS4
 15.1292 +          "4"
 15.1293 +#else
 15.1294 +	  ""
 15.1295 +#endif
 15.1296 +         ); exit (0);
 15.1297 +#endif
 15.1298 +#endif
 15.1299 +
 15.1300 +#if defined (__arm) && defined (__acorn) && defined (__unix)
 15.1301 +  printf ("arm-acorn-riscix\n"); exit (0);
 15.1302 +#endif
 15.1303 +
 15.1304 +#if defined (hp300) && !defined (hpux)
 15.1305 +  printf ("m68k-hp-bsd\n"); exit (0);
 15.1306 +#endif
 15.1307 +
 15.1308 +#if defined (NeXT)
 15.1309 +#if !defined (__ARCHITECTURE__)
 15.1310 +#define __ARCHITECTURE__ "m68k"
 15.1311 +#endif
 15.1312 +  int version;
 15.1313 +  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
 15.1314 +  if (version < 4)
 15.1315 +    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
 15.1316 +  else
 15.1317 +    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
 15.1318 +  exit (0);
 15.1319 +#endif
 15.1320 +
 15.1321 +#if defined (MULTIMAX) || defined (n16)
 15.1322 +#if defined (UMAXV)
 15.1323 +  printf ("ns32k-encore-sysv\n"); exit (0);
 15.1324 +#else
 15.1325 +#if defined (CMU)
 15.1326 +  printf ("ns32k-encore-mach\n"); exit (0);
 15.1327 +#else
 15.1328 +  printf ("ns32k-encore-bsd\n"); exit (0);
 15.1329 +#endif
 15.1330 +#endif
 15.1331 +#endif
 15.1332 +
 15.1333 +#if defined (__386BSD__)
 15.1334 +  printf ("i386-pc-bsd\n"); exit (0);
 15.1335 +#endif
 15.1336 +
 15.1337 +#if defined (sequent)
 15.1338 +#if defined (i386)
 15.1339 +  printf ("i386-sequent-dynix\n"); exit (0);
 15.1340 +#endif
 15.1341 +#if defined (ns32000)
 15.1342 +  printf ("ns32k-sequent-dynix\n"); exit (0);
 15.1343 +#endif
 15.1344 +#endif
 15.1345 +
 15.1346 +#if defined (_SEQUENT_)
 15.1347 +    struct utsname un;
 15.1348 +
 15.1349 +    uname(&un);
 15.1350 +
 15.1351 +    if (strncmp(un.version, "V2", 2) == 0) {
 15.1352 +	printf ("i386-sequent-ptx2\n"); exit (0);
 15.1353 +    }
 15.1354 +    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
 15.1355 +	printf ("i386-sequent-ptx1\n"); exit (0);
 15.1356 +    }
 15.1357 +    printf ("i386-sequent-ptx\n"); exit (0);
 15.1358 +
 15.1359 +#endif
 15.1360 +
 15.1361 +#if defined (vax)
 15.1362 +# if !defined (ultrix)
 15.1363 +#  include <sys/param.h>
 15.1364 +#  if defined (BSD)
 15.1365 +#   if BSD == 43
 15.1366 +      printf ("vax-dec-bsd4.3\n"); exit (0);
 15.1367 +#   else
 15.1368 +#    if BSD == 199006
 15.1369 +      printf ("vax-dec-bsd4.3reno\n"); exit (0);
 15.1370 +#    else
 15.1371 +      printf ("vax-dec-bsd\n"); exit (0);
 15.1372 +#    endif
 15.1373 +#   endif
 15.1374 +#  else
 15.1375 +    printf ("vax-dec-bsd\n"); exit (0);
 15.1376 +#  endif
 15.1377 +# else
 15.1378 +    printf ("vax-dec-ultrix\n"); exit (0);
 15.1379 +# endif
 15.1380 +#endif
 15.1381 +
 15.1382 +#if defined (alliant) && defined (i860)
 15.1383 +  printf ("i860-alliant-bsd\n"); exit (0);
 15.1384 +#endif
 15.1385 +
 15.1386 +  exit (1);
 15.1387 +}
 15.1388 +EOF
 15.1389 +
 15.1390 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
 15.1391 +	{ echo "$SYSTEM_NAME"; exit; }
 15.1392 +
 15.1393 +# Apollos put the system type in the environment.
 15.1394 +
 15.1395 +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 15.1396 +
 15.1397 +# Convex versions that predate uname can use getsysinfo(1)
 15.1398 +
 15.1399 +if [ -x /usr/convex/getsysinfo ]
 15.1400 +then
 15.1401 +    case `getsysinfo -f cpu_type` in
 15.1402 +    c1*)
 15.1403 +	echo c1-convex-bsd
 15.1404 +	exit ;;
 15.1405 +    c2*)
 15.1406 +	if getsysinfo -f scalar_acc
 15.1407 +	then echo c32-convex-bsd
 15.1408 +	else echo c2-convex-bsd
 15.1409 +	fi
 15.1410 +	exit ;;
 15.1411 +    c34*)
 15.1412 +	echo c34-convex-bsd
 15.1413 +	exit ;;
 15.1414 +    c38*)
 15.1415 +	echo c38-convex-bsd
 15.1416 +	exit ;;
 15.1417 +    c4*)
 15.1418 +	echo c4-convex-bsd
 15.1419 +	exit ;;
 15.1420 +    esac
 15.1421 +fi
 15.1422 +
 15.1423 +cat >&2 <<EOF
 15.1424 +$0: unable to guess system type
 15.1425 +
 15.1426 +This script, last modified $timestamp, has failed to recognize
 15.1427 +the operating system you are using. It is advised that you
 15.1428 +download the most up to date version of the config scripts from
 15.1429 +
 15.1430 +  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
 15.1431 +and
 15.1432 +  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 15.1433 +
 15.1434 +If the version you run ($0) is already up to date, please
 15.1435 +send the following data and any information you think might be
 15.1436 +pertinent to <config-patches@gnu.org> in order to provide the needed
 15.1437 +information to handle your system.
 15.1438 +
 15.1439 +config.guess timestamp = $timestamp
 15.1440 +
 15.1441 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
 15.1442 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
 15.1443 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
 15.1444 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
 15.1445 +
 15.1446 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
 15.1447 +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
 15.1448 +
 15.1449 +hostinfo               = `(hostinfo) 2>/dev/null`
 15.1450 +/bin/universe          = `(/bin/universe) 2>/dev/null`
 15.1451 +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
 15.1452 +/bin/arch              = `(/bin/arch) 2>/dev/null`
 15.1453 +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 15.1454 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 15.1455 +
 15.1456 +UNAME_MACHINE = ${UNAME_MACHINE}
 15.1457 +UNAME_RELEASE = ${UNAME_RELEASE}
 15.1458 +UNAME_SYSTEM  = ${UNAME_SYSTEM}
 15.1459 +UNAME_VERSION = ${UNAME_VERSION}
 15.1460 +EOF
 15.1461 +
 15.1462 +exit 1
 15.1463 +
 15.1464 +# Local variables:
 15.1465 +# eval: (add-hook 'write-file-hooks 'time-stamp)
 15.1466 +# time-stamp-start: "timestamp='"
 15.1467 +# time-stamp-format: "%:y-%02m-%02d"
 15.1468 +# time-stamp-end: "'"
 15.1469 +# End:
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/config.h.in	Fri Sep 26 17:05:23 2008 +0200
    16.3 @@ -0,0 +1,183 @@
    16.4 +/* config.h.in.  Generated from configure.ac by autoheader.  */
    16.5 +#undef DEF_MAIL_GROUP
    16.6 +#undef DEF_MAIL_USER
    16.7 +
    16.8 +/* Define if you want to use lockfile library.  */
    16.9 +#undef USE_LIBLOCKFILE
   16.10 +
   16.11 +#undef ENABLE_DEBUG
   16.12 +
   16.13 +#undef ENABLE_RESOLVER
   16.14 +
   16.15 +#undef ENABLE_SMTP_SERVER
   16.16 +
   16.17 +#undef ENABLE_POP3
   16.18 +
   16.19 +#undef ENABLE_AUTH
   16.20 +
   16.21 +#undef ENABLE_MAILDIR
   16.22 +
   16.23 +#undef USE_LIB_CRYPTO
   16.24 +
   16.25 +#undef ENABLE_IDENT
   16.26 +
   16.27 +#undef ENABLE_MSERVER
   16.28 +
   16.29 +#undef CONF_DIR
   16.30 +
   16.31 +#undef DATA_DIR
   16.32 +
   16.33 +#undef SBINDIR
   16.34 +
   16.35 +/* The configuration file location */
   16.36 +#undef CONF_DIR
   16.37 +
   16.38 +/* The data directory */
   16.39 +#undef DATA_DIR
   16.40 +
   16.41 +/* The mail group */
   16.42 +#undef DEF_MAIL_GROUP
   16.43 +
   16.44 +/* The mail user */
   16.45 +#undef DEF_MAIL_USER
   16.46 +
   16.47 +/* If AUTH is enabled */
   16.48 +#undef ENABLE_AUTH
   16.49 +
   16.50 +/* If debugging is enabled */
   16.51 +#undef ENABLE_DEBUG
   16.52 +
   16.53 +/* If ident is enabled */
   16.54 +#undef ENABLE_IDENT
   16.55 +
   16.56 +/* If Maildirs are enabled */
   16.57 +#undef ENABLE_MAILDIR
   16.58 +
   16.59 +/* If mserver support is enabled */
   16.60 +#undef ENABLE_MSERVER
   16.61 +
   16.62 +/* If the POP3 support is enabled */
   16.63 +#undef ENABLE_POP3
   16.64 +
   16.65 +/* If the resolver is to be used */
   16.66 +#undef ENABLE_RESOLVER
   16.67 +
   16.68 +/* If the SMTP server is enabled */
   16.69 +#undef ENABLE_SMTP_SERVER
   16.70 +
   16.71 +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
   16.72 +#undef HAVE_DOPRNT
   16.73 +
   16.74 +/* Define to 1 if you have the <fcntl.h> header file. */
   16.75 +#undef HAVE_FCNTL_H
   16.76 +
   16.77 +/* Define to 1 if you have the `fdatasync' function. */
   16.78 +#undef HAVE_FDATASYNC
   16.79 +
   16.80 +/* Define to 1 if your system has a working POSIX `fnmatch' function. */
   16.81 +#undef HAVE_FNMATCH
   16.82 +
   16.83 +/* Define to 1 if you have the `getline' function. */
   16.84 +#undef HAVE_GETLINE
   16.85 +
   16.86 +/* Define to 1 if you have the <inttypes.h> header file. */
   16.87 +#undef HAVE_INTTYPES_H
   16.88 +
   16.89 +/* Define to 1 if you have the <memory.h> header file. */
   16.90 +#undef HAVE_MEMORY_H
   16.91 +
   16.92 +/* Define to 1 if you have the `select' function. */
   16.93 +#undef HAVE_SELECT
   16.94 +
   16.95 +/* Define to 1 if you have the `socket' function. */
   16.96 +#undef HAVE_SOCKET
   16.97 +
   16.98 +/* Define to 1 if you have the <stdint.h> header file. */
   16.99 +#undef HAVE_STDINT_H
  16.100 +
  16.101 +/* Define to 1 if you have the <stdlib.h> header file. */
  16.102 +#undef HAVE_STDLIB_H
  16.103 +
  16.104 +/* Define to 1 if you have the `strerror' function. */
  16.105 +#undef HAVE_STRERROR
  16.106 +
  16.107 +/* Define to 1 if you have the `strftime' function. */
  16.108 +#undef HAVE_STRFTIME
  16.109 +
  16.110 +/* Define to 1 if you have the <strings.h> header file. */
  16.111 +#undef HAVE_STRINGS_H
  16.112 +
  16.113 +/* Define to 1 if you have the <string.h> header file. */
  16.114 +#undef HAVE_STRING_H
  16.115 +
  16.116 +/* Define to 1 if you have the `strstr' function. */
  16.117 +#undef HAVE_STRSTR
  16.118 +
  16.119 +/* Define to 1 if you have the <syslog.h> header file. */
  16.120 +#undef HAVE_SYSLOG_H
  16.121 +
  16.122 +/* Define to 1 if you have the <sys/stat.h> header file. */
  16.123 +#undef HAVE_SYS_STAT_H
  16.124 +
  16.125 +/* Define to 1 if you have the <sys/time.h> header file. */
  16.126 +#undef HAVE_SYS_TIME_H
  16.127 +
  16.128 +/* Define to 1 if you have the <sys/types.h> header file. */
  16.129 +#undef HAVE_SYS_TYPES_H
  16.130 +
  16.131 +/* Define to 1 if you have the <unistd.h> header file. */
  16.132 +#undef HAVE_UNISTD_H
  16.133 +
  16.134 +/* Define to 1 if you have the `vprintf' function. */
  16.135 +#undef HAVE_VPRINTF
  16.136 +
  16.137 +/* Name of package */
  16.138 +#undef PACKAGE
  16.139 +
  16.140 +/* Define to the address where bug reports for this package should be sent. */
  16.141 +#undef PACKAGE_BUGREPORT
  16.142 +
  16.143 +/* Define to the full name of this package. */
  16.144 +#undef PACKAGE_NAME
  16.145 +
  16.146 +/* Define to the full name and version of this package. */
  16.147 +#undef PACKAGE_STRING
  16.148 +
  16.149 +/* Define to the one symbol short name of this package. */
  16.150 +#undef PACKAGE_TARNAME
  16.151 +
  16.152 +/* Define to the version of this package. */
  16.153 +#undef PACKAGE_VERSION
  16.154 +
  16.155 +/* Define as the return type of signal handlers (`int' or `void'). */
  16.156 +#undef RETSIGTYPE
  16.157 +
  16.158 +/* The sbin directory */
  16.159 +#undef SBINDIR
  16.160 +
  16.161 +/* Define to 1 if you have the ANSI C header files. */
  16.162 +#undef STDC_HEADERS
  16.163 +
  16.164 +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
  16.165 +#undef TIME_WITH_SYS_TIME
  16.166 +
  16.167 +/* Define to 1 if your <sys/time.h> declares `struct tm'. */
  16.168 +#undef TM_IN_SYS_TIME
  16.169 +
  16.170 +/* If liblockfile is to be used */
  16.171 +#undef USE_LIBLOCKFILE
  16.172 +
  16.173 +/* If libcrypto is available */
  16.174 +#undef USE_LIB_CRYPTO
  16.175 +
  16.176 +/* Version number of package */
  16.177 +#undef VERSION
  16.178 +
  16.179 +/* Define to empty if `const' does not conform to ANSI C. */
  16.180 +#undef const
  16.181 +
  16.182 +/* Define to `int' if <sys/types.h> does not define. */
  16.183 +#undef pid_t
  16.184 +
  16.185 +/* Define to `unsigned' if <sys/types.h> does not define. */
  16.186 +#undef size_t
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/config.sub	Fri Sep 26 17:05:23 2008 +0200
    17.3 @@ -0,0 +1,1579 @@
    17.4 +#! /bin/sh
    17.5 +# Configuration validation subroutine script.
    17.6 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    17.7 +#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    17.8 +
    17.9 +timestamp='2005-07-08'
   17.10 +
   17.11 +# This file is (in principle) common to ALL GNU software.
   17.12 +# The presence of a machine in this file suggests that SOME GNU software
   17.13 +# can handle that machine.  It does not imply ALL GNU software can.
   17.14 +#
   17.15 +# This file is free software; you can redistribute it and/or modify
   17.16 +# it under the terms of the GNU General Public License as published by
   17.17 +# the Free Software Foundation; either version 2 of the License, or
   17.18 +# (at your option) any later version.
   17.19 +#
   17.20 +# This program is distributed in the hope that it will be useful,
   17.21 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   17.22 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17.23 +# GNU General Public License for more details.
   17.24 +#
   17.25 +# You should have received a copy of the GNU General Public License
   17.26 +# along with this program; if not, write to the Free Software
   17.27 +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
   17.28 +# 02110-1301, USA.
   17.29 +#
   17.30 +# As a special exception to the GNU General Public License, if you
   17.31 +# distribute this file as part of a program that contains a
   17.32 +# configuration script generated by Autoconf, you may include it under
   17.33 +# the same distribution terms that you use for the rest of that program.
   17.34 +
   17.35 +
   17.36 +# Please send patches to <config-patches@gnu.org>.  Submit a context
   17.37 +# diff and a properly formatted ChangeLog entry.
   17.38 +#
   17.39 +# Configuration subroutine to validate and canonicalize a configuration type.
   17.40 +# Supply the specified configuration type as an argument.
   17.41 +# If it is invalid, we print an error message on stderr and exit with code 1.
   17.42 +# Otherwise, we print the canonical config type on stdout and succeed.
   17.43 +
   17.44 +# This file is supposed to be the same for all GNU packages
   17.45 +# and recognize all the CPU types, system types and aliases
   17.46 +# that are meaningful with *any* GNU software.
   17.47 +# Each package is responsible for reporting which valid configurations
   17.48 +# it does not support.  The user should be able to distinguish
   17.49 +# a failure to support a valid configuration from a meaningless
   17.50 +# configuration.
   17.51 +
   17.52 +# The goal of this file is to map all the various variations of a given
   17.53 +# machine specification into a single specification in the form:
   17.54 +#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
   17.55 +# or in some cases, the newer four-part form:
   17.56 +#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
   17.57 +# It is wrong to echo any other type of specification.
   17.58 +
   17.59 +me=`echo "$0" | sed -e 's,.*/,,'`
   17.60 +
   17.61 +usage="\
   17.62 +Usage: $0 [OPTION] CPU-MFR-OPSYS
   17.63 +       $0 [OPTION] ALIAS
   17.64 +
   17.65 +Canonicalize a configuration name.
   17.66 +
   17.67 +Operation modes:
   17.68 +  -h, --help         print this help, then exit
   17.69 +  -t, --time-stamp   print date of last modification, then exit
   17.70 +  -v, --version      print version number, then exit
   17.71 +
   17.72 +Report bugs and patches to <config-patches@gnu.org>."
   17.73 +
   17.74 +version="\
   17.75 +GNU config.sub ($timestamp)
   17.76 +
   17.77 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
   17.78 +Free Software Foundation, Inc.
   17.79 +
   17.80 +This is free software; see the source for copying conditions.  There is NO
   17.81 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   17.82 +
   17.83 +help="
   17.84 +Try \`$me --help' for more information."
   17.85 +
   17.86 +# Parse command line
   17.87 +while test $# -gt 0 ; do
   17.88 +  case $1 in
   17.89 +    --time-stamp | --time* | -t )
   17.90 +       echo "$timestamp" ; exit ;;
   17.91 +    --version | -v )
   17.92 +       echo "$version" ; exit ;;
   17.93 +    --help | --h* | -h )
   17.94 +       echo "$usage"; exit ;;
   17.95 +    -- )     # Stop option processing
   17.96 +       shift; break ;;
   17.97 +    - )	# Use stdin as input.
   17.98 +       break ;;
   17.99 +    -* )
  17.100 +       echo "$me: invalid option $1$help"
  17.101 +       exit 1 ;;
  17.102 +
  17.103 +    *local*)
  17.104 +       # First pass through any local machine types.
  17.105 +       echo $1
  17.106 +       exit ;;
  17.107 +
  17.108 +    * )
  17.109 +       break ;;
  17.110 +  esac
  17.111 +done
  17.112 +
  17.113 +case $# in
  17.114 + 0) echo "$me: missing argument$help" >&2
  17.115 +    exit 1;;
  17.116 + 1) ;;
  17.117 + *) echo "$me: too many arguments$help" >&2
  17.118 +    exit 1;;
  17.119 +esac
  17.120 +
  17.121 +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  17.122 +# Here we must recognize all the valid KERNEL-OS combinations.
  17.123 +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  17.124 +case $maybe_os in
  17.125 +  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
  17.126 +  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
  17.127 +    os=-$maybe_os
  17.128 +    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
  17.129 +    ;;
  17.130 +  *)
  17.131 +    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  17.132 +    if [ $basic_machine != $1 ]
  17.133 +    then os=`echo $1 | sed 's/.*-/-/'`
  17.134 +    else os=; fi
  17.135 +    ;;
  17.136 +esac
  17.137 +
  17.138 +### Let's recognize common machines as not being operating systems so
  17.139 +### that things like config.sub decstation-3100 work.  We also
  17.140 +### recognize some manufacturers as not being operating systems, so we
  17.141 +### can provide default operating systems below.
  17.142 +case $os in
  17.143 +	-sun*os*)
  17.144 +		# Prevent following clause from handling this invalid input.
  17.145 +		;;
  17.146 +	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  17.147 +	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  17.148 +	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  17.149 +	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  17.150 +	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  17.151 +	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  17.152 +	-apple | -axis | -knuth | -cray)
  17.153 +		os=
  17.154 +		basic_machine=$1
  17.155 +		;;
  17.156 +	-sim | -cisco | -oki | -wec | -winbond)
  17.157 +		os=
  17.158 +		basic_machine=$1
  17.159 +		;;
  17.160 +	-scout)
  17.161 +		;;
  17.162 +	-wrs)
  17.163 +		os=-vxworks
  17.164 +		basic_machine=$1
  17.165 +		;;
  17.166 +	-chorusos*)
  17.167 +		os=-chorusos
  17.168 +		basic_machine=$1
  17.169 +		;;
  17.170 + 	-chorusrdb)
  17.171 + 		os=-chorusrdb
  17.172 +		basic_machine=$1
  17.173 + 		;;
  17.174 +	-hiux*)
  17.175 +		os=-hiuxwe2
  17.176 +		;;
  17.177 +	-sco5)
  17.178 +		os=-sco3.2v5
  17.179 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.180 +		;;
  17.181 +	-sco4)
  17.182 +		os=-sco3.2v4
  17.183 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.184 +		;;
  17.185 +	-sco3.2.[4-9]*)
  17.186 +		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  17.187 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.188 +		;;
  17.189 +	-sco3.2v[4-9]*)
  17.190 +		# Don't forget version if it is 3.2v4 or newer.
  17.191 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.192 +		;;
  17.193 +	-sco*)
  17.194 +		os=-sco3.2v2
  17.195 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.196 +		;;
  17.197 +	-udk*)
  17.198 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.199 +		;;
  17.200 +	-isc)
  17.201 +		os=-isc2.2
  17.202 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.203 +		;;
  17.204 +	-clix*)
  17.205 +		basic_machine=clipper-intergraph
  17.206 +		;;
  17.207 +	-isc*)
  17.208 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  17.209 +		;;
  17.210 +	-lynx*)
  17.211 +		os=-lynxos
  17.212 +		;;
  17.213 +	-ptx*)
  17.214 +		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
  17.215 +		;;
  17.216 +	-windowsnt*)
  17.217 +		os=`echo $os | sed -e 's/windowsnt/winnt/'`
  17.218 +		;;
  17.219 +	-psos*)
  17.220 +		os=-psos
  17.221 +		;;
  17.222 +	-mint | -mint[0-9]*)
  17.223 +		basic_machine=m68k-atari
  17.224 +		os=-mint
  17.225 +		;;
  17.226 +esac
  17.227 +
  17.228 +# Decode aliases for certain CPU-COMPANY combinations.
  17.229 +case $basic_machine in
  17.230 +	# Recognize the basic CPU types without company name.
  17.231 +	# Some are omitted here because they have special meanings below.
  17.232 +	1750a | 580 \
  17.233 +	| a29k \
  17.234 +	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
  17.235 +	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
  17.236 +	| am33_2.0 \
  17.237 +	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
  17.238 +	| bfin \
  17.239 +	| c4x | clipper \
  17.240 +	| d10v | d30v | dlx | dsp16xx \
  17.241 +	| fr30 | frv \
  17.242 +	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
  17.243 +	| i370 | i860 | i960 | ia64 \
  17.244 +	| ip2k | iq2000 \
  17.245 +	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
  17.246 +	| mips | mipsbe | mipseb | mipsel | mipsle \
  17.247 +	| mips16 \
  17.248 +	| mips64 | mips64el \
  17.249 +	| mips64vr | mips64vrel \
  17.250 +	| mips64orion | mips64orionel \
  17.251 +	| mips64vr4100 | mips64vr4100el \
  17.252 +	| mips64vr4300 | mips64vr4300el \
  17.253 +	| mips64vr5000 | mips64vr5000el \
  17.254 +	| mips64vr5900 | mips64vr5900el \
  17.255 +	| mipsisa32 | mipsisa32el \
  17.256 +	| mipsisa32r2 | mipsisa32r2el \
  17.257 +	| mipsisa64 | mipsisa64el \
  17.258 +	| mipsisa64r2 | mipsisa64r2el \
  17.259 +	| mipsisa64sb1 | mipsisa64sb1el \
  17.260 +	| mipsisa64sr71k | mipsisa64sr71kel \
  17.261 +	| mipstx39 | mipstx39el \
  17.262 +	| mn10200 | mn10300 \
  17.263 +	| ms1 \
  17.264 +	| msp430 \
  17.265 +	| ns16k | ns32k \
  17.266 +	| or32 \
  17.267 +	| pdp10 | pdp11 | pj | pjl \
  17.268 +	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
  17.269 +	| pyramid \
  17.270 +	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
  17.271 +	| sh64 | sh64le \
  17.272 +	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
  17.273 +	| sparcv8 | sparcv9 | sparcv9b \
  17.274 +	| strongarm \
  17.275 +	| tahoe | thumb | tic4x | tic80 | tron \
  17.276 +	| v850 | v850e \
  17.277 +	| we32k \
  17.278 +	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
  17.279 +	| z8k)
  17.280 +		basic_machine=$basic_machine-unknown
  17.281 +		;;
  17.282 +	m32c)
  17.283 +		basic_machine=$basic_machine-unknown
  17.284 +		;;
  17.285 +	m6811 | m68hc11 | m6812 | m68hc12)
  17.286 +		# Motorola 68HC11/12.
  17.287 +		basic_machine=$basic_machine-unknown
  17.288 +		os=-none
  17.289 +		;;
  17.290 +	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
  17.291 +		;;
  17.292 +
  17.293 +	# We use `pc' rather than `unknown'
  17.294 +	# because (1) that's what they normally are, and
  17.295 +	# (2) the word "unknown" tends to confuse beginning users.
  17.296 +	i*86 | x86_64)
  17.297 +	  basic_machine=$basic_machine-pc
  17.298 +	  ;;
  17.299 +	# Object if more than one company name word.
  17.300 +	*-*-*)
  17.301 +		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  17.302 +		exit 1
  17.303 +		;;
  17.304 +	# Recognize the basic CPU types with company name.
  17.305 +	580-* \
  17.306 +	| a29k-* \
  17.307 +	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
  17.308 +	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
  17.309 +	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
  17.310 +	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
  17.311 +	| avr-* \
  17.312 +	| bfin-* | bs2000-* \
  17.313 +	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
  17.314 +	| clipper-* | craynv-* | cydra-* \
  17.315 +	| d10v-* | d30v-* | dlx-* \
  17.316 +	| elxsi-* \
  17.317 +	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
  17.318 +	| h8300-* | h8500-* \
  17.319 +	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
  17.320 +	| i*86-* | i860-* | i960-* | ia64-* \
  17.321 +	| ip2k-* | iq2000-* \
  17.322 +	| m32r-* | m32rle-* \
  17.323 +	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
  17.324 +	| m88110-* | m88k-* | maxq-* | mcore-* \
  17.325 +	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
  17.326 +	| mips16-* \
  17.327 +	| mips64-* | mips64el-* \
  17.328 +	| mips64vr-* | mips64vrel-* \
  17.329 +	| mips64orion-* | mips64orionel-* \
  17.330 +	| mips64vr4100-* | mips64vr4100el-* \
  17.331 +	| mips64vr4300-* | mips64vr4300el-* \
  17.332 +	| mips64vr5000-* | mips64vr5000el-* \
  17.333 +	| mips64vr5900-* | mips64vr5900el-* \
  17.334 +	| mipsisa32-* | mipsisa32el-* \
  17.335 +	| mipsisa32r2-* | mipsisa32r2el-* \
  17.336 +	| mipsisa64-* | mipsisa64el-* \
  17.337 +	| mipsisa64r2-* | mipsisa64r2el-* \
  17.338 +	| mipsisa64sb1-* | mipsisa64sb1el-* \
  17.339 +	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
  17.340 +	| mipstx39-* | mipstx39el-* \
  17.341 +	| mmix-* \
  17.342 +	| ms1-* \
  17.343 +	| msp430-* \
  17.344 +	| none-* | np1-* | ns16k-* | ns32k-* \
  17.345 +	| orion-* \
  17.346 +	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
  17.347 +	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
  17.348 +	| pyramid-* \
  17.349 +	| romp-* | rs6000-* \
  17.350 +	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
  17.351 +	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
  17.352 +	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
  17.353 +	| sparclite-* \
  17.354 +	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
  17.355 +	| tahoe-* | thumb-* \
  17.356 +	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
  17.357 +	| tron-* \
  17.358 +	| v850-* | v850e-* | vax-* \
  17.359 +	| we32k-* \
  17.360 +	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
  17.361 +	| xstormy16-* | xtensa-* \
  17.362 +	| ymp-* \
  17.363 +	| z8k-*)
  17.364 +		;;
  17.365 +	m32c-*)
  17.366 +		;;
  17.367 +	# Recognize the various machine names and aliases which stand
  17.368 +	# for a CPU type and a company and sometimes even an OS.
  17.369 +	386bsd)
  17.370 +		basic_machine=i386-unknown
  17.371 +		os=-bsd
  17.372 +		;;
  17.373 +	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  17.374 +		basic_machine=m68000-att
  17.375 +		;;
  17.376 +	3b*)
  17.377 +		basic_machine=we32k-att
  17.378 +		;;
  17.379 +	a29khif)
  17.380 +		basic_machine=a29k-amd
  17.381 +		os=-udi
  17.382 +		;;
  17.383 +    	abacus)
  17.384 +		basic_machine=abacus-unknown
  17.385 +		;;
  17.386 +	adobe68k)
  17.387 +		basic_machine=m68010-adobe
  17.388 +		os=-scout
  17.389 +		;;
  17.390 +	alliant | fx80)
  17.391 +		basic_machine=fx80-alliant
  17.392 +		;;
  17.393 +	altos | altos3068)
  17.394 +		basic_machine=m68k-altos
  17.395 +		;;
  17.396 +	am29k)
  17.397 +		basic_machine=a29k-none
  17.398 +		os=-bsd
  17.399 +		;;
  17.400 +	amd64)
  17.401 +		basic_machine=x86_64-pc
  17.402 +		;;
  17.403 +	amd64-*)
  17.404 +		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.405 +		;;
  17.406 +	amdahl)
  17.407 +		basic_machine=580-amdahl
  17.408 +		os=-sysv
  17.409 +		;;
  17.410 +	amiga | amiga-*)
  17.411 +		basic_machine=m68k-unknown
  17.412 +		;;
  17.413 +	amigaos | amigados)
  17.414 +		basic_machine=m68k-unknown
  17.415 +		os=-amigaos
  17.416 +		;;
  17.417 +	amigaunix | amix)
  17.418 +		basic_machine=m68k-unknown
  17.419 +		os=-sysv4
  17.420 +		;;
  17.421 +	apollo68)
  17.422 +		basic_machine=m68k-apollo
  17.423 +		os=-sysv
  17.424 +		;;
  17.425 +	apollo68bsd)
  17.426 +		basic_machine=m68k-apollo
  17.427 +		os=-bsd
  17.428 +		;;
  17.429 +	aux)
  17.430 +		basic_machine=m68k-apple
  17.431 +		os=-aux
  17.432 +		;;
  17.433 +	balance)
  17.434 +		basic_machine=ns32k-sequent
  17.435 +		os=-dynix
  17.436 +		;;
  17.437 +	c90)
  17.438 +		basic_machine=c90-cray
  17.439 +		os=-unicos
  17.440 +		;;
  17.441 +	convex-c1)
  17.442 +		basic_machine=c1-convex
  17.443 +		os=-bsd
  17.444 +		;;
  17.445 +	convex-c2)
  17.446 +		basic_machine=c2-convex
  17.447 +		os=-bsd
  17.448 +		;;
  17.449 +	convex-c32)
  17.450 +		basic_machine=c32-convex
  17.451 +		os=-bsd
  17.452 +		;;
  17.453 +	convex-c34)
  17.454 +		basic_machine=c34-convex
  17.455 +		os=-bsd
  17.456 +		;;
  17.457 +	convex-c38)
  17.458 +		basic_machine=c38-convex
  17.459 +		os=-bsd
  17.460 +		;;
  17.461 +	cray | j90)
  17.462 +		basic_machine=j90-cray
  17.463 +		os=-unicos
  17.464 +		;;
  17.465 +	craynv)
  17.466 +		basic_machine=craynv-cray
  17.467 +		os=-unicosmp
  17.468 +		;;
  17.469 +	cr16c)
  17.470 +		basic_machine=cr16c-unknown
  17.471 +		os=-elf
  17.472 +		;;
  17.473 +	crds | unos)
  17.474 +		basic_machine=m68k-crds
  17.475 +		;;
  17.476 +	crisv32 | crisv32-* | etraxfs*)
  17.477 +		basic_machine=crisv32-axis
  17.478 +		;;
  17.479 +	cris | cris-* | etrax*)
  17.480 +		basic_machine=cris-axis
  17.481 +		;;
  17.482 +	crx)
  17.483 +		basic_machine=crx-unknown
  17.484 +		os=-elf
  17.485 +		;;
  17.486 +	da30 | da30-*)
  17.487 +		basic_machine=m68k-da30
  17.488 +		;;
  17.489 +	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  17.490 +		basic_machine=mips-dec
  17.491 +		;;
  17.492 +	decsystem10* | dec10*)
  17.493 +		basic_machine=pdp10-dec
  17.494 +		os=-tops10
  17.495 +		;;
  17.496 +	decsystem20* | dec20*)
  17.497 +		basic_machine=pdp10-dec
  17.498 +		os=-tops20
  17.499 +		;;
  17.500 +	delta | 3300 | motorola-3300 | motorola-delta \
  17.501 +	      | 3300-motorola | delta-motorola)
  17.502 +		basic_machine=m68k-motorola
  17.503 +		;;
  17.504 +	delta88)
  17.505 +		basic_machine=m88k-motorola
  17.506 +		os=-sysv3
  17.507 +		;;
  17.508 +	djgpp)
  17.509 +		basic_machine=i586-pc
  17.510 +		os=-msdosdjgpp
  17.511 +		;;
  17.512 +	dpx20 | dpx20-*)
  17.513 +		basic_machine=rs6000-bull
  17.514 +		os=-bosx
  17.515 +		;;
  17.516 +	dpx2* | dpx2*-bull)
  17.517 +		basic_machine=m68k-bull
  17.518 +		os=-sysv3
  17.519 +		;;
  17.520 +	ebmon29k)
  17.521 +		basic_machine=a29k-amd
  17.522 +		os=-ebmon
  17.523 +		;;
  17.524 +	elxsi)
  17.525 +		basic_machine=elxsi-elxsi
  17.526 +		os=-bsd
  17.527 +		;;
  17.528 +	encore | umax | mmax)
  17.529 +		basic_machine=ns32k-encore
  17.530 +		;;
  17.531 +	es1800 | OSE68k | ose68k | ose | OSE)
  17.532 +		basic_machine=m68k-ericsson
  17.533 +		os=-ose
  17.534 +		;;
  17.535 +	fx2800)
  17.536 +		basic_machine=i860-alliant
  17.537 +		;;
  17.538 +	genix)
  17.539 +		basic_machine=ns32k-ns
  17.540 +		;;
  17.541 +	gmicro)
  17.542 +		basic_machine=tron-gmicro
  17.543 +		os=-sysv
  17.544 +		;;
  17.545 +	go32)
  17.546 +		basic_machine=i386-pc
  17.547 +		os=-go32
  17.548 +		;;
  17.549 +	h3050r* | hiux*)
  17.550 +		basic_machine=hppa1.1-hitachi
  17.551 +		os=-hiuxwe2
  17.552 +		;;
  17.553 +	h8300hms)
  17.554 +		basic_machine=h8300-hitachi
  17.555 +		os=-hms
  17.556 +		;;
  17.557 +	h8300xray)
  17.558 +		basic_machine=h8300-hitachi
  17.559 +		os=-xray
  17.560 +		;;
  17.561 +	h8500hms)
  17.562 +		basic_machine=h8500-hitachi
  17.563 +		os=-hms
  17.564 +		;;
  17.565 +	harris)
  17.566 +		basic_machine=m88k-harris
  17.567 +		os=-sysv3
  17.568 +		;;
  17.569 +	hp300-*)
  17.570 +		basic_machine=m68k-hp
  17.571 +		;;
  17.572 +	hp300bsd)
  17.573 +		basic_machine=m68k-hp
  17.574 +		os=-bsd
  17.575 +		;;
  17.576 +	hp300hpux)
  17.577 +		basic_machine=m68k-hp
  17.578 +		os=-hpux
  17.579 +		;;
  17.580 +	hp3k9[0-9][0-9] | hp9[0-9][0-9])
  17.581 +		basic_machine=hppa1.0-hp
  17.582 +		;;
  17.583 +	hp9k2[0-9][0-9] | hp9k31[0-9])
  17.584 +		basic_machine=m68000-hp
  17.585 +		;;
  17.586 +	hp9k3[2-9][0-9])
  17.587 +		basic_machine=m68k-hp
  17.588 +		;;
  17.589 +	hp9k6[0-9][0-9] | hp6[0-9][0-9])
  17.590 +		basic_machine=hppa1.0-hp
  17.591 +		;;
  17.592 +	hp9k7[0-79][0-9] | hp7[0-79][0-9])
  17.593 +		basic_machine=hppa1.1-hp
  17.594 +		;;
  17.595 +	hp9k78[0-9] | hp78[0-9])
  17.596 +		# FIXME: really hppa2.0-hp
  17.597 +		basic_machine=hppa1.1-hp
  17.598 +		;;
  17.599 +	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
  17.600 +		# FIXME: really hppa2.0-hp
  17.601 +		basic_machine=hppa1.1-hp
  17.602 +		;;
  17.603 +	hp9k8[0-9][13679] | hp8[0-9][13679])
  17.604 +		basic_machine=hppa1.1-hp
  17.605 +		;;
  17.606 +	hp9k8[0-9][0-9] | hp8[0-9][0-9])
  17.607 +		basic_machine=hppa1.0-hp
  17.608 +		;;
  17.609 +	hppa-next)
  17.610 +		os=-nextstep3
  17.611 +		;;
  17.612 +	hppaosf)
  17.613 +		basic_machine=hppa1.1-hp
  17.614 +		os=-osf
  17.615 +		;;
  17.616 +	hppro)
  17.617 +		basic_machine=hppa1.1-hp
  17.618 +		os=-proelf
  17.619 +		;;
  17.620 +	i370-ibm* | ibm*)
  17.621 +		basic_machine=i370-ibm
  17.622 +		;;
  17.623 +# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
  17.624 +	i*86v32)
  17.625 +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  17.626 +		os=-sysv32
  17.627 +		;;
  17.628 +	i*86v4*)
  17.629 +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  17.630 +		os=-sysv4
  17.631 +		;;
  17.632 +	i*86v)
  17.633 +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  17.634 +		os=-sysv
  17.635 +		;;
  17.636 +	i*86sol2)
  17.637 +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  17.638 +		os=-solaris2
  17.639 +		;;
  17.640 +	i386mach)
  17.641 +		basic_machine=i386-mach
  17.642 +		os=-mach
  17.643 +		;;
  17.644 +	i386-vsta | vsta)
  17.645 +		basic_machine=i386-unknown
  17.646 +		os=-vsta
  17.647 +		;;
  17.648 +	iris | iris4d)
  17.649 +		basic_machine=mips-sgi
  17.650 +		case $os in
  17.651 +		    -irix*)
  17.652 +			;;
  17.653 +		    *)
  17.654 +			os=-irix4
  17.655 +			;;
  17.656 +		esac
  17.657 +		;;
  17.658 +	isi68 | isi)
  17.659 +		basic_machine=m68k-isi
  17.660 +		os=-sysv
  17.661 +		;;
  17.662 +	m88k-omron*)
  17.663 +		basic_machine=m88k-omron
  17.664 +		;;
  17.665 +	magnum | m3230)
  17.666 +		basic_machine=mips-mips
  17.667 +		os=-sysv
  17.668 +		;;
  17.669 +	merlin)
  17.670 +		basic_machine=ns32k-utek
  17.671 +		os=-sysv
  17.672 +		;;
  17.673 +	mingw32)
  17.674 +		basic_machine=i386-pc
  17.675 +		os=-mingw32
  17.676 +		;;
  17.677 +	miniframe)
  17.678 +		basic_machine=m68000-convergent
  17.679 +		;;
  17.680 +	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
  17.681 +		basic_machine=m68k-atari
  17.682 +		os=-mint
  17.683 +		;;
  17.684 +	mips3*-*)
  17.685 +		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  17.686 +		;;
  17.687 +	mips3*)
  17.688 +		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
  17.689 +		;;
  17.690 +	monitor)
  17.691 +		basic_machine=m68k-rom68k
  17.692 +		os=-coff
  17.693 +		;;
  17.694 +	morphos)
  17.695 +		basic_machine=powerpc-unknown
  17.696 +		os=-morphos
  17.697 +		;;
  17.698 +	msdos)
  17.699 +		basic_machine=i386-pc
  17.700 +		os=-msdos
  17.701 +		;;
  17.702 +	mvs)
  17.703 +		basic_machine=i370-ibm
  17.704 +		os=-mvs
  17.705 +		;;
  17.706 +	ncr3000)
  17.707 +		basic_machine=i486-ncr
  17.708 +		os=-sysv4
  17.709 +		;;
  17.710 +	netbsd386)
  17.711 +		basic_machine=i386-unknown
  17.712 +		os=-netbsd
  17.713 +		;;
  17.714 +	netwinder)
  17.715 +		basic_machine=armv4l-rebel
  17.716 +		os=-linux
  17.717 +		;;
  17.718 +	news | news700 | news800 | news900)
  17.719 +		basic_machine=m68k-sony
  17.720 +		os=-newsos
  17.721 +		;;
  17.722 +	news1000)
  17.723 +		basic_machine=m68030-sony
  17.724 +		os=-newsos
  17.725 +		;;
  17.726 +	news-3600 | risc-news)
  17.727 +		basic_machine=mips-sony
  17.728 +		os=-newsos
  17.729 +		;;
  17.730 +	necv70)
  17.731 +		basic_machine=v70-nec
  17.732 +		os=-sysv
  17.733 +		;;
  17.734 +	next | m*-next )
  17.735 +		basic_machine=m68k-next
  17.736 +		case $os in
  17.737 +		    -nextstep* )
  17.738 +			;;
  17.739 +		    -ns2*)
  17.740 +		      os=-nextstep2
  17.741 +			;;
  17.742 +		    *)
  17.743 +		      os=-nextstep3
  17.744 +			;;
  17.745 +		esac
  17.746 +		;;
  17.747 +	nh3000)
  17.748 +		basic_machine=m68k-harris
  17.749 +		os=-cxux
  17.750 +		;;
  17.751 +	nh[45]000)
  17.752 +		basic_machine=m88k-harris
  17.753 +		os=-cxux
  17.754 +		;;
  17.755 +	nindy960)
  17.756 +		basic_machine=i960-intel
  17.757 +		os=-nindy
  17.758 +		;;
  17.759 +	mon960)
  17.760 +		basic_machine=i960-intel
  17.761 +		os=-mon960
  17.762 +		;;
  17.763 +	nonstopux)
  17.764 +		basic_machine=mips-compaq
  17.765 +		os=-nonstopux
  17.766 +		;;
  17.767 +	np1)
  17.768 +		basic_machine=np1-gould
  17.769 +		;;
  17.770 +	nsr-tandem)
  17.771 +		basic_machine=nsr-tandem
  17.772 +		;;
  17.773 +	op50n-* | op60c-*)
  17.774 +		basic_machine=hppa1.1-oki
  17.775 +		os=-proelf
  17.776 +		;;
  17.777 +	openrisc | openrisc-*)
  17.778 +		basic_machine=or32-unknown
  17.779 +		;;
  17.780 +	os400)
  17.781 +		basic_machine=powerpc-ibm
  17.782 +		os=-os400
  17.783 +		;;
  17.784 +	OSE68000 | ose68000)
  17.785 +		basic_machine=m68000-ericsson
  17.786 +		os=-ose
  17.787 +		;;
  17.788 +	os68k)
  17.789 +		basic_machine=m68k-none
  17.790 +		os=-os68k
  17.791 +		;;
  17.792 +	pa-hitachi)
  17.793 +		basic_machine=hppa1.1-hitachi
  17.794 +		os=-hiuxwe2
  17.795 +		;;
  17.796 +	paragon)
  17.797 +		basic_machine=i860-intel
  17.798 +		os=-osf
  17.799 +		;;
  17.800 +	pbd)
  17.801 +		basic_machine=sparc-tti
  17.802 +		;;
  17.803 +	pbb)
  17.804 +		basic_machine=m68k-tti
  17.805 +		;;
  17.806 +	pc532 | pc532-*)
  17.807 +		basic_machine=ns32k-pc532
  17.808 +		;;
  17.809 +	pentium | p5 | k5 | k6 | nexgen | viac3)
  17.810 +		basic_machine=i586-pc
  17.811 +		;;
  17.812 +	pentiumpro | p6 | 6x86 | athlon | athlon_*)
  17.813 +		basic_machine=i686-pc
  17.814 +		;;
  17.815 +	pentiumii | pentium2 | pentiumiii | pentium3)
  17.816 +		basic_machine=i686-pc
  17.817 +		;;
  17.818 +	pentium4)
  17.819 +		basic_machine=i786-pc
  17.820 +		;;
  17.821 +	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
  17.822 +		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.823 +		;;
  17.824 +	pentiumpro-* | p6-* | 6x86-* | athlon-*)
  17.825 +		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.826 +		;;
  17.827 +	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
  17.828 +		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.829 +		;;
  17.830 +	pentium4-*)
  17.831 +		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.832 +		;;
  17.833 +	pn)
  17.834 +		basic_machine=pn-gould
  17.835 +		;;
  17.836 +	power)	basic_machine=power-ibm
  17.837 +		;;
  17.838 +	ppc)	basic_machine=powerpc-unknown
  17.839 +		;;
  17.840 +	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.841 +		;;
  17.842 +	ppcle | powerpclittle | ppc-le | powerpc-little)
  17.843 +		basic_machine=powerpcle-unknown
  17.844 +		;;
  17.845 +	ppcle-* | powerpclittle-*)
  17.846 +		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.847 +		;;
  17.848 +	ppc64)	basic_machine=powerpc64-unknown
  17.849 +		;;
  17.850 +	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.851 +		;;
  17.852 +	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
  17.853 +		basic_machine=powerpc64le-unknown
  17.854 +		;;
  17.855 +	ppc64le-* | powerpc64little-*)
  17.856 +		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
  17.857 +		;;
  17.858 +	ps2)
  17.859 +		basic_machine=i386-ibm
  17.860 +		;;
  17.861 +	pw32)
  17.862 +		basic_machine=i586-unknown
  17.863 +		os=-pw32
  17.864 +		;;
  17.865 +	rom68k)
  17.866 +		basic_machine=m68k-rom68k
  17.867 +		os=-coff
  17.868 +		;;
  17.869 +	rm[46]00)
  17.870 +		basic_machine=mips-siemens
  17.871 +		;;
  17.872 +	rtpc | rtpc-*)
  17.873 +		basic_machine=romp-ibm
  17.874 +		;;
  17.875 +	s390 | s390-*)
  17.876 +		basic_machine=s390-ibm
  17.877 +		;;
  17.878 +	s390x | s390x-*)
  17.879 +		basic_machine=s390x-ibm
  17.880 +		;;
  17.881 +	sa29200)
  17.882 +		basic_machine=a29k-amd
  17.883 +		os=-udi
  17.884 +		;;
  17.885 +	sb1)
  17.886 +		basic_machine=mipsisa64sb1-unknown
  17.887 +		;;
  17.888 +	sb1el)
  17.889 +		basic_machine=mipsisa64sb1el-unknown
  17.890 +		;;
  17.891 +	sei)
  17.892 +		basic_machine=mips-sei
  17.893 +		os=-seiux
  17.894 +		;;
  17.895 +	sequent)
  17.896 +		basic_machine=i386-sequent
  17.897 +		;;
  17.898 +	sh)
  17.899 +		basic_machine=sh-hitachi
  17.900 +		os=-hms
  17.901 +		;;
  17.902 +	sh64)
  17.903 +		basic_machine=sh64-unknown
  17.904 +		;;
  17.905 +	sparclite-wrs | simso-wrs)
  17.906 +		basic_machine=sparclite-wrs
  17.907 +		os=-vxworks
  17.908 +		;;
  17.909 +	sps7)
  17.910 +		basic_machine=m68k-bull
  17.911 +		os=-sysv2
  17.912 +		;;
  17.913 +	spur)
  17.914 +		basic_machine=spur-unknown
  17.915 +		;;
  17.916 +	st2000)
  17.917 +		basic_machine=m68k-tandem
  17.918 +		;;
  17.919 +	stratus)
  17.920 +		basic_machine=i860-stratus
  17.921 +		os=-sysv4
  17.922 +		;;
  17.923 +	sun2)
  17.924 +		basic_machine=m68000-sun
  17.925 +		;;
  17.926 +	sun2os3)
  17.927 +		basic_machine=m68000-sun
  17.928 +		os=-sunos3
  17.929 +		;;
  17.930 +	sun2os4)
  17.931 +		basic_machine=m68000-sun
  17.932 +		os=-sunos4
  17.933 +		;;
  17.934 +	sun3os3)
  17.935 +		basic_machine=m68k-sun
  17.936 +		os=-sunos3
  17.937 +		;;
  17.938 +	sun3os4)
  17.939 +		basic_machine=m68k-sun
  17.940 +		os=-sunos4
  17.941 +		;;
  17.942 +	sun4os3)
  17.943 +		basic_machine=sparc-sun
  17.944 +		os=-sunos3
  17.945 +		;;
  17.946 +	sun4os4)
  17.947 +		basic_machine=sparc-sun
  17.948 +		os=-sunos4
  17.949 +		;;
  17.950 +	sun4sol2)
  17.951 +		basic_machine=sparc-sun
  17.952 +		os=-solaris2
  17.953 +		;;
  17.954 +	sun3 | sun3-*)
  17.955 +		basic_machine=m68k-sun
  17.956 +		;;
  17.957 +	sun4)
  17.958 +		basic_machine=sparc-sun
  17.959 +		;;
  17.960 +	sun386 | sun386i | roadrunner)
  17.961 +		basic_machine=i386-sun
  17.962 +		;;
  17.963 +	sv1)
  17.964 +		basic_machine=sv1-cray
  17.965 +		os=-unicos
  17.966 +		;;
  17.967 +	symmetry)
  17.968 +		basic_machine=i386-sequent
  17.969 +		os=-dynix
  17.970 +		;;
  17.971 +	t3e)
  17.972 +		basic_machine=alphaev5-cray
  17.973 +		os=-unicos
  17.974 +		;;
  17.975 +	t90)
  17.976 +		basic_machine=t90-cray
  17.977 +		os=-unicos
  17.978 +		;;
  17.979 +	tic54x | c54x*)
  17.980 +		basic_machine=tic54x-unknown
  17.981 +		os=-coff
  17.982 +		;;
  17.983 +	tic55x | c55x*)
  17.984 +		basic_machine=tic55x-unknown
  17.985 +		os=-coff
  17.986 +		;;
  17.987 +	tic6x | c6x*)
  17.988 +		basic_machine=tic6x-unknown
  17.989 +		os=-coff
  17.990 +		;;
  17.991 +	tx39)
  17.992 +		basic_machine=mipstx39-unknown
  17.993 +		;;
  17.994 +	tx39el)
  17.995 +		basic_machine=mipstx39el-unknown
  17.996 +		;;
  17.997 +	toad1)
  17.998 +		basic_machine=pdp10-xkl
  17.999 +		os=-tops20
 17.1000 +		;;
 17.1001 +	tower | tower-32)
 17.1002 +		basic_machine=m68k-ncr
 17.1003 +		;;
 17.1004 +	tpf)
 17.1005 +		basic_machine=s390x-ibm
 17.1006 +		os=-tpf
 17.1007 +		;;
 17.1008 +	udi29k)
 17.1009 +		basic_machine=a29k-amd
 17.1010 +		os=-udi
 17.1011 +		;;
 17.1012 +	ultra3)
 17.1013 +		basic_machine=a29k-nyu
 17.1014 +		os=-sym1
 17.1015 +		;;
 17.1016 +	v810 | necv810)
 17.1017 +		basic_machine=v810-nec
 17.1018 +		os=-none
 17.1019 +		;;
 17.1020 +	vaxv)
 17.1021 +		basic_machine=vax-dec
 17.1022 +		os=-sysv
 17.1023 +		;;
 17.1024 +	vms)
 17.1025 +		basic_machine=vax-dec
 17.1026 +		os=-vms
 17.1027 +		;;
 17.1028 +	vpp*|vx|vx-*)
 17.1029 +		basic_machine=f301-fujitsu
 17.1030 +		;;
 17.1031 +	vxworks960)
 17.1032 +		basic_machine=i960-wrs
 17.1033 +		os=-vxworks
 17.1034 +		;;
 17.1035 +	vxworks68)
 17.1036 +		basic_machine=m68k-wrs
 17.1037 +		os=-vxworks
 17.1038 +		;;
 17.1039 +	vxworks29k)
 17.1040 +		basic_machine=a29k-wrs
 17.1041 +		os=-vxworks
 17.1042 +		;;
 17.1043 +	w65*)
 17.1044 +		basic_machine=w65-wdc
 17.1045 +		os=-none
 17.1046 +		;;
 17.1047 +	w89k-*)
 17.1048 +		basic_machine=hppa1.1-winbond
 17.1049 +		os=-proelf
 17.1050 +		;;
 17.1051 +	xbox)
 17.1052 +		basic_machine=i686-pc
 17.1053 +		os=-mingw32
 17.1054 +		;;
 17.1055 +	xps | xps100)
 17.1056 +		basic_machine=xps100-honeywell
 17.1057 +		;;
 17.1058 +	ymp)
 17.1059 +		basic_machine=ymp-cray
 17.1060 +		os=-unicos
 17.1061 +		;;
 17.1062 +	z8k-*-coff)
 17.1063 +		basic_machine=z8k-unknown
 17.1064 +		os=-sim
 17.1065 +		;;
 17.1066 +	none)
 17.1067 +		basic_machine=none-none
 17.1068 +		os=-none
 17.1069 +		;;
 17.1070 +
 17.1071 +# Here we handle the default manufacturer of certain CPU types.  It is in
 17.1072 +# some cases the only manufacturer, in others, it is the most popular.
 17.1073 +	w89k)
 17.1074 +		basic_machine=hppa1.1-winbond
 17.1075 +		;;
 17.1076 +	op50n)
 17.1077 +		basic_machine=hppa1.1-oki
 17.1078 +		;;
 17.1079 +	op60c)
 17.1080 +		basic_machine=hppa1.1-oki
 17.1081 +		;;
 17.1082 +	romp)
 17.1083 +		basic_machine=romp-ibm
 17.1084 +		;;
 17.1085 +	mmix)
 17.1086 +		basic_machine=mmix-knuth
 17.1087 +		;;
 17.1088 +	rs6000)
 17.1089 +		basic_machine=rs6000-ibm
 17.1090 +		;;
 17.1091 +	vax)
 17.1092 +		basic_machine=vax-dec
 17.1093 +		;;
 17.1094 +	pdp10)
 17.1095 +		# there are many clones, so DEC is not a safe bet
 17.1096 +		basic_machine=pdp10-unknown
 17.1097 +		;;
 17.1098 +	pdp11)
 17.1099 +		basic_machine=pdp11-dec
 17.1100 +		;;
 17.1101 +	we32k)
 17.1102 +		basic_machine=we32k-att
 17.1103 +		;;
 17.1104 +	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
 17.1105 +		basic_machine=sh-unknown
 17.1106 +		;;
 17.1107 +	sparc | sparcv8 | sparcv9 | sparcv9b)
 17.1108 +		basic_machine=sparc-sun
 17.1109 +		;;
 17.1110 +	cydra)
 17.1111 +		basic_machine=cydra-cydrome
 17.1112 +		;;
 17.1113 +	orion)
 17.1114 +		basic_machine=orion-highlevel
 17.1115 +		;;
 17.1116 +	orion105)
 17.1117 +		basic_machine=clipper-highlevel
 17.1118 +		;;
 17.1119 +	mac | mpw | mac-mpw)
 17.1120 +		basic_machine=m68k-apple
 17.1121 +		;;
 17.1122 +	pmac | pmac-mpw)
 17.1123 +		basic_machine=powerpc-apple
 17.1124 +		;;
 17.1125 +	*-unknown)
 17.1126 +		# Make sure to match an already-canonicalized machine name.
 17.1127 +		;;
 17.1128 +	*)
 17.1129 +		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 17.1130 +		exit 1
 17.1131 +		;;
 17.1132 +esac
 17.1133 +
 17.1134 +# Here we canonicalize certain aliases for manufacturers.
 17.1135 +case $basic_machine in
 17.1136 +	*-digital*)
 17.1137 +		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
 17.1138 +		;;
 17.1139 +	*-commodore*)
 17.1140 +		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
 17.1141 +		;;
 17.1142 +	*)
 17.1143 +		;;
 17.1144 +esac
 17.1145 +
 17.1146 +# Decode manufacturer-specific aliases for certain operating systems.
 17.1147 +
 17.1148 +if [ x"$os" != x"" ]
 17.1149 +then
 17.1150 +case $os in
 17.1151 +        # First match some system type aliases
 17.1152 +        # that might get confused with valid system types.
 17.1153 +	# -solaris* is a basic system type, with this one exception.
 17.1154 +	-solaris1 | -solaris1.*)
 17.1155 +		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 17.1156 +		;;
 17.1157 +	-solaris)
 17.1158 +		os=-solaris2
 17.1159 +		;;
 17.1160 +	-svr4*)
 17.1161 +		os=-sysv4
 17.1162 +		;;
 17.1163 +	-unixware*)
 17.1164 +		os=-sysv4.2uw
 17.1165 +		;;
 17.1166 +	-gnu/linux*)
 17.1167 +		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 17.1168 +		;;
 17.1169 +	# First accept the basic system types.
 17.1170 +	# The portable systems comes first.
 17.1171 +	# Each alternative MUST END IN A *, to match a version number.
 17.1172 +	# -sysv* is not here because it comes later, after sysvr4.
 17.1173 +	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 17.1174 +	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 17.1175 +	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
 17.1176 +	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 17.1177 +	      | -aos* \
 17.1178 +	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 17.1179 +	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 17.1180 +	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
 17.1181 +	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 17.1182 +	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 17.1183 +	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 17.1184 +	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 17.1185 +	      | -chorusos* | -chorusrdb* \
 17.1186 +	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 17.1187 +	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
 17.1188 +	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 17.1189 +	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 17.1190 +	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 17.1191 +	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 17.1192 +	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 17.1193 +	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
 17.1194 +	      | -skyos* | -haiku*)
 17.1195 +	# Remember, each alternative MUST END IN *, to match a version number.
 17.1196 +		;;
 17.1197 +	-qnx*)
 17.1198 +		case $basic_machine in
 17.1199 +		    x86-* | i*86-*)
 17.1200 +			;;
 17.1201 +		    *)
 17.1202 +			os=-nto$os
 17.1203 +			;;
 17.1204 +		esac
 17.1205 +		;;
 17.1206 +	-nto-qnx*)
 17.1207 +		;;
 17.1208 +	-nto*)
 17.1209 +		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 17.1210 +		;;
 17.1211 +	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
 17.1212 +	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
 17.1213 +	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 17.1214 +		;;
 17.1215 +	-mac*)
 17.1216 +		os=`echo $os | sed -e 's|mac|macos|'`
 17.1217 +		;;
 17.1218 +	-linux-dietlibc)
 17.1219 +		os=-linux-dietlibc
 17.1220 +		;;
 17.1221 +	-linux*)
 17.1222 +		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 17.1223 +		;;
 17.1224 +	-sunos5*)
 17.1225 +		os=`echo $os | sed -e 's|sunos5|solaris2|'`
 17.1226 +		;;
 17.1227 +	-sunos6*)
 17.1228 +		os=`echo $os | sed -e 's|sunos6|solaris3|'`
 17.1229 +		;;
 17.1230 +	-opened*)
 17.1231 +		os=-openedition
 17.1232 +		;;
 17.1233 +        -os400*)
 17.1234 +		os=-os400
 17.1235 +		;;
 17.1236 +	-wince*)
 17.1237 +		os=-wince
 17.1238 +		;;
 17.1239 +	-osfrose*)
 17.1240 +		os=-osfrose
 17.1241 +		;;
 17.1242 +	-osf*)
 17.1243 +		os=-osf
 17.1244 +		;;
 17.1245 +	-utek*)
 17.1246 +		os=-bsd
 17.1247 +		;;
 17.1248 +	-dynix*)
 17.1249 +		os=-bsd
 17.1250 +		;;
 17.1251 +	-acis*)
 17.1252 +		os=-aos
 17.1253 +		;;
 17.1254 +	-atheos*)
 17.1255 +		os=-atheos
 17.1256 +		;;
 17.1257 +	-syllable*)
 17.1258 +		os=-syllable
 17.1259 +		;;
 17.1260 +	-386bsd)
 17.1261 +		os=-bsd
 17.1262 +		;;
 17.1263 +	-ctix* | -uts*)
 17.1264 +		os=-sysv
 17.1265 +		;;
 17.1266 +	-nova*)
 17.1267 +		os=-rtmk-nova
 17.1268 +		;;
 17.1269 +	-ns2 )
 17.1270 +		os=-nextstep2
 17.1271 +		;;
 17.1272 +	-nsk*)
 17.1273 +		os=-nsk
 17.1274 +		;;
 17.1275 +	# Preserve the version number of sinix5.
 17.1276 +	-sinix5.*)
 17.1277 +		os=`echo $os | sed -e 's|sinix|sysv|'`
 17.1278 +		;;
 17.1279 +	-sinix*)
 17.1280 +		os=-sysv4
 17.1281 +		;;
 17.1282 +        -tpf*)
 17.1283 +		os=-tpf
 17.1284 +		;;
 17.1285 +	-triton*)
 17.1286 +		os=-sysv3
 17.1287 +		;;
 17.1288 +	-oss*)
 17.1289 +		os=-sysv3
 17.1290 +		;;
 17.1291 +	-svr4)
 17.1292 +		os=-sysv4
 17.1293 +		;;
 17.1294 +	-svr3)
 17.1295 +		os=-sysv3
 17.1296 +		;;
 17.1297 +	-sysvr4)
 17.1298 +		os=-sysv4
 17.1299 +		;;
 17.1300 +	# This must come after -sysvr4.
 17.1301 +	-sysv*)
 17.1302 +		;;
 17.1303 +	-ose*)
 17.1304 +		os=-ose
 17.1305 +		;;
 17.1306 +	-es1800*)
 17.1307 +		os=-ose
 17.1308 +		;;
 17.1309 +	-xenix)
 17.1310 +		os=-xenix
 17.1311 +		;;
 17.1312 +	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 17.1313 +		os=-mint
 17.1314 +		;;
 17.1315 +	-aros*)
 17.1316 +		os=-aros
 17.1317 +		;;
 17.1318 +	-kaos*)
 17.1319 +		os=-kaos
 17.1320 +		;;
 17.1321 +	-zvmoe)
 17.1322 +		os=-zvmoe
 17.1323 +		;;
 17.1324 +	-none)
 17.1325 +		;;
 17.1326 +	*)
 17.1327 +		# Get rid of the `-' at the beginning of $os.
 17.1328 +		os=`echo $os | sed 's/[^-]*-//'`
 17.1329 +		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
 17.1330 +		exit 1
 17.1331 +		;;
 17.1332 +esac
 17.1333 +else
 17.1334 +
 17.1335 +# Here we handle the default operating systems that come with various machines.
 17.1336 +# The value should be what the vendor currently ships out the door with their
 17.1337 +# machine or put another way, the most popular os provided with the machine.
 17.1338 +
 17.1339 +# Note that if you're going to try to match "-MANUFACTURER" here (say,
 17.1340 +# "-sun"), then you have to tell the case statement up towards the top
 17.1341 +# that MANUFACTURER isn't an operating system.  Otherwise, code above
 17.1342 +# will signal an error saying that MANUFACTURER isn't an operating
 17.1343 +# system, and we'll never get to this point.
 17.1344 +
 17.1345 +case $basic_machine in
 17.1346 +	*-acorn)
 17.1347 +		os=-riscix1.2
 17.1348 +		;;
 17.1349 +	arm*-rebel)
 17.1350 +		os=-linux
 17.1351 +		;;
 17.1352 +	arm*-semi)
 17.1353 +		os=-aout
 17.1354 +		;;
 17.1355 +    c4x-* | tic4x-*)
 17.1356 +        os=-coff
 17.1357 +        ;;
 17.1358 +	# This must come before the *-dec entry.
 17.1359 +	pdp10-*)
 17.1360 +		os=-tops20
 17.1361 +		;;
 17.1362 +	pdp11-*)
 17.1363 +		os=-none
 17.1364 +		;;
 17.1365 +	*-dec | vax-*)
 17.1366 +		os=-ultrix4.2
 17.1367 +		;;
 17.1368 +	m68*-apollo)
 17.1369 +		os=-domain
 17.1370 +		;;
 17.1371 +	i386-sun)
 17.1372 +		os=-sunos4.0.2
 17.1373 +		;;
 17.1374 +	m68000-sun)
 17.1375 +		os=-sunos3
 17.1376 +		# This also exists in the configure program, but was not the
 17.1377 +		# default.
 17.1378 +		# os=-sunos4
 17.1379 +		;;
 17.1380 +	m68*-cisco)
 17.1381 +		os=-aout
 17.1382 +		;;
 17.1383 +	mips*-cisco)
 17.1384 +		os=-elf
 17.1385 +		;;
 17.1386 +	mips*-*)
 17.1387 +		os=-elf
 17.1388 +		;;
 17.1389 +	or32-*)
 17.1390 +		os=-coff
 17.1391 +		;;
 17.1392 +	*-tti)	# must be before sparc entry or we get the wrong os.
 17.1393 +		os=-sysv3
 17.1394 +		;;
 17.1395 +	sparc-* | *-sun)
 17.1396 +		os=-sunos4.1.1
 17.1397 +		;;
 17.1398 +	*-be)
 17.1399 +		os=-beos
 17.1400 +		;;
 17.1401 +	*-haiku)
 17.1402 +		os=-haiku
 17.1403 +		;;
 17.1404 +	*-ibm)
 17.1405 +		os=-aix
 17.1406 +		;;
 17.1407 +    	*-knuth)
 17.1408 +		os=-mmixware
 17.1409 +		;;
 17.1410 +	*-wec)
 17.1411 +		os=-proelf
 17.1412 +		;;
 17.1413 +	*-winbond)
 17.1414 +		os=-proelf
 17.1415 +		;;
 17.1416 +	*-oki)
 17.1417 +		os=-proelf
 17.1418 +		;;
 17.1419 +	*-hp)
 17.1420 +		os=-hpux
 17.1421 +		;;
 17.1422 +	*-hitachi)
 17.1423 +		os=-hiux
 17.1424 +		;;
 17.1425 +	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
 17.1426 +		os=-sysv
 17.1427 +		;;
 17.1428 +	*-cbm)
 17.1429 +		os=-amigaos
 17.1430 +		;;
 17.1431 +	*-dg)
 17.1432 +		os=-dgux
 17.1433 +		;;
 17.1434 +	*-dolphin)
 17.1435 +		os=-sysv3
 17.1436 +		;;
 17.1437 +	m68k-ccur)
 17.1438 +		os=-rtu
 17.1439 +		;;
 17.1440 +	m88k-omron*)
 17.1441 +		os=-luna
 17.1442 +		;;
 17.1443 +	*-next )
 17.1444 +		os=-nextstep
 17.1445 +		;;
 17.1446 +	*-sequent)
 17.1447 +		os=-ptx
 17.1448 +		;;
 17.1449 +	*-crds)
 17.1450 +		os=-unos
 17.1451 +		;;
 17.1452 +	*-ns)
 17.1453 +		os=-genix
 17.1454 +		;;
 17.1455 +	i370-*)
 17.1456 +		os=-mvs
 17.1457 +		;;
 17.1458 +	*-next)
 17.1459 +		os=-nextstep3
 17.1460 +		;;
 17.1461 +	*-gould)
 17.1462 +		os=-sysv
 17.1463 +		;;
 17.1464 +	*-highlevel)
 17.1465 +		os=-bsd
 17.1466 +		;;
 17.1467 +	*-encore)
 17.1468 +		os=-bsd
 17.1469 +		;;
 17.1470 +	*-sgi)
 17.1471 +		os=-irix
 17.1472 +		;;
 17.1473 +	*-siemens)
 17.1474 +		os=-sysv4
 17.1475 +		;;
 17.1476 +	*-masscomp)
 17.1477 +		os=-rtu
 17.1478 +		;;
 17.1479 +	f30[01]-fujitsu | f700-fujitsu)
 17.1480 +		os=-uxpv
 17.1481 +		;;
 17.1482 +	*-rom68k)
 17.1483 +		os=-coff
 17.1484 +		;;
 17.1485 +	*-*bug)
 17.1486 +		os=-coff
 17.1487 +		;;
 17.1488 +	*-apple)
 17.1489 +		os=-macos
 17.1490 +		;;
 17.1491 +	*-atari*)
 17.1492 +		os=-mint
 17.1493 +		;;
 17.1494 +	*)
 17.1495 +		os=-none
 17.1496 +		;;
 17.1497 +esac
 17.1498 +fi
 17.1499 +
 17.1500 +# Here we handle the case where we know the os, and the CPU type, but not the
 17.1501 +# manufacturer.  We pick the logical manufacturer.
 17.1502 +vendor=unknown
 17.1503 +case $basic_machine in
 17.1504 +	*-unknown)
 17.1505 +		case $os in
 17.1506 +			-riscix*)
 17.1507 +				vendor=acorn
 17.1508 +				;;
 17.1509 +			-sunos*)
 17.1510 +				vendor=sun
 17.1511 +				;;
 17.1512 +			-aix*)
 17.1513 +				vendor=ibm
 17.1514 +				;;
 17.1515 +			-beos*)
 17.1516 +				vendor=be
 17.1517 +				;;
 17.1518 +			-hpux*)
 17.1519 +				vendor=hp
 17.1520 +				;;
 17.1521 +			-mpeix*)
 17.1522 +				vendor=hp
 17.1523 +				;;
 17.1524 +			-hiux*)
 17.1525 +				vendor=hitachi
 17.1526 +				;;
 17.1527 +			-unos*)
 17.1528 +				vendor=crds
 17.1529 +				;;
 17.1530 +			-dgux*)
 17.1531 +				vendor=dg
 17.1532 +				;;
 17.1533 +			-luna*)
 17.1534 +				vendor=omron
 17.1535 +				;;
 17.1536 +			-genix*)
 17.1537 +				vendor=ns
 17.1538 +				;;
 17.1539 +			-mvs* | -opened*)
 17.1540 +				vendor=ibm
 17.1541 +				;;
 17.1542 +			-os400*)
 17.1543 +				vendor=ibm
 17.1544 +				;;
 17.1545 +			-ptx*)
 17.1546 +				vendor=sequent
 17.1547 +				;;
 17.1548 +			-tpf*)
 17.1549 +				vendor=ibm
 17.1550 +				;;
 17.1551 +			-vxsim* | -vxworks* | -windiss*)
 17.1552 +				vendor=wrs
 17.1553 +				;;
 17.1554 +			-aux*)
 17.1555 +				vendor=apple
 17.1556 +				;;
 17.1557 +			-hms*)
 17.1558 +				vendor=hitachi
 17.1559 +				;;
 17.1560 +			-mpw* | -macos*)
 17.1561 +				vendor=apple
 17.1562 +				;;
 17.1563 +			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 17.1564 +				vendor=atari
 17.1565 +				;;
 17.1566 +			-vos*)
 17.1567 +				vendor=stratus
 17.1568 +				;;
 17.1569 +		esac
 17.1570 +		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 17.1571 +		;;
 17.1572 +esac
 17.1573 +
 17.1574 +echo $basic_machine$os
 17.1575 +exit
 17.1576 +
 17.1577 +# Local variables:
 17.1578 +# eval: (add-hook 'write-file-hooks 'time-stamp)
 17.1579 +# time-stamp-start: "timestamp='"
 17.1580 +# time-stamp-format: "%:y-%02m-%02d"
 17.1581 +# time-stamp-end: "'"
 17.1582 +# End:
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/configure	Fri Sep 26 17:05:23 2008 +0200
    18.3 @@ -0,0 +1,7269 @@
    18.4 +#! /bin/sh
    18.5 +# Guess values for system-dependent variables and create Makefiles.
    18.6 +# Generated by GNU Autoconf 2.59 for masqmail 0.2.21.
    18.7 +#
    18.8 +# Report bugs to <oku@debian.org>.
    18.9 +#
   18.10 +# Copyright (C) 2003 Free Software Foundation, Inc.
   18.11 +# This configure script is free software; the Free Software Foundation
   18.12 +# gives unlimited permission to copy, distribute and modify it.
   18.13 +## --------------------- ##
   18.14 +## M4sh Initialization.  ##
   18.15 +## --------------------- ##
   18.16 +
   18.17 +# Be Bourne compatible
   18.18 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   18.19 +  emulate sh
   18.20 +  NULLCMD=:
   18.21 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   18.22 +  # is contrary to our usage.  Disable this feature.
   18.23 +  alias -g '${1+"$@"}'='"$@"'
   18.24 +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   18.25 +  set -o posix
   18.26 +fi
   18.27 +DUALCASE=1; export DUALCASE # for MKS sh
   18.28 +
   18.29 +# Support unset when possible.
   18.30 +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   18.31 +  as_unset=unset
   18.32 +else
   18.33 +  as_unset=false
   18.34 +fi
   18.35 +
   18.36 +
   18.37 +# Work around bugs in pre-3.0 UWIN ksh.
   18.38 +$as_unset ENV MAIL MAILPATH
   18.39 +PS1='$ '
   18.40 +PS2='> '
   18.41 +PS4='+ '
   18.42 +
   18.43 +# NLS nuisances.
   18.44 +for as_var in \
   18.45 +  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
   18.46 +  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   18.47 +  LC_TELEPHONE LC_TIME
   18.48 +do
   18.49 +  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
   18.50 +    eval $as_var=C; export $as_var
   18.51 +  else
   18.52 +    $as_unset $as_var
   18.53 +  fi
   18.54 +done
   18.55 +
   18.56 +# Required to use basename.
   18.57 +if expr a : '\(a\)' >/dev/null 2>&1; then
   18.58 +  as_expr=expr
   18.59 +else
   18.60 +  as_expr=false
   18.61 +fi
   18.62 +
   18.63 +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
   18.64 +  as_basename=basename
   18.65 +else
   18.66 +  as_basename=false
   18.67 +fi
   18.68 +
   18.69 +
   18.70 +# Name of the executable.
   18.71 +as_me=`$as_basename "$0" ||
   18.72 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
   18.73 +	 X"$0" : 'X\(//\)$' \| \
   18.74 +	 X"$0" : 'X\(/\)$' \| \
   18.75 +	 .     : '\(.\)' 2>/dev/null ||
   18.76 +echo X/"$0" |
   18.77 +    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
   18.78 +  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
   18.79 +  	  /^X\/\(\/\).*/{ s//\1/; q; }
   18.80 +  	  s/.*/./; q'`
   18.81 +
   18.82 +
   18.83 +# PATH needs CR, and LINENO needs CR and PATH.
   18.84 +# Avoid depending upon Character Ranges.
   18.85 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
   18.86 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
   18.87 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
   18.88 +as_cr_digits='0123456789'
   18.89 +as_cr_alnum=$as_cr_Letters$as_cr_digits
   18.90 +
   18.91 +# The user is always right.
   18.92 +if test "${PATH_SEPARATOR+set}" != set; then
   18.93 +  echo "#! /bin/sh" >conf$$.sh
   18.94 +  echo  "exit 0"   >>conf$$.sh
   18.95 +  chmod +x conf$$.sh
   18.96 +  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
   18.97 +    PATH_SEPARATOR=';'
   18.98 +  else
   18.99 +    PATH_SEPARATOR=:
  18.100 +  fi
  18.101 +  rm -f conf$$.sh
  18.102 +fi
  18.103 +
  18.104 +
  18.105 +  as_lineno_1=$LINENO
  18.106 +  as_lineno_2=$LINENO
  18.107 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  18.108 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
  18.109 +  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  18.110 +  # Find who we are.  Look in the path if we contain no path at all
  18.111 +  # relative or not.
  18.112 +  case $0 in
  18.113 +    *[\\/]* ) as_myself=$0 ;;
  18.114 +    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  18.115 +for as_dir in $PATH
  18.116 +do
  18.117 +  IFS=$as_save_IFS
  18.118 +  test -z "$as_dir" && as_dir=.
  18.119 +  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  18.120 +done
  18.121 +
  18.122 +       ;;
  18.123 +  esac
  18.124 +  # We did not find ourselves, most probably we were run as `sh COMMAND'
  18.125 +  # in which case we are not to be found in the path.
  18.126 +  if test "x$as_myself" = x; then
  18.127 +    as_myself=$0
  18.128 +  fi
  18.129 +  if test ! -f "$as_myself"; then
  18.130 +    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
  18.131 +   { (exit 1); exit 1; }; }
  18.132 +  fi
  18.133 +  case $CONFIG_SHELL in
  18.134 +  '')
  18.135 +    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  18.136 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
  18.137 +do
  18.138 +  IFS=$as_save_IFS
  18.139 +  test -z "$as_dir" && as_dir=.
  18.140 +  for as_base in sh bash ksh sh5; do
  18.141 +	 case $as_dir in
  18.142 +	 /*)
  18.143 +	   if ("$as_dir/$as_base" -c '
  18.144 +  as_lineno_1=$LINENO
  18.145 +  as_lineno_2=$LINENO
  18.146 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  18.147 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
  18.148 +  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
  18.149 +	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
  18.150 +	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
  18.151 +	     CONFIG_SHELL=$as_dir/$as_base
  18.152 +	     export CONFIG_SHELL
  18.153 +	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
  18.154 +	   fi;;
  18.155 +	 esac
  18.156 +       done
  18.157 +done
  18.158 +;;
  18.159 +  esac
  18.160 +
  18.161 +  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  18.162 +  # uniformly replaced by the line number.  The first 'sed' inserts a
  18.163 +  # line-number line before each line; the second 'sed' does the real
  18.164 +  # work.  The second script uses 'N' to pair each line-number line
  18.165 +  # with the numbered line, and appends trailing '-' during
  18.166 +  # substitution so that $LINENO is not a special case at line end.
  18.167 +  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  18.168 +  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  18.169 +  sed '=' <$as_myself |
  18.170 +    sed '
  18.171 +      N
  18.172 +      s,$,-,
  18.173 +      : loop
  18.174 +      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
  18.175 +      t loop
  18.176 +      s,-$,,
  18.177 +      s,^['$as_cr_digits']*\n,,
  18.178 +    ' >$as_me.lineno &&
  18.179 +  chmod +x $as_me.lineno ||
  18.180 +    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
  18.181 +   { (exit 1); exit 1; }; }
  18.182 +
  18.183 +  # Don't try to exec as it changes $[0], causing all sort of problems
  18.184 +  # (the dirname of $[0] is not the place where we might find the
  18.185 +  # original and so on.  Autoconf is especially sensible to this).
  18.186 +  . ./$as_me.lineno
  18.187 +  # Exit status is that of the last command.
  18.188 +  exit
  18.189 +}
  18.190 +
  18.191 +
  18.192 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  18.193 +  *c*,-n*) ECHO_N= ECHO_C='
  18.194 +' ECHO_T='	' ;;
  18.195 +  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  18.196 +  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
  18.197 +esac
  18.198 +
  18.199 +if expr a : '\(a\)' >/dev/null 2>&1; then
  18.200 +  as_expr=expr
  18.201 +else
  18.202 +  as_expr=false
  18.203 +fi
  18.204 +
  18.205 +rm -f conf$$ conf$$.exe conf$$.file
  18.206 +echo >conf$$.file
  18.207 +if ln -s conf$$.file conf$$ 2>/dev/null; then
  18.208 +  # We could just check for DJGPP; but this test a) works b) is more generic
  18.209 +  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  18.210 +  if test -f conf$$.exe; then
  18.211 +    # Don't use ln at all; we don't have any links
  18.212 +    as_ln_s='cp -p'
  18.213 +  else
  18.214 +    as_ln_s='ln -s'
  18.215 +  fi
  18.216 +elif ln conf$$.file conf$$ 2>/dev/null; then
  18.217 +  as_ln_s=ln
  18.218 +else
  18.219 +  as_ln_s='cp -p'
  18.220 +fi
  18.221 +rm -f conf$$ conf$$.exe conf$$.file
  18.222 +
  18.223 +if mkdir -p . 2>/dev/null; then
  18.224 +  as_mkdir_p=:
  18.225 +else
  18.226 +  test -d ./-p && rmdir ./-p
  18.227 +  as_mkdir_p=false
  18.228 +fi
  18.229 +
  18.230 +as_executable_p="test -f"
  18.231 +
  18.232 +# Sed expression to map a string onto a valid CPP name.
  18.233 +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
  18.234 +
  18.235 +# Sed expression to map a string onto a valid variable name.
  18.236 +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
  18.237 +
  18.238 +
  18.239 +# IFS
  18.240 +# We need space, tab and new line, in precisely that order.
  18.241 +as_nl='
  18.242 +'
  18.243 +IFS=" 	$as_nl"
  18.244 +
  18.245 +# CDPATH.
  18.246 +$as_unset CDPATH
  18.247 +
  18.248 +
  18.249 +# Name of the host.
  18.250 +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
  18.251 +# so uname gets run too.
  18.252 +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
  18.253 +
  18.254 +exec 6>&1
  18.255 +
  18.256 +#
  18.257 +# Initializations.
  18.258 +#
  18.259 +ac_default_prefix=/usr/local
  18.260 +ac_config_libobj_dir=.
  18.261 +cross_compiling=no
  18.262 +subdirs=
  18.263 +MFLAGS=
  18.264 +MAKEFLAGS=
  18.265 +SHELL=${CONFIG_SHELL-/bin/sh}
  18.266 +
  18.267 +# Maximum number of lines to put in a shell here document.
  18.268 +# This variable seems obsolete.  It should probably be removed, and
  18.269 +# only ac_max_sed_lines should be used.
  18.270 +: ${ac_max_here_lines=38}
  18.271 +
  18.272 +# Identity of this package.
  18.273 +PACKAGE_NAME='masqmail'
  18.274 +PACKAGE_TARNAME='masqmail'
  18.275 +PACKAGE_VERSION='0.2.21'
  18.276 +PACKAGE_STRING='masqmail 0.2.21'
  18.277 +PACKAGE_BUGREPORT='oku@debian.org'
  18.278 +
  18.279 +ac_unique_file="src/masqmail.c"
  18.280 +ac_default_prefix=/usr
  18.281 +# Factoring default headers for most tests.
  18.282 +ac_includes_default="\
  18.283 +#include <stdio.h>
  18.284 +#if HAVE_SYS_TYPES_H
  18.285 +# include <sys/types.h>
  18.286 +#endif
  18.287 +#if HAVE_SYS_STAT_H
  18.288 +# include <sys/stat.h>
  18.289 +#endif
  18.290 +#if STDC_HEADERS
  18.291 +# include <stdlib.h>
  18.292 +# include <stddef.h>
  18.293 +#else
  18.294 +# if HAVE_STDLIB_H
  18.295 +#  include <stdlib.h>
  18.296 +# endif
  18.297 +#endif
  18.298 +#if HAVE_STRING_H
  18.299 +# if !STDC_HEADERS && HAVE_MEMORY_H
  18.300 +#  include <memory.h>
  18.301 +# endif
  18.302 +# include <string.h>
  18.303 +#endif
  18.304 +#if HAVE_STRINGS_H
  18.305 +# include <strings.h>
  18.306 +#endif
  18.307 +#if HAVE_INTTYPES_H
  18.308 +# include <inttypes.h>
  18.309 +#else
  18.310 +# if HAVE_STDINT_H
  18.311 +#  include <stdint.h>
  18.312 +# endif
  18.313 +#endif
  18.314 +#if HAVE_UNISTD_H
  18.315 +# include <unistd.h>
  18.316 +#endif"
  18.317 +
  18.318 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP RANLIB ac_ct_RANLIB PKG_CONFIG ac_pt_PKG_CONFIG GLIB_CFLAGS GLIB_LIBS RESOLV_LIBS with_user with_group BASE64_LIBS MD5_LIBS has_ident IDENT_LIBS LOCKFILE_LIBS USE_LIBLOCKFILE with_logdir with_spooldir with_confdir LIBOBJS LTLIBOBJS'
  18.319 +ac_subst_files=''
  18.320 +
  18.321 +# Initialize some variables set by options.
  18.322 +ac_init_help=
  18.323 +ac_init_version=false
  18.324 +# The variables have the same names as the options, with
  18.325 +# dashes changed to underlines.
  18.326 +cache_file=/dev/null
  18.327 +exec_prefix=NONE
  18.328 +no_create=
  18.329 +no_recursion=
  18.330 +prefix=NONE
  18.331 +program_prefix=NONE
  18.332 +program_suffix=NONE
  18.333 +program_transform_name=s,x,x,
  18.334 +silent=
  18.335 +site=
  18.336 +srcdir=
  18.337 +verbose=
  18.338 +x_includes=NONE
  18.339 +x_libraries=NONE
  18.340 +
  18.341 +# Installation directory options.
  18.342 +# These are left unexpanded so users can "make install exec_prefix=/foo"
  18.343 +# and all the variables that are supposed to be based on exec_prefix
  18.344 +# by default will actually change.
  18.345 +# Use braces instead of parens because sh, perl, etc. also accept them.
  18.346 +bindir='${exec_prefix}/bin'
  18.347 +sbindir='${exec_prefix}/sbin'
  18.348 +libexecdir='${exec_prefix}/libexec'
  18.349 +datadir='${prefix}/share'
  18.350 +sysconfdir='${prefix}/etc'
  18.351 +sharedstatedir='${prefix}/com'
  18.352 +localstatedir='${prefix}/var'
  18.353 +libdir='${exec_prefix}/lib'
  18.354 +includedir='${prefix}/include'
  18.355 +oldincludedir='/usr/include'
  18.356 +infodir='${prefix}/info'
  18.357 +mandir='${prefix}/man'
  18.358 +
  18.359 +ac_prev=
  18.360 +for ac_option
  18.361 +do
  18.362 +  # If the previous option needs an argument, assign it.
  18.363 +  if test -n "$ac_prev"; then
  18.364 +    eval "$ac_prev=\$ac_option"
  18.365 +    ac_prev=
  18.366 +    continue
  18.367 +  fi
  18.368 +
  18.369 +  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
  18.370 +
  18.371 +  # Accept the important Cygnus configure options, so we can diagnose typos.
  18.372 +
  18.373 +  case $ac_option in
  18.374 +
  18.375 +  -bindir | --bindir | --bindi | --bind | --bin | --bi)
  18.376 +    ac_prev=bindir ;;
  18.377 +  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
  18.378 +    bindir=$ac_optarg ;;
  18.379 +
  18.380 +  -build | --build | --buil | --bui | --bu)
  18.381 +    ac_prev=build_alias ;;
  18.382 +  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
  18.383 +    build_alias=$ac_optarg ;;
  18.384 +
  18.385 +  -cache-file | --cache-file | --cache-fil | --cache-fi \
  18.386 +  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  18.387 +    ac_prev=cache_file ;;
  18.388 +  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  18.389 +  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  18.390 +    cache_file=$ac_optarg ;;
  18.391 +
  18.392 +  --config-cache | -C)
  18.393 +    cache_file=config.cache ;;
  18.394 +
  18.395 +  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
  18.396 +    ac_prev=datadir ;;
  18.397 +  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  18.398 +  | --da=*)
  18.399 +    datadir=$ac_optarg ;;
  18.400 +
  18.401 +  -disable-* | --disable-*)
  18.402 +    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
  18.403 +    # Reject names that are not valid shell variable names.
  18.404 +    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  18.405 +      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
  18.406 +   { (exit 1); exit 1; }; }
  18.407 +    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
  18.408 +    eval "enable_$ac_feature=no" ;;
  18.409 +
  18.410 +  -enable-* | --enable-*)
  18.411 +    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
  18.412 +    # Reject names that are not valid shell variable names.
  18.413 +    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  18.414 +      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
  18.415 +   { (exit 1); exit 1; }; }
  18.416 +    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
  18.417 +    case $ac_option in
  18.418 +      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
  18.419 +      *) ac_optarg=yes ;;
  18.420 +    esac
  18.421 +    eval "enable_$ac_feature='$ac_optarg'" ;;
  18.422 +
  18.423 +  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  18.424 +  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  18.425 +  | --exec | --exe | --ex)
  18.426 +    ac_prev=exec_prefix ;;
  18.427 +  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  18.428 +  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  18.429 +  | --exec=* | --exe=* | --ex=*)
  18.430 +    exec_prefix=$ac_optarg ;;
  18.431 +
  18.432 +  -gas | --gas | --ga | --g)
  18.433 +    # Obsolete; use --with-gas.
  18.434 +    with_gas=yes ;;
  18.435 +
  18.436 +  -help | --help | --hel | --he | -h)
  18.437 +    ac_init_help=long ;;
  18.438 +  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
  18.439 +    ac_init_help=recursive ;;
  18.440 +  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
  18.441 +    ac_init_help=short ;;
  18.442 +
  18.443 +  -host | --host | --hos | --ho)
  18.444 +    ac_prev=host_alias ;;
  18.445 +  -host=* | --host=* | --hos=* | --ho=*)
  18.446 +    host_alias=$ac_optarg ;;
  18.447 +
  18.448 +  -includedir | --includedir | --includedi | --included | --include \
  18.449 +  | --includ | --inclu | --incl | --inc)
  18.450 +    ac_prev=includedir ;;
  18.451 +  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  18.452 +  | --includ=* | --inclu=* | --incl=* | --inc=*)
  18.453 +    includedir=$ac_optarg ;;
  18.454 +
  18.455 +  -infodir | --infodir | --infodi | --infod | --info | --inf)
  18.456 +    ac_prev=infodir ;;
  18.457 +  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
  18.458 +    infodir=$ac_optarg ;;
  18.459 +
  18.460 +  -libdir | --libdir | --libdi | --libd)
  18.461 +    ac_prev=libdir ;;
  18.462 +  -libdir=* | --libdir=* | --libdi=* | --libd=*)
  18.463 +    libdir=$ac_optarg ;;
  18.464 +
  18.465 +  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  18.466 +  | --libexe | --libex | --libe)
  18.467 +    ac_prev=libexecdir ;;
  18.468 +  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  18.469 +  | --libexe=* | --libex=* | --libe=*)
  18.470 +    libexecdir=$ac_optarg ;;
  18.471 +
  18.472 +  -localstatedir | --localstatedir | --localstatedi | --localstated \
  18.473 +  | --localstate | --localstat | --localsta | --localst \
  18.474 +  | --locals | --local | --loca | --loc | --lo)
  18.475 +    ac_prev=localstatedir ;;
  18.476 +  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  18.477 +  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  18.478 +  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
  18.479 +    localstatedir=$ac_optarg ;;
  18.480 +
  18.481 +  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
  18.482 +    ac_prev=mandir ;;
  18.483 +  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
  18.484 +    mandir=$ac_optarg ;;
  18.485 +
  18.486 +  -nfp | --nfp | --nf)
  18.487 +    # Obsolete; use --without-fp.
  18.488 +    with_fp=no ;;
  18.489 +
  18.490 +  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  18.491 +  | --no-cr | --no-c | -n)
  18.492 +    no_create=yes ;;
  18.493 +
  18.494 +  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  18.495 +  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  18.496 +    no_recursion=yes ;;
  18.497 +
  18.498 +  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  18.499 +  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  18.500 +  | --oldin | --oldi | --old | --ol | --o)
  18.501 +    ac_prev=oldincludedir ;;
  18.502 +  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  18.503 +  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  18.504 +  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
  18.505 +    oldincludedir=$ac_optarg ;;
  18.506 +
  18.507 +  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  18.508 +    ac_prev=prefix ;;
  18.509 +  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  18.510 +    prefix=$ac_optarg ;;
  18.511 +
  18.512 +  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  18.513 +  | --program-pre | --program-pr | --program-p)
  18.514 +    ac_prev=program_prefix ;;
  18.515 +  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  18.516 +  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  18.517 +    program_prefix=$ac_optarg ;;
  18.518 +
  18.519 +  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  18.520 +  | --program-suf | --program-su | --program-s)
  18.521 +    ac_prev=program_suffix ;;
  18.522 +  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  18.523 +  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  18.524 +    program_suffix=$ac_optarg ;;
  18.525 +
  18.526 +  -program-transform-name | --program-transform-name \
  18.527 +  | --program-transform-nam | --program-transform-na \
  18.528 +  | --program-transform-n | --program-transform- \
  18.529 +  | --program-transform | --program-transfor \
  18.530 +  | --program-transfo | --program-transf \
  18.531 +  | --program-trans | --program-tran \
  18.532 +  | --progr-tra | --program-tr | --program-t)
  18.533 +    ac_prev=program_transform_name ;;
  18.534 +  -program-transform-name=* | --program-transform-name=* \
  18.535 +  | --program-transform-nam=* | --program-transform-na=* \
  18.536 +  | --program-transform-n=* | --program-transform-=* \
  18.537 +  | --program-transform=* | --program-transfor=* \
  18.538 +  | --program-transfo=* | --program-transf=* \
  18.539 +  | --program-trans=* | --program-tran=* \
  18.540 +  | --progr-tra=* | --program-tr=* | --program-t=*)
  18.541 +    program_transform_name=$ac_optarg ;;
  18.542 +
  18.543 +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  18.544 +  | -silent | --silent | --silen | --sile | --sil)
  18.545 +    silent=yes ;;
  18.546 +
  18.547 +  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  18.548 +    ac_prev=sbindir ;;
  18.549 +  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  18.550 +  | --sbi=* | --sb=*)
  18.551 +    sbindir=$ac_optarg ;;
  18.552 +
  18.553 +  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  18.554 +  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  18.555 +  | --sharedst | --shareds | --shared | --share | --shar \
  18.556 +  | --sha | --sh)
  18.557 +    ac_prev=sharedstatedir ;;
  18.558 +  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  18.559 +  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  18.560 +  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  18.561 +  | --sha=* | --sh=*)
  18.562 +    sharedstatedir=$ac_optarg ;;
  18.563 +
  18.564 +  -site | --site | --sit)
  18.565 +    ac_prev=site ;;
  18.566 +  -site=* | --site=* | --sit=*)
  18.567 +    site=$ac_optarg ;;
  18.568 +
  18.569 +  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  18.570 +    ac_prev=srcdir ;;
  18.571 +  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  18.572 +    srcdir=$ac_optarg ;;
  18.573 +
  18.574 +  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  18.575 +  | --syscon | --sysco | --sysc | --sys | --sy)
  18.576 +    ac_prev=sysconfdir ;;
  18.577 +  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  18.578 +  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
  18.579 +    sysconfdir=$ac_optarg ;;
  18.580 +
  18.581 +  -target | --target | --targe | --targ | --tar | --ta | --t)
  18.582 +    ac_prev=target_alias ;;
  18.583 +  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  18.584 +    target_alias=$ac_optarg ;;
  18.585 +
  18.586 +  -v | -verbose | --verbose | --verbos | --verbo | --verb)
  18.587 +    verbose=yes ;;
  18.588 +
  18.589 +  -version | --version | --versio | --versi | --vers | -V)
  18.590 +    ac_init_version=: ;;
  18.591 +
  18.592 +  -with-* | --with-*)
  18.593 +    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
  18.594 +    # Reject names that are not valid shell variable names.
  18.595 +    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  18.596 +      { echo "$as_me: error: invalid package name: $ac_package" >&2
  18.597 +   { (exit 1); exit 1; }; }
  18.598 +    ac_package=`echo $ac_package| sed 's/-/_/g'`
  18.599 +    case $ac_option in
  18.600 +      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
  18.601 +      *) ac_optarg=yes ;;
  18.602 +    esac
  18.603 +    eval "with_$ac_package='$ac_optarg'" ;;
  18.604 +
  18.605 +  -without-* | --without-*)
  18.606 +    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
  18.607 +    # Reject names that are not valid shell variable names.
  18.608 +    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  18.609 +      { echo "$as_me: error: invalid package name: $ac_package" >&2
  18.610 +   { (exit 1); exit 1; }; }
  18.611 +    ac_package=`echo $ac_package | sed 's/-/_/g'`
  18.612 +    eval "with_$ac_package=no" ;;
  18.613 +
  18.614 +  --x)
  18.615 +    # Obsolete; use --with-x.
  18.616 +    with_x=yes ;;
  18.617 +
  18.618 +  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  18.619 +  | --x-incl | --x-inc | --x-in | --x-i)
  18.620 +    ac_prev=x_includes ;;
  18.621 +  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  18.622 +  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  18.623 +    x_includes=$ac_optarg ;;
  18.624 +
  18.625 +  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  18.626 +  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  18.627 +    ac_prev=x_libraries ;;
  18.628 +  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  18.629 +  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  18.630 +    x_libraries=$ac_optarg ;;
  18.631 +
  18.632 +  -*) { echo "$as_me: error: unrecognized option: $ac_option
  18.633 +Try \`$0 --help' for more information." >&2
  18.634 +   { (exit 1); exit 1; }; }
  18.635 +    ;;
  18.636 +
  18.637 +  *=*)
  18.638 +    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
  18.639 +    # Reject names that are not valid shell variable names.
  18.640 +    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
  18.641 +      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
  18.642 +   { (exit 1); exit 1; }; }
  18.643 +    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
  18.644 +    eval "$ac_envvar='$ac_optarg'"
  18.645 +    export $ac_envvar ;;
  18.646 +
  18.647 +  *)
  18.648 +    # FIXME: should be removed in autoconf 3.0.
  18.649 +    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
  18.650 +    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
  18.651 +      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
  18.652 +    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
  18.653 +    ;;
  18.654 +
  18.655 +  esac
  18.656 +done
  18.657 +
  18.658 +if test -n "$ac_prev"; then
  18.659 +  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  18.660 +  { echo "$as_me: error: missing argument to $ac_option" >&2
  18.661 +   { (exit 1); exit 1; }; }
  18.662 +fi
  18.663 +
  18.664 +# Be sure to have absolute paths.
  18.665 +for ac_var in exec_prefix prefix
  18.666 +do
  18.667 +  eval ac_val=$`echo $ac_var`
  18.668 +  case $ac_val in
  18.669 +    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
  18.670 +    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
  18.671 +   { (exit 1); exit 1; }; };;
  18.672 +  esac
  18.673 +done
  18.674 +
  18.675 +# Be sure to have absolute paths.
  18.676 +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
  18.677 +	      localstatedir libdir includedir oldincludedir infodir mandir
  18.678 +do
  18.679 +  eval ac_val=$`echo $ac_var`
  18.680 +  case $ac_val in
  18.681 +    [\\/$]* | ?:[\\/]* ) ;;
  18.682 +    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
  18.683 +   { (exit 1); exit 1; }; };;
  18.684 +  esac
  18.685 +done
  18.686 +
  18.687 +# There might be people who depend on the old broken behavior: `$host'
  18.688 +# used to hold the argument of --host etc.
  18.689 +# FIXME: To remove some day.
  18.690 +build=$build_alias
  18.691 +host=$host_alias
  18.692 +target=$target_alias
  18.693 +
  18.694 +# FIXME: To remove some day.
  18.695 +if test "x$host_alias" != x; then
  18.696 +  if test "x$build_alias" = x; then
  18.697 +    cross_compiling=maybe
  18.698 +    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
  18.699 +    If a cross compiler is detected then cross compile mode will be used." >&2
  18.700 +  elif test "x$build_alias" != "x$host_alias"; then
  18.701 +    cross_compiling=yes
  18.702 +  fi
  18.703 +fi
  18.704 +
  18.705 +ac_tool_prefix=
  18.706 +test -n "$host_alias" && ac_tool_prefix=$host_alias-
  18.707 +
  18.708 +test "$silent" = yes && exec 6>/dev/null
  18.709 +
  18.710 +
  18.711 +# Find the source files, if location was not specified.
  18.712 +if test -z "$srcdir"; then
  18.713 +  ac_srcdir_defaulted=yes
  18.714 +  # Try the directory containing this script, then its parent.
  18.715 +  ac_confdir=`(dirname "$0") 2>/dev/null ||
  18.716 +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  18.717 +	 X"$0" : 'X\(//\)[^/]' \| \
  18.718 +	 X"$0" : 'X\(//\)$' \| \
  18.719 +	 X"$0" : 'X\(/\)' \| \
  18.720 +	 .     : '\(.\)' 2>/dev/null ||
  18.721 +echo X"$0" |
  18.722 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  18.723 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  18.724 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  18.725 +  	  /^X\(\/\).*/{ s//\1/; q; }
  18.726 +  	  s/.*/./; q'`
  18.727 +  srcdir=$ac_confdir
  18.728 +  if test ! -r $srcdir/$ac_unique_file; then
  18.729 +    srcdir=..
  18.730 +  fi
  18.731 +else
  18.732 +  ac_srcdir_defaulted=no
  18.733 +fi
  18.734 +if test ! -r $srcdir/$ac_unique_file; then
  18.735 +  if test "$ac_srcdir_defaulted" = yes; then
  18.736 +    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
  18.737 +   { (exit 1); exit 1; }; }
  18.738 +  else
  18.739 +    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
  18.740 +   { (exit 1); exit 1; }; }
  18.741 +  fi
  18.742 +fi
  18.743 +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
  18.744 +  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
  18.745 +   { (exit 1); exit 1; }; }
  18.746 +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
  18.747 +ac_env_build_alias_set=${build_alias+set}
  18.748 +ac_env_build_alias_value=$build_alias
  18.749 +ac_cv_env_build_alias_set=${build_alias+set}
  18.750 +ac_cv_env_build_alias_value=$build_alias
  18.751 +ac_env_host_alias_set=${host_alias+set}
  18.752 +ac_env_host_alias_value=$host_alias
  18.753 +ac_cv_env_host_alias_set=${host_alias+set}
  18.754 +ac_cv_env_host_alias_value=$host_alias
  18.755 +ac_env_target_alias_set=${target_alias+set}
  18.756 +ac_env_target_alias_value=$target_alias
  18.757 +ac_cv_env_target_alias_set=${target_alias+set}
  18.758 +ac_cv_env_target_alias_value=$target_alias
  18.759 +ac_env_CC_set=${CC+set}
  18.760 +ac_env_CC_value=$CC
  18.761 +ac_cv_env_CC_set=${CC+set}
  18.762 +ac_cv_env_CC_value=$CC
  18.763 +ac_env_CFLAGS_set=${CFLAGS+set}
  18.764 +ac_env_CFLAGS_value=$CFLAGS
  18.765 +ac_cv_env_CFLAGS_set=${CFLAGS+set}
  18.766 +ac_cv_env_CFLAGS_value=$CFLAGS
  18.767 +ac_env_LDFLAGS_set=${LDFLAGS+set}
  18.768 +ac_env_LDFLAGS_value=$LDFLAGS
  18.769 +ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
  18.770 +ac_cv_env_LDFLAGS_value=$LDFLAGS
  18.771 +ac_env_CPPFLAGS_set=${CPPFLAGS+set}
  18.772 +ac_env_CPPFLAGS_value=$CPPFLAGS
  18.773 +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
  18.774 +ac_cv_env_CPPFLAGS_value=$CPPFLAGS
  18.775 +ac_env_CPP_set=${CPP+set}
  18.776 +ac_env_CPP_value=$CPP
  18.777 +ac_cv_env_CPP_set=${CPP+set}
  18.778 +ac_cv_env_CPP_value=$CPP
  18.779 +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
  18.780 +ac_env_PKG_CONFIG_value=$PKG_CONFIG
  18.781 +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
  18.782 +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
  18.783 +ac_env_GLIB_CFLAGS_set=${GLIB_CFLAGS+set}
  18.784 +ac_env_GLIB_CFLAGS_value=$GLIB_CFLAGS
  18.785 +ac_cv_env_GLIB_CFLAGS_set=${GLIB_CFLAGS+set}
  18.786 +ac_cv_env_GLIB_CFLAGS_value=$GLIB_CFLAGS
  18.787 +ac_env_GLIB_LIBS_set=${GLIB_LIBS+set}
  18.788 +ac_env_GLIB_LIBS_value=$GLIB_LIBS
  18.789 +ac_cv_env_GLIB_LIBS_set=${GLIB_LIBS+set}
  18.790 +ac_cv_env_GLIB_LIBS_value=$GLIB_LIBS
  18.791 +
  18.792 +#
  18.793 +# Report the --help message.
  18.794 +#
  18.795 +if test "$ac_init_help" = "long"; then
  18.796 +  # Omit some internal or obsolete options to make the list less imposing.
  18.797 +  # This message is too long to be a string in the A/UX 3.1 sh.
  18.798 +  cat <<_ACEOF
  18.799 +\`configure' configures masqmail 0.2.21 to adapt to many kinds of systems.
  18.800 +
  18.801 +Usage: $0 [OPTION]... [VAR=VALUE]...
  18.802 +
  18.803 +To assign environment variables (e.g., CC, CFLAGS...), specify them as
  18.804 +VAR=VALUE.  See below for descriptions of some of the useful variables.
  18.805 +
  18.806 +Defaults for the options are specified in brackets.
  18.807 +
  18.808 +Configuration:
  18.809 +  -h, --help              display this help and exit
  18.810 +      --help=short        display options specific to this package
  18.811 +      --help=recursive    display the short help of all the included packages
  18.812 +  -V, --version           display version information and exit
  18.813 +  -q, --quiet, --silent   do not print \`checking...' messages
  18.814 +      --cache-file=FILE   cache test results in FILE [disabled]
  18.815 +  -C, --config-cache      alias for \`--cache-file=config.cache'
  18.816 +  -n, --no-create         do not create output files
  18.817 +      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
  18.818 +
  18.819 +_ACEOF
  18.820 +
  18.821 +  cat <<_ACEOF
  18.822 +Installation directories:
  18.823 +  --prefix=PREFIX         install architecture-independent files in PREFIX
  18.824 +			  [$ac_default_prefix]
  18.825 +  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
  18.826 +			  [PREFIX]
  18.827 +
  18.828 +By default, \`make install' will install all the files in
  18.829 +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
  18.830 +an installation prefix other than \`$ac_default_prefix' using \`--prefix',
  18.831 +for instance \`--prefix=\$HOME'.
  18.832 +
  18.833 +For better control, use the options below.
  18.834 +
  18.835 +Fine tuning of the installation directories:
  18.836 +  --bindir=DIR           user executables [EPREFIX/bin]
  18.837 +  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  18.838 +  --libexecdir=DIR       program executables [EPREFIX/libexec]
  18.839 +  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  18.840 +  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  18.841 +  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  18.842 +  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  18.843 +  --libdir=DIR           object code libraries [EPREFIX/lib]
  18.844 +  --includedir=DIR       C header files [PREFIX/include]
  18.845 +  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  18.846 +  --infodir=DIR          info documentation [PREFIX/info]
  18.847 +  --mandir=DIR           man documentation [PREFIX/man]
  18.848 +_ACEOF
  18.849 +
  18.850 +  cat <<\_ACEOF
  18.851 +
  18.852 +Program names:
  18.853 +  --program-prefix=PREFIX            prepend PREFIX to installed program names
  18.854 +  --program-suffix=SUFFIX            append SUFFIX to installed program names
  18.855 +  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
  18.856 +_ACEOF
  18.857 +fi
  18.858 +
  18.859 +if test -n "$ac_init_help"; then
  18.860 +  case $ac_init_help in
  18.861 +     short | recursive ) echo "Configuration of masqmail 0.2.21:";;
  18.862 +   esac
  18.863 +  cat <<\_ACEOF
  18.864 +
  18.865 +Optional Features:
  18.866 +  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  18.867 +  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  18.868 +  --disable-dependency-tracking Speeds up one-time builds
  18.869 +  --enable-dependency-tracking  Do not reject slow dependency extractors
  18.870 +  --disable-resolver       disable resolver support
  18.871 +  --disable-debug          disable debugging
  18.872 +  --disable-smtp-server    disable smtp server support
  18.873 +  --disable-pop3           disable pop3 support
  18.874 +  --enable-auth            enable AUTH (RFC 2554) client support
  18.875 +  --enable-maildir            enable qmail style maildir support
  18.876 +  --enable-ident           enable ident (RFC 1413) support
  18.877 +  --enable-mserver         enable mserver support
  18.878 +
  18.879 +Optional Packages:
  18.880 +  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  18.881 +  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  18.882 +  --with-user=USER         set user mail
  18.883 +  --with-group=GROUP       set group trusted
  18.884 +  --with-glib-static=path  link glib statically (path mandatory!)
  18.885 +  --with-libcrypto         use libcrypto
  18.886 +  --with-liblockfile       use liblock (for Debian)
  18.887 +  --with-logdir=DIR        set log directory /var/masqmail
  18.888 +  --with-spooldir=DIR      set spool directory /var/spool/masqmail
  18.889 +  --with-confdir           directory for configuration /etc/masqmail
  18.890 +
  18.891 +Some influential environment variables:
  18.892 +  CC          C compiler command
  18.893 +  CFLAGS      C compiler flags
  18.894 +  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
  18.895 +              nonstandard directory <lib dir>
  18.896 +  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
  18.897 +              headers in a nonstandard directory <include dir>
  18.898 +  CPP         C preprocessor
  18.899 +  PKG_CONFIG  path to pkg-config utility
  18.900 +  GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
  18.901 +  GLIB_LIBS   linker flags for GLIB, overriding pkg-config
  18.902 +
  18.903 +Use these variables to override the choices made by `configure' or to help
  18.904 +it to find libraries and programs with nonstandard names/locations.
  18.905 +
  18.906 +Report bugs to <oku@debian.org>.
  18.907 +_ACEOF
  18.908 +fi
  18.909 +
  18.910 +if test "$ac_init_help" = "recursive"; then
  18.911 +  # If there are subdirs, report their specific --help.
  18.912 +  ac_popdir=`pwd`
  18.913 +  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
  18.914 +    test -d $ac_dir || continue
  18.915 +    ac_builddir=.
  18.916 +
  18.917 +if test "$ac_dir" != .; then
  18.918 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  18.919 +  # A "../" for each directory in $ac_dir_suffix.
  18.920 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
  18.921 +else
  18.922 +  ac_dir_suffix= ac_top_builddir=
  18.923 +fi
  18.924 +
  18.925 +case $srcdir in
  18.926 +  .)  # No --srcdir option.  We are building in place.
  18.927 +    ac_srcdir=.
  18.928 +    if test -z "$ac_top_builddir"; then
  18.929 +       ac_top_srcdir=.
  18.930 +    else
  18.931 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
  18.932 +    fi ;;
  18.933 +  [\\/]* | ?:[\\/]* )  # Absolute path.
  18.934 +    ac_srcdir=$srcdir$ac_dir_suffix;
  18.935 +    ac_top_srcdir=$srcdir ;;
  18.936 +  *) # Relative path.
  18.937 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
  18.938 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
  18.939 +esac
  18.940 +
  18.941 +# Do not use `cd foo && pwd` to compute absolute paths, because
  18.942 +# the directories may not exist.
  18.943 +case `pwd` in
  18.944 +.) ac_abs_builddir="$ac_dir";;
  18.945 +*)
  18.946 +  case "$ac_dir" in
  18.947 +  .) ac_abs_builddir=`pwd`;;
  18.948 +  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
  18.949 +  *) ac_abs_builddir=`pwd`/"$ac_dir";;
  18.950 +  esac;;
  18.951 +esac
  18.952 +case $ac_abs_builddir in
  18.953 +.) ac_abs_top_builddir=${ac_top_builddir}.;;
  18.954 +*)
  18.955 +  case ${ac_top_builddir}. in
  18.956 +  .) ac_abs_top_builddir=$ac_abs_builddir;;
  18.957 +  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
  18.958 +  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
  18.959 +  esac;;
  18.960 +esac
  18.961 +case $ac_abs_builddir in
  18.962 +.) ac_abs_srcdir=$ac_srcdir;;
  18.963 +*)
  18.964 +  case $ac_srcdir in
  18.965 +  .) ac_abs_srcdir=$ac_abs_builddir;;
  18.966 +  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
  18.967 +  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
  18.968 +  esac;;
  18.969 +esac
  18.970 +case $ac_abs_builddir in
  18.971 +.) ac_abs_top_srcdir=$ac_top_srcdir;;
  18.972 +*)
  18.973 +  case $ac_top_srcdir in
  18.974 +  .) ac_abs_top_srcdir=$ac_abs_builddir;;
  18.975 +  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
  18.976 +  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
  18.977 +  esac;;
  18.978 +esac
  18.979 +
  18.980 +    cd $ac_dir
  18.981 +    # Check for guested configure; otherwise get Cygnus style configure.
  18.982 +    if test -f $ac_srcdir/configure.gnu; then
  18.983 +      echo
  18.984 +      $SHELL $ac_srcdir/configure.gnu  --help=recursive
  18.985 +    elif test -f $ac_srcdir/configure; then
  18.986 +      echo
  18.987 +      $SHELL $ac_srcdir/configure  --help=recursive
  18.988 +    elif test -f $ac_srcdir/configure.ac ||
  18.989 +	   test -f $ac_srcdir/configure.in; then
  18.990 +      echo
  18.991 +      $ac_configure --help
  18.992 +    else
  18.993 +      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
  18.994 +    fi
  18.995 +    cd "$ac_popdir"
  18.996 +  done
  18.997 +fi
  18.998 +
  18.999 +test -n "$ac_init_help" && exit 0
 18.1000 +if $ac_init_version; then
 18.1001 +  cat <<\_ACEOF
 18.1002 +masqmail configure 0.2.21
 18.1003 +generated by GNU Autoconf 2.59
 18.1004 +
 18.1005 +Copyright (C) 2003 Free Software Foundation, Inc.
 18.1006 +This configure script is free software; the Free Software Foundation
 18.1007 +gives unlimited permission to copy, distribute and modify it.
 18.1008 +_ACEOF
 18.1009 +  exit 0
 18.1010 +fi
 18.1011 +exec 5>config.log
 18.1012 +cat >&5 <<_ACEOF
 18.1013 +This file contains any messages produced by compilers while
 18.1014 +running configure, to aid debugging if configure makes a mistake.
 18.1015 +
 18.1016 +It was created by masqmail $as_me 0.2.21, which was
 18.1017 +generated by GNU Autoconf 2.59.  Invocation command line was
 18.1018 +
 18.1019 +  $ $0 $@
 18.1020 +
 18.1021 +_ACEOF
 18.1022 +{
 18.1023 +cat <<_ASUNAME
 18.1024 +## --------- ##
 18.1025 +## Platform. ##
 18.1026 +## --------- ##
 18.1027 +
 18.1028 +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
 18.1029 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
 18.1030 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
 18.1031 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
 18.1032 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
 18.1033 +
 18.1034 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
 18.1035 +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
 18.1036 +
 18.1037 +/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 18.1038 +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 18.1039 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
 18.1040 +hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
 18.1041 +/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 18.1042 +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 18.1043 +/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
 18.1044 +
 18.1045 +_ASUNAME
 18.1046 +
 18.1047 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1048 +for as_dir in $PATH
 18.1049 +do
 18.1050 +  IFS=$as_save_IFS
 18.1051 +  test -z "$as_dir" && as_dir=.
 18.1052 +  echo "PATH: $as_dir"
 18.1053 +done
 18.1054 +
 18.1055 +} >&5
 18.1056 +
 18.1057 +cat >&5 <<_ACEOF
 18.1058 +
 18.1059 +
 18.1060 +## ----------- ##
 18.1061 +## Core tests. ##
 18.1062 +## ----------- ##
 18.1063 +
 18.1064 +_ACEOF
 18.1065 +
 18.1066 +
 18.1067 +# Keep a trace of the command line.
 18.1068 +# Strip out --no-create and --no-recursion so they do not pile up.
 18.1069 +# Strip out --silent because we don't want to record it for future runs.
 18.1070 +# Also quote any args containing shell meta-characters.
 18.1071 +# Make two passes to allow for proper duplicate-argument suppression.
 18.1072 +ac_configure_args=
 18.1073 +ac_configure_args0=
 18.1074 +ac_configure_args1=
 18.1075 +ac_sep=
 18.1076 +ac_must_keep_next=false
 18.1077 +for ac_pass in 1 2
 18.1078 +do
 18.1079 +  for ac_arg
 18.1080 +  do
 18.1081 +    case $ac_arg in
 18.1082 +    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
 18.1083 +    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
 18.1084 +    | -silent | --silent | --silen | --sile | --sil)
 18.1085 +      continue ;;
 18.1086 +    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
 18.1087 +      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
 18.1088 +    esac
 18.1089 +    case $ac_pass in
 18.1090 +    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
 18.1091 +    2)
 18.1092 +      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
 18.1093 +      if test $ac_must_keep_next = true; then
 18.1094 +	ac_must_keep_next=false # Got value, back to normal.
 18.1095 +      else
 18.1096 +	case $ac_arg in
 18.1097 +	  *=* | --config-cache | -C | -disable-* | --disable-* \
 18.1098 +	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
 18.1099 +	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
 18.1100 +	  | -with-* | --with-* | -without-* | --without-* | --x)
 18.1101 +	    case "$ac_configure_args0 " in
 18.1102 +	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
 18.1103 +	    esac
 18.1104 +	    ;;
 18.1105 +	  -* ) ac_must_keep_next=true ;;
 18.1106 +	esac
 18.1107 +      fi
 18.1108 +      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
 18.1109 +      # Get rid of the leading space.
 18.1110 +      ac_sep=" "
 18.1111 +      ;;
 18.1112 +    esac
 18.1113 +  done
 18.1114 +done
 18.1115 +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
 18.1116 +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
 18.1117 +
 18.1118 +# When interrupted or exit'd, cleanup temporary files, and complete
 18.1119 +# config.log.  We remove comments because anyway the quotes in there
 18.1120 +# would cause problems or look ugly.
 18.1121 +# WARNING: Be sure not to use single quotes in there, as some shells,
 18.1122 +# such as our DU 5.0 friend, will then `close' the trap.
 18.1123 +trap 'exit_status=$?
 18.1124 +  # Save into config.log some information that might help in debugging.
 18.1125 +  {
 18.1126 +    echo
 18.1127 +
 18.1128 +    cat <<\_ASBOX
 18.1129 +## ---------------- ##
 18.1130 +## Cache variables. ##
 18.1131 +## ---------------- ##
 18.1132 +_ASBOX
 18.1133 +    echo
 18.1134 +    # The following way of writing the cache mishandles newlines in values,
 18.1135 +{
 18.1136 +  (set) 2>&1 |
 18.1137 +    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
 18.1138 +    *ac_space=\ *)
 18.1139 +      sed -n \
 18.1140 +	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
 18.1141 +	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
 18.1142 +      ;;
 18.1143 +    *)
 18.1144 +      sed -n \
 18.1145 +	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
 18.1146 +      ;;
 18.1147 +    esac;
 18.1148 +}
 18.1149 +    echo
 18.1150 +
 18.1151 +    cat <<\_ASBOX
 18.1152 +## ----------------- ##
 18.1153 +## Output variables. ##
 18.1154 +## ----------------- ##
 18.1155 +_ASBOX
 18.1156 +    echo
 18.1157 +    for ac_var in $ac_subst_vars
 18.1158 +    do
 18.1159 +      eval ac_val=$`echo $ac_var`
 18.1160 +      echo "$ac_var='"'"'$ac_val'"'"'"
 18.1161 +    done | sort
 18.1162 +    echo
 18.1163 +
 18.1164 +    if test -n "$ac_subst_files"; then
 18.1165 +      cat <<\_ASBOX
 18.1166 +## ------------- ##
 18.1167 +## Output files. ##
 18.1168 +## ------------- ##
 18.1169 +_ASBOX
 18.1170 +      echo
 18.1171 +      for ac_var in $ac_subst_files
 18.1172 +      do
 18.1173 +	eval ac_val=$`echo $ac_var`
 18.1174 +	echo "$ac_var='"'"'$ac_val'"'"'"
 18.1175 +      done | sort
 18.1176 +      echo
 18.1177 +    fi
 18.1178 +
 18.1179 +    if test -s confdefs.h; then
 18.1180 +      cat <<\_ASBOX
 18.1181 +## ----------- ##
 18.1182 +## confdefs.h. ##
 18.1183 +## ----------- ##
 18.1184 +_ASBOX
 18.1185 +      echo
 18.1186 +      sed "/^$/d" confdefs.h | sort
 18.1187 +      echo
 18.1188 +    fi
 18.1189 +    test "$ac_signal" != 0 &&
 18.1190 +      echo "$as_me: caught signal $ac_signal"
 18.1191 +    echo "$as_me: exit $exit_status"
 18.1192 +  } >&5
 18.1193 +  rm -f core *.core &&
 18.1194 +  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
 18.1195 +    exit $exit_status
 18.1196 +     ' 0
 18.1197 +for ac_signal in 1 2 13 15; do
 18.1198 +  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 18.1199 +done
 18.1200 +ac_signal=0
 18.1201 +
 18.1202 +# confdefs.h avoids OS command line length limits that DEFS can exceed.
 18.1203 +rm -rf conftest* confdefs.h
 18.1204 +# AIX cpp loses on an empty file, so make sure it contains at least a newline.
 18.1205 +echo >confdefs.h
 18.1206 +
 18.1207 +# Predefined preprocessor variables.
 18.1208 +
 18.1209 +cat >>confdefs.h <<_ACEOF
 18.1210 +#define PACKAGE_NAME "$PACKAGE_NAME"
 18.1211 +_ACEOF
 18.1212 +
 18.1213 +
 18.1214 +cat >>confdefs.h <<_ACEOF
 18.1215 +#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 18.1216 +_ACEOF
 18.1217 +
 18.1218 +
 18.1219 +cat >>confdefs.h <<_ACEOF
 18.1220 +#define PACKAGE_VERSION "$PACKAGE_VERSION"
 18.1221 +_ACEOF
 18.1222 +
 18.1223 +
 18.1224 +cat >>confdefs.h <<_ACEOF
 18.1225 +#define PACKAGE_STRING "$PACKAGE_STRING"
 18.1226 +_ACEOF
 18.1227 +
 18.1228 +
 18.1229 +cat >>confdefs.h <<_ACEOF
 18.1230 +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 18.1231 +_ACEOF
 18.1232 +
 18.1233 +
 18.1234 +# Let the site file select an alternate cache file if it wants to.
 18.1235 +# Prefer explicitly selected file to automatically selected ones.
 18.1236 +if test -z "$CONFIG_SITE"; then
 18.1237 +  if test "x$prefix" != xNONE; then
 18.1238 +    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
 18.1239 +  else
 18.1240 +    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
 18.1241 +  fi
 18.1242 +fi
 18.1243 +for ac_site_file in $CONFIG_SITE; do
 18.1244 +  if test -r "$ac_site_file"; then
 18.1245 +    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 18.1246 +echo "$as_me: loading site script $ac_site_file" >&6;}
 18.1247 +    sed 's/^/| /' "$ac_site_file" >&5
 18.1248 +    . "$ac_site_file"
 18.1249 +  fi
 18.1250 +done
 18.1251 +
 18.1252 +if test -r "$cache_file"; then
 18.1253 +  # Some versions of bash will fail to source /dev/null (special
 18.1254 +  # files actually), so we avoid doing that.
 18.1255 +  if test -f "$cache_file"; then
 18.1256 +    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 18.1257 +echo "$as_me: loading cache $cache_file" >&6;}
 18.1258 +    case $cache_file in
 18.1259 +      [\\/]* | ?:[\\/]* ) . $cache_file;;
 18.1260 +      *)                      . ./$cache_file;;
 18.1261 +    esac
 18.1262 +  fi
 18.1263 +else
 18.1264 +  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
 18.1265 +echo "$as_me: creating cache $cache_file" >&6;}
 18.1266 +  >$cache_file
 18.1267 +fi
 18.1268 +
 18.1269 +# Check that the precious variables saved in the cache have kept the same
 18.1270 +# value.
 18.1271 +ac_cache_corrupted=false
 18.1272 +for ac_var in `(set) 2>&1 |
 18.1273 +	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
 18.1274 +  eval ac_old_set=\$ac_cv_env_${ac_var}_set
 18.1275 +  eval ac_new_set=\$ac_env_${ac_var}_set
 18.1276 +  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
 18.1277 +  eval ac_new_val="\$ac_env_${ac_var}_value"
 18.1278 +  case $ac_old_set,$ac_new_set in
 18.1279 +    set,)
 18.1280 +      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 18.1281 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
 18.1282 +      ac_cache_corrupted=: ;;
 18.1283 +    ,set)
 18.1284 +      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
 18.1285 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
 18.1286 +      ac_cache_corrupted=: ;;
 18.1287 +    ,);;
 18.1288 +    *)
 18.1289 +      if test "x$ac_old_val" != "x$ac_new_val"; then
 18.1290 +	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 18.1291 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
 18.1292 +	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
 18.1293 +echo "$as_me:   former value:  $ac_old_val" >&2;}
 18.1294 +	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
 18.1295 +echo "$as_me:   current value: $ac_new_val" >&2;}
 18.1296 +	ac_cache_corrupted=:
 18.1297 +      fi;;
 18.1298 +  esac
 18.1299 +  # Pass precious variables to config.status.
 18.1300 +  if test "$ac_new_set" = set; then
 18.1301 +    case $ac_new_val in
 18.1302 +    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
 18.1303 +      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
 18.1304 +    *) ac_arg=$ac_var=$ac_new_val ;;
 18.1305 +    esac
 18.1306 +    case " $ac_configure_args " in
 18.1307 +      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
 18.1308 +      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
 18.1309 +    esac
 18.1310 +  fi
 18.1311 +done
 18.1312 +if $ac_cache_corrupted; then
 18.1313 +  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 18.1314 +echo "$as_me: error: changes in the environment can compromise the build" >&2;}
 18.1315 +  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 18.1316 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
 18.1317 +   { (exit 1); exit 1; }; }
 18.1318 +fi
 18.1319 +
 18.1320 +ac_ext=c
 18.1321 +ac_cpp='$CPP $CPPFLAGS'
 18.1322 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 18.1323 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 18.1324 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
 18.1325 +
 18.1326 +
 18.1327 +
 18.1328 +
 18.1329 +
 18.1330 +
 18.1331 +
 18.1332 +
 18.1333 +
 18.1334 +
 18.1335 +
 18.1336 +
 18.1337 +
 18.1338 +
 18.1339 +
 18.1340 +
 18.1341 +
 18.1342 +
 18.1343 +
 18.1344 +
 18.1345 +
 18.1346 +
 18.1347 +
 18.1348 +
 18.1349 +
 18.1350 +
 18.1351 +
 18.1352 +
 18.1353 +          ac_config_headers="$ac_config_headers config.h"
 18.1354 +
 18.1355 +am__api_version="1.7"
 18.1356 +ac_aux_dir=
 18.1357 +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
 18.1358 +  if test -f $ac_dir/install-sh; then
 18.1359 +    ac_aux_dir=$ac_dir
 18.1360 +    ac_install_sh="$ac_aux_dir/install-sh -c"
 18.1361 +    break
 18.1362 +  elif test -f $ac_dir/install.sh; then
 18.1363 +    ac_aux_dir=$ac_dir
 18.1364 +    ac_install_sh="$ac_aux_dir/install.sh -c"
 18.1365 +    break
 18.1366 +  elif test -f $ac_dir/shtool; then
 18.1367 +    ac_aux_dir=$ac_dir
 18.1368 +    ac_install_sh="$ac_aux_dir/shtool install -c"
 18.1369 +    break
 18.1370 +  fi
 18.1371 +done
 18.1372 +if test -z "$ac_aux_dir"; then
 18.1373 +  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 18.1374 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
 18.1375 +   { (exit 1); exit 1; }; }
 18.1376 +fi
 18.1377 +ac_config_guess="$SHELL $ac_aux_dir/config.guess"
 18.1378 +ac_config_sub="$SHELL $ac_aux_dir/config.sub"
 18.1379 +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 18.1380 +
 18.1381 +# Find a good install program.  We prefer a C program (faster),
 18.1382 +# so one script is as good as another.  But avoid the broken or
 18.1383 +# incompatible versions:
 18.1384 +# SysV /etc/install, /usr/sbin/install
 18.1385 +# SunOS /usr/etc/install
 18.1386 +# IRIX /sbin/install
 18.1387 +# AIX /bin/install
 18.1388 +# AmigaOS /C/install, which installs bootblocks on floppy discs
 18.1389 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 18.1390 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
 18.1391 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 18.1392 +# OS/2's system install, which has a completely different semantic
 18.1393 +# ./install, which can be erroneously created by make from ./install.sh.
 18.1394 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
 18.1395 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
 18.1396 +if test -z "$INSTALL"; then
 18.1397 +if test "${ac_cv_path_install+set}" = set; then
 18.1398 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1399 +else
 18.1400 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1401 +for as_dir in $PATH
 18.1402 +do
 18.1403 +  IFS=$as_save_IFS
 18.1404 +  test -z "$as_dir" && as_dir=.
 18.1405 +  # Account for people who put trailing slashes in PATH elements.
 18.1406 +case $as_dir/ in
 18.1407 +  ./ | .// | /cC/* | \
 18.1408 +  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
 18.1409 +  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
 18.1410 +  /usr/ucb/* ) ;;
 18.1411 +  *)
 18.1412 +    # OSF1 and SCO ODT 3.0 have their own names for install.
 18.1413 +    # Don't use installbsd from OSF since it installs stuff as root
 18.1414 +    # by default.
 18.1415 +    for ac_prog in ginstall scoinst install; do
 18.1416 +      for ac_exec_ext in '' $ac_executable_extensions; do
 18.1417 +	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 18.1418 +	  if test $ac_prog = install &&
 18.1419 +	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 18.1420 +	    # AIX install.  It has an incompatible calling convention.
 18.1421 +	    :
 18.1422 +	  elif test $ac_prog = install &&
 18.1423 +	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 18.1424 +	    # program-specific install script used by HP pwplus--don't use.
 18.1425 +	    :
 18.1426 +	  else
 18.1427 +	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
 18.1428 +	    break 3
 18.1429 +	  fi
 18.1430 +	fi
 18.1431 +      done
 18.1432 +    done
 18.1433 +    ;;
 18.1434 +esac
 18.1435 +done
 18.1436 +
 18.1437 +
 18.1438 +fi
 18.1439 +  if test "${ac_cv_path_install+set}" = set; then
 18.1440 +    INSTALL=$ac_cv_path_install
 18.1441 +  else
 18.1442 +    # As a last resort, use the slow shell script.  We don't cache a
 18.1443 +    # path for INSTALL within a source directory, because that will
 18.1444 +    # break other packages using the cache if that directory is
 18.1445 +    # removed, or if the path is relative.
 18.1446 +    INSTALL=$ac_install_sh
 18.1447 +  fi
 18.1448 +fi
 18.1449 +echo "$as_me:$LINENO: result: $INSTALL" >&5
 18.1450 +echo "${ECHO_T}$INSTALL" >&6
 18.1451 +
 18.1452 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 18.1453 +# It thinks the first close brace ends the variable substitution.
 18.1454 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 18.1455 +
 18.1456 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 18.1457 +
 18.1458 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 18.1459 +
 18.1460 +echo "$as_me:$LINENO: checking whether build environment is sane" >&5
 18.1461 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
 18.1462 +# Just in case
 18.1463 +sleep 1
 18.1464 +echo timestamp > conftest.file
 18.1465 +# Do `set' in a subshell so we don't clobber the current shell's
 18.1466 +# arguments.  Must try -L first in case configure is actually a
 18.1467 +# symlink; some systems play weird games with the mod time of symlinks
 18.1468 +# (eg FreeBSD returns the mod time of the symlink's containing
 18.1469 +# directory).
 18.1470 +if (
 18.1471 +   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
 18.1472 +   if test "$*" = "X"; then
 18.1473 +      # -L didn't work.
 18.1474 +      set X `ls -t $srcdir/configure conftest.file`
 18.1475 +   fi
 18.1476 +   rm -f conftest.file
 18.1477 +   if test "$*" != "X $srcdir/configure conftest.file" \
 18.1478 +      && test "$*" != "X conftest.file $srcdir/configure"; then
 18.1479 +
 18.1480 +      # If neither matched, then we have a broken ls.  This can happen
 18.1481 +      # if, for instance, CONFIG_SHELL is bash and it inherits a
 18.1482 +      # broken ls alias from the environment.  This has actually
 18.1483 +      # happened.  Such a system could not be considered "sane".
 18.1484 +      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
 18.1485 +alias in your environment" >&5
 18.1486 +echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
 18.1487 +alias in your environment" >&2;}
 18.1488 +   { (exit 1); exit 1; }; }
 18.1489 +   fi
 18.1490 +
 18.1491 +   test "$2" = conftest.file
 18.1492 +   )
 18.1493 +then
 18.1494 +   # Ok.
 18.1495 +   :
 18.1496 +else
 18.1497 +   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
 18.1498 +Check your system clock" >&5
 18.1499 +echo "$as_me: error: newly created file is older than distributed files!
 18.1500 +Check your system clock" >&2;}
 18.1501 +   { (exit 1); exit 1; }; }
 18.1502 +fi
 18.1503 +echo "$as_me:$LINENO: result: yes" >&5
 18.1504 +echo "${ECHO_T}yes" >&6
 18.1505 +test "$program_prefix" != NONE &&
 18.1506 +  program_transform_name="s,^,$program_prefix,;$program_transform_name"
 18.1507 +# Use a double $ so make ignores it.
 18.1508 +test "$program_suffix" != NONE &&
 18.1509 +  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
 18.1510 +# Double any \ or $.  echo might interpret backslashes.
 18.1511 +# By default was `s,x,x', remove it if useless.
 18.1512 +cat <<\_ACEOF >conftest.sed
 18.1513 +s/[\\$]/&&/g;s/;s,x,x,$//
 18.1514 +_ACEOF
 18.1515 +program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 18.1516 +rm conftest.sed
 18.1517 +
 18.1518 +
 18.1519 +# expand $ac_aux_dir to an absolute path
 18.1520 +am_aux_dir=`cd $ac_aux_dir && pwd`
 18.1521 +
 18.1522 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 18.1523 +# Use eval to expand $SHELL
 18.1524 +if eval "$MISSING --run true"; then
 18.1525 +  am_missing_run="$MISSING --run "
 18.1526 +else
 18.1527 +  am_missing_run=
 18.1528 +  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
 18.1529 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 18.1530 +fi
 18.1531 +
 18.1532 +for ac_prog in gawk mawk nawk awk
 18.1533 +do
 18.1534 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
 18.1535 +set dummy $ac_prog; ac_word=$2
 18.1536 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1537 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1538 +if test "${ac_cv_prog_AWK+set}" = set; then
 18.1539 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1540 +else
 18.1541 +  if test -n "$AWK"; then
 18.1542 +  ac_cv_prog_AWK="$AWK" # Let the user override the test.
 18.1543 +else
 18.1544 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1545 +for as_dir in $PATH
 18.1546 +do
 18.1547 +  IFS=$as_save_IFS
 18.1548 +  test -z "$as_dir" && as_dir=.
 18.1549 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1550 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1551 +    ac_cv_prog_AWK="$ac_prog"
 18.1552 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1553 +    break 2
 18.1554 +  fi
 18.1555 +done
 18.1556 +done
 18.1557 +
 18.1558 +fi
 18.1559 +fi
 18.1560 +AWK=$ac_cv_prog_AWK
 18.1561 +if test -n "$AWK"; then
 18.1562 +  echo "$as_me:$LINENO: result: $AWK" >&5
 18.1563 +echo "${ECHO_T}$AWK" >&6
 18.1564 +else
 18.1565 +  echo "$as_me:$LINENO: result: no" >&5
 18.1566 +echo "${ECHO_T}no" >&6
 18.1567 +fi
 18.1568 +
 18.1569 +  test -n "$AWK" && break
 18.1570 +done
 18.1571 +
 18.1572 +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 18.1573 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
 18.1574 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
 18.1575 +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
 18.1576 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1577 +else
 18.1578 +  cat >conftest.make <<\_ACEOF
 18.1579 +all:
 18.1580 +	@echo 'ac_maketemp="$(MAKE)"'
 18.1581 +_ACEOF
 18.1582 +# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
 18.1583 +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 18.1584 +if test -n "$ac_maketemp"; then
 18.1585 +  eval ac_cv_prog_make_${ac_make}_set=yes
 18.1586 +else
 18.1587 +  eval ac_cv_prog_make_${ac_make}_set=no
 18.1588 +fi
 18.1589 +rm -f conftest.make
 18.1590 +fi
 18.1591 +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
 18.1592 +  echo "$as_me:$LINENO: result: yes" >&5
 18.1593 +echo "${ECHO_T}yes" >&6
 18.1594 +  SET_MAKE=
 18.1595 +else
 18.1596 +  echo "$as_me:$LINENO: result: no" >&5
 18.1597 +echo "${ECHO_T}no" >&6
 18.1598 +  SET_MAKE="MAKE=${MAKE-make}"
 18.1599 +fi
 18.1600 +
 18.1601 +rm -rf .tst 2>/dev/null
 18.1602 +mkdir .tst 2>/dev/null
 18.1603 +if test -d .tst; then
 18.1604 +  am__leading_dot=.
 18.1605 +else
 18.1606 +  am__leading_dot=_
 18.1607 +fi
 18.1608 +rmdir .tst 2>/dev/null
 18.1609 +
 18.1610 + # test to see if srcdir already configured
 18.1611 +if test "`cd $srcdir && pwd`" != "`pwd`" &&
 18.1612 +   test -f $srcdir/config.status; then
 18.1613 +  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
 18.1614 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
 18.1615 +   { (exit 1); exit 1; }; }
 18.1616 +fi
 18.1617 +
 18.1618 +# test whether we have cygpath
 18.1619 +if test -z "$CYGPATH_W"; then
 18.1620 +  if (cygpath --version) >/dev/null 2>/dev/null; then
 18.1621 +    CYGPATH_W='cygpath -w'
 18.1622 +  else
 18.1623 +    CYGPATH_W=echo
 18.1624 +  fi
 18.1625 +fi
 18.1626 +
 18.1627 +
 18.1628 +# Define the identity of the package.
 18.1629 + PACKAGE='masqmail'
 18.1630 + VERSION='0.2.21'
 18.1631 +
 18.1632 +
 18.1633 +cat >>confdefs.h <<_ACEOF
 18.1634 +#define PACKAGE "$PACKAGE"
 18.1635 +_ACEOF
 18.1636 +
 18.1637 +
 18.1638 +cat >>confdefs.h <<_ACEOF
 18.1639 +#define VERSION "$VERSION"
 18.1640 +_ACEOF
 18.1641 +
 18.1642 +# Some tools Automake needs.
 18.1643 +
 18.1644 +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
 18.1645 +
 18.1646 +
 18.1647 +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
 18.1648 +
 18.1649 +
 18.1650 +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
 18.1651 +
 18.1652 +
 18.1653 +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 18.1654 +
 18.1655 +
 18.1656 +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 18.1657 +
 18.1658 +
 18.1659 +AMTAR=${AMTAR-"${am_missing_run}tar"}
 18.1660 +
 18.1661 +install_sh=${install_sh-"$am_aux_dir/install-sh"}
 18.1662 +
 18.1663 +# Installed binaries are usually stripped using `strip' when the user
 18.1664 +# run `make install-strip'.  However `strip' might not be the right
 18.1665 +# tool to use in cross-compilation environments, therefore Automake
 18.1666 +# will honor the `STRIP' environment variable to overrule this program.
 18.1667 +if test "$cross_compiling" != no; then
 18.1668 +  if test -n "$ac_tool_prefix"; then
 18.1669 +  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 18.1670 +set dummy ${ac_tool_prefix}strip; ac_word=$2
 18.1671 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1672 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1673 +if test "${ac_cv_prog_STRIP+set}" = set; then
 18.1674 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1675 +else
 18.1676 +  if test -n "$STRIP"; then
 18.1677 +  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 18.1678 +else
 18.1679 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1680 +for as_dir in $PATH
 18.1681 +do
 18.1682 +  IFS=$as_save_IFS
 18.1683 +  test -z "$as_dir" && as_dir=.
 18.1684 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1685 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1686 +    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
 18.1687 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1688 +    break 2
 18.1689 +  fi
 18.1690 +done
 18.1691 +done
 18.1692 +
 18.1693 +fi
 18.1694 +fi
 18.1695 +STRIP=$ac_cv_prog_STRIP
 18.1696 +if test -n "$STRIP"; then
 18.1697 +  echo "$as_me:$LINENO: result: $STRIP" >&5
 18.1698 +echo "${ECHO_T}$STRIP" >&6
 18.1699 +else
 18.1700 +  echo "$as_me:$LINENO: result: no" >&5
 18.1701 +echo "${ECHO_T}no" >&6
 18.1702 +fi
 18.1703 +
 18.1704 +fi
 18.1705 +if test -z "$ac_cv_prog_STRIP"; then
 18.1706 +  ac_ct_STRIP=$STRIP
 18.1707 +  # Extract the first word of "strip", so it can be a program name with args.
 18.1708 +set dummy strip; ac_word=$2
 18.1709 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1710 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1711 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
 18.1712 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1713 +else
 18.1714 +  if test -n "$ac_ct_STRIP"; then
 18.1715 +  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 18.1716 +else
 18.1717 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1718 +for as_dir in $PATH
 18.1719 +do
 18.1720 +  IFS=$as_save_IFS
 18.1721 +  test -z "$as_dir" && as_dir=.
 18.1722 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1723 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1724 +    ac_cv_prog_ac_ct_STRIP="strip"
 18.1725 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1726 +    break 2
 18.1727 +  fi
 18.1728 +done
 18.1729 +done
 18.1730 +
 18.1731 +  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 18.1732 +fi
 18.1733 +fi
 18.1734 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 18.1735 +if test -n "$ac_ct_STRIP"; then
 18.1736 +  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
 18.1737 +echo "${ECHO_T}$ac_ct_STRIP" >&6
 18.1738 +else
 18.1739 +  echo "$as_me:$LINENO: result: no" >&5
 18.1740 +echo "${ECHO_T}no" >&6
 18.1741 +fi
 18.1742 +
 18.1743 +  STRIP=$ac_ct_STRIP
 18.1744 +else
 18.1745 +  STRIP="$ac_cv_prog_STRIP"
 18.1746 +fi
 18.1747 +
 18.1748 +fi
 18.1749 +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 18.1750 +
 18.1751 +# We need awk for the "check" target.  The system "awk" is bad on
 18.1752 +# some platforms.
 18.1753 +
 18.1754 +
 18.1755 +
 18.1756 +
 18.1757 +
 18.1758 +
 18.1759 +
 18.1760 +
 18.1761 +ac_ext=c
 18.1762 +ac_cpp='$CPP $CPPFLAGS'
 18.1763 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 18.1764 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 18.1765 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
 18.1766 +if test -n "$ac_tool_prefix"; then
 18.1767 +  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 18.1768 +set dummy ${ac_tool_prefix}gcc; ac_word=$2
 18.1769 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1770 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1771 +if test "${ac_cv_prog_CC+set}" = set; then
 18.1772 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1773 +else
 18.1774 +  if test -n "$CC"; then
 18.1775 +  ac_cv_prog_CC="$CC" # Let the user override the test.
 18.1776 +else
 18.1777 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1778 +for as_dir in $PATH
 18.1779 +do
 18.1780 +  IFS=$as_save_IFS
 18.1781 +  test -z "$as_dir" && as_dir=.
 18.1782 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1783 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1784 +    ac_cv_prog_CC="${ac_tool_prefix}gcc"
 18.1785 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1786 +    break 2
 18.1787 +  fi
 18.1788 +done
 18.1789 +done
 18.1790 +
 18.1791 +fi
 18.1792 +fi
 18.1793 +CC=$ac_cv_prog_CC
 18.1794 +if test -n "$CC"; then
 18.1795 +  echo "$as_me:$LINENO: result: $CC" >&5
 18.1796 +echo "${ECHO_T}$CC" >&6
 18.1797 +else
 18.1798 +  echo "$as_me:$LINENO: result: no" >&5
 18.1799 +echo "${ECHO_T}no" >&6
 18.1800 +fi
 18.1801 +
 18.1802 +fi
 18.1803 +if test -z "$ac_cv_prog_CC"; then
 18.1804 +  ac_ct_CC=$CC
 18.1805 +  # Extract the first word of "gcc", so it can be a program name with args.
 18.1806 +set dummy gcc; ac_word=$2
 18.1807 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1808 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1809 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
 18.1810 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1811 +else
 18.1812 +  if test -n "$ac_ct_CC"; then
 18.1813 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 18.1814 +else
 18.1815 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1816 +for as_dir in $PATH
 18.1817 +do
 18.1818 +  IFS=$as_save_IFS
 18.1819 +  test -z "$as_dir" && as_dir=.
 18.1820 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1821 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1822 +    ac_cv_prog_ac_ct_CC="gcc"
 18.1823 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1824 +    break 2
 18.1825 +  fi
 18.1826 +done
 18.1827 +done
 18.1828 +
 18.1829 +fi
 18.1830 +fi
 18.1831 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
 18.1832 +if test -n "$ac_ct_CC"; then
 18.1833 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 18.1834 +echo "${ECHO_T}$ac_ct_CC" >&6
 18.1835 +else
 18.1836 +  echo "$as_me:$LINENO: result: no" >&5
 18.1837 +echo "${ECHO_T}no" >&6
 18.1838 +fi
 18.1839 +
 18.1840 +  CC=$ac_ct_CC
 18.1841 +else
 18.1842 +  CC="$ac_cv_prog_CC"
 18.1843 +fi
 18.1844 +
 18.1845 +if test -z "$CC"; then
 18.1846 +  if test -n "$ac_tool_prefix"; then
 18.1847 +  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 18.1848 +set dummy ${ac_tool_prefix}cc; ac_word=$2
 18.1849 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1850 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1851 +if test "${ac_cv_prog_CC+set}" = set; then
 18.1852 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1853 +else
 18.1854 +  if test -n "$CC"; then
 18.1855 +  ac_cv_prog_CC="$CC" # Let the user override the test.
 18.1856 +else
 18.1857 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1858 +for as_dir in $PATH
 18.1859 +do
 18.1860 +  IFS=$as_save_IFS
 18.1861 +  test -z "$as_dir" && as_dir=.
 18.1862 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1863 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1864 +    ac_cv_prog_CC="${ac_tool_prefix}cc"
 18.1865 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1866 +    break 2
 18.1867 +  fi
 18.1868 +done
 18.1869 +done
 18.1870 +
 18.1871 +fi
 18.1872 +fi
 18.1873 +CC=$ac_cv_prog_CC
 18.1874 +if test -n "$CC"; then
 18.1875 +  echo "$as_me:$LINENO: result: $CC" >&5
 18.1876 +echo "${ECHO_T}$CC" >&6
 18.1877 +else
 18.1878 +  echo "$as_me:$LINENO: result: no" >&5
 18.1879 +echo "${ECHO_T}no" >&6
 18.1880 +fi
 18.1881 +
 18.1882 +fi
 18.1883 +if test -z "$ac_cv_prog_CC"; then
 18.1884 +  ac_ct_CC=$CC
 18.1885 +  # Extract the first word of "cc", so it can be a program name with args.
 18.1886 +set dummy cc; ac_word=$2
 18.1887 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1888 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1889 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
 18.1890 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1891 +else
 18.1892 +  if test -n "$ac_ct_CC"; then
 18.1893 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 18.1894 +else
 18.1895 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1896 +for as_dir in $PATH
 18.1897 +do
 18.1898 +  IFS=$as_save_IFS
 18.1899 +  test -z "$as_dir" && as_dir=.
 18.1900 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1901 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1902 +    ac_cv_prog_ac_ct_CC="cc"
 18.1903 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1904 +    break 2
 18.1905 +  fi
 18.1906 +done
 18.1907 +done
 18.1908 +
 18.1909 +fi
 18.1910 +fi
 18.1911 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
 18.1912 +if test -n "$ac_ct_CC"; then
 18.1913 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 18.1914 +echo "${ECHO_T}$ac_ct_CC" >&6
 18.1915 +else
 18.1916 +  echo "$as_me:$LINENO: result: no" >&5
 18.1917 +echo "${ECHO_T}no" >&6
 18.1918 +fi
 18.1919 +
 18.1920 +  CC=$ac_ct_CC
 18.1921 +else
 18.1922 +  CC="$ac_cv_prog_CC"
 18.1923 +fi
 18.1924 +
 18.1925 +fi
 18.1926 +if test -z "$CC"; then
 18.1927 +  # Extract the first word of "cc", so it can be a program name with args.
 18.1928 +set dummy cc; ac_word=$2
 18.1929 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1930 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1931 +if test "${ac_cv_prog_CC+set}" = set; then
 18.1932 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1933 +else
 18.1934 +  if test -n "$CC"; then
 18.1935 +  ac_cv_prog_CC="$CC" # Let the user override the test.
 18.1936 +else
 18.1937 +  ac_prog_rejected=no
 18.1938 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1939 +for as_dir in $PATH
 18.1940 +do
 18.1941 +  IFS=$as_save_IFS
 18.1942 +  test -z "$as_dir" && as_dir=.
 18.1943 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.1944 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.1945 +    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
 18.1946 +       ac_prog_rejected=yes
 18.1947 +       continue
 18.1948 +     fi
 18.1949 +    ac_cv_prog_CC="cc"
 18.1950 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.1951 +    break 2
 18.1952 +  fi
 18.1953 +done
 18.1954 +done
 18.1955 +
 18.1956 +if test $ac_prog_rejected = yes; then
 18.1957 +  # We found a bogon in the path, so make sure we never use it.
 18.1958 +  set dummy $ac_cv_prog_CC
 18.1959 +  shift
 18.1960 +  if test $# != 0; then
 18.1961 +    # We chose a different compiler from the bogus one.
 18.1962 +    # However, it has the same basename, so the bogon will be chosen
 18.1963 +    # first if we set CC to just the basename; use the full file name.
 18.1964 +    shift
 18.1965 +    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
 18.1966 +  fi
 18.1967 +fi
 18.1968 +fi
 18.1969 +fi
 18.1970 +CC=$ac_cv_prog_CC
 18.1971 +if test -n "$CC"; then
 18.1972 +  echo "$as_me:$LINENO: result: $CC" >&5
 18.1973 +echo "${ECHO_T}$CC" >&6
 18.1974 +else
 18.1975 +  echo "$as_me:$LINENO: result: no" >&5
 18.1976 +echo "${ECHO_T}no" >&6
 18.1977 +fi
 18.1978 +
 18.1979 +fi
 18.1980 +if test -z "$CC"; then
 18.1981 +  if test -n "$ac_tool_prefix"; then
 18.1982 +  for ac_prog in cl
 18.1983 +  do
 18.1984 +    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 18.1985 +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 18.1986 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.1987 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.1988 +if test "${ac_cv_prog_CC+set}" = set; then
 18.1989 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.1990 +else
 18.1991 +  if test -n "$CC"; then
 18.1992 +  ac_cv_prog_CC="$CC" # Let the user override the test.
 18.1993 +else
 18.1994 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.1995 +for as_dir in $PATH
 18.1996 +do
 18.1997 +  IFS=$as_save_IFS
 18.1998 +  test -z "$as_dir" && as_dir=.
 18.1999 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.2000 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.2001 +    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
 18.2002 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.2003 +    break 2
 18.2004 +  fi
 18.2005 +done
 18.2006 +done
 18.2007 +
 18.2008 +fi
 18.2009 +fi
 18.2010 +CC=$ac_cv_prog_CC
 18.2011 +if test -n "$CC"; then
 18.2012 +  echo "$as_me:$LINENO: result: $CC" >&5
 18.2013 +echo "${ECHO_T}$CC" >&6
 18.2014 +else
 18.2015 +  echo "$as_me:$LINENO: result: no" >&5
 18.2016 +echo "${ECHO_T}no" >&6
 18.2017 +fi
 18.2018 +
 18.2019 +    test -n "$CC" && break
 18.2020 +  done
 18.2021 +fi
 18.2022 +if test -z "$CC"; then
 18.2023 +  ac_ct_CC=$CC
 18.2024 +  for ac_prog in cl
 18.2025 +do
 18.2026 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
 18.2027 +set dummy $ac_prog; ac_word=$2
 18.2028 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.2029 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.2030 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
 18.2031 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2032 +else
 18.2033 +  if test -n "$ac_ct_CC"; then
 18.2034 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 18.2035 +else
 18.2036 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.2037 +for as_dir in $PATH
 18.2038 +do
 18.2039 +  IFS=$as_save_IFS
 18.2040 +  test -z "$as_dir" && as_dir=.
 18.2041 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.2042 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.2043 +    ac_cv_prog_ac_ct_CC="$ac_prog"
 18.2044 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.2045 +    break 2
 18.2046 +  fi
 18.2047 +done
 18.2048 +done
 18.2049 +
 18.2050 +fi
 18.2051 +fi
 18.2052 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
 18.2053 +if test -n "$ac_ct_CC"; then
 18.2054 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 18.2055 +echo "${ECHO_T}$ac_ct_CC" >&6
 18.2056 +else
 18.2057 +  echo "$as_me:$LINENO: result: no" >&5
 18.2058 +echo "${ECHO_T}no" >&6
 18.2059 +fi
 18.2060 +
 18.2061 +  test -n "$ac_ct_CC" && break
 18.2062 +done
 18.2063 +
 18.2064 +  CC=$ac_ct_CC
 18.2065 +fi
 18.2066 +
 18.2067 +fi
 18.2068 +
 18.2069 +
 18.2070 +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 18.2071 +See \`config.log' for more details." >&5
 18.2072 +echo "$as_me: error: no acceptable C compiler found in \$PATH
 18.2073 +See \`config.log' for more details." >&2;}
 18.2074 +   { (exit 1); exit 1; }; }
 18.2075 +
 18.2076 +# Provide some information about the compiler.
 18.2077 +echo "$as_me:$LINENO:" \
 18.2078 +     "checking for C compiler version" >&5
 18.2079 +ac_compiler=`set X $ac_compile; echo $2`
 18.2080 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
 18.2081 +  (eval $ac_compiler --version </dev/null >&5) 2>&5
 18.2082 +  ac_status=$?
 18.2083 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2084 +  (exit $ac_status); }
 18.2085 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
 18.2086 +  (eval $ac_compiler -v </dev/null >&5) 2>&5
 18.2087 +  ac_status=$?
 18.2088 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2089 +  (exit $ac_status); }
 18.2090 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
 18.2091 +  (eval $ac_compiler -V </dev/null >&5) 2>&5
 18.2092 +  ac_status=$?
 18.2093 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2094 +  (exit $ac_status); }
 18.2095 +
 18.2096 +cat >conftest.$ac_ext <<_ACEOF
 18.2097 +/* confdefs.h.  */
 18.2098 +_ACEOF
 18.2099 +cat confdefs.h >>conftest.$ac_ext
 18.2100 +cat >>conftest.$ac_ext <<_ACEOF
 18.2101 +/* end confdefs.h.  */
 18.2102 +
 18.2103 +int
 18.2104 +main ()
 18.2105 +{
 18.2106 +
 18.2107 +  ;
 18.2108 +  return 0;
 18.2109 +}
 18.2110 +_ACEOF
 18.2111 +ac_clean_files_save=$ac_clean_files
 18.2112 +ac_clean_files="$ac_clean_files a.out a.exe b.out"
 18.2113 +# Try to create an executable without -o first, disregard a.out.
 18.2114 +# It will help us diagnose broken compilers, and finding out an intuition
 18.2115 +# of exeext.
 18.2116 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
 18.2117 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
 18.2118 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 18.2119 +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
 18.2120 +  (eval $ac_link_default) 2>&5
 18.2121 +  ac_status=$?
 18.2122 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2123 +  (exit $ac_status); }; then
 18.2124 +  # Find the output, starting from the most likely.  This scheme is
 18.2125 +# not robust to junk in `.', hence go to wildcards (a.*) only as a last
 18.2126 +# resort.
 18.2127 +
 18.2128 +# Be careful to initialize this variable, since it used to be cached.
 18.2129 +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
 18.2130 +ac_cv_exeext=
 18.2131 +# b.out is created by i960 compilers.
 18.2132 +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
 18.2133 +do
 18.2134 +  test -f "$ac_file" || continue
 18.2135 +  case $ac_file in
 18.2136 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
 18.2137 +	;;
 18.2138 +    conftest.$ac_ext )
 18.2139 +	# This is the source file.
 18.2140 +	;;
 18.2141 +    [ab].out )
 18.2142 +	# We found the default executable, but exeext='' is most
 18.2143 +	# certainly right.
 18.2144 +	break;;
 18.2145 +    *.* )
 18.2146 +	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 18.2147 +	# FIXME: I believe we export ac_cv_exeext for Libtool,
 18.2148 +	# but it would be cool to find out if it's true.  Does anybody
 18.2149 +	# maintain Libtool? --akim.
 18.2150 +	export ac_cv_exeext
 18.2151 +	break;;
 18.2152 +    * )
 18.2153 +	break;;
 18.2154 +  esac
 18.2155 +done
 18.2156 +else
 18.2157 +  echo "$as_me: failed program was:" >&5
 18.2158 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2159 +
 18.2160 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
 18.2161 +See \`config.log' for more details." >&5
 18.2162 +echo "$as_me: error: C compiler cannot create executables
 18.2163 +See \`config.log' for more details." >&2;}
 18.2164 +   { (exit 77); exit 77; }; }
 18.2165 +fi
 18.2166 +
 18.2167 +ac_exeext=$ac_cv_exeext
 18.2168 +echo "$as_me:$LINENO: result: $ac_file" >&5
 18.2169 +echo "${ECHO_T}$ac_file" >&6
 18.2170 +
 18.2171 +# Check the compiler produces executables we can run.  If not, either
 18.2172 +# the compiler is broken, or we cross compile.
 18.2173 +echo "$as_me:$LINENO: checking whether the C compiler works" >&5
 18.2174 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 18.2175 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 18.2176 +# If not cross compiling, check that we can run a simple program.
 18.2177 +if test "$cross_compiling" != yes; then
 18.2178 +  if { ac_try='./$ac_file'
 18.2179 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2180 +  (eval $ac_try) 2>&5
 18.2181 +  ac_status=$?
 18.2182 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2183 +  (exit $ac_status); }; }; then
 18.2184 +    cross_compiling=no
 18.2185 +  else
 18.2186 +    if test "$cross_compiling" = maybe; then
 18.2187 +	cross_compiling=yes
 18.2188 +    else
 18.2189 +	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
 18.2190 +If you meant to cross compile, use \`--host'.
 18.2191 +See \`config.log' for more details." >&5
 18.2192 +echo "$as_me: error: cannot run C compiled programs.
 18.2193 +If you meant to cross compile, use \`--host'.
 18.2194 +See \`config.log' for more details." >&2;}
 18.2195 +   { (exit 1); exit 1; }; }
 18.2196 +    fi
 18.2197 +  fi
 18.2198 +fi
 18.2199 +echo "$as_me:$LINENO: result: yes" >&5
 18.2200 +echo "${ECHO_T}yes" >&6
 18.2201 +
 18.2202 +rm -f a.out a.exe conftest$ac_cv_exeext b.out
 18.2203 +ac_clean_files=$ac_clean_files_save
 18.2204 +# Check the compiler produces executables we can run.  If not, either
 18.2205 +# the compiler is broken, or we cross compile.
 18.2206 +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
 18.2207 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
 18.2208 +echo "$as_me:$LINENO: result: $cross_compiling" >&5
 18.2209 +echo "${ECHO_T}$cross_compiling" >&6
 18.2210 +
 18.2211 +echo "$as_me:$LINENO: checking for suffix of executables" >&5
 18.2212 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
 18.2213 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.2214 +  (eval $ac_link) 2>&5
 18.2215 +  ac_status=$?
 18.2216 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2217 +  (exit $ac_status); }; then
 18.2218 +  # If both `conftest.exe' and `conftest' are `present' (well, observable)
 18.2219 +# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 18.2220 +# work properly (i.e., refer to `conftest.exe'), while it won't with
 18.2221 +# `rm'.
 18.2222 +for ac_file in conftest.exe conftest conftest.*; do
 18.2223 +  test -f "$ac_file" || continue
 18.2224 +  case $ac_file in
 18.2225 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
 18.2226 +    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 18.2227 +	  export ac_cv_exeext
 18.2228 +	  break;;
 18.2229 +    * ) break;;
 18.2230 +  esac
 18.2231 +done
 18.2232 +else
 18.2233 +  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 18.2234 +See \`config.log' for more details." >&5
 18.2235 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 18.2236 +See \`config.log' for more details." >&2;}
 18.2237 +   { (exit 1); exit 1; }; }
 18.2238 +fi
 18.2239 +
 18.2240 +rm -f conftest$ac_cv_exeext
 18.2241 +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
 18.2242 +echo "${ECHO_T}$ac_cv_exeext" >&6
 18.2243 +
 18.2244 +rm -f conftest.$ac_ext
 18.2245 +EXEEXT=$ac_cv_exeext
 18.2246 +ac_exeext=$EXEEXT
 18.2247 +echo "$as_me:$LINENO: checking for suffix of object files" >&5
 18.2248 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
 18.2249 +if test "${ac_cv_objext+set}" = set; then
 18.2250 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2251 +else
 18.2252 +  cat >conftest.$ac_ext <<_ACEOF
 18.2253 +/* confdefs.h.  */
 18.2254 +_ACEOF
 18.2255 +cat confdefs.h >>conftest.$ac_ext
 18.2256 +cat >>conftest.$ac_ext <<_ACEOF
 18.2257 +/* end confdefs.h.  */
 18.2258 +
 18.2259 +int
 18.2260 +main ()
 18.2261 +{
 18.2262 +
 18.2263 +  ;
 18.2264 +  return 0;
 18.2265 +}
 18.2266 +_ACEOF
 18.2267 +rm -f conftest.o conftest.obj
 18.2268 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2269 +  (eval $ac_compile) 2>&5
 18.2270 +  ac_status=$?
 18.2271 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2272 +  (exit $ac_status); }; then
 18.2273 +  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
 18.2274 +  case $ac_file in
 18.2275 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
 18.2276 +    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
 18.2277 +       break;;
 18.2278 +  esac
 18.2279 +done
 18.2280 +else
 18.2281 +  echo "$as_me: failed program was:" >&5
 18.2282 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2283 +
 18.2284 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 18.2285 +See \`config.log' for more details." >&5
 18.2286 +echo "$as_me: error: cannot compute suffix of object files: cannot compile
 18.2287 +See \`config.log' for more details." >&2;}
 18.2288 +   { (exit 1); exit 1; }; }
 18.2289 +fi
 18.2290 +
 18.2291 +rm -f conftest.$ac_cv_objext conftest.$ac_ext
 18.2292 +fi
 18.2293 +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
 18.2294 +echo "${ECHO_T}$ac_cv_objext" >&6
 18.2295 +OBJEXT=$ac_cv_objext
 18.2296 +ac_objext=$OBJEXT
 18.2297 +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
 18.2298 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 18.2299 +if test "${ac_cv_c_compiler_gnu+set}" = set; then
 18.2300 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2301 +else
 18.2302 +  cat >conftest.$ac_ext <<_ACEOF
 18.2303 +/* confdefs.h.  */
 18.2304 +_ACEOF
 18.2305 +cat confdefs.h >>conftest.$ac_ext
 18.2306 +cat >>conftest.$ac_ext <<_ACEOF
 18.2307 +/* end confdefs.h.  */
 18.2308 +
 18.2309 +int
 18.2310 +main ()
 18.2311 +{
 18.2312 +#ifndef __GNUC__
 18.2313 +       choke me
 18.2314 +#endif
 18.2315 +
 18.2316 +  ;
 18.2317 +  return 0;
 18.2318 +}
 18.2319 +_ACEOF
 18.2320 +rm -f conftest.$ac_objext
 18.2321 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2322 +  (eval $ac_compile) 2>conftest.er1
 18.2323 +  ac_status=$?
 18.2324 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2325 +  rm -f conftest.er1
 18.2326 +  cat conftest.err >&5
 18.2327 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2328 +  (exit $ac_status); } &&
 18.2329 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2330 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2331 +  (eval $ac_try) 2>&5
 18.2332 +  ac_status=$?
 18.2333 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2334 +  (exit $ac_status); }; } &&
 18.2335 +	 { ac_try='test -s conftest.$ac_objext'
 18.2336 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2337 +  (eval $ac_try) 2>&5
 18.2338 +  ac_status=$?
 18.2339 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2340 +  (exit $ac_status); }; }; then
 18.2341 +  ac_compiler_gnu=yes
 18.2342 +else
 18.2343 +  echo "$as_me: failed program was:" >&5
 18.2344 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2345 +
 18.2346 +ac_compiler_gnu=no
 18.2347 +fi
 18.2348 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.2349 +ac_cv_c_compiler_gnu=$ac_compiler_gnu
 18.2350 +
 18.2351 +fi
 18.2352 +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
 18.2353 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 18.2354 +GCC=`test $ac_compiler_gnu = yes && echo yes`
 18.2355 +ac_test_CFLAGS=${CFLAGS+set}
 18.2356 +ac_save_CFLAGS=$CFLAGS
 18.2357 +CFLAGS="-g"
 18.2358 +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
 18.2359 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 18.2360 +if test "${ac_cv_prog_cc_g+set}" = set; then
 18.2361 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2362 +else
 18.2363 +  cat >conftest.$ac_ext <<_ACEOF
 18.2364 +/* confdefs.h.  */
 18.2365 +_ACEOF
 18.2366 +cat confdefs.h >>conftest.$ac_ext
 18.2367 +cat >>conftest.$ac_ext <<_ACEOF
 18.2368 +/* end confdefs.h.  */
 18.2369 +
 18.2370 +int
 18.2371 +main ()
 18.2372 +{
 18.2373 +
 18.2374 +  ;
 18.2375 +  return 0;
 18.2376 +}
 18.2377 +_ACEOF
 18.2378 +rm -f conftest.$ac_objext
 18.2379 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2380 +  (eval $ac_compile) 2>conftest.er1
 18.2381 +  ac_status=$?
 18.2382 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2383 +  rm -f conftest.er1
 18.2384 +  cat conftest.err >&5
 18.2385 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2386 +  (exit $ac_status); } &&
 18.2387 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2388 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2389 +  (eval $ac_try) 2>&5
 18.2390 +  ac_status=$?
 18.2391 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2392 +  (exit $ac_status); }; } &&
 18.2393 +	 { ac_try='test -s conftest.$ac_objext'
 18.2394 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2395 +  (eval $ac_try) 2>&5
 18.2396 +  ac_status=$?
 18.2397 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2398 +  (exit $ac_status); }; }; then
 18.2399 +  ac_cv_prog_cc_g=yes
 18.2400 +else
 18.2401 +  echo "$as_me: failed program was:" >&5
 18.2402 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2403 +
 18.2404 +ac_cv_prog_cc_g=no
 18.2405 +fi
 18.2406 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.2407 +fi
 18.2408 +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 18.2409 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 18.2410 +if test "$ac_test_CFLAGS" = set; then
 18.2411 +  CFLAGS=$ac_save_CFLAGS
 18.2412 +elif test $ac_cv_prog_cc_g = yes; then
 18.2413 +  if test "$GCC" = yes; then
 18.2414 +    CFLAGS="-g -O2"
 18.2415 +  else
 18.2416 +    CFLAGS="-g"
 18.2417 +  fi
 18.2418 +else
 18.2419 +  if test "$GCC" = yes; then
 18.2420 +    CFLAGS="-O2"
 18.2421 +  else
 18.2422 +    CFLAGS=
 18.2423 +  fi
 18.2424 +fi
 18.2425 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
 18.2426 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
 18.2427 +if test "${ac_cv_prog_cc_stdc+set}" = set; then
 18.2428 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2429 +else
 18.2430 +  ac_cv_prog_cc_stdc=no
 18.2431 +ac_save_CC=$CC
 18.2432 +cat >conftest.$ac_ext <<_ACEOF
 18.2433 +/* confdefs.h.  */
 18.2434 +_ACEOF
 18.2435 +cat confdefs.h >>conftest.$ac_ext
 18.2436 +cat >>conftest.$ac_ext <<_ACEOF
 18.2437 +/* end confdefs.h.  */
 18.2438 +#include <stdarg.h>
 18.2439 +#include <stdio.h>
 18.2440 +#include <sys/types.h>
 18.2441 +#include <sys/stat.h>
 18.2442 +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 18.2443 +struct buf { int x; };
 18.2444 +FILE * (*rcsopen) (struct buf *, struct stat *, int);
 18.2445 +static char *e (p, i)
 18.2446 +     char **p;
 18.2447 +     int i;
 18.2448 +{
 18.2449 +  return p[i];
 18.2450 +}
 18.2451 +static char *f (char * (*g) (char **, int), char **p, ...)
 18.2452 +{
 18.2453 +  char *s;
 18.2454 +  va_list v;
 18.2455 +  va_start (v,p);
 18.2456 +  s = g (p, va_arg (v,int));
 18.2457 +  va_end (v);
 18.2458 +  return s;
 18.2459 +}
 18.2460 +
 18.2461 +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
 18.2462 +   function prototypes and stuff, but not '\xHH' hex character constants.
 18.2463 +   These don't provoke an error unfortunately, instead are silently treated
 18.2464 +   as 'x'.  The following induces an error, until -std1 is added to get
 18.2465 +   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
 18.2466 +   array size at least.  It's necessary to write '\x00'==0 to get something
 18.2467 +   that's true only with -std1.  */
 18.2468 +int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 18.2469 +
 18.2470 +int test (int i, double x);
 18.2471 +struct s1 {int (*f) (int a);};
 18.2472 +struct s2 {int (*f) (double a);};
 18.2473 +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 18.2474 +int argc;
 18.2475 +char **argv;
 18.2476 +int
 18.2477 +main ()
 18.2478 +{
 18.2479 +return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 18.2480 +  ;
 18.2481 +  return 0;
 18.2482 +}
 18.2483 +_ACEOF
 18.2484 +# Don't try gcc -ansi; that turns off useful extensions and
 18.2485 +# breaks some systems' header files.
 18.2486 +# AIX			-qlanglvl=ansi
 18.2487 +# Ultrix and OSF/1	-std1
 18.2488 +# HP-UX 10.20 and later	-Ae
 18.2489 +# HP-UX older versions	-Aa -D_HPUX_SOURCE
 18.2490 +# SVR4			-Xc -D__EXTENSIONS__
 18.2491 +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 18.2492 +do
 18.2493 +  CC="$ac_save_CC $ac_arg"
 18.2494 +  rm -f conftest.$ac_objext
 18.2495 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2496 +  (eval $ac_compile) 2>conftest.er1
 18.2497 +  ac_status=$?
 18.2498 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2499 +  rm -f conftest.er1
 18.2500 +  cat conftest.err >&5
 18.2501 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2502 +  (exit $ac_status); } &&
 18.2503 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2504 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2505 +  (eval $ac_try) 2>&5
 18.2506 +  ac_status=$?
 18.2507 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2508 +  (exit $ac_status); }; } &&
 18.2509 +	 { ac_try='test -s conftest.$ac_objext'
 18.2510 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2511 +  (eval $ac_try) 2>&5
 18.2512 +  ac_status=$?
 18.2513 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2514 +  (exit $ac_status); }; }; then
 18.2515 +  ac_cv_prog_cc_stdc=$ac_arg
 18.2516 +break
 18.2517 +else
 18.2518 +  echo "$as_me: failed program was:" >&5
 18.2519 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2520 +
 18.2521 +fi
 18.2522 +rm -f conftest.err conftest.$ac_objext
 18.2523 +done
 18.2524 +rm -f conftest.$ac_ext conftest.$ac_objext
 18.2525 +CC=$ac_save_CC
 18.2526 +
 18.2527 +fi
 18.2528 +
 18.2529 +case "x$ac_cv_prog_cc_stdc" in
 18.2530 +  x|xno)
 18.2531 +    echo "$as_me:$LINENO: result: none needed" >&5
 18.2532 +echo "${ECHO_T}none needed" >&6 ;;
 18.2533 +  *)
 18.2534 +    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
 18.2535 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
 18.2536 +    CC="$CC $ac_cv_prog_cc_stdc" ;;
 18.2537 +esac
 18.2538 +
 18.2539 +# Some people use a C++ compiler to compile C.  Since we use `exit',
 18.2540 +# in C++ we need to declare it.  In case someone uses the same compiler
 18.2541 +# for both compiling C and C++ we need to have the C++ compiler decide
 18.2542 +# the declaration of exit, since it's the most demanding environment.
 18.2543 +cat >conftest.$ac_ext <<_ACEOF
 18.2544 +#ifndef __cplusplus
 18.2545 +  choke me
 18.2546 +#endif
 18.2547 +_ACEOF
 18.2548 +rm -f conftest.$ac_objext
 18.2549 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2550 +  (eval $ac_compile) 2>conftest.er1
 18.2551 +  ac_status=$?
 18.2552 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2553 +  rm -f conftest.er1
 18.2554 +  cat conftest.err >&5
 18.2555 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2556 +  (exit $ac_status); } &&
 18.2557 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2558 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2559 +  (eval $ac_try) 2>&5
 18.2560 +  ac_status=$?
 18.2561 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2562 +  (exit $ac_status); }; } &&
 18.2563 +	 { ac_try='test -s conftest.$ac_objext'
 18.2564 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2565 +  (eval $ac_try) 2>&5
 18.2566 +  ac_status=$?
 18.2567 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2568 +  (exit $ac_status); }; }; then
 18.2569 +  for ac_declaration in \
 18.2570 +   '' \
 18.2571 +   'extern "C" void std::exit (int) throw (); using std::exit;' \
 18.2572 +   'extern "C" void std::exit (int); using std::exit;' \
 18.2573 +   'extern "C" void exit (int) throw ();' \
 18.2574 +   'extern "C" void exit (int);' \
 18.2575 +   'void exit (int);'
 18.2576 +do
 18.2577 +  cat >conftest.$ac_ext <<_ACEOF
 18.2578 +/* confdefs.h.  */
 18.2579 +_ACEOF
 18.2580 +cat confdefs.h >>conftest.$ac_ext
 18.2581 +cat >>conftest.$ac_ext <<_ACEOF
 18.2582 +/* end confdefs.h.  */
 18.2583 +$ac_declaration
 18.2584 +#include <stdlib.h>
 18.2585 +int
 18.2586 +main ()
 18.2587 +{
 18.2588 +exit (42);
 18.2589 +  ;
 18.2590 +  return 0;
 18.2591 +}
 18.2592 +_ACEOF
 18.2593 +rm -f conftest.$ac_objext
 18.2594 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2595 +  (eval $ac_compile) 2>conftest.er1
 18.2596 +  ac_status=$?
 18.2597 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2598 +  rm -f conftest.er1
 18.2599 +  cat conftest.err >&5
 18.2600 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2601 +  (exit $ac_status); } &&
 18.2602 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2603 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2604 +  (eval $ac_try) 2>&5
 18.2605 +  ac_status=$?
 18.2606 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2607 +  (exit $ac_status); }; } &&
 18.2608 +	 { ac_try='test -s conftest.$ac_objext'
 18.2609 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2610 +  (eval $ac_try) 2>&5
 18.2611 +  ac_status=$?
 18.2612 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2613 +  (exit $ac_status); }; }; then
 18.2614 +  :
 18.2615 +else
 18.2616 +  echo "$as_me: failed program was:" >&5
 18.2617 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2618 +
 18.2619 +continue
 18.2620 +fi
 18.2621 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.2622 +  cat >conftest.$ac_ext <<_ACEOF
 18.2623 +/* confdefs.h.  */
 18.2624 +_ACEOF
 18.2625 +cat confdefs.h >>conftest.$ac_ext
 18.2626 +cat >>conftest.$ac_ext <<_ACEOF
 18.2627 +/* end confdefs.h.  */
 18.2628 +$ac_declaration
 18.2629 +int
 18.2630 +main ()
 18.2631 +{
 18.2632 +exit (42);
 18.2633 +  ;
 18.2634 +  return 0;
 18.2635 +}
 18.2636 +_ACEOF
 18.2637 +rm -f conftest.$ac_objext
 18.2638 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.2639 +  (eval $ac_compile) 2>conftest.er1
 18.2640 +  ac_status=$?
 18.2641 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2642 +  rm -f conftest.er1
 18.2643 +  cat conftest.err >&5
 18.2644 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2645 +  (exit $ac_status); } &&
 18.2646 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2647 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2648 +  (eval $ac_try) 2>&5
 18.2649 +  ac_status=$?
 18.2650 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2651 +  (exit $ac_status); }; } &&
 18.2652 +	 { ac_try='test -s conftest.$ac_objext'
 18.2653 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2654 +  (eval $ac_try) 2>&5
 18.2655 +  ac_status=$?
 18.2656 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2657 +  (exit $ac_status); }; }; then
 18.2658 +  break
 18.2659 +else
 18.2660 +  echo "$as_me: failed program was:" >&5
 18.2661 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2662 +
 18.2663 +fi
 18.2664 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.2665 +done
 18.2666 +rm -f conftest*
 18.2667 +if test -n "$ac_declaration"; then
 18.2668 +  echo '#ifdef __cplusplus' >>confdefs.h
 18.2669 +  echo $ac_declaration      >>confdefs.h
 18.2670 +  echo '#endif'             >>confdefs.h
 18.2671 +fi
 18.2672 +
 18.2673 +else
 18.2674 +  echo "$as_me: failed program was:" >&5
 18.2675 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2676 +
 18.2677 +fi
 18.2678 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.2679 +ac_ext=c
 18.2680 +ac_cpp='$CPP $CPPFLAGS'
 18.2681 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 18.2682 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 18.2683 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
 18.2684 +DEPDIR="${am__leading_dot}deps"
 18.2685 +
 18.2686 +          ac_config_commands="$ac_config_commands depfiles"
 18.2687 +
 18.2688 +
 18.2689 +am_make=${MAKE-make}
 18.2690 +cat > confinc << 'END'
 18.2691 +am__doit:
 18.2692 +	@echo done
 18.2693 +.PHONY: am__doit
 18.2694 +END
 18.2695 +# If we don't find an include directive, just comment out the code.
 18.2696 +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
 18.2697 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
 18.2698 +am__include="#"
 18.2699 +am__quote=
 18.2700 +_am_result=none
 18.2701 +# First try GNU make style include.
 18.2702 +echo "include confinc" > confmf
 18.2703 +# We grep out `Entering directory' and `Leaving directory'
 18.2704 +# messages which can occur if `w' ends up in MAKEFLAGS.
 18.2705 +# In particular we don't look at `^make:' because GNU make might
 18.2706 +# be invoked under some other name (usually "gmake"), in which
 18.2707 +# case it prints its new name instead of `make'.
 18.2708 +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
 18.2709 +   am__include=include
 18.2710 +   am__quote=
 18.2711 +   _am_result=GNU
 18.2712 +fi
 18.2713 +# Now try BSD make style include.
 18.2714 +if test "$am__include" = "#"; then
 18.2715 +   echo '.include "confinc"' > confmf
 18.2716 +   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
 18.2717 +      am__include=.include
 18.2718 +      am__quote="\""
 18.2719 +      _am_result=BSD
 18.2720 +   fi
 18.2721 +fi
 18.2722 +
 18.2723 +
 18.2724 +echo "$as_me:$LINENO: result: $_am_result" >&5
 18.2725 +echo "${ECHO_T}$_am_result" >&6
 18.2726 +rm -f confinc confmf
 18.2727 +
 18.2728 +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
 18.2729 +if test "${enable_dependency_tracking+set}" = set; then
 18.2730 +  enableval="$enable_dependency_tracking"
 18.2731 +
 18.2732 +fi;
 18.2733 +if test "x$enable_dependency_tracking" != xno; then
 18.2734 +  am_depcomp="$ac_aux_dir/depcomp"
 18.2735 +  AMDEPBACKSLASH='\'
 18.2736 +fi
 18.2737 +
 18.2738 +
 18.2739 +if test "x$enable_dependency_tracking" != xno; then
 18.2740 +  AMDEP_TRUE=
 18.2741 +  AMDEP_FALSE='#'
 18.2742 +else
 18.2743 +  AMDEP_TRUE='#'
 18.2744 +  AMDEP_FALSE=
 18.2745 +fi
 18.2746 +
 18.2747 +
 18.2748 +
 18.2749 +
 18.2750 +depcc="$CC"   am_compiler_list=
 18.2751 +
 18.2752 +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
 18.2753 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
 18.2754 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
 18.2755 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2756 +else
 18.2757 +  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
 18.2758 +  # We make a subdir and do the tests there.  Otherwise we can end up
 18.2759 +  # making bogus files that we don't know about and never remove.  For
 18.2760 +  # instance it was reported that on HP-UX the gcc test will end up
 18.2761 +  # making a dummy file named `D' -- because `-MD' means `put the output
 18.2762 +  # in D'.
 18.2763 +  mkdir conftest.dir
 18.2764 +  # Copy depcomp to subdir because otherwise we won't find it if we're
 18.2765 +  # using a relative directory.
 18.2766 +  cp "$am_depcomp" conftest.dir
 18.2767 +  cd conftest.dir
 18.2768 +  # We will build objects and dependencies in a subdirectory because
 18.2769 +  # it helps to detect inapplicable dependency modes.  For instance
 18.2770 +  # both Tru64's cc and ICC support -MD to output dependencies as a
 18.2771 +  # side effect of compilation, but ICC will put the dependencies in
 18.2772 +  # the current directory while Tru64 will put them in the object
 18.2773 +  # directory.
 18.2774 +  mkdir sub
 18.2775 +
 18.2776 +  am_cv_CC_dependencies_compiler_type=none
 18.2777 +  if test "$am_compiler_list" = ""; then
 18.2778 +     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
 18.2779 +  fi
 18.2780 +  for depmode in $am_compiler_list; do
 18.2781 +    # Setup a source with many dependencies, because some compilers
 18.2782 +    # like to wrap large dependency lists on column 80 (with \), and
 18.2783 +    # we should not choose a depcomp mode which is confused by this.
 18.2784 +    #
 18.2785 +    # We need to recreate these files for each test, as the compiler may
 18.2786 +    # overwrite some of them when testing with obscure command lines.
 18.2787 +    # This happens at least with the AIX C compiler.
 18.2788 +    : > sub/conftest.c
 18.2789 +    for i in 1 2 3 4 5 6; do
 18.2790 +      echo '#include "conftst'$i'.h"' >> sub/conftest.c
 18.2791 +      : > sub/conftst$i.h
 18.2792 +    done
 18.2793 +    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 18.2794 +
 18.2795 +    case $depmode in
 18.2796 +    nosideeffect)
 18.2797 +      # after this tag, mechanisms are not by side-effect, so they'll
 18.2798 +      # only be used when explicitly requested
 18.2799 +      if test "x$enable_dependency_tracking" = xyes; then
 18.2800 +	continue
 18.2801 +      else
 18.2802 +	break
 18.2803 +      fi
 18.2804 +      ;;
 18.2805 +    none) break ;;
 18.2806 +    esac
 18.2807 +    # We check with `-c' and `-o' for the sake of the "dashmstdout"
 18.2808 +    # mode.  It turns out that the SunPro C++ compiler does not properly
 18.2809 +    # handle `-M -o', and we need to detect this.
 18.2810 +    if depmode=$depmode \
 18.2811 +       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
 18.2812 +       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
 18.2813 +       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
 18.2814 +         >/dev/null 2>conftest.err &&
 18.2815 +       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
 18.2816 +       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
 18.2817 +       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
 18.2818 +      # icc doesn't choke on unknown options, it will just issue warnings
 18.2819 +      # (even with -Werror).  So we grep stderr for any message
 18.2820 +      # that says an option was ignored.
 18.2821 +      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
 18.2822 +        am_cv_CC_dependencies_compiler_type=$depmode
 18.2823 +        break
 18.2824 +      fi
 18.2825 +    fi
 18.2826 +  done
 18.2827 +
 18.2828 +  cd ..
 18.2829 +  rm -rf conftest.dir
 18.2830 +else
 18.2831 +  am_cv_CC_dependencies_compiler_type=none
 18.2832 +fi
 18.2833 +
 18.2834 +fi
 18.2835 +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
 18.2836 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
 18.2837 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 18.2838 +
 18.2839 +
 18.2840 +
 18.2841 +if
 18.2842 +  test "x$enable_dependency_tracking" != xno \
 18.2843 +  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
 18.2844 +  am__fastdepCC_TRUE=
 18.2845 +  am__fastdepCC_FALSE='#'
 18.2846 +else
 18.2847 +  am__fastdepCC_TRUE='#'
 18.2848 +  am__fastdepCC_FALSE=
 18.2849 +fi
 18.2850 +
 18.2851 +
 18.2852 +
 18.2853 +
 18.2854 +        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
 18.2855 +echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
 18.2856 +if test "${ac_cv_lib_cposix_strerror+set}" = set; then
 18.2857 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2858 +else
 18.2859 +  ac_check_lib_save_LIBS=$LIBS
 18.2860 +LIBS="-lcposix  $LIBS"
 18.2861 +cat >conftest.$ac_ext <<_ACEOF
 18.2862 +/* confdefs.h.  */
 18.2863 +_ACEOF
 18.2864 +cat confdefs.h >>conftest.$ac_ext
 18.2865 +cat >>conftest.$ac_ext <<_ACEOF
 18.2866 +/* end confdefs.h.  */
 18.2867 +
 18.2868 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.2869 +#ifdef __cplusplus
 18.2870 +extern "C"
 18.2871 +#endif
 18.2872 +/* We use char because int might match the return type of a gcc2
 18.2873 +   builtin and then its argument prototype would still apply.  */
 18.2874 +char strerror ();
 18.2875 +int
 18.2876 +main ()
 18.2877 +{
 18.2878 +strerror ();
 18.2879 +  ;
 18.2880 +  return 0;
 18.2881 +}
 18.2882 +_ACEOF
 18.2883 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.2884 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.2885 +  (eval $ac_link) 2>conftest.er1
 18.2886 +  ac_status=$?
 18.2887 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2888 +  rm -f conftest.er1
 18.2889 +  cat conftest.err >&5
 18.2890 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2891 +  (exit $ac_status); } &&
 18.2892 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.2893 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2894 +  (eval $ac_try) 2>&5
 18.2895 +  ac_status=$?
 18.2896 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2897 +  (exit $ac_status); }; } &&
 18.2898 +	 { ac_try='test -s conftest$ac_exeext'
 18.2899 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.2900 +  (eval $ac_try) 2>&5
 18.2901 +  ac_status=$?
 18.2902 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2903 +  (exit $ac_status); }; }; then
 18.2904 +  ac_cv_lib_cposix_strerror=yes
 18.2905 +else
 18.2906 +  echo "$as_me: failed program was:" >&5
 18.2907 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2908 +
 18.2909 +ac_cv_lib_cposix_strerror=no
 18.2910 +fi
 18.2911 +rm -f conftest.err conftest.$ac_objext \
 18.2912 +      conftest$ac_exeext conftest.$ac_ext
 18.2913 +LIBS=$ac_check_lib_save_LIBS
 18.2914 +fi
 18.2915 +echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
 18.2916 +echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
 18.2917 +if test $ac_cv_lib_cposix_strerror = yes; then
 18.2918 +  LIBS="$LIBS -lcposix"
 18.2919 +fi
 18.2920 +
 18.2921 +
 18.2922 +
 18.2923 +ac_ext=c
 18.2924 +ac_cpp='$CPP $CPPFLAGS'
 18.2925 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 18.2926 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 18.2927 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
 18.2928 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
 18.2929 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 18.2930 +# On Suns, sometimes $CPP names a directory.
 18.2931 +if test -n "$CPP" && test -d "$CPP"; then
 18.2932 +  CPP=
 18.2933 +fi
 18.2934 +if test -z "$CPP"; then
 18.2935 +  if test "${ac_cv_prog_CPP+set}" = set; then
 18.2936 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.2937 +else
 18.2938 +      # Double quotes because CPP needs to be expanded
 18.2939 +    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
 18.2940 +    do
 18.2941 +      ac_preproc_ok=false
 18.2942 +for ac_c_preproc_warn_flag in '' yes
 18.2943 +do
 18.2944 +  # Use a header file that comes with gcc, so configuring glibc
 18.2945 +  # with a fresh cross-compiler works.
 18.2946 +  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.2947 +  # <limits.h> exists even on freestanding compilers.
 18.2948 +  # On the NeXT, cc -E runs the code through the compiler's parser,
 18.2949 +  # not just through cpp. "Syntax error" is here to catch this case.
 18.2950 +  cat >conftest.$ac_ext <<_ACEOF
 18.2951 +/* confdefs.h.  */
 18.2952 +_ACEOF
 18.2953 +cat confdefs.h >>conftest.$ac_ext
 18.2954 +cat >>conftest.$ac_ext <<_ACEOF
 18.2955 +/* end confdefs.h.  */
 18.2956 +#ifdef __STDC__
 18.2957 +# include <limits.h>
 18.2958 +#else
 18.2959 +# include <assert.h>
 18.2960 +#endif
 18.2961 +		     Syntax error
 18.2962 +_ACEOF
 18.2963 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
 18.2964 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
 18.2965 +  ac_status=$?
 18.2966 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.2967 +  rm -f conftest.er1
 18.2968 +  cat conftest.err >&5
 18.2969 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.2970 +  (exit $ac_status); } >/dev/null; then
 18.2971 +  if test -s conftest.err; then
 18.2972 +    ac_cpp_err=$ac_c_preproc_warn_flag
 18.2973 +    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
 18.2974 +  else
 18.2975 +    ac_cpp_err=
 18.2976 +  fi
 18.2977 +else
 18.2978 +  ac_cpp_err=yes
 18.2979 +fi
 18.2980 +if test -z "$ac_cpp_err"; then
 18.2981 +  :
 18.2982 +else
 18.2983 +  echo "$as_me: failed program was:" >&5
 18.2984 +sed 's/^/| /' conftest.$ac_ext >&5
 18.2985 +
 18.2986 +  # Broken: fails on valid input.
 18.2987 +continue
 18.2988 +fi
 18.2989 +rm -f conftest.err conftest.$ac_ext
 18.2990 +
 18.2991 +  # OK, works on sane cases.  Now check whether non-existent headers
 18.2992 +  # can be detected and how.
 18.2993 +  cat >conftest.$ac_ext <<_ACEOF
 18.2994 +/* confdefs.h.  */
 18.2995 +_ACEOF
 18.2996 +cat confdefs.h >>conftest.$ac_ext
 18.2997 +cat >>conftest.$ac_ext <<_ACEOF
 18.2998 +/* end confdefs.h.  */
 18.2999 +#include <ac_nonexistent.h>
 18.3000 +_ACEOF
 18.3001 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
 18.3002 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
 18.3003 +  ac_status=$?
 18.3004 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3005 +  rm -f conftest.er1
 18.3006 +  cat conftest.err >&5
 18.3007 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3008 +  (exit $ac_status); } >/dev/null; then
 18.3009 +  if test -s conftest.err; then
 18.3010 +    ac_cpp_err=$ac_c_preproc_warn_flag
 18.3011 +    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
 18.3012 +  else
 18.3013 +    ac_cpp_err=
 18.3014 +  fi
 18.3015 +else
 18.3016 +  ac_cpp_err=yes
 18.3017 +fi
 18.3018 +if test -z "$ac_cpp_err"; then
 18.3019 +  # Broken: success on invalid input.
 18.3020 +continue
 18.3021 +else
 18.3022 +  echo "$as_me: failed program was:" >&5
 18.3023 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3024 +
 18.3025 +  # Passes both tests.
 18.3026 +ac_preproc_ok=:
 18.3027 +break
 18.3028 +fi
 18.3029 +rm -f conftest.err conftest.$ac_ext
 18.3030 +
 18.3031 +done
 18.3032 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 18.3033 +rm -f conftest.err conftest.$ac_ext
 18.3034 +if $ac_preproc_ok; then
 18.3035 +  break
 18.3036 +fi
 18.3037 +
 18.3038 +    done
 18.3039 +    ac_cv_prog_CPP=$CPP
 18.3040 +
 18.3041 +fi
 18.3042 +  CPP=$ac_cv_prog_CPP
 18.3043 +else
 18.3044 +  ac_cv_prog_CPP=$CPP
 18.3045 +fi
 18.3046 +echo "$as_me:$LINENO: result: $CPP" >&5
 18.3047 +echo "${ECHO_T}$CPP" >&6
 18.3048 +ac_preproc_ok=false
 18.3049 +for ac_c_preproc_warn_flag in '' yes
 18.3050 +do
 18.3051 +  # Use a header file that comes with gcc, so configuring glibc
 18.3052 +  # with a fresh cross-compiler works.
 18.3053 +  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.3054 +  # <limits.h> exists even on freestanding compilers.
 18.3055 +  # On the NeXT, cc -E runs the code through the compiler's parser,
 18.3056 +  # not just through cpp. "Syntax error" is here to catch this case.
 18.3057 +  cat >conftest.$ac_ext <<_ACEOF
 18.3058 +/* confdefs.h.  */
 18.3059 +_ACEOF
 18.3060 +cat confdefs.h >>conftest.$ac_ext
 18.3061 +cat >>conftest.$ac_ext <<_ACEOF
 18.3062 +/* end confdefs.h.  */
 18.3063 +#ifdef __STDC__
 18.3064 +# include <limits.h>
 18.3065 +#else
 18.3066 +# include <assert.h>
 18.3067 +#endif
 18.3068 +		     Syntax error
 18.3069 +_ACEOF
 18.3070 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
 18.3071 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
 18.3072 +  ac_status=$?
 18.3073 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3074 +  rm -f conftest.er1
 18.3075 +  cat conftest.err >&5
 18.3076 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3077 +  (exit $ac_status); } >/dev/null; then
 18.3078 +  if test -s conftest.err; then
 18.3079 +    ac_cpp_err=$ac_c_preproc_warn_flag
 18.3080 +    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
 18.3081 +  else
 18.3082 +    ac_cpp_err=
 18.3083 +  fi
 18.3084 +else
 18.3085 +  ac_cpp_err=yes
 18.3086 +fi
 18.3087 +if test -z "$ac_cpp_err"; then
 18.3088 +  :
 18.3089 +else
 18.3090 +  echo "$as_me: failed program was:" >&5
 18.3091 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3092 +
 18.3093 +  # Broken: fails on valid input.
 18.3094 +continue
 18.3095 +fi
 18.3096 +rm -f conftest.err conftest.$ac_ext
 18.3097 +
 18.3098 +  # OK, works on sane cases.  Now check whether non-existent headers
 18.3099 +  # can be detected and how.
 18.3100 +  cat >conftest.$ac_ext <<_ACEOF
 18.3101 +/* confdefs.h.  */
 18.3102 +_ACEOF
 18.3103 +cat confdefs.h >>conftest.$ac_ext
 18.3104 +cat >>conftest.$ac_ext <<_ACEOF
 18.3105 +/* end confdefs.h.  */
 18.3106 +#include <ac_nonexistent.h>
 18.3107 +_ACEOF
 18.3108 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
 18.3109 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
 18.3110 +  ac_status=$?
 18.3111 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3112 +  rm -f conftest.er1
 18.3113 +  cat conftest.err >&5
 18.3114 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3115 +  (exit $ac_status); } >/dev/null; then
 18.3116 +  if test -s conftest.err; then
 18.3117 +    ac_cpp_err=$ac_c_preproc_warn_flag
 18.3118 +    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
 18.3119 +  else
 18.3120 +    ac_cpp_err=
 18.3121 +  fi
 18.3122 +else
 18.3123 +  ac_cpp_err=yes
 18.3124 +fi
 18.3125 +if test -z "$ac_cpp_err"; then
 18.3126 +  # Broken: success on invalid input.
 18.3127 +continue
 18.3128 +else
 18.3129 +  echo "$as_me: failed program was:" >&5
 18.3130 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3131 +
 18.3132 +  # Passes both tests.
 18.3133 +ac_preproc_ok=:
 18.3134 +break
 18.3135 +fi
 18.3136 +rm -f conftest.err conftest.$ac_ext
 18.3137 +
 18.3138 +done
 18.3139 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 18.3140 +rm -f conftest.err conftest.$ac_ext
 18.3141 +if $ac_preproc_ok; then
 18.3142 +  :
 18.3143 +else
 18.3144 +  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 18.3145 +See \`config.log' for more details." >&5
 18.3146 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 18.3147 +See \`config.log' for more details." >&2;}
 18.3148 +   { (exit 1); exit 1; }; }
 18.3149 +fi
 18.3150 +
 18.3151 +ac_ext=c
 18.3152 +ac_cpp='$CPP $CPPFLAGS'
 18.3153 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 18.3154 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 18.3155 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
 18.3156 +
 18.3157 +
 18.3158 +echo "$as_me:$LINENO: checking for egrep" >&5
 18.3159 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6
 18.3160 +if test "${ac_cv_prog_egrep+set}" = set; then
 18.3161 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3162 +else
 18.3163 +  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
 18.3164 +    then ac_cv_prog_egrep='grep -E'
 18.3165 +    else ac_cv_prog_egrep='egrep'
 18.3166 +    fi
 18.3167 +fi
 18.3168 +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
 18.3169 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6
 18.3170 + EGREP=$ac_cv_prog_egrep
 18.3171 +
 18.3172 +
 18.3173 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 18.3174 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 18.3175 +if test "${ac_cv_header_stdc+set}" = set; then
 18.3176 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3177 +else
 18.3178 +  cat >conftest.$ac_ext <<_ACEOF
 18.3179 +/* confdefs.h.  */
 18.3180 +_ACEOF
 18.3181 +cat confdefs.h >>conftest.$ac_ext
 18.3182 +cat >>conftest.$ac_ext <<_ACEOF
 18.3183 +/* end confdefs.h.  */
 18.3184 +#include <stdlib.h>
 18.3185 +#include <stdarg.h>
 18.3186 +#include <string.h>
 18.3187 +#include <float.h>
 18.3188 +
 18.3189 +int
 18.3190 +main ()
 18.3191 +{
 18.3192 +
 18.3193 +  ;
 18.3194 +  return 0;
 18.3195 +}
 18.3196 +_ACEOF
 18.3197 +rm -f conftest.$ac_objext
 18.3198 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.3199 +  (eval $ac_compile) 2>conftest.er1
 18.3200 +  ac_status=$?
 18.3201 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3202 +  rm -f conftest.er1
 18.3203 +  cat conftest.err >&5
 18.3204 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3205 +  (exit $ac_status); } &&
 18.3206 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.3207 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3208 +  (eval $ac_try) 2>&5
 18.3209 +  ac_status=$?
 18.3210 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3211 +  (exit $ac_status); }; } &&
 18.3212 +	 { ac_try='test -s conftest.$ac_objext'
 18.3213 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3214 +  (eval $ac_try) 2>&5
 18.3215 +  ac_status=$?
 18.3216 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3217 +  (exit $ac_status); }; }; then
 18.3218 +  ac_cv_header_stdc=yes
 18.3219 +else
 18.3220 +  echo "$as_me: failed program was:" >&5
 18.3221 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3222 +
 18.3223 +ac_cv_header_stdc=no
 18.3224 +fi
 18.3225 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.3226 +
 18.3227 +if test $ac_cv_header_stdc = yes; then
 18.3228 +  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 18.3229 +  cat >conftest.$ac_ext <<_ACEOF
 18.3230 +/* confdefs.h.  */
 18.3231 +_ACEOF
 18.3232 +cat confdefs.h >>conftest.$ac_ext
 18.3233 +cat >>conftest.$ac_ext <<_ACEOF
 18.3234 +/* end confdefs.h.  */
 18.3235 +#include <string.h>
 18.3236 +
 18.3237 +_ACEOF
 18.3238 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 18.3239 +  $EGREP "memchr" >/dev/null 2>&1; then
 18.3240 +  :
 18.3241 +else
 18.3242 +  ac_cv_header_stdc=no
 18.3243 +fi
 18.3244 +rm -f conftest*
 18.3245 +
 18.3246 +fi
 18.3247 +
 18.3248 +if test $ac_cv_header_stdc = yes; then
 18.3249 +  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 18.3250 +  cat >conftest.$ac_ext <<_ACEOF
 18.3251 +/* confdefs.h.  */
 18.3252 +_ACEOF
 18.3253 +cat confdefs.h >>conftest.$ac_ext
 18.3254 +cat >>conftest.$ac_ext <<_ACEOF
 18.3255 +/* end confdefs.h.  */
 18.3256 +#include <stdlib.h>
 18.3257 +
 18.3258 +_ACEOF
 18.3259 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 18.3260 +  $EGREP "free" >/dev/null 2>&1; then
 18.3261 +  :
 18.3262 +else
 18.3263 +  ac_cv_header_stdc=no
 18.3264 +fi
 18.3265 +rm -f conftest*
 18.3266 +
 18.3267 +fi
 18.3268 +
 18.3269 +if test $ac_cv_header_stdc = yes; then
 18.3270 +  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 18.3271 +  if test "$cross_compiling" = yes; then
 18.3272 +  :
 18.3273 +else
 18.3274 +  cat >conftest.$ac_ext <<_ACEOF
 18.3275 +/* confdefs.h.  */
 18.3276 +_ACEOF
 18.3277 +cat confdefs.h >>conftest.$ac_ext
 18.3278 +cat >>conftest.$ac_ext <<_ACEOF
 18.3279 +/* end confdefs.h.  */
 18.3280 +#include <ctype.h>
 18.3281 +#if ((' ' & 0x0FF) == 0x020)
 18.3282 +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 18.3283 +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 18.3284 +#else
 18.3285 +# define ISLOWER(c) \
 18.3286 +		   (('a' <= (c) && (c) <= 'i') \
 18.3287 +		     || ('j' <= (c) && (c) <= 'r') \
 18.3288 +		     || ('s' <= (c) && (c) <= 'z'))
 18.3289 +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 18.3290 +#endif
 18.3291 +
 18.3292 +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 18.3293 +int
 18.3294 +main ()
 18.3295 +{
 18.3296 +  int i;
 18.3297 +  for (i = 0; i < 256; i++)
 18.3298 +    if (XOR (islower (i), ISLOWER (i))
 18.3299 +	|| toupper (i) != TOUPPER (i))
 18.3300 +      exit(2);
 18.3301 +  exit (0);
 18.3302 +}
 18.3303 +_ACEOF
 18.3304 +rm -f conftest$ac_exeext
 18.3305 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.3306 +  (eval $ac_link) 2>&5
 18.3307 +  ac_status=$?
 18.3308 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3309 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
 18.3310 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3311 +  (eval $ac_try) 2>&5
 18.3312 +  ac_status=$?
 18.3313 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3314 +  (exit $ac_status); }; }; then
 18.3315 +  :
 18.3316 +else
 18.3317 +  echo "$as_me: program exited with status $ac_status" >&5
 18.3318 +echo "$as_me: failed program was:" >&5
 18.3319 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3320 +
 18.3321 +( exit $ac_status )
 18.3322 +ac_cv_header_stdc=no
 18.3323 +fi
 18.3324 +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 18.3325 +fi
 18.3326 +fi
 18.3327 +fi
 18.3328 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
 18.3329 +echo "${ECHO_T}$ac_cv_header_stdc" >&6
 18.3330 +if test $ac_cv_header_stdc = yes; then
 18.3331 +
 18.3332 +cat >>confdefs.h <<\_ACEOF
 18.3333 +#define STDC_HEADERS 1
 18.3334 +_ACEOF
 18.3335 +
 18.3336 +fi
 18.3337 +
 18.3338 +if test -n "$ac_tool_prefix"; then
 18.3339 +  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 18.3340 +set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 18.3341 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.3342 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.3343 +if test "${ac_cv_prog_RANLIB+set}" = set; then
 18.3344 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3345 +else
 18.3346 +  if test -n "$RANLIB"; then
 18.3347 +  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 18.3348 +else
 18.3349 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.3350 +for as_dir in $PATH
 18.3351 +do
 18.3352 +  IFS=$as_save_IFS
 18.3353 +  test -z "$as_dir" && as_dir=.
 18.3354 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.3355 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.3356 +    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
 18.3357 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.3358 +    break 2
 18.3359 +  fi
 18.3360 +done
 18.3361 +done
 18.3362 +
 18.3363 +fi
 18.3364 +fi
 18.3365 +RANLIB=$ac_cv_prog_RANLIB
 18.3366 +if test -n "$RANLIB"; then
 18.3367 +  echo "$as_me:$LINENO: result: $RANLIB" >&5
 18.3368 +echo "${ECHO_T}$RANLIB" >&6
 18.3369 +else
 18.3370 +  echo "$as_me:$LINENO: result: no" >&5
 18.3371 +echo "${ECHO_T}no" >&6
 18.3372 +fi
 18.3373 +
 18.3374 +fi
 18.3375 +if test -z "$ac_cv_prog_RANLIB"; then
 18.3376 +  ac_ct_RANLIB=$RANLIB
 18.3377 +  # Extract the first word of "ranlib", so it can be a program name with args.
 18.3378 +set dummy ranlib; ac_word=$2
 18.3379 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.3380 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.3381 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
 18.3382 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3383 +else
 18.3384 +  if test -n "$ac_ct_RANLIB"; then
 18.3385 +  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 18.3386 +else
 18.3387 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.3388 +for as_dir in $PATH
 18.3389 +do
 18.3390 +  IFS=$as_save_IFS
 18.3391 +  test -z "$as_dir" && as_dir=.
 18.3392 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.3393 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.3394 +    ac_cv_prog_ac_ct_RANLIB="ranlib"
 18.3395 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.3396 +    break 2
 18.3397 +  fi
 18.3398 +done
 18.3399 +done
 18.3400 +
 18.3401 +  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 18.3402 +fi
 18.3403 +fi
 18.3404 +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 18.3405 +if test -n "$ac_ct_RANLIB"; then
 18.3406 +  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
 18.3407 +echo "${ECHO_T}$ac_ct_RANLIB" >&6
 18.3408 +else
 18.3409 +  echo "$as_me:$LINENO: result: no" >&5
 18.3410 +echo "${ECHO_T}no" >&6
 18.3411 +fi
 18.3412 +
 18.3413 +  RANLIB=$ac_ct_RANLIB
 18.3414 +else
 18.3415 +  RANLIB="$ac_cv_prog_RANLIB"
 18.3416 +fi
 18.3417 +
 18.3418 +
 18.3419 +
 18.3420 +
 18.3421 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 18.3422 +	if test -n "$ac_tool_prefix"; then
 18.3423 +  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 18.3424 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 18.3425 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.3426 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.3427 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
 18.3428 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3429 +else
 18.3430 +  case $PKG_CONFIG in
 18.3431 +  [\\/]* | ?:[\\/]*)
 18.3432 +  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
 18.3433 +  ;;
 18.3434 +  *)
 18.3435 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.3436 +for as_dir in $PATH
 18.3437 +do
 18.3438 +  IFS=$as_save_IFS
 18.3439 +  test -z "$as_dir" && as_dir=.
 18.3440 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.3441 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.3442 +    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
 18.3443 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.3444 +    break 2
 18.3445 +  fi
 18.3446 +done
 18.3447 +done
 18.3448 +
 18.3449 +  ;;
 18.3450 +esac
 18.3451 +fi
 18.3452 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 18.3453 +
 18.3454 +if test -n "$PKG_CONFIG"; then
 18.3455 +  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
 18.3456 +echo "${ECHO_T}$PKG_CONFIG" >&6
 18.3457 +else
 18.3458 +  echo "$as_me:$LINENO: result: no" >&5
 18.3459 +echo "${ECHO_T}no" >&6
 18.3460 +fi
 18.3461 +
 18.3462 +fi
 18.3463 +if test -z "$ac_cv_path_PKG_CONFIG"; then
 18.3464 +  ac_pt_PKG_CONFIG=$PKG_CONFIG
 18.3465 +  # Extract the first word of "pkg-config", so it can be a program name with args.
 18.3466 +set dummy pkg-config; ac_word=$2
 18.3467 +echo "$as_me:$LINENO: checking for $ac_word" >&5
 18.3468 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 18.3469 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
 18.3470 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3471 +else
 18.3472 +  case $ac_pt_PKG_CONFIG in
 18.3473 +  [\\/]* | ?:[\\/]*)
 18.3474 +  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
 18.3475 +  ;;
 18.3476 +  *)
 18.3477 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.3478 +for as_dir in $PATH
 18.3479 +do
 18.3480 +  IFS=$as_save_IFS
 18.3481 +  test -z "$as_dir" && as_dir=.
 18.3482 +  for ac_exec_ext in '' $ac_executable_extensions; do
 18.3483 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 18.3484 +    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
 18.3485 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 18.3486 +    break 2
 18.3487 +  fi
 18.3488 +done
 18.3489 +done
 18.3490 +
 18.3491 +  ;;
 18.3492 +esac
 18.3493 +fi
 18.3494 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
 18.3495 +
 18.3496 +if test -n "$ac_pt_PKG_CONFIG"; then
 18.3497 +  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
 18.3498 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
 18.3499 +else
 18.3500 +  echo "$as_me:$LINENO: result: no" >&5
 18.3501 +echo "${ECHO_T}no" >&6
 18.3502 +fi
 18.3503 +
 18.3504 +  PKG_CONFIG=$ac_pt_PKG_CONFIG
 18.3505 +else
 18.3506 +  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 18.3507 +fi
 18.3508 +
 18.3509 +fi
 18.3510 +if test -n "$PKG_CONFIG"; then
 18.3511 +	_pkg_min_version=0.9.0
 18.3512 +	echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
 18.3513 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
 18.3514 +	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 18.3515 +		echo "$as_me:$LINENO: result: yes" >&5
 18.3516 +echo "${ECHO_T}yes" >&6
 18.3517 +	else
 18.3518 +		echo "$as_me:$LINENO: result: no" >&5
 18.3519 +echo "${ECHO_T}no" >&6
 18.3520 +		PKG_CONFIG=""
 18.3521 +	fi
 18.3522 +
 18.3523 +fi
 18.3524 +
 18.3525 +pkg_failed=no
 18.3526 +echo "$as_me:$LINENO: checking for GLIB" >&5
 18.3527 +echo $ECHO_N "checking for GLIB... $ECHO_C" >&6
 18.3528 +
 18.3529 +if test -n "$PKG_CONFIG"; then
 18.3530 +        if test -n "$PKG_CONFIG" && \
 18.3531 +    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0\"") >&5
 18.3532 +  ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5
 18.3533 +  ac_status=$?
 18.3534 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3535 +  (exit $ac_status); }; then
 18.3536 +  pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null`
 18.3537 +else
 18.3538 +  pkg_failed=yes
 18.3539 +fi
 18.3540 +else
 18.3541 +	pkg_failed=untried
 18.3542 +fi
 18.3543 +if test -n "$PKG_CONFIG"; then
 18.3544 +        if test -n "$PKG_CONFIG" && \
 18.3545 +    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0\"") >&5
 18.3546 +  ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5
 18.3547 +  ac_status=$?
 18.3548 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3549 +  (exit $ac_status); }; then
 18.3550 +  pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null`
 18.3551 +else
 18.3552 +  pkg_failed=yes
 18.3553 +fi
 18.3554 +else
 18.3555 +	pkg_failed=untried
 18.3556 +fi
 18.3557 +
 18.3558 +if test $pkg_failed = yes; then
 18.3559 +	GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0"`
 18.3560 +	# Put the nasty error message in config.log where it belongs
 18.3561 +	echo "$GLIB_PKG_ERRORS" 1>&5
 18.3562 +
 18.3563 +	{ { echo "$as_me:$LINENO: error: Package requirements (glib-2.0) were not met.
 18.3564 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
 18.3565 +installed software in a non-standard prefix.
 18.3566 +
 18.3567 +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables
 18.3568 +to avoid the need to call pkg-config.  See the pkg-config man page for
 18.3569 +more details." >&5
 18.3570 +echo "$as_me: error: Package requirements (glib-2.0) were not met.
 18.3571 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
 18.3572 +installed software in a non-standard prefix.
 18.3573 +
 18.3574 +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables
 18.3575 +to avoid the need to call pkg-config.  See the pkg-config man page for
 18.3576 +more details." >&2;}
 18.3577 +   { (exit 1); exit 1; }; }
 18.3578 +elif test $pkg_failed = untried; then
 18.3579 +	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
 18.3580 +is in your PATH or set the PKG_CONFIG environment variable to the full
 18.3581 +path to pkg-config.
 18.3582 +
 18.3583 +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables
 18.3584 +to avoid the need to call pkg-config.  See the pkg-config man page for
 18.3585 +more details.
 18.3586 +
 18.3587 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
 18.3588 +See \`config.log' for more details." >&5
 18.3589 +echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
 18.3590 +is in your PATH or set the PKG_CONFIG environment variable to the full
 18.3591 +path to pkg-config.
 18.3592 +
 18.3593 +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables
 18.3594 +to avoid the need to call pkg-config.  See the pkg-config man page for
 18.3595 +more details.
 18.3596 +
 18.3597 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
 18.3598 +See \`config.log' for more details." >&2;}
 18.3599 +   { (exit 1); exit 1; }; }
 18.3600 +else
 18.3601 +	GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
 18.3602 +	GLIB_LIBS=$pkg_cv_GLIB_LIBS
 18.3603 +        echo "$as_me:$LINENO: result: yes" >&5
 18.3604 +echo "${ECHO_T}yes" >&6
 18.3605 +	:
 18.3606 +fi
 18.3607 +
 18.3608 +
 18.3609 +
 18.3610 +# Check whether --enable-resolver or --disable-resolver was given.
 18.3611 +if test "${enable_resolver+set}" = set; then
 18.3612 +  enableval="$enable_resolver"
 18.3613 +  if test "$enable_resolver" != 'no'; then
 18.3614 +		resolver_enabled='yes'
 18.3615 +	fi
 18.3616 +else
 18.3617 +  resolver_enabled='yes'
 18.3618 +
 18.3619 +fi;
 18.3620 +
 18.3621 +if test "$resolver_enabled" = yes; then
 18.3622 +
 18.3623 +cat >>confdefs.h <<\_ACEOF
 18.3624 +#define ENABLE_RESOLVER 1
 18.3625 +_ACEOF
 18.3626 +
 18.3627 +	echo "$as_me:$LINENO: checking for res_search in -lc" >&5
 18.3628 +echo $ECHO_N "checking for res_search in -lc... $ECHO_C" >&6
 18.3629 +if test "${ac_cv_lib_c_res_search+set}" = set; then
 18.3630 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3631 +else
 18.3632 +  ac_check_lib_save_LIBS=$LIBS
 18.3633 +LIBS="-lc  $LIBS"
 18.3634 +cat >conftest.$ac_ext <<_ACEOF
 18.3635 +/* confdefs.h.  */
 18.3636 +_ACEOF
 18.3637 +cat confdefs.h >>conftest.$ac_ext
 18.3638 +cat >>conftest.$ac_ext <<_ACEOF
 18.3639 +/* end confdefs.h.  */
 18.3640 +
 18.3641 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.3642 +#ifdef __cplusplus
 18.3643 +extern "C"
 18.3644 +#endif
 18.3645 +/* We use char because int might match the return type of a gcc2
 18.3646 +   builtin and then its argument prototype would still apply.  */
 18.3647 +char res_search ();
 18.3648 +int
 18.3649 +main ()
 18.3650 +{
 18.3651 +res_search ();
 18.3652 +  ;
 18.3653 +  return 0;
 18.3654 +}
 18.3655 +_ACEOF
 18.3656 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.3657 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.3658 +  (eval $ac_link) 2>conftest.er1
 18.3659 +  ac_status=$?
 18.3660 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3661 +  rm -f conftest.er1
 18.3662 +  cat conftest.err >&5
 18.3663 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3664 +  (exit $ac_status); } &&
 18.3665 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.3666 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3667 +  (eval $ac_try) 2>&5
 18.3668 +  ac_status=$?
 18.3669 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3670 +  (exit $ac_status); }; } &&
 18.3671 +	 { ac_try='test -s conftest$ac_exeext'
 18.3672 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3673 +  (eval $ac_try) 2>&5
 18.3674 +  ac_status=$?
 18.3675 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3676 +  (exit $ac_status); }; }; then
 18.3677 +  ac_cv_lib_c_res_search=yes
 18.3678 +else
 18.3679 +  echo "$as_me: failed program was:" >&5
 18.3680 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3681 +
 18.3682 +ac_cv_lib_c_res_search=no
 18.3683 +fi
 18.3684 +rm -f conftest.err conftest.$ac_objext \
 18.3685 +      conftest$ac_exeext conftest.$ac_ext
 18.3686 +LIBS=$ac_check_lib_save_LIBS
 18.3687 +fi
 18.3688 +echo "$as_me:$LINENO: result: $ac_cv_lib_c_res_search" >&5
 18.3689 +echo "${ECHO_T}$ac_cv_lib_c_res_search" >&6
 18.3690 +if test $ac_cv_lib_c_res_search = yes; then
 18.3691 +  need_resolv=no
 18.3692 +else
 18.3693 +  need_resolv=yes
 18.3694 +fi
 18.3695 +
 18.3696 +	if test "$need_resolv" = yes; then
 18.3697 +		echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5
 18.3698 +echo $ECHO_N "checking for res_search in -lresolv... $ECHO_C" >&6
 18.3699 +if test "${ac_cv_lib_resolv_res_search+set}" = set; then
 18.3700 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3701 +else
 18.3702 +  ac_check_lib_save_LIBS=$LIBS
 18.3703 +LIBS="-lresolv  $LIBS"
 18.3704 +cat >conftest.$ac_ext <<_ACEOF
 18.3705 +/* confdefs.h.  */
 18.3706 +_ACEOF
 18.3707 +cat confdefs.h >>conftest.$ac_ext
 18.3708 +cat >>conftest.$ac_ext <<_ACEOF
 18.3709 +/* end confdefs.h.  */
 18.3710 +
 18.3711 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.3712 +#ifdef __cplusplus
 18.3713 +extern "C"
 18.3714 +#endif
 18.3715 +/* We use char because int might match the return type of a gcc2
 18.3716 +   builtin and then its argument prototype would still apply.  */
 18.3717 +char res_search ();
 18.3718 +int
 18.3719 +main ()
 18.3720 +{
 18.3721 +res_search ();
 18.3722 +  ;
 18.3723 +  return 0;
 18.3724 +}
 18.3725 +_ACEOF
 18.3726 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.3727 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.3728 +  (eval $ac_link) 2>conftest.er1
 18.3729 +  ac_status=$?
 18.3730 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3731 +  rm -f conftest.er1
 18.3732 +  cat conftest.err >&5
 18.3733 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3734 +  (exit $ac_status); } &&
 18.3735 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.3736 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3737 +  (eval $ac_try) 2>&5
 18.3738 +  ac_status=$?
 18.3739 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3740 +  (exit $ac_status); }; } &&
 18.3741 +	 { ac_try='test -s conftest$ac_exeext'
 18.3742 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3743 +  (eval $ac_try) 2>&5
 18.3744 +  ac_status=$?
 18.3745 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3746 +  (exit $ac_status); }; }; then
 18.3747 +  ac_cv_lib_resolv_res_search=yes
 18.3748 +else
 18.3749 +  echo "$as_me: failed program was:" >&5
 18.3750 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3751 +
 18.3752 +ac_cv_lib_resolv_res_search=no
 18.3753 +fi
 18.3754 +rm -f conftest.err conftest.$ac_objext \
 18.3755 +      conftest$ac_exeext conftest.$ac_ext
 18.3756 +LIBS=$ac_check_lib_save_LIBS
 18.3757 +fi
 18.3758 +echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5
 18.3759 +echo "${ECHO_T}$ac_cv_lib_resolv_res_search" >&6
 18.3760 +if test $ac_cv_lib_resolv_res_search = yes; then
 18.3761 +  has_resolv=yes
 18.3762 +else
 18.3763 +  { { echo "$as_me:$LINENO: error: \"no libresolv\"" >&5
 18.3764 +echo "$as_me: error: \"no libresolv\"" >&2;}
 18.3765 +   { (exit 1); exit 1; }; }
 18.3766 +fi
 18.3767 +
 18.3768 +		RESOLV_LIBS='-lresolv'
 18.3769 +	else
 18.3770 +		RESOLV_LIBS=''
 18.3771 +	fi
 18.3772 +else
 18.3773 +	RESOLV_LIBS=''
 18.3774 +fi
 18.3775 +
 18.3776 +
 18.3777 +
 18.3778 +for ac_func in getline
 18.3779 +do
 18.3780 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 18.3781 +echo "$as_me:$LINENO: checking for $ac_func" >&5
 18.3782 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 18.3783 +if eval "test \"\${$as_ac_var+set}\" = set"; then
 18.3784 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3785 +else
 18.3786 +  cat >conftest.$ac_ext <<_ACEOF
 18.3787 +/* confdefs.h.  */
 18.3788 +_ACEOF
 18.3789 +cat confdefs.h >>conftest.$ac_ext
 18.3790 +cat >>conftest.$ac_ext <<_ACEOF
 18.3791 +/* end confdefs.h.  */
 18.3792 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
 18.3793 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 18.3794 +#define $ac_func innocuous_$ac_func
 18.3795 +
 18.3796 +/* System header to define __stub macros and hopefully few prototypes,
 18.3797 +    which can conflict with char $ac_func (); below.
 18.3798 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.3799 +    <limits.h> exists even on freestanding compilers.  */
 18.3800 +
 18.3801 +#ifdef __STDC__
 18.3802 +# include <limits.h>
 18.3803 +#else
 18.3804 +# include <assert.h>
 18.3805 +#endif
 18.3806 +
 18.3807 +#undef $ac_func
 18.3808 +
 18.3809 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.3810 +#ifdef __cplusplus
 18.3811 +extern "C"
 18.3812 +{
 18.3813 +#endif
 18.3814 +/* We use char because int might match the return type of a gcc2
 18.3815 +   builtin and then its argument prototype would still apply.  */
 18.3816 +char $ac_func ();
 18.3817 +/* The GNU C library defines this for functions which it implements
 18.3818 +    to always fail with ENOSYS.  Some functions are actually named
 18.3819 +    something starting with __ and the normal name is an alias.  */
 18.3820 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 18.3821 +choke me
 18.3822 +#else
 18.3823 +char (*f) () = $ac_func;
 18.3824 +#endif
 18.3825 +#ifdef __cplusplus
 18.3826 +}
 18.3827 +#endif
 18.3828 +
 18.3829 +int
 18.3830 +main ()
 18.3831 +{
 18.3832 +return f != $ac_func;
 18.3833 +  ;
 18.3834 +  return 0;
 18.3835 +}
 18.3836 +_ACEOF
 18.3837 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.3838 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.3839 +  (eval $ac_link) 2>conftest.er1
 18.3840 +  ac_status=$?
 18.3841 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3842 +  rm -f conftest.er1
 18.3843 +  cat conftest.err >&5
 18.3844 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3845 +  (exit $ac_status); } &&
 18.3846 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.3847 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3848 +  (eval $ac_try) 2>&5
 18.3849 +  ac_status=$?
 18.3850 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3851 +  (exit $ac_status); }; } &&
 18.3852 +	 { ac_try='test -s conftest$ac_exeext'
 18.3853 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3854 +  (eval $ac_try) 2>&5
 18.3855 +  ac_status=$?
 18.3856 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3857 +  (exit $ac_status); }; }; then
 18.3858 +  eval "$as_ac_var=yes"
 18.3859 +else
 18.3860 +  echo "$as_me: failed program was:" >&5
 18.3861 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3862 +
 18.3863 +eval "$as_ac_var=no"
 18.3864 +fi
 18.3865 +rm -f conftest.err conftest.$ac_objext \
 18.3866 +      conftest$ac_exeext conftest.$ac_ext
 18.3867 +fi
 18.3868 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 18.3869 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 18.3870 +if test `eval echo '${'$as_ac_var'}'` = yes; then
 18.3871 +  cat >>confdefs.h <<_ACEOF
 18.3872 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 18.3873 +_ACEOF
 18.3874 +
 18.3875 +fi
 18.3876 +done
 18.3877 +
 18.3878 +
 18.3879 +
 18.3880 +for ac_func in fdatasync
 18.3881 +do
 18.3882 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 18.3883 +echo "$as_me:$LINENO: checking for $ac_func" >&5
 18.3884 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 18.3885 +if eval "test \"\${$as_ac_var+set}\" = set"; then
 18.3886 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3887 +else
 18.3888 +  cat >conftest.$ac_ext <<_ACEOF
 18.3889 +/* confdefs.h.  */
 18.3890 +_ACEOF
 18.3891 +cat confdefs.h >>conftest.$ac_ext
 18.3892 +cat >>conftest.$ac_ext <<_ACEOF
 18.3893 +/* end confdefs.h.  */
 18.3894 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
 18.3895 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 18.3896 +#define $ac_func innocuous_$ac_func
 18.3897 +
 18.3898 +/* System header to define __stub macros and hopefully few prototypes,
 18.3899 +    which can conflict with char $ac_func (); below.
 18.3900 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.3901 +    <limits.h> exists even on freestanding compilers.  */
 18.3902 +
 18.3903 +#ifdef __STDC__
 18.3904 +# include <limits.h>
 18.3905 +#else
 18.3906 +# include <assert.h>
 18.3907 +#endif
 18.3908 +
 18.3909 +#undef $ac_func
 18.3910 +
 18.3911 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.3912 +#ifdef __cplusplus
 18.3913 +extern "C"
 18.3914 +{
 18.3915 +#endif
 18.3916 +/* We use char because int might match the return type of a gcc2
 18.3917 +   builtin and then its argument prototype would still apply.  */
 18.3918 +char $ac_func ();
 18.3919 +/* The GNU C library defines this for functions which it implements
 18.3920 +    to always fail with ENOSYS.  Some functions are actually named
 18.3921 +    something starting with __ and the normal name is an alias.  */
 18.3922 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 18.3923 +choke me
 18.3924 +#else
 18.3925 +char (*f) () = $ac_func;
 18.3926 +#endif
 18.3927 +#ifdef __cplusplus
 18.3928 +}
 18.3929 +#endif
 18.3930 +
 18.3931 +int
 18.3932 +main ()
 18.3933 +{
 18.3934 +return f != $ac_func;
 18.3935 +  ;
 18.3936 +  return 0;
 18.3937 +}
 18.3938 +_ACEOF
 18.3939 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.3940 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.3941 +  (eval $ac_link) 2>conftest.er1
 18.3942 +  ac_status=$?
 18.3943 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.3944 +  rm -f conftest.er1
 18.3945 +  cat conftest.err >&5
 18.3946 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3947 +  (exit $ac_status); } &&
 18.3948 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.3949 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3950 +  (eval $ac_try) 2>&5
 18.3951 +  ac_status=$?
 18.3952 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3953 +  (exit $ac_status); }; } &&
 18.3954 +	 { ac_try='test -s conftest$ac_exeext'
 18.3955 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.3956 +  (eval $ac_try) 2>&5
 18.3957 +  ac_status=$?
 18.3958 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.3959 +  (exit $ac_status); }; }; then
 18.3960 +  eval "$as_ac_var=yes"
 18.3961 +else
 18.3962 +  echo "$as_me: failed program was:" >&5
 18.3963 +sed 's/^/| /' conftest.$ac_ext >&5
 18.3964 +
 18.3965 +eval "$as_ac_var=no"
 18.3966 +fi
 18.3967 +rm -f conftest.err conftest.$ac_objext \
 18.3968 +      conftest$ac_exeext conftest.$ac_ext
 18.3969 +fi
 18.3970 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 18.3971 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 18.3972 +if test `eval echo '${'$as_ac_var'}'` = yes; then
 18.3973 +  cat >>confdefs.h <<_ACEOF
 18.3974 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 18.3975 +_ACEOF
 18.3976 +
 18.3977 +fi
 18.3978 +done
 18.3979 +
 18.3980 +
 18.3981 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 18.3982 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 18.3983 +if test "${ac_cv_header_stdc+set}" = set; then
 18.3984 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.3985 +else
 18.3986 +  cat >conftest.$ac_ext <<_ACEOF
 18.3987 +/* confdefs.h.  */
 18.3988 +_ACEOF
 18.3989 +cat confdefs.h >>conftest.$ac_ext
 18.3990 +cat >>conftest.$ac_ext <<_ACEOF
 18.3991 +/* end confdefs.h.  */
 18.3992 +#include <stdlib.h>
 18.3993 +#include <stdarg.h>
 18.3994 +#include <string.h>
 18.3995 +#include <float.h>
 18.3996 +
 18.3997 +int
 18.3998 +main ()
 18.3999 +{
 18.4000 +
 18.4001 +  ;
 18.4002 +  return 0;
 18.4003 +}
 18.4004 +_ACEOF
 18.4005 +rm -f conftest.$ac_objext
 18.4006 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4007 +  (eval $ac_compile) 2>conftest.er1
 18.4008 +  ac_status=$?
 18.4009 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4010 +  rm -f conftest.er1
 18.4011 +  cat conftest.err >&5
 18.4012 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4013 +  (exit $ac_status); } &&
 18.4014 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4015 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4016 +  (eval $ac_try) 2>&5
 18.4017 +  ac_status=$?
 18.4018 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4019 +  (exit $ac_status); }; } &&
 18.4020 +	 { ac_try='test -s conftest.$ac_objext'
 18.4021 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4022 +  (eval $ac_try) 2>&5
 18.4023 +  ac_status=$?
 18.4024 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4025 +  (exit $ac_status); }; }; then
 18.4026 +  ac_cv_header_stdc=yes
 18.4027 +else
 18.4028 +  echo "$as_me: failed program was:" >&5
 18.4029 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4030 +
 18.4031 +ac_cv_header_stdc=no
 18.4032 +fi
 18.4033 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4034 +
 18.4035 +if test $ac_cv_header_stdc = yes; then
 18.4036 +  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 18.4037 +  cat >conftest.$ac_ext <<_ACEOF
 18.4038 +/* confdefs.h.  */
 18.4039 +_ACEOF
 18.4040 +cat confdefs.h >>conftest.$ac_ext
 18.4041 +cat >>conftest.$ac_ext <<_ACEOF
 18.4042 +/* end confdefs.h.  */
 18.4043 +#include <string.h>
 18.4044 +
 18.4045 +_ACEOF
 18.4046 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 18.4047 +  $EGREP "memchr" >/dev/null 2>&1; then
 18.4048 +  :
 18.4049 +else
 18.4050 +  ac_cv_header_stdc=no
 18.4051 +fi
 18.4052 +rm -f conftest*
 18.4053 +
 18.4054 +fi
 18.4055 +
 18.4056 +if test $ac_cv_header_stdc = yes; then
 18.4057 +  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 18.4058 +  cat >conftest.$ac_ext <<_ACEOF
 18.4059 +/* confdefs.h.  */
 18.4060 +_ACEOF
 18.4061 +cat confdefs.h >>conftest.$ac_ext
 18.4062 +cat >>conftest.$ac_ext <<_ACEOF
 18.4063 +/* end confdefs.h.  */
 18.4064 +#include <stdlib.h>
 18.4065 +
 18.4066 +_ACEOF
 18.4067 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 18.4068 +  $EGREP "free" >/dev/null 2>&1; then
 18.4069 +  :
 18.4070 +else
 18.4071 +  ac_cv_header_stdc=no
 18.4072 +fi
 18.4073 +rm -f conftest*
 18.4074 +
 18.4075 +fi
 18.4076 +
 18.4077 +if test $ac_cv_header_stdc = yes; then
 18.4078 +  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 18.4079 +  if test "$cross_compiling" = yes; then
 18.4080 +  :
 18.4081 +else
 18.4082 +  cat >conftest.$ac_ext <<_ACEOF
 18.4083 +/* confdefs.h.  */
 18.4084 +_ACEOF
 18.4085 +cat confdefs.h >>conftest.$ac_ext
 18.4086 +cat >>conftest.$ac_ext <<_ACEOF
 18.4087 +/* end confdefs.h.  */
 18.4088 +#include <ctype.h>
 18.4089 +#if ((' ' & 0x0FF) == 0x020)
 18.4090 +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 18.4091 +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 18.4092 +#else
 18.4093 +# define ISLOWER(c) \
 18.4094 +		   (('a' <= (c) && (c) <= 'i') \
 18.4095 +		     || ('j' <= (c) && (c) <= 'r') \
 18.4096 +		     || ('s' <= (c) && (c) <= 'z'))
 18.4097 +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 18.4098 +#endif
 18.4099 +
 18.4100 +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 18.4101 +int
 18.4102 +main ()
 18.4103 +{
 18.4104 +  int i;
 18.4105 +  for (i = 0; i < 256; i++)
 18.4106 +    if (XOR (islower (i), ISLOWER (i))
 18.4107 +	|| toupper (i) != TOUPPER (i))
 18.4108 +      exit(2);
 18.4109 +  exit (0);
 18.4110 +}
 18.4111 +_ACEOF
 18.4112 +rm -f conftest$ac_exeext
 18.4113 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.4114 +  (eval $ac_link) 2>&5
 18.4115 +  ac_status=$?
 18.4116 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4117 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
 18.4118 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4119 +  (eval $ac_try) 2>&5
 18.4120 +  ac_status=$?
 18.4121 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4122 +  (exit $ac_status); }; }; then
 18.4123 +  :
 18.4124 +else
 18.4125 +  echo "$as_me: program exited with status $ac_status" >&5
 18.4126 +echo "$as_me: failed program was:" >&5
 18.4127 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4128 +
 18.4129 +( exit $ac_status )
 18.4130 +ac_cv_header_stdc=no
 18.4131 +fi
 18.4132 +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 18.4133 +fi
 18.4134 +fi
 18.4135 +fi
 18.4136 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
 18.4137 +echo "${ECHO_T}$ac_cv_header_stdc" >&6
 18.4138 +if test $ac_cv_header_stdc = yes; then
 18.4139 +
 18.4140 +cat >>confdefs.h <<\_ACEOF
 18.4141 +#define STDC_HEADERS 1
 18.4142 +_ACEOF
 18.4143 +
 18.4144 +fi
 18.4145 +
 18.4146 +# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 18.4147 +
 18.4148 +
 18.4149 +
 18.4150 +
 18.4151 +
 18.4152 +
 18.4153 +
 18.4154 +
 18.4155 +
 18.4156 +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 18.4157 +		  inttypes.h stdint.h unistd.h
 18.4158 +do
 18.4159 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 18.4160 +echo "$as_me:$LINENO: checking for $ac_header" >&5
 18.4161 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 18.4162 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
 18.4163 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4164 +else
 18.4165 +  cat >conftest.$ac_ext <<_ACEOF
 18.4166 +/* confdefs.h.  */
 18.4167 +_ACEOF
 18.4168 +cat confdefs.h >>conftest.$ac_ext
 18.4169 +cat >>conftest.$ac_ext <<_ACEOF
 18.4170 +/* end confdefs.h.  */
 18.4171 +$ac_includes_default
 18.4172 +
 18.4173 +#include <$ac_header>
 18.4174 +_ACEOF
 18.4175 +rm -f conftest.$ac_objext
 18.4176 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4177 +  (eval $ac_compile) 2>conftest.er1
 18.4178 +  ac_status=$?
 18.4179 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4180 +  rm -f conftest.er1
 18.4181 +  cat conftest.err >&5
 18.4182 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4183 +  (exit $ac_status); } &&
 18.4184 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4185 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4186 +  (eval $ac_try) 2>&5
 18.4187 +  ac_status=$?
 18.4188 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4189 +  (exit $ac_status); }; } &&
 18.4190 +	 { ac_try='test -s conftest.$ac_objext'
 18.4191 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4192 +  (eval $ac_try) 2>&5
 18.4193 +  ac_status=$?
 18.4194 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4195 +  (exit $ac_status); }; }; then
 18.4196 +  eval "$as_ac_Header=yes"
 18.4197 +else
 18.4198 +  echo "$as_me: failed program was:" >&5
 18.4199 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4200 +
 18.4201 +eval "$as_ac_Header=no"
 18.4202 +fi
 18.4203 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4204 +fi
 18.4205 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 18.4206 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 18.4207 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
 18.4208 +  cat >>confdefs.h <<_ACEOF
 18.4209 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 18.4210 +_ACEOF
 18.4211 +
 18.4212 +fi
 18.4213 +
 18.4214 +done
 18.4215 +
 18.4216 +
 18.4217 +
 18.4218 +
 18.4219 +
 18.4220 +
 18.4221 +for ac_header in fcntl.h sys/time.h syslog.h unistd.h
 18.4222 +do
 18.4223 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 18.4224 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
 18.4225 +  echo "$as_me:$LINENO: checking for $ac_header" >&5
 18.4226 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 18.4227 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
 18.4228 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4229 +fi
 18.4230 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 18.4231 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 18.4232 +else
 18.4233 +  # Is the header compilable?
 18.4234 +echo "$as_me:$LINENO: checking $ac_header usability" >&5
 18.4235 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 18.4236 +cat >conftest.$ac_ext <<_ACEOF
 18.4237 +/* confdefs.h.  */
 18.4238 +_ACEOF
 18.4239 +cat confdefs.h >>conftest.$ac_ext
 18.4240 +cat >>conftest.$ac_ext <<_ACEOF
 18.4241 +/* end confdefs.h.  */
 18.4242 +$ac_includes_default
 18.4243 +#include <$ac_header>
 18.4244 +_ACEOF
 18.4245 +rm -f conftest.$ac_objext
 18.4246 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4247 +  (eval $ac_compile) 2>conftest.er1
 18.4248 +  ac_status=$?
 18.4249 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4250 +  rm -f conftest.er1
 18.4251 +  cat conftest.err >&5
 18.4252 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4253 +  (exit $ac_status); } &&
 18.4254 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4255 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4256 +  (eval $ac_try) 2>&5
 18.4257 +  ac_status=$?
 18.4258 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4259 +  (exit $ac_status); }; } &&
 18.4260 +	 { ac_try='test -s conftest.$ac_objext'
 18.4261 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4262 +  (eval $ac_try) 2>&5
 18.4263 +  ac_status=$?
 18.4264 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4265 +  (exit $ac_status); }; }; then
 18.4266 +  ac_header_compiler=yes
 18.4267 +else
 18.4268 +  echo "$as_me: failed program was:" >&5
 18.4269 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4270 +
 18.4271 +ac_header_compiler=no
 18.4272 +fi
 18.4273 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4274 +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 18.4275 +echo "${ECHO_T}$ac_header_compiler" >&6
 18.4276 +
 18.4277 +# Is the header present?
 18.4278 +echo "$as_me:$LINENO: checking $ac_header presence" >&5
 18.4279 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 18.4280 +cat >conftest.$ac_ext <<_ACEOF
 18.4281 +/* confdefs.h.  */
 18.4282 +_ACEOF
 18.4283 +cat confdefs.h >>conftest.$ac_ext
 18.4284 +cat >>conftest.$ac_ext <<_ACEOF
 18.4285 +/* end confdefs.h.  */
 18.4286 +#include <$ac_header>
 18.4287 +_ACEOF
 18.4288 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
 18.4289 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
 18.4290 +  ac_status=$?
 18.4291 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4292 +  rm -f conftest.er1
 18.4293 +  cat conftest.err >&5
 18.4294 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4295 +  (exit $ac_status); } >/dev/null; then
 18.4296 +  if test -s conftest.err; then
 18.4297 +    ac_cpp_err=$ac_c_preproc_warn_flag
 18.4298 +    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
 18.4299 +  else
 18.4300 +    ac_cpp_err=
 18.4301 +  fi
 18.4302 +else
 18.4303 +  ac_cpp_err=yes
 18.4304 +fi
 18.4305 +if test -z "$ac_cpp_err"; then
 18.4306 +  ac_header_preproc=yes
 18.4307 +else
 18.4308 +  echo "$as_me: failed program was:" >&5
 18.4309 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4310 +
 18.4311 +  ac_header_preproc=no
 18.4312 +fi
 18.4313 +rm -f conftest.err conftest.$ac_ext
 18.4314 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 18.4315 +echo "${ECHO_T}$ac_header_preproc" >&6
 18.4316 +
 18.4317 +# So?  What about this header?
 18.4318 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
 18.4319 +  yes:no: )
 18.4320 +    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 18.4321 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
 18.4322 +    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
 18.4323 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
 18.4324 +    ac_header_preproc=yes
 18.4325 +    ;;
 18.4326 +  no:yes:* )
 18.4327 +    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 18.4328 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
 18.4329 +    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
 18.4330 +echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
 18.4331 +    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
 18.4332 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
 18.4333 +    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
 18.4334 +echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
 18.4335 +    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 18.4336 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
 18.4337 +    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 18.4338 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 18.4339 +    (
 18.4340 +      cat <<\_ASBOX
 18.4341 +## ----------------------------- ##
 18.4342 +## Report this to oku@debian.org ##
 18.4343 +## ----------------------------- ##
 18.4344 +_ASBOX
 18.4345 +    ) |
 18.4346 +      sed "s/^/$as_me: WARNING:     /" >&2
 18.4347 +    ;;
 18.4348 +esac
 18.4349 +echo "$as_me:$LINENO: checking for $ac_header" >&5
 18.4350 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 18.4351 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
 18.4352 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4353 +else
 18.4354 +  eval "$as_ac_Header=\$ac_header_preproc"
 18.4355 +fi
 18.4356 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 18.4357 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 18.4358 +
 18.4359 +fi
 18.4360 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
 18.4361 +  cat >>confdefs.h <<_ACEOF
 18.4362 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 18.4363 +_ACEOF
 18.4364 +
 18.4365 +fi
 18.4366 +
 18.4367 +done
 18.4368 +
 18.4369 +
 18.4370 +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
 18.4371 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 18.4372 +if test "${ac_cv_c_const+set}" = set; then
 18.4373 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4374 +else
 18.4375 +  cat >conftest.$ac_ext <<_ACEOF
 18.4376 +/* confdefs.h.  */
 18.4377 +_ACEOF
 18.4378 +cat confdefs.h >>conftest.$ac_ext
 18.4379 +cat >>conftest.$ac_ext <<_ACEOF
 18.4380 +/* end confdefs.h.  */
 18.4381 +
 18.4382 +int
 18.4383 +main ()
 18.4384 +{
 18.4385 +/* FIXME: Include the comments suggested by Paul. */
 18.4386 +#ifndef __cplusplus
 18.4387 +  /* Ultrix mips cc rejects this.  */
 18.4388 +  typedef int charset[2];
 18.4389 +  const charset x;
 18.4390 +  /* SunOS 4.1.1 cc rejects this.  */
 18.4391 +  char const *const *ccp;
 18.4392 +  char **p;
 18.4393 +  /* NEC SVR4.0.2 mips cc rejects this.  */
 18.4394 +  struct point {int x, y;};
 18.4395 +  static struct point const zero = {0,0};
 18.4396 +  /* AIX XL C 1.02.0.0 rejects this.
 18.4397 +     It does not let you subtract one const X* pointer from another in
 18.4398 +     an arm of an if-expression whose if-part is not a constant
 18.4399 +     expression */
 18.4400 +  const char *g = "string";
 18.4401 +  ccp = &g + (g ? g-g : 0);
 18.4402 +  /* HPUX 7.0 cc rejects these. */
 18.4403 +  ++ccp;
 18.4404 +  p = (char**) ccp;
 18.4405 +  ccp = (char const *const *) p;
 18.4406 +  { /* SCO 3.2v4 cc rejects this.  */
 18.4407 +    char *t;
 18.4408 +    char const *s = 0 ? (char *) 0 : (char const *) 0;
 18.4409 +
 18.4410 +    *t++ = 0;
 18.4411 +  }
 18.4412 +  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
 18.4413 +    int x[] = {25, 17};
 18.4414 +    const int *foo = &x[0];
 18.4415 +    ++foo;
 18.4416 +  }
 18.4417 +  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
 18.4418 +    typedef const int *iptr;
 18.4419 +    iptr p = 0;
 18.4420 +    ++p;
 18.4421 +  }
 18.4422 +  { /* AIX XL C 1.02.0.0 rejects this saying
 18.4423 +       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
 18.4424 +    struct s { int j; const int *ap[3]; };
 18.4425 +    struct s *b; b->j = 5;
 18.4426 +  }
 18.4427 +  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
 18.4428 +    const int foo = 10;
 18.4429 +  }
 18.4430 +#endif
 18.4431 +
 18.4432 +  ;
 18.4433 +  return 0;
 18.4434 +}
 18.4435 +_ACEOF
 18.4436 +rm -f conftest.$ac_objext
 18.4437 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4438 +  (eval $ac_compile) 2>conftest.er1
 18.4439 +  ac_status=$?
 18.4440 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4441 +  rm -f conftest.er1
 18.4442 +  cat conftest.err >&5
 18.4443 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4444 +  (exit $ac_status); } &&
 18.4445 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4446 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4447 +  (eval $ac_try) 2>&5
 18.4448 +  ac_status=$?
 18.4449 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4450 +  (exit $ac_status); }; } &&
 18.4451 +	 { ac_try='test -s conftest.$ac_objext'
 18.4452 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4453 +  (eval $ac_try) 2>&5
 18.4454 +  ac_status=$?
 18.4455 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4456 +  (exit $ac_status); }; }; then
 18.4457 +  ac_cv_c_const=yes
 18.4458 +else
 18.4459 +  echo "$as_me: failed program was:" >&5
 18.4460 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4461 +
 18.4462 +ac_cv_c_const=no
 18.4463 +fi
 18.4464 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4465 +fi
 18.4466 +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
 18.4467 +echo "${ECHO_T}$ac_cv_c_const" >&6
 18.4468 +if test $ac_cv_c_const = no; then
 18.4469 +
 18.4470 +cat >>confdefs.h <<\_ACEOF
 18.4471 +#define const
 18.4472 +_ACEOF
 18.4473 +
 18.4474 +fi
 18.4475 +
 18.4476 +echo "$as_me:$LINENO: checking for pid_t" >&5
 18.4477 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
 18.4478 +if test "${ac_cv_type_pid_t+set}" = set; then
 18.4479 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4480 +else
 18.4481 +  cat >conftest.$ac_ext <<_ACEOF
 18.4482 +/* confdefs.h.  */
 18.4483 +_ACEOF
 18.4484 +cat confdefs.h >>conftest.$ac_ext
 18.4485 +cat >>conftest.$ac_ext <<_ACEOF
 18.4486 +/* end confdefs.h.  */
 18.4487 +$ac_includes_default
 18.4488 +int
 18.4489 +main ()
 18.4490 +{
 18.4491 +if ((pid_t *) 0)
 18.4492 +  return 0;
 18.4493 +if (sizeof (pid_t))
 18.4494 +  return 0;
 18.4495 +  ;
 18.4496 +  return 0;
 18.4497 +}
 18.4498 +_ACEOF
 18.4499 +rm -f conftest.$ac_objext
 18.4500 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4501 +  (eval $ac_compile) 2>conftest.er1
 18.4502 +  ac_status=$?
 18.4503 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4504 +  rm -f conftest.er1
 18.4505 +  cat conftest.err >&5
 18.4506 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4507 +  (exit $ac_status); } &&
 18.4508 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4509 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4510 +  (eval $ac_try) 2>&5
 18.4511 +  ac_status=$?
 18.4512 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4513 +  (exit $ac_status); }; } &&
 18.4514 +	 { ac_try='test -s conftest.$ac_objext'
 18.4515 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4516 +  (eval $ac_try) 2>&5
 18.4517 +  ac_status=$?
 18.4518 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4519 +  (exit $ac_status); }; }; then
 18.4520 +  ac_cv_type_pid_t=yes
 18.4521 +else
 18.4522 +  echo "$as_me: failed program was:" >&5
 18.4523 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4524 +
 18.4525 +ac_cv_type_pid_t=no
 18.4526 +fi
 18.4527 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4528 +fi
 18.4529 +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
 18.4530 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6
 18.4531 +if test $ac_cv_type_pid_t = yes; then
 18.4532 +  :
 18.4533 +else
 18.4534 +
 18.4535 +cat >>confdefs.h <<_ACEOF
 18.4536 +#define pid_t int
 18.4537 +_ACEOF
 18.4538 +
 18.4539 +fi
 18.4540 +
 18.4541 +echo "$as_me:$LINENO: checking for size_t" >&5
 18.4542 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6
 18.4543 +if test "${ac_cv_type_size_t+set}" = set; then
 18.4544 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4545 +else
 18.4546 +  cat >conftest.$ac_ext <<_ACEOF
 18.4547 +/* confdefs.h.  */
 18.4548 +_ACEOF
 18.4549 +cat confdefs.h >>conftest.$ac_ext
 18.4550 +cat >>conftest.$ac_ext <<_ACEOF
 18.4551 +/* end confdefs.h.  */
 18.4552 +$ac_includes_default
 18.4553 +int
 18.4554 +main ()
 18.4555 +{
 18.4556 +if ((size_t *) 0)
 18.4557 +  return 0;
 18.4558 +if (sizeof (size_t))
 18.4559 +  return 0;
 18.4560 +  ;
 18.4561 +  return 0;
 18.4562 +}
 18.4563 +_ACEOF
 18.4564 +rm -f conftest.$ac_objext
 18.4565 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4566 +  (eval $ac_compile) 2>conftest.er1
 18.4567 +  ac_status=$?
 18.4568 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4569 +  rm -f conftest.er1
 18.4570 +  cat conftest.err >&5
 18.4571 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4572 +  (exit $ac_status); } &&
 18.4573 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4574 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4575 +  (eval $ac_try) 2>&5
 18.4576 +  ac_status=$?
 18.4577 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4578 +  (exit $ac_status); }; } &&
 18.4579 +	 { ac_try='test -s conftest.$ac_objext'
 18.4580 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4581 +  (eval $ac_try) 2>&5
 18.4582 +  ac_status=$?
 18.4583 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4584 +  (exit $ac_status); }; }; then
 18.4585 +  ac_cv_type_size_t=yes
 18.4586 +else
 18.4587 +  echo "$as_me: failed program was:" >&5
 18.4588 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4589 +
 18.4590 +ac_cv_type_size_t=no
 18.4591 +fi
 18.4592 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4593 +fi
 18.4594 +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
 18.4595 +echo "${ECHO_T}$ac_cv_type_size_t" >&6
 18.4596 +if test $ac_cv_type_size_t = yes; then
 18.4597 +  :
 18.4598 +else
 18.4599 +
 18.4600 +cat >>confdefs.h <<_ACEOF
 18.4601 +#define size_t unsigned
 18.4602 +_ACEOF
 18.4603 +
 18.4604 +fi
 18.4605 +
 18.4606 +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
 18.4607 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
 18.4608 +if test "${ac_cv_header_time+set}" = set; then
 18.4609 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4610 +else
 18.4611 +  cat >conftest.$ac_ext <<_ACEOF
 18.4612 +/* confdefs.h.  */
 18.4613 +_ACEOF
 18.4614 +cat confdefs.h >>conftest.$ac_ext
 18.4615 +cat >>conftest.$ac_ext <<_ACEOF
 18.4616 +/* end confdefs.h.  */
 18.4617 +#include <sys/types.h>
 18.4618 +#include <sys/time.h>
 18.4619 +#include <time.h>
 18.4620 +
 18.4621 +int
 18.4622 +main ()
 18.4623 +{
 18.4624 +if ((struct tm *) 0)
 18.4625 +return 0;
 18.4626 +  ;
 18.4627 +  return 0;
 18.4628 +}
 18.4629 +_ACEOF
 18.4630 +rm -f conftest.$ac_objext
 18.4631 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4632 +  (eval $ac_compile) 2>conftest.er1
 18.4633 +  ac_status=$?
 18.4634 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4635 +  rm -f conftest.er1
 18.4636 +  cat conftest.err >&5
 18.4637 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4638 +  (exit $ac_status); } &&
 18.4639 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4640 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4641 +  (eval $ac_try) 2>&5
 18.4642 +  ac_status=$?
 18.4643 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4644 +  (exit $ac_status); }; } &&
 18.4645 +	 { ac_try='test -s conftest.$ac_objext'
 18.4646 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4647 +  (eval $ac_try) 2>&5
 18.4648 +  ac_status=$?
 18.4649 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4650 +  (exit $ac_status); }; }; then
 18.4651 +  ac_cv_header_time=yes
 18.4652 +else
 18.4653 +  echo "$as_me: failed program was:" >&5
 18.4654 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4655 +
 18.4656 +ac_cv_header_time=no
 18.4657 +fi
 18.4658 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4659 +fi
 18.4660 +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
 18.4661 +echo "${ECHO_T}$ac_cv_header_time" >&6
 18.4662 +if test $ac_cv_header_time = yes; then
 18.4663 +
 18.4664 +cat >>confdefs.h <<\_ACEOF
 18.4665 +#define TIME_WITH_SYS_TIME 1
 18.4666 +_ACEOF
 18.4667 +
 18.4668 +fi
 18.4669 +
 18.4670 +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
 18.4671 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
 18.4672 +if test "${ac_cv_struct_tm+set}" = set; then
 18.4673 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4674 +else
 18.4675 +  cat >conftest.$ac_ext <<_ACEOF
 18.4676 +/* confdefs.h.  */
 18.4677 +_ACEOF
 18.4678 +cat confdefs.h >>conftest.$ac_ext
 18.4679 +cat >>conftest.$ac_ext <<_ACEOF
 18.4680 +/* end confdefs.h.  */
 18.4681 +#include <sys/types.h>
 18.4682 +#include <time.h>
 18.4683 +
 18.4684 +int
 18.4685 +main ()
 18.4686 +{
 18.4687 +struct tm *tp; tp->tm_sec;
 18.4688 +  ;
 18.4689 +  return 0;
 18.4690 +}
 18.4691 +_ACEOF
 18.4692 +rm -f conftest.$ac_objext
 18.4693 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4694 +  (eval $ac_compile) 2>conftest.er1
 18.4695 +  ac_status=$?
 18.4696 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4697 +  rm -f conftest.er1
 18.4698 +  cat conftest.err >&5
 18.4699 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4700 +  (exit $ac_status); } &&
 18.4701 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4702 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4703 +  (eval $ac_try) 2>&5
 18.4704 +  ac_status=$?
 18.4705 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4706 +  (exit $ac_status); }; } &&
 18.4707 +	 { ac_try='test -s conftest.$ac_objext'
 18.4708 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4709 +  (eval $ac_try) 2>&5
 18.4710 +  ac_status=$?
 18.4711 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4712 +  (exit $ac_status); }; }; then
 18.4713 +  ac_cv_struct_tm=time.h
 18.4714 +else
 18.4715 +  echo "$as_me: failed program was:" >&5
 18.4716 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4717 +
 18.4718 +ac_cv_struct_tm=sys/time.h
 18.4719 +fi
 18.4720 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4721 +fi
 18.4722 +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
 18.4723 +echo "${ECHO_T}$ac_cv_struct_tm" >&6
 18.4724 +if test $ac_cv_struct_tm = sys/time.h; then
 18.4725 +
 18.4726 +cat >>confdefs.h <<\_ACEOF
 18.4727 +#define TM_IN_SYS_TIME 1
 18.4728 +_ACEOF
 18.4729 +
 18.4730 +fi
 18.4731 +
 18.4732 +
 18.4733 +echo "$as_me:$LINENO: checking for working POSIX fnmatch" >&5
 18.4734 +echo $ECHO_N "checking for working POSIX fnmatch... $ECHO_C" >&6
 18.4735 +if test "${ac_cv_func_fnmatch_works+set}" = set; then
 18.4736 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4737 +else
 18.4738 +  # Some versions of Solaris, SCO, and the GNU C Library
 18.4739 +   # have a broken or incompatible fnmatch.
 18.4740 +   # So we run a test program.  If we are cross-compiling, take no chance.
 18.4741 +   # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
 18.4742 +   if test "$cross_compiling" = yes; then
 18.4743 +  ac_cv_func_fnmatch_works=cross
 18.4744 +else
 18.4745 +  cat >conftest.$ac_ext <<_ACEOF
 18.4746 +/* confdefs.h.  */
 18.4747 +_ACEOF
 18.4748 +cat confdefs.h >>conftest.$ac_ext
 18.4749 +cat >>conftest.$ac_ext <<_ACEOF
 18.4750 +/* end confdefs.h.  */
 18.4751 +#include <fnmatch.h>
 18.4752 +#	   define y(a, b, c) (fnmatch (a, b, c) == 0)
 18.4753 +#	   define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
 18.4754 +
 18.4755 +int
 18.4756 +main ()
 18.4757 +{
 18.4758 +exit
 18.4759 +	   (!(y ("a*", "abc", 0)
 18.4760 +	      && n ("d*/*1", "d/s/1", FNM_PATHNAME)
 18.4761 +	      && y ("a\\\\bc", "abc", 0)
 18.4762 +	      && n ("a\\\\bc", "abc", FNM_NOESCAPE)
 18.4763 +	      && y ("*x", ".x", 0)
 18.4764 +	      && n ("*x", ".x", FNM_PERIOD)
 18.4765 +	      && 1));
 18.4766 +  ;
 18.4767 +  return 0;
 18.4768 +}
 18.4769 +_ACEOF
 18.4770 +rm -f conftest$ac_exeext
 18.4771 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.4772 +  (eval $ac_link) 2>&5
 18.4773 +  ac_status=$?
 18.4774 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4775 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
 18.4776 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4777 +  (eval $ac_try) 2>&5
 18.4778 +  ac_status=$?
 18.4779 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4780 +  (exit $ac_status); }; }; then
 18.4781 +  ac_cv_func_fnmatch_works=yes
 18.4782 +else
 18.4783 +  echo "$as_me: program exited with status $ac_status" >&5
 18.4784 +echo "$as_me: failed program was:" >&5
 18.4785 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4786 +
 18.4787 +( exit $ac_status )
 18.4788 +ac_cv_func_fnmatch_works=no
 18.4789 +fi
 18.4790 +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 18.4791 +fi
 18.4792 +fi
 18.4793 +echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_works" >&5
 18.4794 +echo "${ECHO_T}$ac_cv_func_fnmatch_works" >&6
 18.4795 +if test $ac_cv_func_fnmatch_works = yes; then
 18.4796 +
 18.4797 +cat >>confdefs.h <<\_ACEOF
 18.4798 +#define HAVE_FNMATCH 1
 18.4799 +_ACEOF
 18.4800 +
 18.4801 +fi
 18.4802 +
 18.4803 +
 18.4804 +
 18.4805 +echo "$as_me:$LINENO: checking return type of signal handlers" >&5
 18.4806 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 18.4807 +if test "${ac_cv_type_signal+set}" = set; then
 18.4808 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4809 +else
 18.4810 +  cat >conftest.$ac_ext <<_ACEOF
 18.4811 +/* confdefs.h.  */
 18.4812 +_ACEOF
 18.4813 +cat confdefs.h >>conftest.$ac_ext
 18.4814 +cat >>conftest.$ac_ext <<_ACEOF
 18.4815 +/* end confdefs.h.  */
 18.4816 +#include <sys/types.h>
 18.4817 +#include <signal.h>
 18.4818 +#ifdef signal
 18.4819 +# undef signal
 18.4820 +#endif
 18.4821 +#ifdef __cplusplus
 18.4822 +extern "C" void (*signal (int, void (*)(int)))(int);
 18.4823 +#else
 18.4824 +void (*signal ()) ();
 18.4825 +#endif
 18.4826 +
 18.4827 +int
 18.4828 +main ()
 18.4829 +{
 18.4830 +int i;
 18.4831 +  ;
 18.4832 +  return 0;
 18.4833 +}
 18.4834 +_ACEOF
 18.4835 +rm -f conftest.$ac_objext
 18.4836 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 18.4837 +  (eval $ac_compile) 2>conftest.er1
 18.4838 +  ac_status=$?
 18.4839 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4840 +  rm -f conftest.er1
 18.4841 +  cat conftest.err >&5
 18.4842 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4843 +  (exit $ac_status); } &&
 18.4844 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4845 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4846 +  (eval $ac_try) 2>&5
 18.4847 +  ac_status=$?
 18.4848 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4849 +  (exit $ac_status); }; } &&
 18.4850 +	 { ac_try='test -s conftest.$ac_objext'
 18.4851 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4852 +  (eval $ac_try) 2>&5
 18.4853 +  ac_status=$?
 18.4854 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4855 +  (exit $ac_status); }; }; then
 18.4856 +  ac_cv_type_signal=void
 18.4857 +else
 18.4858 +  echo "$as_me: failed program was:" >&5
 18.4859 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4860 +
 18.4861 +ac_cv_type_signal=int
 18.4862 +fi
 18.4863 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 18.4864 +fi
 18.4865 +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
 18.4866 +echo "${ECHO_T}$ac_cv_type_signal" >&6
 18.4867 +
 18.4868 +cat >>confdefs.h <<_ACEOF
 18.4869 +#define RETSIGTYPE $ac_cv_type_signal
 18.4870 +_ACEOF
 18.4871 +
 18.4872 +
 18.4873 +
 18.4874 +for ac_func in strftime
 18.4875 +do
 18.4876 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 18.4877 +echo "$as_me:$LINENO: checking for $ac_func" >&5
 18.4878 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 18.4879 +if eval "test \"\${$as_ac_var+set}\" = set"; then
 18.4880 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4881 +else
 18.4882 +  cat >conftest.$ac_ext <<_ACEOF
 18.4883 +/* confdefs.h.  */
 18.4884 +_ACEOF
 18.4885 +cat confdefs.h >>conftest.$ac_ext
 18.4886 +cat >>conftest.$ac_ext <<_ACEOF
 18.4887 +/* end confdefs.h.  */
 18.4888 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
 18.4889 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 18.4890 +#define $ac_func innocuous_$ac_func
 18.4891 +
 18.4892 +/* System header to define __stub macros and hopefully few prototypes,
 18.4893 +    which can conflict with char $ac_func (); below.
 18.4894 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.4895 +    <limits.h> exists even on freestanding compilers.  */
 18.4896 +
 18.4897 +#ifdef __STDC__
 18.4898 +# include <limits.h>
 18.4899 +#else
 18.4900 +# include <assert.h>
 18.4901 +#endif
 18.4902 +
 18.4903 +#undef $ac_func
 18.4904 +
 18.4905 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.4906 +#ifdef __cplusplus
 18.4907 +extern "C"
 18.4908 +{
 18.4909 +#endif
 18.4910 +/* We use char because int might match the return type of a gcc2
 18.4911 +   builtin and then its argument prototype would still apply.  */
 18.4912 +char $ac_func ();
 18.4913 +/* The GNU C library defines this for functions which it implements
 18.4914 +    to always fail with ENOSYS.  Some functions are actually named
 18.4915 +    something starting with __ and the normal name is an alias.  */
 18.4916 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 18.4917 +choke me
 18.4918 +#else
 18.4919 +char (*f) () = $ac_func;
 18.4920 +#endif
 18.4921 +#ifdef __cplusplus
 18.4922 +}
 18.4923 +#endif
 18.4924 +
 18.4925 +int
 18.4926 +main ()
 18.4927 +{
 18.4928 +return f != $ac_func;
 18.4929 +  ;
 18.4930 +  return 0;
 18.4931 +}
 18.4932 +_ACEOF
 18.4933 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.4934 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.4935 +  (eval $ac_link) 2>conftest.er1
 18.4936 +  ac_status=$?
 18.4937 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.4938 +  rm -f conftest.er1
 18.4939 +  cat conftest.err >&5
 18.4940 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4941 +  (exit $ac_status); } &&
 18.4942 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.4943 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4944 +  (eval $ac_try) 2>&5
 18.4945 +  ac_status=$?
 18.4946 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4947 +  (exit $ac_status); }; } &&
 18.4948 +	 { ac_try='test -s conftest$ac_exeext'
 18.4949 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.4950 +  (eval $ac_try) 2>&5
 18.4951 +  ac_status=$?
 18.4952 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.4953 +  (exit $ac_status); }; }; then
 18.4954 +  eval "$as_ac_var=yes"
 18.4955 +else
 18.4956 +  echo "$as_me: failed program was:" >&5
 18.4957 +sed 's/^/| /' conftest.$ac_ext >&5
 18.4958 +
 18.4959 +eval "$as_ac_var=no"
 18.4960 +fi
 18.4961 +rm -f conftest.err conftest.$ac_objext \
 18.4962 +      conftest$ac_exeext conftest.$ac_ext
 18.4963 +fi
 18.4964 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 18.4965 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 18.4966 +if test `eval echo '${'$as_ac_var'}'` = yes; then
 18.4967 +  cat >>confdefs.h <<_ACEOF
 18.4968 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 18.4969 +_ACEOF
 18.4970 +
 18.4971 +else
 18.4972 +  # strftime is in -lintl on SCO UNIX.
 18.4973 +echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
 18.4974 +echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
 18.4975 +if test "${ac_cv_lib_intl_strftime+set}" = set; then
 18.4976 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.4977 +else
 18.4978 +  ac_check_lib_save_LIBS=$LIBS
 18.4979 +LIBS="-lintl  $LIBS"
 18.4980 +cat >conftest.$ac_ext <<_ACEOF
 18.4981 +/* confdefs.h.  */
 18.4982 +_ACEOF
 18.4983 +cat confdefs.h >>conftest.$ac_ext
 18.4984 +cat >>conftest.$ac_ext <<_ACEOF
 18.4985 +/* end confdefs.h.  */
 18.4986 +
 18.4987 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.4988 +#ifdef __cplusplus
 18.4989 +extern "C"
 18.4990 +#endif
 18.4991 +/* We use char because int might match the return type of a gcc2
 18.4992 +   builtin and then its argument prototype would still apply.  */
 18.4993 +char strftime ();
 18.4994 +int
 18.4995 +main ()
 18.4996 +{
 18.4997 +strftime ();
 18.4998 +  ;
 18.4999 +  return 0;
 18.5000 +}
 18.5001 +_ACEOF
 18.5002 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5003 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5004 +  (eval $ac_link) 2>conftest.er1
 18.5005 +  ac_status=$?
 18.5006 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5007 +  rm -f conftest.er1
 18.5008 +  cat conftest.err >&5
 18.5009 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5010 +  (exit $ac_status); } &&
 18.5011 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5012 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5013 +  (eval $ac_try) 2>&5
 18.5014 +  ac_status=$?
 18.5015 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5016 +  (exit $ac_status); }; } &&
 18.5017 +	 { ac_try='test -s conftest$ac_exeext'
 18.5018 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5019 +  (eval $ac_try) 2>&5
 18.5020 +  ac_status=$?
 18.5021 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5022 +  (exit $ac_status); }; }; then
 18.5023 +  ac_cv_lib_intl_strftime=yes
 18.5024 +else
 18.5025 +  echo "$as_me: failed program was:" >&5
 18.5026 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5027 +
 18.5028 +ac_cv_lib_intl_strftime=no
 18.5029 +fi
 18.5030 +rm -f conftest.err conftest.$ac_objext \
 18.5031 +      conftest$ac_exeext conftest.$ac_ext
 18.5032 +LIBS=$ac_check_lib_save_LIBS
 18.5033 +fi
 18.5034 +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
 18.5035 +echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
 18.5036 +if test $ac_cv_lib_intl_strftime = yes; then
 18.5037 +  cat >>confdefs.h <<\_ACEOF
 18.5038 +#define HAVE_STRFTIME 1
 18.5039 +_ACEOF
 18.5040 +
 18.5041 +LIBS="-lintl $LIBS"
 18.5042 +fi
 18.5043 +
 18.5044 +fi
 18.5045 +done
 18.5046 +
 18.5047 +
 18.5048 +for ac_func in vprintf
 18.5049 +do
 18.5050 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 18.5051 +echo "$as_me:$LINENO: checking for $ac_func" >&5
 18.5052 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 18.5053 +if eval "test \"\${$as_ac_var+set}\" = set"; then
 18.5054 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.5055 +else
 18.5056 +  cat >conftest.$ac_ext <<_ACEOF
 18.5057 +/* confdefs.h.  */
 18.5058 +_ACEOF
 18.5059 +cat confdefs.h >>conftest.$ac_ext
 18.5060 +cat >>conftest.$ac_ext <<_ACEOF
 18.5061 +/* end confdefs.h.  */
 18.5062 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
 18.5063 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 18.5064 +#define $ac_func innocuous_$ac_func
 18.5065 +
 18.5066 +/* System header to define __stub macros and hopefully few prototypes,
 18.5067 +    which can conflict with char $ac_func (); below.
 18.5068 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.5069 +    <limits.h> exists even on freestanding compilers.  */
 18.5070 +
 18.5071 +#ifdef __STDC__
 18.5072 +# include <limits.h>
 18.5073 +#else
 18.5074 +# include <assert.h>
 18.5075 +#endif
 18.5076 +
 18.5077 +#undef $ac_func
 18.5078 +
 18.5079 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.5080 +#ifdef __cplusplus
 18.5081 +extern "C"
 18.5082 +{
 18.5083 +#endif
 18.5084 +/* We use char because int might match the return type of a gcc2
 18.5085 +   builtin and then its argument prototype would still apply.  */
 18.5086 +char $ac_func ();
 18.5087 +/* The GNU C library defines this for functions which it implements
 18.5088 +    to always fail with ENOSYS.  Some functions are actually named
 18.5089 +    something starting with __ and the normal name is an alias.  */
 18.5090 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 18.5091 +choke me
 18.5092 +#else
 18.5093 +char (*f) () = $ac_func;
 18.5094 +#endif
 18.5095 +#ifdef __cplusplus
 18.5096 +}
 18.5097 +#endif
 18.5098 +
 18.5099 +int
 18.5100 +main ()
 18.5101 +{
 18.5102 +return f != $ac_func;
 18.5103 +  ;
 18.5104 +  return 0;
 18.5105 +}
 18.5106 +_ACEOF
 18.5107 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5108 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5109 +  (eval $ac_link) 2>conftest.er1
 18.5110 +  ac_status=$?
 18.5111 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5112 +  rm -f conftest.er1
 18.5113 +  cat conftest.err >&5
 18.5114 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5115 +  (exit $ac_status); } &&
 18.5116 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5117 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5118 +  (eval $ac_try) 2>&5
 18.5119 +  ac_status=$?
 18.5120 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5121 +  (exit $ac_status); }; } &&
 18.5122 +	 { ac_try='test -s conftest$ac_exeext'
 18.5123 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5124 +  (eval $ac_try) 2>&5
 18.5125 +  ac_status=$?
 18.5126 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5127 +  (exit $ac_status); }; }; then
 18.5128 +  eval "$as_ac_var=yes"
 18.5129 +else
 18.5130 +  echo "$as_me: failed program was:" >&5
 18.5131 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5132 +
 18.5133 +eval "$as_ac_var=no"
 18.5134 +fi
 18.5135 +rm -f conftest.err conftest.$ac_objext \
 18.5136 +      conftest$ac_exeext conftest.$ac_ext
 18.5137 +fi
 18.5138 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 18.5139 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 18.5140 +if test `eval echo '${'$as_ac_var'}'` = yes; then
 18.5141 +  cat >>confdefs.h <<_ACEOF
 18.5142 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 18.5143 +_ACEOF
 18.5144 +
 18.5145 +echo "$as_me:$LINENO: checking for _doprnt" >&5
 18.5146 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
 18.5147 +if test "${ac_cv_func__doprnt+set}" = set; then
 18.5148 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.5149 +else
 18.5150 +  cat >conftest.$ac_ext <<_ACEOF
 18.5151 +/* confdefs.h.  */
 18.5152 +_ACEOF
 18.5153 +cat confdefs.h >>conftest.$ac_ext
 18.5154 +cat >>conftest.$ac_ext <<_ACEOF
 18.5155 +/* end confdefs.h.  */
 18.5156 +/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
 18.5157 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 18.5158 +#define _doprnt innocuous__doprnt
 18.5159 +
 18.5160 +/* System header to define __stub macros and hopefully few prototypes,
 18.5161 +    which can conflict with char _doprnt (); below.
 18.5162 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.5163 +    <limits.h> exists even on freestanding compilers.  */
 18.5164 +
 18.5165 +#ifdef __STDC__
 18.5166 +# include <limits.h>
 18.5167 +#else
 18.5168 +# include <assert.h>
 18.5169 +#endif
 18.5170 +
 18.5171 +#undef _doprnt
 18.5172 +
 18.5173 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.5174 +#ifdef __cplusplus
 18.5175 +extern "C"
 18.5176 +{
 18.5177 +#endif
 18.5178 +/* We use char because int might match the return type of a gcc2
 18.5179 +   builtin and then its argument prototype would still apply.  */
 18.5180 +char _doprnt ();
 18.5181 +/* The GNU C library defines this for functions which it implements
 18.5182 +    to always fail with ENOSYS.  Some functions are actually named
 18.5183 +    something starting with __ and the normal name is an alias.  */
 18.5184 +#if defined (__stub__doprnt) || defined (__stub____doprnt)
 18.5185 +choke me
 18.5186 +#else
 18.5187 +char (*f) () = _doprnt;
 18.5188 +#endif
 18.5189 +#ifdef __cplusplus
 18.5190 +}
 18.5191 +#endif
 18.5192 +
 18.5193 +int
 18.5194 +main ()
 18.5195 +{
 18.5196 +return f != _doprnt;
 18.5197 +  ;
 18.5198 +  return 0;
 18.5199 +}
 18.5200 +_ACEOF
 18.5201 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5202 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5203 +  (eval $ac_link) 2>conftest.er1
 18.5204 +  ac_status=$?
 18.5205 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5206 +  rm -f conftest.er1
 18.5207 +  cat conftest.err >&5
 18.5208 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5209 +  (exit $ac_status); } &&
 18.5210 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5211 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5212 +  (eval $ac_try) 2>&5
 18.5213 +  ac_status=$?
 18.5214 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5215 +  (exit $ac_status); }; } &&
 18.5216 +	 { ac_try='test -s conftest$ac_exeext'
 18.5217 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5218 +  (eval $ac_try) 2>&5
 18.5219 +  ac_status=$?
 18.5220 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5221 +  (exit $ac_status); }; }; then
 18.5222 +  ac_cv_func__doprnt=yes
 18.5223 +else
 18.5224 +  echo "$as_me: failed program was:" >&5
 18.5225 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5226 +
 18.5227 +ac_cv_func__doprnt=no
 18.5228 +fi
 18.5229 +rm -f conftest.err conftest.$ac_objext \
 18.5230 +      conftest$ac_exeext conftest.$ac_ext
 18.5231 +fi
 18.5232 +echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
 18.5233 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6
 18.5234 +if test $ac_cv_func__doprnt = yes; then
 18.5235 +
 18.5236 +cat >>confdefs.h <<\_ACEOF
 18.5237 +#define HAVE_DOPRNT 1
 18.5238 +_ACEOF
 18.5239 +
 18.5240 +fi
 18.5241 +
 18.5242 +fi
 18.5243 +done
 18.5244 +
 18.5245 +
 18.5246 +
 18.5247 +
 18.5248 +
 18.5249 +
 18.5250 +for ac_func in select socket strerror strstr
 18.5251 +do
 18.5252 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 18.5253 +echo "$as_me:$LINENO: checking for $ac_func" >&5
 18.5254 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 18.5255 +if eval "test \"\${$as_ac_var+set}\" = set"; then
 18.5256 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.5257 +else
 18.5258 +  cat >conftest.$ac_ext <<_ACEOF
 18.5259 +/* confdefs.h.  */
 18.5260 +_ACEOF
 18.5261 +cat confdefs.h >>conftest.$ac_ext
 18.5262 +cat >>conftest.$ac_ext <<_ACEOF
 18.5263 +/* end confdefs.h.  */
 18.5264 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
 18.5265 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 18.5266 +#define $ac_func innocuous_$ac_func
 18.5267 +
 18.5268 +/* System header to define __stub macros and hopefully few prototypes,
 18.5269 +    which can conflict with char $ac_func (); below.
 18.5270 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
 18.5271 +    <limits.h> exists even on freestanding compilers.  */
 18.5272 +
 18.5273 +#ifdef __STDC__
 18.5274 +# include <limits.h>
 18.5275 +#else
 18.5276 +# include <assert.h>
 18.5277 +#endif
 18.5278 +
 18.5279 +#undef $ac_func
 18.5280 +
 18.5281 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.5282 +#ifdef __cplusplus
 18.5283 +extern "C"
 18.5284 +{
 18.5285 +#endif
 18.5286 +/* We use char because int might match the return type of a gcc2
 18.5287 +   builtin and then its argument prototype would still apply.  */
 18.5288 +char $ac_func ();
 18.5289 +/* The GNU C library defines this for functions which it implements
 18.5290 +    to always fail with ENOSYS.  Some functions are actually named
 18.5291 +    something starting with __ and the normal name is an alias.  */
 18.5292 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 18.5293 +choke me
 18.5294 +#else
 18.5295 +char (*f) () = $ac_func;
 18.5296 +#endif
 18.5297 +#ifdef __cplusplus
 18.5298 +}
 18.5299 +#endif
 18.5300 +
 18.5301 +int
 18.5302 +main ()
 18.5303 +{
 18.5304 +return f != $ac_func;
 18.5305 +  ;
 18.5306 +  return 0;
 18.5307 +}
 18.5308 +_ACEOF
 18.5309 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5310 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5311 +  (eval $ac_link) 2>conftest.er1
 18.5312 +  ac_status=$?
 18.5313 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5314 +  rm -f conftest.er1
 18.5315 +  cat conftest.err >&5
 18.5316 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5317 +  (exit $ac_status); } &&
 18.5318 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5319 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5320 +  (eval $ac_try) 2>&5
 18.5321 +  ac_status=$?
 18.5322 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5323 +  (exit $ac_status); }; } &&
 18.5324 +	 { ac_try='test -s conftest$ac_exeext'
 18.5325 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5326 +  (eval $ac_try) 2>&5
 18.5327 +  ac_status=$?
 18.5328 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5329 +  (exit $ac_status); }; }; then
 18.5330 +  eval "$as_ac_var=yes"
 18.5331 +else
 18.5332 +  echo "$as_me: failed program was:" >&5
 18.5333 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5334 +
 18.5335 +eval "$as_ac_var=no"
 18.5336 +fi
 18.5337 +rm -f conftest.err conftest.$ac_objext \
 18.5338 +      conftest$ac_exeext conftest.$ac_ext
 18.5339 +fi
 18.5340 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 18.5341 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 18.5342 +if test `eval echo '${'$as_ac_var'}'` = yes; then
 18.5343 +  cat >>confdefs.h <<_ACEOF
 18.5344 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 18.5345 +_ACEOF
 18.5346 +
 18.5347 +fi
 18.5348 +done
 18.5349 +
 18.5350 +
 18.5351 +
 18.5352 +# Check whether --with-user or --without-user was given.
 18.5353 +if test "${with_user+set}" = set; then
 18.5354 +  withval="$with_user"
 18.5355 +
 18.5356 +fi;
 18.5357 +if test "x$with_user" = 'x'; then
 18.5358 +	with_user='mail'
 18.5359 +fi
 18.5360 +
 18.5361 +
 18.5362 +# Check whether --with-group or --without-group was given.
 18.5363 +if test "${with_group+set}" = set; then
 18.5364 +  withval="$with_group"
 18.5365 +
 18.5366 +fi;
 18.5367 +if test "x$with_group" = 'x'; then
 18.5368 +	with_group='trusted'
 18.5369 +fi
 18.5370 +
 18.5371 +# Check whether --enable-debug or --disable-debug was given.
 18.5372 +if test "${enable_debug+set}" = set; then
 18.5373 +  enableval="$enable_debug"
 18.5374 +  if test "x$enable_debug" != 'xno'; then
 18.5375 +		debug_enabled='yes'
 18.5376 +	fi
 18.5377 +else
 18.5378 +  debug_enabled='yes'
 18.5379 +
 18.5380 +fi;
 18.5381 +if test "x$debug_enabled" = xyes; then
 18.5382 +
 18.5383 +cat >>confdefs.h <<\_ACEOF
 18.5384 +#define ENABLE_DEBUG 1
 18.5385 +_ACEOF
 18.5386 +
 18.5387 +fi
 18.5388 +
 18.5389 +
 18.5390 +cat >>confdefs.h <<_ACEOF
 18.5391 +#define DEF_MAIL_USER "${with_user}"
 18.5392 +_ACEOF
 18.5393 +
 18.5394 +
 18.5395 +
 18.5396 +cat >>confdefs.h <<_ACEOF
 18.5397 +#define DEF_MAIL_GROUP "${with_group}"
 18.5398 +_ACEOF
 18.5399 +
 18.5400 +
 18.5401 +
 18.5402 +
 18.5403 +# Check whether --with-glib_static or --without-glib_static was given.
 18.5404 +if test "${with_glib_static+set}" = set; then
 18.5405 +  withval="$with_glib_static"
 18.5406 +
 18.5407 +fi;
 18.5408 +if test "x$with_glib_static" != 'x'; then
 18.5409 +	GLIB_LIBS=$with_glib_static
 18.5410 +
 18.5411 +fi
 18.5412 +
 18.5413 +MD5_LIBS=''
 18.5414 +BASE64_LIBS=''
 18.5415 +
 18.5416 +# Check whether --enable-smtp_server or --disable-smtp_server was given.
 18.5417 +if test "${enable_smtp_server+set}" = set; then
 18.5418 +  enableval="$enable_smtp_server"
 18.5419 +  if test "x$enable_smtp_server" != 'xno'; then
 18.5420 +		smtp_server_enabled='yes'
 18.5421 +	fi
 18.5422 +else
 18.5423 +  smtp_server_enabled='yes'
 18.5424 +
 18.5425 +fi;
 18.5426 +if test "x$smtp_server_enabled" = xyes; then
 18.5427 +
 18.5428 +cat >>confdefs.h <<\_ACEOF
 18.5429 +#define ENABLE_SMTP_SERVER 1
 18.5430 +_ACEOF
 18.5431 +
 18.5432 +fi
 18.5433 +
 18.5434 +# Check whether --enable-pop3 or --disable-pop3 was given.
 18.5435 +if test "${enable_pop3+set}" = set; then
 18.5436 +  enableval="$enable_pop3"
 18.5437 +  if test "x$enable_pop3" != 'xno'; then
 18.5438 +		pop3_enabled='yes'
 18.5439 +	fi
 18.5440 +else
 18.5441 +  pop3_enabled='yes'
 18.5442 +
 18.5443 +fi;
 18.5444 +if test "x$pop3_enabled" = xyes; then
 18.5445 +
 18.5446 +cat >>confdefs.h <<\_ACEOF
 18.5447 +#define ENABLE_POP3 1
 18.5448 +_ACEOF
 18.5449 +
 18.5450 +#	MD5_LIBS='md5/libmd5c.a'
 18.5451 +	need_md5='yes'
 18.5452 +fi
 18.5453 +
 18.5454 +# Check whether --enable-auth or --disable-auth was given.
 18.5455 +if test "${enable_auth+set}" = set; then
 18.5456 +  enableval="$enable_auth"
 18.5457 +  if test "x$enable_auth" != 'xno'; then
 18.5458 +		auth_enabled='yes'
 18.5459 +	fi
 18.5460 +fi;
 18.5461 +if test "x$auth_enabled" = xyes; then
 18.5462 +
 18.5463 +cat >>confdefs.h <<\_ACEOF
 18.5464 +#define ENABLE_AUTH 1
 18.5465 +_ACEOF
 18.5466 +
 18.5467 +	BASE64_LIBS='base64/libbase64.a'
 18.5468 +#	MD5_LIBS='md5/libmd5c.a'
 18.5469 +	need_md5='yes'
 18.5470 +fi
 18.5471 +
 18.5472 +
 18.5473 +# Check whether --enable-maildir or --disable-maildir was given.
 18.5474 +if test "${enable_maildir+set}" = set; then
 18.5475 +  enableval="$enable_maildir"
 18.5476 +  if test "x$enable_maildir" != 'xno'; then
 18.5477 +		maildir_enabled='yes'
 18.5478 +	fi
 18.5479 +fi;
 18.5480 +if test "x$maildir_enabled" = xyes; then
 18.5481 +
 18.5482 +cat >>confdefs.h <<\_ACEOF
 18.5483 +#define ENABLE_MAILDIR 1
 18.5484 +_ACEOF
 18.5485 +
 18.5486 +fi
 18.5487 +
 18.5488 +
 18.5489 +# Check whether --with-libcrypto or --without-libcrypto was given.
 18.5490 +if test "${with_libcrypto+set}" = set; then
 18.5491 +  withval="$with_libcrypto"
 18.5492 +
 18.5493 +fi;
 18.5494 +if test "x$with_libcrypto" != 'xyes'; then
 18.5495 +	with_libcrypto='no'
 18.5496 +fi
 18.5497 +
 18.5498 +if test "x$need_md5" = 'xyes'; then
 18.5499 +	if test "x$with_libcrypto" = "xyes"; then
 18.5500 +		echo "$as_me:$LINENO: checking for MD5 in -lcrypto" >&5
 18.5501 +echo $ECHO_N "checking for MD5 in -lcrypto... $ECHO_C" >&6
 18.5502 +if test "${ac_cv_lib_crypto_MD5+set}" = set; then
 18.5503 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.5504 +else
 18.5505 +  ac_check_lib_save_LIBS=$LIBS
 18.5506 +LIBS="-lcrypto  $LIBS"
 18.5507 +cat >conftest.$ac_ext <<_ACEOF
 18.5508 +/* confdefs.h.  */
 18.5509 +_ACEOF
 18.5510 +cat confdefs.h >>conftest.$ac_ext
 18.5511 +cat >>conftest.$ac_ext <<_ACEOF
 18.5512 +/* end confdefs.h.  */
 18.5513 +
 18.5514 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.5515 +#ifdef __cplusplus
 18.5516 +extern "C"
 18.5517 +#endif
 18.5518 +/* We use char because int might match the return type of a gcc2
 18.5519 +   builtin and then its argument prototype would still apply.  */
 18.5520 +char MD5 ();
 18.5521 +int
 18.5522 +main ()
 18.5523 +{
 18.5524 +MD5 ();
 18.5525 +  ;
 18.5526 +  return 0;
 18.5527 +}
 18.5528 +_ACEOF
 18.5529 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5530 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5531 +  (eval $ac_link) 2>conftest.er1
 18.5532 +  ac_status=$?
 18.5533 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5534 +  rm -f conftest.er1
 18.5535 +  cat conftest.err >&5
 18.5536 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5537 +  (exit $ac_status); } &&
 18.5538 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5539 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5540 +  (eval $ac_try) 2>&5
 18.5541 +  ac_status=$?
 18.5542 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5543 +  (exit $ac_status); }; } &&
 18.5544 +	 { ac_try='test -s conftest$ac_exeext'
 18.5545 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5546 +  (eval $ac_try) 2>&5
 18.5547 +  ac_status=$?
 18.5548 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5549 +  (exit $ac_status); }; }; then
 18.5550 +  ac_cv_lib_crypto_MD5=yes
 18.5551 +else
 18.5552 +  echo "$as_me: failed program was:" >&5
 18.5553 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5554 +
 18.5555 +ac_cv_lib_crypto_MD5=no
 18.5556 +fi
 18.5557 +rm -f conftest.err conftest.$ac_objext \
 18.5558 +      conftest$ac_exeext conftest.$ac_ext
 18.5559 +LIBS=$ac_check_lib_save_LIBS
 18.5560 +fi
 18.5561 +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5" >&5
 18.5562 +echo "${ECHO_T}$ac_cv_lib_crypto_MD5" >&6
 18.5563 +if test $ac_cv_lib_crypto_MD5 = yes; then
 18.5564 +  has_crypto='yes'
 18.5565 +else
 18.5566 +  { { echo "$as_me:$LINENO: error: 'no libcrypto'" >&5
 18.5567 +echo "$as_me: error: 'no libcrypto'" >&2;}
 18.5568 +   { (exit 1); exit 1; }; }
 18.5569 +fi
 18.5570 +
 18.5571 +		if test "x$has_crypto" = 'xyes'; then
 18.5572 +
 18.5573 +cat >>confdefs.h <<\_ACEOF
 18.5574 +#define USE_LIB_CRYPTO 1
 18.5575 +_ACEOF
 18.5576 +
 18.5577 +			MD5_LIBS='-lcrypto'
 18.5578 +		fi
 18.5579 +	else
 18.5580 +		MD5_LIBS='md5/libmd5c.a'
 18.5581 +	fi
 18.5582 +fi
 18.5583 +
 18.5584 +
 18.5585 +IDENT_LIBS=''
 18.5586 +# Check whether --enable-ident or --disable-ident was given.
 18.5587 +if test "${enable_ident+set}" = set; then
 18.5588 +  enableval="$enable_ident"
 18.5589 +  if test "x$enable_ident" != 'xno'; then
 18.5590 +		ident_enabled='yes'
 18.5591 +	fi
 18.5592 +fi;
 18.5593 +
 18.5594 +if test "x$ident_enabled" = xyes; then
 18.5595 +
 18.5596 +cat >>confdefs.h <<\_ACEOF
 18.5597 +#define ENABLE_IDENT 1
 18.5598 +_ACEOF
 18.5599 +
 18.5600 +	echo "$as_me:$LINENO: checking for ident_id in -lident" >&5
 18.5601 +echo $ECHO_N "checking for ident_id in -lident... $ECHO_C" >&6
 18.5602 +if test "${ac_cv_lib_ident_ident_id+set}" = set; then
 18.5603 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.5604 +else
 18.5605 +  ac_check_lib_save_LIBS=$LIBS
 18.5606 +LIBS="-lident  $LIBS"
 18.5607 +cat >conftest.$ac_ext <<_ACEOF
 18.5608 +/* confdefs.h.  */
 18.5609 +_ACEOF
 18.5610 +cat confdefs.h >>conftest.$ac_ext
 18.5611 +cat >>conftest.$ac_ext <<_ACEOF
 18.5612 +/* end confdefs.h.  */
 18.5613 +
 18.5614 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.5615 +#ifdef __cplusplus
 18.5616 +extern "C"
 18.5617 +#endif
 18.5618 +/* We use char because int might match the return type of a gcc2
 18.5619 +   builtin and then its argument prototype would still apply.  */
 18.5620 +char ident_id ();
 18.5621 +int
 18.5622 +main ()
 18.5623 +{
 18.5624 +ident_id ();
 18.5625 +  ;
 18.5626 +  return 0;
 18.5627 +}
 18.5628 +_ACEOF
 18.5629 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5630 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5631 +  (eval $ac_link) 2>conftest.er1
 18.5632 +  ac_status=$?
 18.5633 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5634 +  rm -f conftest.er1
 18.5635 +  cat conftest.err >&5
 18.5636 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5637 +  (exit $ac_status); } &&
 18.5638 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5639 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5640 +  (eval $ac_try) 2>&5
 18.5641 +  ac_status=$?
 18.5642 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5643 +  (exit $ac_status); }; } &&
 18.5644 +	 { ac_try='test -s conftest$ac_exeext'
 18.5645 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5646 +  (eval $ac_try) 2>&5
 18.5647 +  ac_status=$?
 18.5648 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5649 +  (exit $ac_status); }; }; then
 18.5650 +  ac_cv_lib_ident_ident_id=yes
 18.5651 +else
 18.5652 +  echo "$as_me: failed program was:" >&5
 18.5653 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5654 +
 18.5655 +ac_cv_lib_ident_ident_id=no
 18.5656 +fi
 18.5657 +rm -f conftest.err conftest.$ac_objext \
 18.5658 +      conftest$ac_exeext conftest.$ac_ext
 18.5659 +LIBS=$ac_check_lib_save_LIBS
 18.5660 +fi
 18.5661 +echo "$as_me:$LINENO: result: $ac_cv_lib_ident_ident_id" >&5
 18.5662 +echo "${ECHO_T}$ac_cv_lib_ident_ident_id" >&6
 18.5663 +if test $ac_cv_lib_ident_ident_id = yes; then
 18.5664 +  IDENT_LIBS='-lident'
 18.5665 +else
 18.5666 +  IDENT_LIBS='libident/libident.a'
 18.5667 +fi
 18.5668 +
 18.5669 +fi
 18.5670 +
 18.5671 +
 18.5672 +# Check whether --enable-mserver or --disable-mserver was given.
 18.5673 +if test "${enable_mserver+set}" = set; then
 18.5674 +  enableval="$enable_mserver"
 18.5675 +  if test "x$enable_mserver" != 'xno'; then
 18.5676 +		mserver_enabled='yes'
 18.5677 +	fi
 18.5678 +fi;
 18.5679 +if test "x$mserver_enabled" = xyes; then
 18.5680 +
 18.5681 +cat >>confdefs.h <<\_ACEOF
 18.5682 +#define ENABLE_MSERVER 1
 18.5683 +_ACEOF
 18.5684 +
 18.5685 +fi
 18.5686 +
 18.5687 +
 18.5688 +# Check whether --with-liblockfile or --without-liblockfile was given.
 18.5689 +if test "${with_liblockfile+set}" = set; then
 18.5690 +  withval="$with_liblockfile"
 18.5691 +
 18.5692 +fi;
 18.5693 +if test "x$with_liblockfile" != 'x'; then
 18.5694 +	with_liblockfile='yes'
 18.5695 +fi
 18.5696 +if test "x$with_liblockfile" = xyes; then
 18.5697 +	echo "$as_me:$LINENO: checking for maillock in -llockfile" >&5
 18.5698 +echo $ECHO_N "checking for maillock in -llockfile... $ECHO_C" >&6
 18.5699 +if test "${ac_cv_lib_lockfile_maillock+set}" = set; then
 18.5700 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 18.5701 +else
 18.5702 +  ac_check_lib_save_LIBS=$LIBS
 18.5703 +LIBS="-llockfile  $LIBS"
 18.5704 +cat >conftest.$ac_ext <<_ACEOF
 18.5705 +/* confdefs.h.  */
 18.5706 +_ACEOF
 18.5707 +cat confdefs.h >>conftest.$ac_ext
 18.5708 +cat >>conftest.$ac_ext <<_ACEOF
 18.5709 +/* end confdefs.h.  */
 18.5710 +
 18.5711 +/* Override any gcc2 internal prototype to avoid an error.  */
 18.5712 +#ifdef __cplusplus
 18.5713 +extern "C"
 18.5714 +#endif
 18.5715 +/* We use char because int might match the return type of a gcc2
 18.5716 +   builtin and then its argument prototype would still apply.  */
 18.5717 +char maillock ();
 18.5718 +int
 18.5719 +main ()
 18.5720 +{
 18.5721 +maillock ();
 18.5722 +  ;
 18.5723 +  return 0;
 18.5724 +}
 18.5725 +_ACEOF
 18.5726 +rm -f conftest.$ac_objext conftest$ac_exeext
 18.5727 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 18.5728 +  (eval $ac_link) 2>conftest.er1
 18.5729 +  ac_status=$?
 18.5730 +  grep -v '^ *+' conftest.er1 >conftest.err
 18.5731 +  rm -f conftest.er1
 18.5732 +  cat conftest.err >&5
 18.5733 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5734 +  (exit $ac_status); } &&
 18.5735 +	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 18.5736 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5737 +  (eval $ac_try) 2>&5
 18.5738 +  ac_status=$?
 18.5739 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5740 +  (exit $ac_status); }; } &&
 18.5741 +	 { ac_try='test -s conftest$ac_exeext'
 18.5742 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 18.5743 +  (eval $ac_try) 2>&5
 18.5744 +  ac_status=$?
 18.5745 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 18.5746 +  (exit $ac_status); }; }; then
 18.5747 +  ac_cv_lib_lockfile_maillock=yes
 18.5748 +else
 18.5749 +  echo "$as_me: failed program was:" >&5
 18.5750 +sed 's/^/| /' conftest.$ac_ext >&5
 18.5751 +
 18.5752 +ac_cv_lib_lockfile_maillock=no
 18.5753 +fi
 18.5754 +rm -f conftest.err conftest.$ac_objext \
 18.5755 +      conftest$ac_exeext conftest.$ac_ext
 18.5756 +LIBS=$ac_check_lib_save_LIBS
 18.5757 +fi
 18.5758 +echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_maillock" >&5
 18.5759 +echo "${ECHO_T}$ac_cv_lib_lockfile_maillock" >&6
 18.5760 +if test $ac_cv_lib_lockfile_maillock = yes; then
 18.5761 +  has_lockfile=yes
 18.5762 +else
 18.5763 +  { { echo "$as_me:$LINENO: error: \"no liblockfile\"" >&5
 18.5764 +echo "$as_me: error: \"no liblockfile\"" >&2;}
 18.5765 +   { (exit 1); exit 1; }; }
 18.5766 +fi
 18.5767 +
 18.5768 +	LOCKFILE_LIBS='-llockfile'
 18.5769 +
 18.5770 +cat >>confdefs.h <<\_ACEOF
 18.5771 +#define USE_LIBLOCKFILE 1
 18.5772 +_ACEOF
 18.5773 +
 18.5774 +else
 18.5775 +	LOCKFILE_LIBS=''
 18.5776 +fi
 18.5777 +
 18.5778 +
 18.5779 +
 18.5780 +
 18.5781 +# Check whether --with-logdir or --without-logdir was given.
 18.5782 +if test "${with_logdir+set}" = set; then
 18.5783 +  withval="$with_logdir"
 18.5784 +
 18.5785 +else
 18.5786 +  with_logdir='/var/log/masqmail/'
 18.5787 +
 18.5788 +fi;
 18.5789 +
 18.5790 +
 18.5791 +
 18.5792 +# Check whether --with-spooldir or --without-spooldir was given.
 18.5793 +if test "${with_spooldir+set}" = set; then
 18.5794 +  withval="$with_spooldir"
 18.5795 +
 18.5796 +else
 18.5797 +  with_spooldir='/var/spool/masqmail/'
 18.5798 +
 18.5799 +fi;
 18.5800 +
 18.5801 +
 18.5802 +
 18.5803 +# Check whether --with-confdir or --without-confdir was given.
 18.5804 +if test "${with_confdir+set}" = set; then
 18.5805 +  withval="$with_confdir"
 18.5806 +
 18.5807 +else
 18.5808 +  with_confdir='/etc/masqmail'
 18.5809 +
 18.5810 +fi;
 18.5811 +
 18.5812 +cat >>confdefs.h <<_ACEOF
 18.5813 +#define CONF_DIR "${with_confdir}"
 18.5814 +_ACEOF
 18.5815 +
 18.5816 +
 18.5817 +
 18.5818 +test "x$prefix" = xNONE && prefix="$ac_default_prefix"
 18.5819 +
 18.5820 +cat >>confdefs.h <<_ACEOF
 18.5821 +#define DATA_DIR "`eval echo \""$datadir"\"`/masqmail"
 18.5822 +_ACEOF
 18.5823 +
 18.5824 +
 18.5825 +if test "x${exec_prefix}" != 'xNONE'; then
 18.5826 +
 18.5827 +cat >>confdefs.h <<_ACEOF
 18.5828 +#define SBINDIR "${exec_prefix}/sbin"
 18.5829 +_ACEOF
 18.5830 +
 18.5831 +else
 18.5832 +	if test "x${prefix}" != 'xNONE'; then
 18.5833 +		cat >>confdefs.h <<_ACEOF
 18.5834 +#define SBINDIR "${prefix}/sbin"
 18.5835 +_ACEOF
 18.5836 +
 18.5837 +	else
 18.5838 +		cat >>confdefs.h <<_ACEOF
 18.5839 +#define SBINDIR "/usr/sbin"
 18.5840 +_ACEOF
 18.5841 +
 18.5842 +	fi
 18.5843 +fi
 18.5844 +
 18.5845 +                                                                                                                        ac_config_files="$ac_config_files Makefile debian/Makefile docs/Makefile docs/man/Makefile docs/xml/Makefile tests/Makefile src/Makefile src/base64/Makefile src/md5/Makefile src/libident/Makefile suse/masqmail.spec redhat/masqmail.spec"
 18.5846 +cat >confcache <<\_ACEOF
 18.5847 +# This file is a shell script that caches the results of configure
 18.5848 +# tests run on this system so they can be shared between configure
 18.5849 +# scripts and configure runs, see configure's option --config-cache.
 18.5850 +# It is not useful on other systems.  If it contains results you don't
 18.5851 +# want to keep, you may remove or edit it.
 18.5852 +#
 18.5853 +# config.status only pays attention to the cache file if you give it
 18.5854 +# the --recheck option to rerun configure.
 18.5855 +#
 18.5856 +# `ac_cv_env_foo' variables (set or unset) will be overridden when
 18.5857 +# loading this file, other *unset* `ac_cv_foo' will be assigned the
 18.5858 +# following values.
 18.5859 +
 18.5860 +_ACEOF
 18.5861 +
 18.5862 +# The following way of writing the cache mishandles newlines in values,
 18.5863 +# but we know of no workaround that is simple, portable, and efficient.
 18.5864 +# So, don't put newlines in cache variables' values.
 18.5865 +# Ultrix sh set writes to stderr and can't be redirected directly,
 18.5866 +# and sets the high bit in the cache file unless we assign to the vars.
 18.5867 +{
 18.5868 +  (set) 2>&1 |
 18.5869 +    case `(ac_space=' '; set | grep ac_space) 2>&1` in
 18.5870 +    *ac_space=\ *)
 18.5871 +      # `set' does not quote correctly, so add quotes (double-quote
 18.5872 +      # substitution turns \\\\ into \\, and sed turns \\ into \).
 18.5873 +      sed -n \
 18.5874 +	"s/'/'\\\\''/g;
 18.5875 +	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
 18.5876 +      ;;
 18.5877 +    *)
 18.5878 +      # `set' quotes correctly as required by POSIX, so do not add quotes.
 18.5879 +      sed -n \
 18.5880 +	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
 18.5881 +      ;;
 18.5882 +    esac;
 18.5883 +} |
 18.5884 +  sed '
 18.5885 +     t clear
 18.5886 +     : clear
 18.5887 +     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
 18.5888 +     t end
 18.5889 +     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
 18.5890 +     : end' >>confcache
 18.5891 +if diff $cache_file confcache >/dev/null 2>&1; then :; else
 18.5892 +  if test -w $cache_file; then
 18.5893 +    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
 18.5894 +    cat confcache >$cache_file
 18.5895 +  else
 18.5896 +    echo "not updating unwritable cache $cache_file"
 18.5897 +  fi
 18.5898 +fi
 18.5899 +rm -f confcache
 18.5900 +
 18.5901 +test "x$prefix" = xNONE && prefix=$ac_default_prefix
 18.5902 +# Let make expand exec_prefix.
 18.5903 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 18.5904 +
 18.5905 +# VPATH may cause trouble with some makes, so we remove $(srcdir),
 18.5906 +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
 18.5907 +# trailing colons and then remove the whole line if VPATH becomes empty
 18.5908 +# (actually we leave an empty line to preserve line numbers).
 18.5909 +if test "x$srcdir" = x.; then
 18.5910 +  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
 18.5911 +s/:*\$(srcdir):*/:/;
 18.5912 +s/:*\${srcdir}:*/:/;
 18.5913 +s/:*@srcdir@:*/:/;
 18.5914 +s/^\([^=]*=[	 ]*\):*/\1/;
 18.5915 +s/:*$//;
 18.5916 +s/^[^=]*=[	 ]*$//;
 18.5917 +}'
 18.5918 +fi
 18.5919 +
 18.5920 +DEFS=-DHAVE_CONFIG_H
 18.5921 +
 18.5922 +ac_libobjs=
 18.5923 +ac_ltlibobjs=
 18.5924 +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
 18.5925 +  # 1. Remove the extension, and $U if already installed.
 18.5926 +  ac_i=`echo "$ac_i" |
 18.5927 +	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
 18.5928 +  # 2. Add them.
 18.5929 +  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
 18.5930 +  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
 18.5931 +done
 18.5932 +LIBOBJS=$ac_libobjs
 18.5933 +
 18.5934 +LTLIBOBJS=$ac_ltlibobjs
 18.5935 +
 18.5936 +
 18.5937 +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
 18.5938 +  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
 18.5939 +Usually this means the macro was only invoked conditionally." >&5
 18.5940 +echo "$as_me: error: conditional \"AMDEP\" was never defined.
 18.5941 +Usually this means the macro was only invoked conditionally." >&2;}
 18.5942 +   { (exit 1); exit 1; }; }
 18.5943 +fi
 18.5944 +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
 18.5945 +  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
 18.5946 +Usually this means the macro was only invoked conditionally." >&5
 18.5947 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 18.5948 +Usually this means the macro was only invoked conditionally." >&2;}
 18.5949 +   { (exit 1); exit 1; }; }
 18.5950 +fi
 18.5951 +
 18.5952 +: ${CONFIG_STATUS=./config.status}
 18.5953 +ac_clean_files_save=$ac_clean_files
 18.5954 +ac_clean_files="$ac_clean_files $CONFIG_STATUS"
 18.5955 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
 18.5956 +echo "$as_me: creating $CONFIG_STATUS" >&6;}
 18.5957 +cat >$CONFIG_STATUS <<_ACEOF
 18.5958 +#! $SHELL
 18.5959 +# Generated by $as_me.
 18.5960 +# Run this file to recreate the current configuration.
 18.5961 +# Compiler output produced by configure, useful for debugging
 18.5962 +# configure, is in config.log if it exists.
 18.5963 +
 18.5964 +debug=false
 18.5965 +ac_cs_recheck=false
 18.5966 +ac_cs_silent=false
 18.5967 +SHELL=\${CONFIG_SHELL-$SHELL}
 18.5968 +_ACEOF
 18.5969 +
 18.5970 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.5971 +## --------------------- ##
 18.5972 +## M4sh Initialization.  ##
 18.5973 +## --------------------- ##
 18.5974 +
 18.5975 +# Be Bourne compatible
 18.5976 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 18.5977 +  emulate sh
 18.5978 +  NULLCMD=:
 18.5979 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
 18.5980 +  # is contrary to our usage.  Disable this feature.
 18.5981 +  alias -g '${1+"$@"}'='"$@"'
 18.5982 +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
 18.5983 +  set -o posix
 18.5984 +fi
 18.5985 +DUALCASE=1; export DUALCASE # for MKS sh
 18.5986 +
 18.5987 +# Support unset when possible.
 18.5988 +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
 18.5989 +  as_unset=unset
 18.5990 +else
 18.5991 +  as_unset=false
 18.5992 +fi
 18.5993 +
 18.5994 +
 18.5995 +# Work around bugs in pre-3.0 UWIN ksh.
 18.5996 +$as_unset ENV MAIL MAILPATH
 18.5997 +PS1='$ '
 18.5998 +PS2='> '
 18.5999 +PS4='+ '
 18.6000 +
 18.6001 +# NLS nuisances.
 18.6002 +for as_var in \
 18.6003 +  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
 18.6004 +  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
 18.6005 +  LC_TELEPHONE LC_TIME
 18.6006 +do
 18.6007 +  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
 18.6008 +    eval $as_var=C; export $as_var
 18.6009 +  else
 18.6010 +    $as_unset $as_var
 18.6011 +  fi
 18.6012 +done
 18.6013 +
 18.6014 +# Required to use basename.
 18.6015 +if expr a : '\(a\)' >/dev/null 2>&1; then
 18.6016 +  as_expr=expr
 18.6017 +else
 18.6018 +  as_expr=false
 18.6019 +fi
 18.6020 +
 18.6021 +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
 18.6022 +  as_basename=basename
 18.6023 +else
 18.6024 +  as_basename=false
 18.6025 +fi
 18.6026 +
 18.6027 +
 18.6028 +# Name of the executable.
 18.6029 +as_me=`$as_basename "$0" ||
 18.6030 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 18.6031 +	 X"$0" : 'X\(//\)$' \| \
 18.6032 +	 X"$0" : 'X\(/\)$' \| \
 18.6033 +	 .     : '\(.\)' 2>/dev/null ||
 18.6034 +echo X/"$0" |
 18.6035 +    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
 18.6036 +  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
 18.6037 +  	  /^X\/\(\/\).*/{ s//\1/; q; }
 18.6038 +  	  s/.*/./; q'`
 18.6039 +
 18.6040 +
 18.6041 +# PATH needs CR, and LINENO needs CR and PATH.
 18.6042 +# Avoid depending upon Character Ranges.
 18.6043 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 18.6044 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 18.6045 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 18.6046 +as_cr_digits='0123456789'
 18.6047 +as_cr_alnum=$as_cr_Letters$as_cr_digits
 18.6048 +
 18.6049 +# The user is always right.
 18.6050 +if test "${PATH_SEPARATOR+set}" != set; then
 18.6051 +  echo "#! /bin/sh" >conf$$.sh
 18.6052 +  echo  "exit 0"   >>conf$$.sh
 18.6053 +  chmod +x conf$$.sh
 18.6054 +  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 18.6055 +    PATH_SEPARATOR=';'
 18.6056 +  else
 18.6057 +    PATH_SEPARATOR=:
 18.6058 +  fi
 18.6059 +  rm -f conf$$.sh
 18.6060 +fi
 18.6061 +
 18.6062 +
 18.6063 +  as_lineno_1=$LINENO
 18.6064 +  as_lineno_2=$LINENO
 18.6065 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
 18.6066 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
 18.6067 +  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
 18.6068 +  # Find who we are.  Look in the path if we contain no path at all
 18.6069 +  # relative or not.
 18.6070 +  case $0 in
 18.6071 +    *[\\/]* ) as_myself=$0 ;;
 18.6072 +    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.6073 +for as_dir in $PATH
 18.6074 +do
 18.6075 +  IFS=$as_save_IFS
 18.6076 +  test -z "$as_dir" && as_dir=.
 18.6077 +  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
 18.6078 +done
 18.6079 +
 18.6080 +       ;;
 18.6081 +  esac
 18.6082 +  # We did not find ourselves, most probably we were run as `sh COMMAND'
 18.6083 +  # in which case we are not to be found in the path.
 18.6084 +  if test "x$as_myself" = x; then
 18.6085 +    as_myself=$0
 18.6086 +  fi
 18.6087 +  if test ! -f "$as_myself"; then
 18.6088 +    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
 18.6089 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
 18.6090 +   { (exit 1); exit 1; }; }
 18.6091 +  fi
 18.6092 +  case $CONFIG_SHELL in
 18.6093 +  '')
 18.6094 +    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 18.6095 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 18.6096 +do
 18.6097 +  IFS=$as_save_IFS
 18.6098 +  test -z "$as_dir" && as_dir=.
 18.6099 +  for as_base in sh bash ksh sh5; do
 18.6100 +	 case $as_dir in
 18.6101 +	 /*)
 18.6102 +	   if ("$as_dir/$as_base" -c '
 18.6103 +  as_lineno_1=$LINENO
 18.6104 +  as_lineno_2=$LINENO
 18.6105 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
 18.6106 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
 18.6107 +  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
 18.6108 +	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
 18.6109 +	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
 18.6110 +	     CONFIG_SHELL=$as_dir/$as_base
 18.6111 +	     export CONFIG_SHELL
 18.6112 +	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
 18.6113 +	   fi;;
 18.6114 +	 esac
 18.6115 +       done
 18.6116 +done
 18.6117 +;;
 18.6118 +  esac
 18.6119 +
 18.6120 +  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
 18.6121 +  # uniformly replaced by the line number.  The first 'sed' inserts a
 18.6122 +  # line-number line before each line; the second 'sed' does the real
 18.6123 +  # work.  The second script uses 'N' to pair each line-number line
 18.6124 +  # with the numbered line, and appends trailing '-' during
 18.6125 +  # substitution so that $LINENO is not a special case at line end.
 18.6126 +  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
 18.6127 +  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
 18.6128 +  sed '=' <$as_myself |
 18.6129 +    sed '
 18.6130 +      N
 18.6131 +      s,$,-,
 18.6132 +      : loop
 18.6133 +      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
 18.6134 +      t loop
 18.6135 +      s,-$,,
 18.6136 +      s,^['$as_cr_digits']*\n,,
 18.6137 +    ' >$as_me.lineno &&
 18.6138 +  chmod +x $as_me.lineno ||
 18.6139 +    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
 18.6140 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
 18.6141 +   { (exit 1); exit 1; }; }
 18.6142 +
 18.6143 +  # Don't try to exec as it changes $[0], causing all sort of problems
 18.6144 +  # (the dirname of $[0] is not the place where we might find the
 18.6145 +  # original and so on.  Autoconf is especially sensible to this).
 18.6146 +  . ./$as_me.lineno
 18.6147 +  # Exit status is that of the last command.
 18.6148 +  exit
 18.6149 +}
 18.6150 +
 18.6151 +
 18.6152 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
 18.6153 +  *c*,-n*) ECHO_N= ECHO_C='
 18.6154 +' ECHO_T='	' ;;
 18.6155 +  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
 18.6156 +  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
 18.6157 +esac
 18.6158 +
 18.6159 +if expr a : '\(a\)' >/dev/null 2>&1; then
 18.6160 +  as_expr=expr
 18.6161 +else
 18.6162 +  as_expr=false
 18.6163 +fi
 18.6164 +
 18.6165 +rm -f conf$$ conf$$.exe conf$$.file
 18.6166 +echo >conf$$.file
 18.6167 +if ln -s conf$$.file conf$$ 2>/dev/null; then
 18.6168 +  # We could just check for DJGPP; but this test a) works b) is more generic
 18.6169 +  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
 18.6170 +  if test -f conf$$.exe; then
 18.6171 +    # Don't use ln at all; we don't have any links
 18.6172 +    as_ln_s='cp -p'
 18.6173 +  else
 18.6174 +    as_ln_s='ln -s'
 18.6175 +  fi
 18.6176 +elif ln conf$$.file conf$$ 2>/dev/null; then
 18.6177 +  as_ln_s=ln
 18.6178 +else
 18.6179 +  as_ln_s='cp -p'
 18.6180 +fi
 18.6181 +rm -f conf$$ conf$$.exe conf$$.file
 18.6182 +
 18.6183 +if mkdir -p . 2>/dev/null; then
 18.6184 +  as_mkdir_p=:
 18.6185 +else
 18.6186 +  test -d ./-p && rmdir ./-p
 18.6187 +  as_mkdir_p=false
 18.6188 +fi
 18.6189 +
 18.6190 +as_executable_p="test -f"
 18.6191 +
 18.6192 +# Sed expression to map a string onto a valid CPP name.
 18.6193 +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 18.6194 +
 18.6195 +# Sed expression to map a string onto a valid variable name.
 18.6196 +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 18.6197 +
 18.6198 +
 18.6199 +# IFS
 18.6200 +# We need space, tab and new line, in precisely that order.
 18.6201 +as_nl='
 18.6202 +'
 18.6203 +IFS=" 	$as_nl"
 18.6204 +
 18.6205 +# CDPATH.
 18.6206 +$as_unset CDPATH
 18.6207 +
 18.6208 +exec 6>&1
 18.6209 +
 18.6210 +# Open the log real soon, to keep \$[0] and so on meaningful, and to
 18.6211 +# report actual input values of CONFIG_FILES etc. instead of their
 18.6212 +# values after options handling.  Logging --version etc. is OK.
 18.6213 +exec 5>>config.log
 18.6214 +{
 18.6215 +  echo
 18.6216 +  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 18.6217 +## Running $as_me. ##
 18.6218 +_ASBOX
 18.6219 +} >&5
 18.6220 +cat >&5 <<_CSEOF
 18.6221 +
 18.6222 +This file was extended by masqmail $as_me 0.2.21, which was
 18.6223 +generated by GNU Autoconf 2.59.  Invocation command line was
 18.6224 +
 18.6225 +  CONFIG_FILES    = $CONFIG_FILES
 18.6226 +  CONFIG_HEADERS  = $CONFIG_HEADERS
 18.6227 +  CONFIG_LINKS    = $CONFIG_LINKS
 18.6228 +  CONFIG_COMMANDS = $CONFIG_COMMANDS
 18.6229 +  $ $0 $@
 18.6230 +
 18.6231 +_CSEOF
 18.6232 +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
 18.6233 +echo >&5
 18.6234 +_ACEOF
 18.6235 +
 18.6236 +# Files that config.status was made for.
 18.6237 +if test -n "$ac_config_files"; then
 18.6238 +  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
 18.6239 +fi
 18.6240 +
 18.6241 +if test -n "$ac_config_headers"; then
 18.6242 +  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
 18.6243 +fi
 18.6244 +
 18.6245 +if test -n "$ac_config_links"; then
 18.6246 +  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
 18.6247 +fi
 18.6248 +
 18.6249 +if test -n "$ac_config_commands"; then
 18.6250 +  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
 18.6251 +fi
 18.6252 +
 18.6253 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6254 +
 18.6255 +ac_cs_usage="\
 18.6256 +\`$as_me' instantiates files from templates according to the
 18.6257 +current configuration.
 18.6258 +
 18.6259 +Usage: $0 [OPTIONS] [FILE]...
 18.6260 +
 18.6261 +  -h, --help       print this help, then exit
 18.6262 +  -V, --version    print version number, then exit
 18.6263 +  -q, --quiet      do not print progress messages
 18.6264 +  -d, --debug      don't remove temporary files
 18.6265 +      --recheck    update $as_me by reconfiguring in the same conditions
 18.6266 +  --file=FILE[:TEMPLATE]
 18.6267 +		   instantiate the configuration file FILE
 18.6268 +  --header=FILE[:TEMPLATE]
 18.6269 +		   instantiate the configuration header FILE
 18.6270 +
 18.6271 +Configuration files:
 18.6272 +$config_files
 18.6273 +
 18.6274 +Configuration headers:
 18.6275 +$config_headers
 18.6276 +
 18.6277 +Configuration commands:
 18.6278 +$config_commands
 18.6279 +
 18.6280 +Report bugs to <bug-autoconf@gnu.org>."
 18.6281 +_ACEOF
 18.6282 +
 18.6283 +cat >>$CONFIG_STATUS <<_ACEOF
 18.6284 +ac_cs_version="\\
 18.6285 +masqmail config.status 0.2.21
 18.6286 +configured by $0, generated by GNU Autoconf 2.59,
 18.6287 +  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 18.6288 +
 18.6289 +Copyright (C) 2003 Free Software Foundation, Inc.
 18.6290 +This config.status script is free software; the Free Software Foundation
 18.6291 +gives unlimited permission to copy, distribute and modify it."
 18.6292 +srcdir=$srcdir
 18.6293 +INSTALL="$INSTALL"
 18.6294 +_ACEOF
 18.6295 +
 18.6296 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6297 +# If no file are specified by the user, then we need to provide default
 18.6298 +# value.  By we need to know if files were specified by the user.
 18.6299 +ac_need_defaults=:
 18.6300 +while test $# != 0
 18.6301 +do
 18.6302 +  case $1 in
 18.6303 +  --*=*)
 18.6304 +    ac_option=`expr "x$1" : 'x\([^=]*\)='`
 18.6305 +    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
 18.6306 +    ac_shift=:
 18.6307 +    ;;
 18.6308 +  -*)
 18.6309 +    ac_option=$1
 18.6310 +    ac_optarg=$2
 18.6311 +    ac_shift=shift
 18.6312 +    ;;
 18.6313 +  *) # This is not an option, so the user has probably given explicit
 18.6314 +     # arguments.
 18.6315 +     ac_option=$1
 18.6316 +     ac_need_defaults=false;;
 18.6317 +  esac
 18.6318 +
 18.6319 +  case $ac_option in
 18.6320 +  # Handling of the options.
 18.6321 +_ACEOF
 18.6322 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6323 +  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
 18.6324 +    ac_cs_recheck=: ;;
 18.6325 +  --version | --vers* | -V )
 18.6326 +    echo "$ac_cs_version"; exit 0 ;;
 18.6327 +  --he | --h)
 18.6328 +    # Conflict between --help and --header
 18.6329 +    { { echo "$as_me:$LINENO: error: ambiguous option: $1
 18.6330 +Try \`$0 --help' for more information." >&5
 18.6331 +echo "$as_me: error: ambiguous option: $1
 18.6332 +Try \`$0 --help' for more information." >&2;}
 18.6333 +   { (exit 1); exit 1; }; };;
 18.6334 +  --help | --hel | -h )
 18.6335 +    echo "$ac_cs_usage"; exit 0 ;;
 18.6336 +  --debug | --d* | -d )
 18.6337 +    debug=: ;;
 18.6338 +  --file | --fil | --fi | --f )
 18.6339 +    $ac_shift
 18.6340 +    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
 18.6341 +    ac_need_defaults=false;;
 18.6342 +  --header | --heade | --head | --hea )
 18.6343 +    $ac_shift
 18.6344 +    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
 18.6345 +    ac_need_defaults=false;;
 18.6346 +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
 18.6347 +  | -silent | --silent | --silen | --sile | --sil | --si | --s)
 18.6348 +    ac_cs_silent=: ;;
 18.6349 +
 18.6350 +  # This is an error.
 18.6351 +  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
 18.6352 +Try \`$0 --help' for more information." >&5
 18.6353 +echo "$as_me: error: unrecognized option: $1
 18.6354 +Try \`$0 --help' for more information." >&2;}
 18.6355 +   { (exit 1); exit 1; }; } ;;
 18.6356 +
 18.6357 +  *) ac_config_targets="$ac_config_targets $1" ;;
 18.6358 +
 18.6359 +  esac
 18.6360 +  shift
 18.6361 +done
 18.6362 +
 18.6363 +ac_configure_extra_args=
 18.6364 +
 18.6365 +if $ac_cs_silent; then
 18.6366 +  exec 6>/dev/null
 18.6367 +  ac_configure_extra_args="$ac_configure_extra_args --silent"
 18.6368 +fi
 18.6369 +
 18.6370 +_ACEOF
 18.6371 +cat >>$CONFIG_STATUS <<_ACEOF
 18.6372 +if \$ac_cs_recheck; then
 18.6373 +  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
 18.6374 +  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 18.6375 +fi
 18.6376 +
 18.6377 +_ACEOF
 18.6378 +
 18.6379 +cat >>$CONFIG_STATUS <<_ACEOF
 18.6380 +#
 18.6381 +# INIT-COMMANDS section.
 18.6382 +#
 18.6383 +
 18.6384 +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
 18.6385 +
 18.6386 +_ACEOF
 18.6387 +
 18.6388 +
 18.6389 +
 18.6390 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6391 +for ac_config_target in $ac_config_targets
 18.6392 +do
 18.6393 +  case "$ac_config_target" in
 18.6394 +  # Handling of arguments.
 18.6395 +  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 18.6396 +  "debian/Makefile" ) CONFIG_FILES="$CONFIG_FILES debian/Makefile" ;;
 18.6397 +  "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
 18.6398 +  "docs/man/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/man/Makefile" ;;
 18.6399 +  "docs/xml/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/xml/Makefile" ;;
 18.6400 +  "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
 18.6401 +  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
 18.6402 +  "src/base64/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/base64/Makefile" ;;
 18.6403 +  "src/md5/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/md5/Makefile" ;;
 18.6404 +  "src/libident/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libident/Makefile" ;;
 18.6405 +  "suse/masqmail.spec" ) CONFIG_FILES="$CONFIG_FILES suse/masqmail.spec" ;;
 18.6406 +  "redhat/masqmail.spec" ) CONFIG_FILES="$CONFIG_FILES redhat/masqmail.spec" ;;
 18.6407 +  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
 18.6408 +  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 18.6409 +  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 18.6410 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
 18.6411 +   { (exit 1); exit 1; }; };;
 18.6412 +  esac
 18.6413 +done
 18.6414 +
 18.6415 +# If the user did not use the arguments to specify the items to instantiate,
 18.6416 +# then the envvar interface is used.  Set only those that are not.
 18.6417 +# We use the long form for the default assignment because of an extremely
 18.6418 +# bizarre bug on SunOS 4.1.3.
 18.6419 +if $ac_need_defaults; then
 18.6420 +  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
 18.6421 +  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
 18.6422 +  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
 18.6423 +fi
 18.6424 +
 18.6425 +# Have a temporary directory for convenience.  Make it in the build tree
 18.6426 +# simply because there is no reason to put it here, and in addition,
 18.6427 +# creating and moving files from /tmp can sometimes cause problems.
 18.6428 +# Create a temporary directory, and hook for its removal unless debugging.
 18.6429 +$debug ||
 18.6430 +{
 18.6431 +  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
 18.6432 +  trap '{ (exit 1); exit 1; }' 1 2 13 15
 18.6433 +}
 18.6434 +
 18.6435 +# Create a (secure) tmp directory for tmp files.
 18.6436 +
 18.6437 +{
 18.6438 +  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
 18.6439 +  test -n "$tmp" && test -d "$tmp"
 18.6440 +}  ||
 18.6441 +{
 18.6442 +  tmp=./confstat$$-$RANDOM
 18.6443 +  (umask 077 && mkdir $tmp)
 18.6444 +} ||
 18.6445 +{
 18.6446 +   echo "$me: cannot create a temporary directory in ." >&2
 18.6447 +   { (exit 1); exit 1; }
 18.6448 +}
 18.6449 +
 18.6450 +_ACEOF
 18.6451 +
 18.6452 +cat >>$CONFIG_STATUS <<_ACEOF
 18.6453 +
 18.6454 +#
 18.6455 +# CONFIG_FILES section.
 18.6456 +#
 18.6457 +
 18.6458 +# No need to generate the scripts if there are no CONFIG_FILES.
 18.6459 +# This happens for instance when ./config.status config.h
 18.6460 +if test -n "\$CONFIG_FILES"; then
 18.6461 +  # Protect against being on the right side of a sed subst in config.status.
 18.6462 +  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
 18.6463 +   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
 18.6464 +s,@SHELL@,$SHELL,;t t
 18.6465 +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
 18.6466 +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
 18.6467 +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
 18.6468 +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
 18.6469 +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
 18.6470 +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
 18.6471 +s,@exec_prefix@,$exec_prefix,;t t
 18.6472 +s,@prefix@,$prefix,;t t
 18.6473 +s,@program_transform_name@,$program_transform_name,;t t
 18.6474 +s,@bindir@,$bindir,;t t
 18.6475 +s,@sbindir@,$sbindir,;t t
 18.6476 +s,@libexecdir@,$libexecdir,;t t
 18.6477 +s,@datadir@,$datadir,;t t
 18.6478 +s,@sysconfdir@,$sysconfdir,;t t
 18.6479 +s,@sharedstatedir@,$sharedstatedir,;t t
 18.6480 +s,@localstatedir@,$localstatedir,;t t
 18.6481 +s,@libdir@,$libdir,;t t
 18.6482 +s,@includedir@,$includedir,;t t
 18.6483 +s,@oldincludedir@,$oldincludedir,;t t
 18.6484 +s,@infodir@,$infodir,;t t
 18.6485 +s,@mandir@,$mandir,;t t
 18.6486 +s,@build_alias@,$build_alias,;t t
 18.6487 +s,@host_alias@,$host_alias,;t t
 18.6488 +s,@target_alias@,$target_alias,;t t
 18.6489 +s,@DEFS@,$DEFS,;t t
 18.6490 +s,@ECHO_C@,$ECHO_C,;t t
 18.6491 +s,@ECHO_N@,$ECHO_N,;t t
 18.6492 +s,@ECHO_T@,$ECHO_T,;t t
 18.6493 +s,@LIBS@,$LIBS,;t t
 18.6494 +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
 18.6495 +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
 18.6496 +s,@INSTALL_DATA@,$INSTALL_DATA,;t t
 18.6497 +s,@CYGPATH_W@,$CYGPATH_W,;t t
 18.6498 +s,@PACKAGE@,$PACKAGE,;t t
 18.6499 +s,@VERSION@,$VERSION,;t t
 18.6500 +s,@ACLOCAL@,$ACLOCAL,;t t
 18.6501 +s,@AUTOCONF@,$AUTOCONF,;t t
 18.6502 +s,@AUTOMAKE@,$AUTOMAKE,;t t
 18.6503 +s,@AUTOHEADER@,$AUTOHEADER,;t t
 18.6504 +s,@MAKEINFO@,$MAKEINFO,;t t
 18.6505 +s,@AMTAR@,$AMTAR,;t t
 18.6506 +s,@install_sh@,$install_sh,;t t
 18.6507 +s,@STRIP@,$STRIP,;t t
 18.6508 +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
 18.6509 +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
 18.6510 +s,@AWK@,$AWK,;t t
 18.6511 +s,@SET_MAKE@,$SET_MAKE,;t t
 18.6512 +s,@am__leading_dot@,$am__leading_dot,;t t
 18.6513 +s,@CC@,$CC,;t t
 18.6514 +s,@CFLAGS@,$CFLAGS,;t t
 18.6515 +s,@LDFLAGS@,$LDFLAGS,;t t
 18.6516 +s,@CPPFLAGS@,$CPPFLAGS,;t t
 18.6517 +s,@ac_ct_CC@,$ac_ct_CC,;t t
 18.6518 +s,@EXEEXT@,$EXEEXT,;t t
 18.6519 +s,@OBJEXT@,$OBJEXT,;t t
 18.6520 +s,@DEPDIR@,$DEPDIR,;t t
 18.6521 +s,@am__include@,$am__include,;t t
 18.6522 +s,@am__quote@,$am__quote,;t t
 18.6523 +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
 18.6524 +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
 18.6525 +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
 18.6526 +s,@CCDEPMODE@,$CCDEPMODE,;t t
 18.6527 +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
 18.6528 +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
 18.6529 +s,@CPP@,$CPP,;t t
 18.6530 +s,@EGREP@,$EGREP,;t t
 18.6531 +s,@RANLIB@,$RANLIB,;t t
 18.6532 +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
 18.6533 +s,@PKG_CONFIG@,$PKG_CONFIG,;t t
 18.6534 +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
 18.6535 +s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t
 18.6536 +s,@GLIB_LIBS@,$GLIB_LIBS,;t t
 18.6537 +s,@RESOLV_LIBS@,$RESOLV_LIBS,;t t
 18.6538 +s,@with_user@,$with_user,;t t
 18.6539 +s,@with_group@,$with_group,;t t
 18.6540 +s,@BASE64_LIBS@,$BASE64_LIBS,;t t
 18.6541 +s,@MD5_LIBS@,$MD5_LIBS,;t t
 18.6542 +s,@has_ident@,$has_ident,;t t
 18.6543 +s,@IDENT_LIBS@,$IDENT_LIBS,;t t
 18.6544 +s,@LOCKFILE_LIBS@,$LOCKFILE_LIBS,;t t
 18.6545 +s,@USE_LIBLOCKFILE@,$USE_LIBLOCKFILE,;t t
 18.6546 +s,@with_logdir@,$with_logdir,;t t
 18.6547 +s,@with_spooldir@,$with_spooldir,;t t
 18.6548 +s,@with_confdir@,$with_confdir,;t t
 18.6549 +s,@LIBOBJS@,$LIBOBJS,;t t
 18.6550 +s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 18.6551 +CEOF
 18.6552 +
 18.6553 +_ACEOF
 18.6554 +
 18.6555 +  cat >>$CONFIG_STATUS <<\_ACEOF
 18.6556 +  # Split the substitutions into bite-sized pieces for seds with
 18.6557 +  # small command number limits, like on Digital OSF/1 and HP-UX.
 18.6558 +  ac_max_sed_lines=48
 18.6559 +  ac_sed_frag=1 # Number of current file.
 18.6560 +  ac_beg=1 # First line for current file.
 18.6561 +  ac_end=$ac_max_sed_lines # Line after last line for current file.
 18.6562 +  ac_more_lines=:
 18.6563 +  ac_sed_cmds=
 18.6564 +  while $ac_more_lines; do
 18.6565 +    if test $ac_beg -gt 1; then
 18.6566 +      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
 18.6567 +    else
 18.6568 +      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
 18.6569 +    fi
 18.6570 +    if test ! -s $tmp/subs.frag; then
 18.6571 +      ac_more_lines=false
 18.6572 +    else
 18.6573 +      # The purpose of the label and of the branching condition is to
 18.6574 +      # speed up the sed processing (if there are no `@' at all, there
 18.6575 +      # is no need to browse any of the substitutions).
 18.6576 +      # These are the two extra sed commands mentioned above.
 18.6577 +      (echo ':t
 18.6578 +  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
 18.6579 +      if test -z "$ac_sed_cmds"; then
 18.6580 +	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
 18.6581 +      else
 18.6582 +	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
 18.6583 +      fi
 18.6584 +      ac_sed_frag=`expr $ac_sed_frag + 1`
 18.6585 +      ac_beg=$ac_end
 18.6586 +      ac_end=`expr $ac_end + $ac_max_sed_lines`
 18.6587 +    fi
 18.6588 +  done
 18.6589 +  if test -z "$ac_sed_cmds"; then
 18.6590 +    ac_sed_cmds=cat
 18.6591 +  fi
 18.6592 +fi # test -n "$CONFIG_FILES"
 18.6593 +
 18.6594 +_ACEOF
 18.6595 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6596 +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
 18.6597 +  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
 18.6598 +  case $ac_file in
 18.6599 +  - | *:- | *:-:* ) # input from stdin
 18.6600 +	cat >$tmp/stdin
 18.6601 +	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
 18.6602 +	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
 18.6603 +  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
 18.6604 +	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
 18.6605 +  * )   ac_file_in=$ac_file.in ;;
 18.6606 +  esac
 18.6607 +
 18.6608 +  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
 18.6609 +  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 18.6610 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.6611 +	 X"$ac_file" : 'X\(//\)[^/]' \| \
 18.6612 +	 X"$ac_file" : 'X\(//\)$' \| \
 18.6613 +	 X"$ac_file" : 'X\(/\)' \| \
 18.6614 +	 .     : '\(.\)' 2>/dev/null ||
 18.6615 +echo X"$ac_file" |
 18.6616 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.6617 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.6618 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.6619 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.6620 +  	  s/.*/./; q'`
 18.6621 +  { if $as_mkdir_p; then
 18.6622 +    mkdir -p "$ac_dir"
 18.6623 +  else
 18.6624 +    as_dir="$ac_dir"
 18.6625 +    as_dirs=
 18.6626 +    while test ! -d "$as_dir"; do
 18.6627 +      as_dirs="$as_dir $as_dirs"
 18.6628 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
 18.6629 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.6630 +	 X"$as_dir" : 'X\(//\)[^/]' \| \
 18.6631 +	 X"$as_dir" : 'X\(//\)$' \| \
 18.6632 +	 X"$as_dir" : 'X\(/\)' \| \
 18.6633 +	 .     : '\(.\)' 2>/dev/null ||
 18.6634 +echo X"$as_dir" |
 18.6635 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.6636 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.6637 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.6638 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.6639 +  	  s/.*/./; q'`
 18.6640 +    done
 18.6641 +    test ! -n "$as_dirs" || mkdir $as_dirs
 18.6642 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
 18.6643 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
 18.6644 +   { (exit 1); exit 1; }; }; }
 18.6645 +
 18.6646 +  ac_builddir=.
 18.6647 +
 18.6648 +if test "$ac_dir" != .; then
 18.6649 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
 18.6650 +  # A "../" for each directory in $ac_dir_suffix.
 18.6651 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
 18.6652 +else
 18.6653 +  ac_dir_suffix= ac_top_builddir=
 18.6654 +fi
 18.6655 +
 18.6656 +case $srcdir in
 18.6657 +  .)  # No --srcdir option.  We are building in place.
 18.6658 +    ac_srcdir=.
 18.6659 +    if test -z "$ac_top_builddir"; then
 18.6660 +       ac_top_srcdir=.
 18.6661 +    else
 18.6662 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
 18.6663 +    fi ;;
 18.6664 +  [\\/]* | ?:[\\/]* )  # Absolute path.
 18.6665 +    ac_srcdir=$srcdir$ac_dir_suffix;
 18.6666 +    ac_top_srcdir=$srcdir ;;
 18.6667 +  *) # Relative path.
 18.6668 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
 18.6669 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
 18.6670 +esac
 18.6671 +
 18.6672 +# Do not use `cd foo && pwd` to compute absolute paths, because
 18.6673 +# the directories may not exist.
 18.6674 +case `pwd` in
 18.6675 +.) ac_abs_builddir="$ac_dir";;
 18.6676 +*)
 18.6677 +  case "$ac_dir" in
 18.6678 +  .) ac_abs_builddir=`pwd`;;
 18.6679 +  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
 18.6680 +  *) ac_abs_builddir=`pwd`/"$ac_dir";;
 18.6681 +  esac;;
 18.6682 +esac
 18.6683 +case $ac_abs_builddir in
 18.6684 +.) ac_abs_top_builddir=${ac_top_builddir}.;;
 18.6685 +*)
 18.6686 +  case ${ac_top_builddir}. in
 18.6687 +  .) ac_abs_top_builddir=$ac_abs_builddir;;
 18.6688 +  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
 18.6689 +  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
 18.6690 +  esac;;
 18.6691 +esac
 18.6692 +case $ac_abs_builddir in
 18.6693 +.) ac_abs_srcdir=$ac_srcdir;;
 18.6694 +*)
 18.6695 +  case $ac_srcdir in
 18.6696 +  .) ac_abs_srcdir=$ac_abs_builddir;;
 18.6697 +  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
 18.6698 +  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
 18.6699 +  esac;;
 18.6700 +esac
 18.6701 +case $ac_abs_builddir in
 18.6702 +.) ac_abs_top_srcdir=$ac_top_srcdir;;
 18.6703 +*)
 18.6704 +  case $ac_top_srcdir in
 18.6705 +  .) ac_abs_top_srcdir=$ac_abs_builddir;;
 18.6706 +  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
 18.6707 +  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
 18.6708 +  esac;;
 18.6709 +esac
 18.6710 +
 18.6711 +
 18.6712 +  case $INSTALL in
 18.6713 +  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
 18.6714 +  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
 18.6715 +  esac
 18.6716 +
 18.6717 +  # Let's still pretend it is `configure' which instantiates (i.e., don't
 18.6718 +  # use $as_me), people would be surprised to read:
 18.6719 +  #    /* config.h.  Generated by config.status.  */
 18.6720 +  if test x"$ac_file" = x-; then
 18.6721 +    configure_input=
 18.6722 +  else
 18.6723 +    configure_input="$ac_file.  "
 18.6724 +  fi
 18.6725 +  configure_input=$configure_input"Generated from `echo $ac_file_in |
 18.6726 +				     sed 's,.*/,,'` by configure."
 18.6727 +
 18.6728 +  # First look for the input files in the build tree, otherwise in the
 18.6729 +  # src tree.
 18.6730 +  ac_file_inputs=`IFS=:
 18.6731 +    for f in $ac_file_in; do
 18.6732 +      case $f in
 18.6733 +      -) echo $tmp/stdin ;;
 18.6734 +      [\\/$]*)
 18.6735 +	 # Absolute (can't be DOS-style, as IFS=:)
 18.6736 +	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 18.6737 +echo "$as_me: error: cannot find input file: $f" >&2;}
 18.6738 +   { (exit 1); exit 1; }; }
 18.6739 +	 echo "$f";;
 18.6740 +      *) # Relative
 18.6741 +	 if test -f "$f"; then
 18.6742 +	   # Build tree
 18.6743 +	   echo "$f"
 18.6744 +	 elif test -f "$srcdir/$f"; then
 18.6745 +	   # Source tree
 18.6746 +	   echo "$srcdir/$f"
 18.6747 +	 else
 18.6748 +	   # /dev/null tree
 18.6749 +	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 18.6750 +echo "$as_me: error: cannot find input file: $f" >&2;}
 18.6751 +   { (exit 1); exit 1; }; }
 18.6752 +	 fi;;
 18.6753 +      esac
 18.6754 +    done` || { (exit 1); exit 1; }
 18.6755 +
 18.6756 +  if test x"$ac_file" != x-; then
 18.6757 +    { echo "$as_me:$LINENO: creating $ac_file" >&5
 18.6758 +echo "$as_me: creating $ac_file" >&6;}
 18.6759 +    rm -f "$ac_file"
 18.6760 +  fi
 18.6761 +_ACEOF
 18.6762 +cat >>$CONFIG_STATUS <<_ACEOF
 18.6763 +  sed "$ac_vpsub
 18.6764 +$extrasub
 18.6765 +_ACEOF
 18.6766 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6767 +:t
 18.6768 +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 18.6769 +s,@configure_input@,$configure_input,;t t
 18.6770 +s,@srcdir@,$ac_srcdir,;t t
 18.6771 +s,@abs_srcdir@,$ac_abs_srcdir,;t t
 18.6772 +s,@top_srcdir@,$ac_top_srcdir,;t t
 18.6773 +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
 18.6774 +s,@builddir@,$ac_builddir,;t t
 18.6775 +s,@abs_builddir@,$ac_abs_builddir,;t t
 18.6776 +s,@top_builddir@,$ac_top_builddir,;t t
 18.6777 +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
 18.6778 +s,@INSTALL@,$ac_INSTALL,;t t
 18.6779 +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
 18.6780 +  rm -f $tmp/stdin
 18.6781 +  if test x"$ac_file" != x-; then
 18.6782 +    mv $tmp/out $ac_file
 18.6783 +  else
 18.6784 +    cat $tmp/out
 18.6785 +    rm -f $tmp/out
 18.6786 +  fi
 18.6787 +
 18.6788 +done
 18.6789 +_ACEOF
 18.6790 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6791 +
 18.6792 +#
 18.6793 +# CONFIG_HEADER section.
 18.6794 +#
 18.6795 +
 18.6796 +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
 18.6797 +# NAME is the cpp macro being defined and VALUE is the value it is being given.
 18.6798 +#
 18.6799 +# ac_d sets the value in "#define NAME VALUE" lines.
 18.6800 +ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
 18.6801 +ac_dB='[	 ].*$,\1#\2'
 18.6802 +ac_dC=' '
 18.6803 +ac_dD=',;t'
 18.6804 +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
 18.6805 +ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
 18.6806 +ac_uB='$,\1#\2define\3'
 18.6807 +ac_uC=' '
 18.6808 +ac_uD=',;t'
 18.6809 +
 18.6810 +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
 18.6811 +  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
 18.6812 +  case $ac_file in
 18.6813 +  - | *:- | *:-:* ) # input from stdin
 18.6814 +	cat >$tmp/stdin
 18.6815 +	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
 18.6816 +	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
 18.6817 +  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
 18.6818 +	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
 18.6819 +  * )   ac_file_in=$ac_file.in ;;
 18.6820 +  esac
 18.6821 +
 18.6822 +  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
 18.6823 +echo "$as_me: creating $ac_file" >&6;}
 18.6824 +
 18.6825 +  # First look for the input files in the build tree, otherwise in the
 18.6826 +  # src tree.
 18.6827 +  ac_file_inputs=`IFS=:
 18.6828 +    for f in $ac_file_in; do
 18.6829 +      case $f in
 18.6830 +      -) echo $tmp/stdin ;;
 18.6831 +      [\\/$]*)
 18.6832 +	 # Absolute (can't be DOS-style, as IFS=:)
 18.6833 +	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 18.6834 +echo "$as_me: error: cannot find input file: $f" >&2;}
 18.6835 +   { (exit 1); exit 1; }; }
 18.6836 +	 # Do quote $f, to prevent DOS paths from being IFS'd.
 18.6837 +	 echo "$f";;
 18.6838 +      *) # Relative
 18.6839 +	 if test -f "$f"; then
 18.6840 +	   # Build tree
 18.6841 +	   echo "$f"
 18.6842 +	 elif test -f "$srcdir/$f"; then
 18.6843 +	   # Source tree
 18.6844 +	   echo "$srcdir/$f"
 18.6845 +	 else
 18.6846 +	   # /dev/null tree
 18.6847 +	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 18.6848 +echo "$as_me: error: cannot find input file: $f" >&2;}
 18.6849 +   { (exit 1); exit 1; }; }
 18.6850 +	 fi;;
 18.6851 +      esac
 18.6852 +    done` || { (exit 1); exit 1; }
 18.6853 +  # Remove the trailing spaces.
 18.6854 +  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
 18.6855 +
 18.6856 +_ACEOF
 18.6857 +
 18.6858 +# Transform confdefs.h into two sed scripts, `conftest.defines' and
 18.6859 +# `conftest.undefs', that substitutes the proper values into
 18.6860 +# config.h.in to produce config.h.  The first handles `#define'
 18.6861 +# templates, and the second `#undef' templates.
 18.6862 +# And first: Protect against being on the right side of a sed subst in
 18.6863 +# config.status.  Protect against being in an unquoted here document
 18.6864 +# in config.status.
 18.6865 +rm -f conftest.defines conftest.undefs
 18.6866 +# Using a here document instead of a string reduces the quoting nightmare.
 18.6867 +# Putting comments in sed scripts is not portable.
 18.6868 +#
 18.6869 +# `end' is used to avoid that the second main sed command (meant for
 18.6870 +# 0-ary CPP macros) applies to n-ary macro definitions.
 18.6871 +# See the Autoconf documentation for `clear'.
 18.6872 +cat >confdef2sed.sed <<\_ACEOF
 18.6873 +s/[\\&,]/\\&/g
 18.6874 +s,[\\$`],\\&,g
 18.6875 +t clear
 18.6876 +: clear
 18.6877 +s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
 18.6878 +t end
 18.6879 +s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
 18.6880 +: end
 18.6881 +_ACEOF
 18.6882 +# If some macros were called several times there might be several times
 18.6883 +# the same #defines, which is useless.  Nevertheless, we may not want to
 18.6884 +# sort them, since we want the *last* AC-DEFINE to be honored.
 18.6885 +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
 18.6886 +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
 18.6887 +rm -f confdef2sed.sed
 18.6888 +
 18.6889 +# This sed command replaces #undef with comments.  This is necessary, for
 18.6890 +# example, in the case of _POSIX_SOURCE, which is predefined and required
 18.6891 +# on some systems where configure will not decide to define it.
 18.6892 +cat >>conftest.undefs <<\_ACEOF
 18.6893 +s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
 18.6894 +_ACEOF
 18.6895 +
 18.6896 +# Break up conftest.defines because some shells have a limit on the size
 18.6897 +# of here documents, and old seds have small limits too (100 cmds).
 18.6898 +echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
 18.6899 +echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
 18.6900 +echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
 18.6901 +echo '  :' >>$CONFIG_STATUS
 18.6902 +rm -f conftest.tail
 18.6903 +while grep . conftest.defines >/dev/null
 18.6904 +do
 18.6905 +  # Write a limited-size here document to $tmp/defines.sed.
 18.6906 +  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
 18.6907 +  # Speed up: don't consider the non `#define' lines.
 18.6908 +  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
 18.6909 +  # Work around the forget-to-reset-the-flag bug.
 18.6910 +  echo 't clr' >>$CONFIG_STATUS
 18.6911 +  echo ': clr' >>$CONFIG_STATUS
 18.6912 +  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
 18.6913 +  echo 'CEOF
 18.6914 +  sed -f $tmp/defines.sed $tmp/in >$tmp/out
 18.6915 +  rm -f $tmp/in
 18.6916 +  mv $tmp/out $tmp/in
 18.6917 +' >>$CONFIG_STATUS
 18.6918 +  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
 18.6919 +  rm -f conftest.defines
 18.6920 +  mv conftest.tail conftest.defines
 18.6921 +done
 18.6922 +rm -f conftest.defines
 18.6923 +echo '  fi # grep' >>$CONFIG_STATUS
 18.6924 +echo >>$CONFIG_STATUS
 18.6925 +
 18.6926 +# Break up conftest.undefs because some shells have a limit on the size
 18.6927 +# of here documents, and old seds have small limits too (100 cmds).
 18.6928 +echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
 18.6929 +rm -f conftest.tail
 18.6930 +while grep . conftest.undefs >/dev/null
 18.6931 +do
 18.6932 +  # Write a limited-size here document to $tmp/undefs.sed.
 18.6933 +  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
 18.6934 +  # Speed up: don't consider the non `#undef'
 18.6935 +  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
 18.6936 +  # Work around the forget-to-reset-the-flag bug.
 18.6937 +  echo 't clr' >>$CONFIG_STATUS
 18.6938 +  echo ': clr' >>$CONFIG_STATUS
 18.6939 +  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
 18.6940 +  echo 'CEOF
 18.6941 +  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
 18.6942 +  rm -f $tmp/in
 18.6943 +  mv $tmp/out $tmp/in
 18.6944 +' >>$CONFIG_STATUS
 18.6945 +  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
 18.6946 +  rm -f conftest.undefs
 18.6947 +  mv conftest.tail conftest.undefs
 18.6948 +done
 18.6949 +rm -f conftest.undefs
 18.6950 +
 18.6951 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.6952 +  # Let's still pretend it is `configure' which instantiates (i.e., don't
 18.6953 +  # use $as_me), people would be surprised to read:
 18.6954 +  #    /* config.h.  Generated by config.status.  */
 18.6955 +  if test x"$ac_file" = x-; then
 18.6956 +    echo "/* Generated by configure.  */" >$tmp/config.h
 18.6957 +  else
 18.6958 +    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
 18.6959 +  fi
 18.6960 +  cat $tmp/in >>$tmp/config.h
 18.6961 +  rm -f $tmp/in
 18.6962 +  if test x"$ac_file" != x-; then
 18.6963 +    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
 18.6964 +      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 18.6965 +echo "$as_me: $ac_file is unchanged" >&6;}
 18.6966 +    else
 18.6967 +      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 18.6968 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.6969 +	 X"$ac_file" : 'X\(//\)[^/]' \| \
 18.6970 +	 X"$ac_file" : 'X\(//\)$' \| \
 18.6971 +	 X"$ac_file" : 'X\(/\)' \| \
 18.6972 +	 .     : '\(.\)' 2>/dev/null ||
 18.6973 +echo X"$ac_file" |
 18.6974 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.6975 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.6976 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.6977 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.6978 +  	  s/.*/./; q'`
 18.6979 +      { if $as_mkdir_p; then
 18.6980 +    mkdir -p "$ac_dir"
 18.6981 +  else
 18.6982 +    as_dir="$ac_dir"
 18.6983 +    as_dirs=
 18.6984 +    while test ! -d "$as_dir"; do
 18.6985 +      as_dirs="$as_dir $as_dirs"
 18.6986 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
 18.6987 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.6988 +	 X"$as_dir" : 'X\(//\)[^/]' \| \
 18.6989 +	 X"$as_dir" : 'X\(//\)$' \| \
 18.6990 +	 X"$as_dir" : 'X\(/\)' \| \
 18.6991 +	 .     : '\(.\)' 2>/dev/null ||
 18.6992 +echo X"$as_dir" |
 18.6993 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.6994 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.6995 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.6996 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.6997 +  	  s/.*/./; q'`
 18.6998 +    done
 18.6999 +    test ! -n "$as_dirs" || mkdir $as_dirs
 18.7000 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
 18.7001 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
 18.7002 +   { (exit 1); exit 1; }; }; }
 18.7003 +
 18.7004 +      rm -f $ac_file
 18.7005 +      mv $tmp/config.h $ac_file
 18.7006 +    fi
 18.7007 +  else
 18.7008 +    cat $tmp/config.h
 18.7009 +    rm -f $tmp/config.h
 18.7010 +  fi
 18.7011 +# Compute $ac_file's index in $config_headers.
 18.7012 +_am_stamp_count=1
 18.7013 +for _am_header in $config_headers :; do
 18.7014 +  case $_am_header in
 18.7015 +    $ac_file | $ac_file:* )
 18.7016 +      break ;;
 18.7017 +    * )
 18.7018 +      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
 18.7019 +  esac
 18.7020 +done
 18.7021 +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
 18.7022 +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.7023 +	 X$ac_file : 'X\(//\)[^/]' \| \
 18.7024 +	 X$ac_file : 'X\(//\)$' \| \
 18.7025 +	 X$ac_file : 'X\(/\)' \| \
 18.7026 +	 .     : '\(.\)' 2>/dev/null ||
 18.7027 +echo X$ac_file |
 18.7028 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.7029 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.7030 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.7031 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.7032 +  	  s/.*/./; q'`/stamp-h$_am_stamp_count
 18.7033 +done
 18.7034 +_ACEOF
 18.7035 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.7036 +
 18.7037 +#
 18.7038 +# CONFIG_COMMANDS section.
 18.7039 +#
 18.7040 +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
 18.7041 +  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
 18.7042 +  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
 18.7043 +  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
 18.7044 +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.7045 +	 X"$ac_dest" : 'X\(//\)[^/]' \| \
 18.7046 +	 X"$ac_dest" : 'X\(//\)$' \| \
 18.7047 +	 X"$ac_dest" : 'X\(/\)' \| \
 18.7048 +	 .     : '\(.\)' 2>/dev/null ||
 18.7049 +echo X"$ac_dest" |
 18.7050 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.7051 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.7052 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.7053 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.7054 +  	  s/.*/./; q'`
 18.7055 +  { if $as_mkdir_p; then
 18.7056 +    mkdir -p "$ac_dir"
 18.7057 +  else
 18.7058 +    as_dir="$ac_dir"
 18.7059 +    as_dirs=
 18.7060 +    while test ! -d "$as_dir"; do
 18.7061 +      as_dirs="$as_dir $as_dirs"
 18.7062 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
 18.7063 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.7064 +	 X"$as_dir" : 'X\(//\)[^/]' \| \
 18.7065 +	 X"$as_dir" : 'X\(//\)$' \| \
 18.7066 +	 X"$as_dir" : 'X\(/\)' \| \
 18.7067 +	 .     : '\(.\)' 2>/dev/null ||
 18.7068 +echo X"$as_dir" |
 18.7069 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.7070 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.7071 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.7072 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.7073 +  	  s/.*/./; q'`
 18.7074 +    done
 18.7075 +    test ! -n "$as_dirs" || mkdir $as_dirs
 18.7076 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
 18.7077 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
 18.7078 +   { (exit 1); exit 1; }; }; }
 18.7079 +
 18.7080 +  ac_builddir=.
 18.7081 +
 18.7082 +if test "$ac_dir" != .; then
 18.7083 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
 18.7084 +  # A "../" for each directory in $ac_dir_suffix.
 18.7085 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
 18.7086 +else
 18.7087 +  ac_dir_suffix= ac_top_builddir=
 18.7088 +fi
 18.7089 +
 18.7090 +case $srcdir in
 18.7091 +  .)  # No --srcdir option.  We are building in place.
 18.7092 +    ac_srcdir=.
 18.7093 +    if test -z "$ac_top_builddir"; then
 18.7094 +       ac_top_srcdir=.
 18.7095 +    else
 18.7096 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
 18.7097 +    fi ;;
 18.7098 +  [\\/]* | ?:[\\/]* )  # Absolute path.
 18.7099 +    ac_srcdir=$srcdir$ac_dir_suffix;
 18.7100 +    ac_top_srcdir=$srcdir ;;
 18.7101 +  *) # Relative path.
 18.7102 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
 18.7103 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
 18.7104 +esac
 18.7105 +
 18.7106 +# Do not use `cd foo && pwd` to compute absolute paths, because
 18.7107 +# the directories may not exist.
 18.7108 +case `pwd` in
 18.7109 +.) ac_abs_builddir="$ac_dir";;
 18.7110 +*)
 18.7111 +  case "$ac_dir" in
 18.7112 +  .) ac_abs_builddir=`pwd`;;
 18.7113 +  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
 18.7114 +  *) ac_abs_builddir=`pwd`/"$ac_dir";;
 18.7115 +  esac;;
 18.7116 +esac
 18.7117 +case $ac_abs_builddir in
 18.7118 +.) ac_abs_top_builddir=${ac_top_builddir}.;;
 18.7119 +*)
 18.7120 +  case ${ac_top_builddir}. in
 18.7121 +  .) ac_abs_top_builddir=$ac_abs_builddir;;
 18.7122 +  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
 18.7123 +  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
 18.7124 +  esac;;
 18.7125 +esac
 18.7126 +case $ac_abs_builddir in
 18.7127 +.) ac_abs_srcdir=$ac_srcdir;;
 18.7128 +*)
 18.7129 +  case $ac_srcdir in
 18.7130 +  .) ac_abs_srcdir=$ac_abs_builddir;;
 18.7131 +  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
 18.7132 +  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
 18.7133 +  esac;;
 18.7134 +esac
 18.7135 +case $ac_abs_builddir in
 18.7136 +.) ac_abs_top_srcdir=$ac_top_srcdir;;
 18.7137 +*)
 18.7138 +  case $ac_top_srcdir in
 18.7139 +  .) ac_abs_top_srcdir=$ac_abs_builddir;;
 18.7140 +  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
 18.7141 +  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
 18.7142 +  esac;;
 18.7143 +esac
 18.7144 +
 18.7145 +
 18.7146 +  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
 18.7147 +echo "$as_me: executing $ac_dest commands" >&6;}
 18.7148 +  case $ac_dest in
 18.7149 +    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
 18.7150 +  # Strip MF so we end up with the name of the file.
 18.7151 +  mf=`echo "$mf" | sed -e 's/:.*$//'`
 18.7152 +  # Check whether this is an Automake generated Makefile or not.
 18.7153 +  # We used to match only the files named `Makefile.in', but
 18.7154 +  # some people rename them; so instead we look at the file content.
 18.7155 +  # Grep'ing the first line is not enough: some people post-process
 18.7156 +  # each Makefile.in and add a new line on top of each file to say so.
 18.7157 +  # So let's grep whole file.
 18.7158 +  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
 18.7159 +    dirpart=`(dirname "$mf") 2>/dev/null ||
 18.7160 +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.7161 +	 X"$mf" : 'X\(//\)[^/]' \| \
 18.7162 +	 X"$mf" : 'X\(//\)$' \| \
 18.7163 +	 X"$mf" : 'X\(/\)' \| \
 18.7164 +	 .     : '\(.\)' 2>/dev/null ||
 18.7165 +echo X"$mf" |
 18.7166 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.7167 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.7168 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.7169 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.7170 +  	  s/.*/./; q'`
 18.7171 +  else
 18.7172 +    continue
 18.7173 +  fi
 18.7174 +  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
 18.7175 +  # Extract the definition of DEP_FILES from the Makefile without
 18.7176 +  # running `make'.
 18.7177 +  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
 18.7178 +  test -z "$DEPDIR" && continue
 18.7179 +  # When using ansi2knr, U may be empty or an underscore; expand it
 18.7180 +  U=`sed -n -e '/^U = / s///p' < "$mf"`
 18.7181 +  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
 18.7182 +  # We invoke sed twice because it is the simplest approach to
 18.7183 +  # changing $(DEPDIR) to its actual value in the expansion.
 18.7184 +  for file in `sed -n -e '
 18.7185 +    /^DEP_FILES = .*\\\\$/ {
 18.7186 +      s/^DEP_FILES = //
 18.7187 +      :loop
 18.7188 +	s/\\\\$//
 18.7189 +	p
 18.7190 +	n
 18.7191 +	/\\\\$/ b loop
 18.7192 +      p
 18.7193 +    }
 18.7194 +    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
 18.7195 +       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
 18.7196 +    # Make sure the directory exists.
 18.7197 +    test -f "$dirpart/$file" && continue
 18.7198 +    fdir=`(dirname "$file") 2>/dev/null ||
 18.7199 +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.7200 +	 X"$file" : 'X\(//\)[^/]' \| \
 18.7201 +	 X"$file" : 'X\(//\)$' \| \
 18.7202 +	 X"$file" : 'X\(/\)' \| \
 18.7203 +	 .     : '\(.\)' 2>/dev/null ||
 18.7204 +echo X"$file" |
 18.7205 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.7206 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.7207 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.7208 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.7209 +  	  s/.*/./; q'`
 18.7210 +    { if $as_mkdir_p; then
 18.7211 +    mkdir -p $dirpart/$fdir
 18.7212 +  else
 18.7213 +    as_dir=$dirpart/$fdir
 18.7214 +    as_dirs=
 18.7215 +    while test ! -d "$as_dir"; do
 18.7216 +      as_dirs="$as_dir $as_dirs"
 18.7217 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
 18.7218 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 18.7219 +	 X"$as_dir" : 'X\(//\)[^/]' \| \
 18.7220 +	 X"$as_dir" : 'X\(//\)$' \| \
 18.7221 +	 X"$as_dir" : 'X\(/\)' \| \
 18.7222 +	 .     : '\(.\)' 2>/dev/null ||
 18.7223 +echo X"$as_dir" |
 18.7224 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
 18.7225 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
 18.7226 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
 18.7227 +  	  /^X\(\/\).*/{ s//\1/; q; }
 18.7228 +  	  s/.*/./; q'`
 18.7229 +    done
 18.7230 +    test ! -n "$as_dirs" || mkdir $as_dirs
 18.7231 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
 18.7232 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
 18.7233 +   { (exit 1); exit 1; }; }; }
 18.7234 +
 18.7235 +    # echo "creating $dirpart/$file"
 18.7236 +    echo '# dummy' > "$dirpart/$file"
 18.7237 +  done
 18.7238 +done
 18.7239 + ;;
 18.7240 +  esac
 18.7241 +done
 18.7242 +_ACEOF
 18.7243 +
 18.7244 +cat >>$CONFIG_STATUS <<\_ACEOF
 18.7245 +
 18.7246 +{ (exit 0); exit 0; }
 18.7247 +_ACEOF
 18.7248 +chmod +x $CONFIG_STATUS
 18.7249 +ac_clean_files=$ac_clean_files_save
 18.7250 +
 18.7251 +
 18.7252 +# configure is writing to config.log, and then calls config.status.
 18.7253 +# config.status does its own redirection, appending to config.log.
 18.7254 +# Unfortunately, on DOS this fails, as config.log is still kept open
 18.7255 +# by configure, so config.status won't be able to write to it; its
 18.7256 +# output is simply discarded.  So we exec the FD to /dev/null,
 18.7257 +# effectively closing config.log, so it can be properly (re)opened and
 18.7258 +# appended to by config.status.  When coming back to configure, we
 18.7259 +# need to make the FD available again.
 18.7260 +if test "$no_create" != yes; then
 18.7261 +  ac_cs_success=:
 18.7262 +  ac_config_status_args=
 18.7263 +  test "$silent" = yes &&
 18.7264 +    ac_config_status_args="$ac_config_status_args --quiet"
 18.7265 +  exec 5>/dev/null
 18.7266 +  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
 18.7267 +  exec 5>>config.log
 18.7268 +  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
 18.7269 +  # would make configure fail if this is the last instruction.
 18.7270 +  $ac_cs_success || { (exit 1); exit 1; }
 18.7271 +fi
 18.7272 +
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/configure.ac	Fri Sep 26 17:05:23 2008 +0200
    19.3 @@ -0,0 +1,289 @@
    19.4 +dnl Process this file with autoconf to produce a configure script.
    19.5 +
    19.6 +AC_PREREQ(2.59)
    19.7 +AC_INIT(masqmail, 0.2.21, oku@debian.org)
    19.8 +AC_CONFIG_SRCDIR([src/masqmail.c])
    19.9 +AM_CONFIG_HEADER(config.h)
   19.10 +AM_INIT_AUTOMAKE()
   19.11 +
   19.12 +AC_PREFIX_DEFAULT(/usr)
   19.13 +
   19.14 +dnl Checks for programs.
   19.15 +
   19.16 +dnl Checks for libraries.
   19.17 +
   19.18 +AC_PROG_CC
   19.19 +AC_ISC_POSIX
   19.20 +AC_STDC_HEADERS
   19.21 +dnl AC_ARG_PROGRAM
   19.22 +AC_PROG_RANLIB
   19.23 +
   19.24 +PKG_CHECK_MODULES(GLIB, glib-2.0)
   19.25 +AC_SUBST(GLIB_LIBS)
   19.26 +AC_SUBST(GLIB_CFLAGS)
   19.27 +
   19.28 +dnl resolver support (default is use it)
   19.29 +AC_ARG_ENABLE(resolver,
   19.30 +	[  --disable-resolver       disable resolver support],
   19.31 +	if test "$enable_resolver" != 'no'; then
   19.32 +		resolver_enabled='yes'
   19.33 +	fi,
   19.34 +	resolver_enabled='yes'
   19.35 +	)
   19.36 +
   19.37 +if test "$resolver_enabled" = yes; then
   19.38 +	AC_DEFINE(ENABLE_RESOLVER, 1, [If the resolver is to be used])
   19.39 +dnl checks necessary for libc5:
   19.40 +dnl if there is res_search in libc, it is probably libc5
   19.41 +dnl if not, it is probably libc6 and we need libresolv
   19.42 +	AC_CHECK_LIB(c, res_search, need_resolv=no, need_resolv=yes)
   19.43 +	if test "$need_resolv" = yes; then
   19.44 +		AC_CHECK_LIB(resolv, res_search,has_resolv=yes,AC_MSG_ERROR("no libresolv"))
   19.45 +		RESOLV_LIBS='-lresolv'
   19.46 +	else
   19.47 +		RESOLV_LIBS=''
   19.48 +	fi
   19.49 +else
   19.50 +	RESOLV_LIBS=''
   19.51 +fi
   19.52 +AC_SUBST(RESOLV_LIBS)
   19.53 +
   19.54 +dnl if there is no getline, we define it using getdelim in src/masqmail.h
   19.55 +AC_CHECK_FUNCS(getline)
   19.56 +
   19.57 +dnl if there is no fdatasync, we define it to fsync in src/masqmail.h
   19.58 +AC_CHECK_FUNCS(fdatasync)
   19.59 +
   19.60 +dnl Checks for header files.
   19.61 +AC_HEADER_STDC
   19.62 +AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h)
   19.63 +
   19.64 +dnl Checks for typedefs, structures, and compiler characteristics.
   19.65 +AC_C_CONST
   19.66 +AC_TYPE_PID_T
   19.67 +AC_TYPE_SIZE_T
   19.68 +AC_HEADER_TIME
   19.69 +AC_STRUCT_TM
   19.70 +
   19.71 +dnl Checks for library functions.
   19.72 +AC_FUNC_FNMATCH
   19.73 +AC_TYPE_SIGNAL
   19.74 +AC_FUNC_STRFTIME
   19.75 +AC_FUNC_VPRINTF
   19.76 +AC_CHECK_FUNCS(select socket strerror strstr)
   19.77 +
   19.78 +dnl user and group configuration
   19.79 +AC_ARG_WITH(user,
   19.80 +	[  --with-user=USER         set user [mail]],
   19.81 +	)
   19.82 +if test "x$with_user" = 'x'; then
   19.83 +	with_user='mail'
   19.84 +fi
   19.85 +
   19.86 +AC_ARG_WITH(group,
   19.87 +	[  --with-group=GROUP       set group [trusted]],
   19.88 +	)
   19.89 +if test "x$with_group" = 'x'; then
   19.90 +	with_group='trusted'
   19.91 +fi
   19.92 +
   19.93 +dnl debugging support (default is use it)
   19.94 +AC_ARG_ENABLE(debug,
   19.95 +	[  --disable-debug          disable debugging],
   19.96 +	if test "x$enable_debug" != 'xno'; then
   19.97 +		debug_enabled='yes'
   19.98 +	fi,
   19.99 +	debug_enabled='yes'
  19.100 +	)
  19.101 +if test "x$debug_enabled" = xyes; then
  19.102 +	AC_DEFINE(ENABLE_DEBUG, 1, [If debugging is enabled])
  19.103 +fi
  19.104 +
  19.105 +AC_DEFINE_UNQUOTED(DEF_MAIL_USER, "${with_user}", [The mail user])
  19.106 +AC_SUBST(with_user)
  19.107 +AC_DEFINE_UNQUOTED(DEF_MAIL_GROUP, "${with_group}", [The mail group])
  19.108 +AC_SUBST(with_group)
  19.109 +
  19.110 +dnl link glib statically?
  19.111 +AC_ARG_WITH(glib_static,
  19.112 +	[  --with-glib-static=path  link glib statically (path mandatory!)],
  19.113 +	)
  19.114 +if test "x$with_glib_static" != 'x'; then
  19.115 +	GLIB_LIBS=$with_glib_static
  19.116 +	AC_SUBST(GLIB_LIBS)
  19.117 +fi
  19.118 +
  19.119 +dnl optional features
  19.120 +MD5_LIBS=''
  19.121 +BASE64_LIBS=''
  19.122 +
  19.123 +dnl smtp server support (default is use it)
  19.124 +AC_ARG_ENABLE(smtp_server,
  19.125 +	[  --disable-smtp-server    disable smtp server support],
  19.126 +	if test "x$enable_smtp_server" != 'xno'; then
  19.127 +		smtp_server_enabled='yes'
  19.128 +	fi,
  19.129 +	smtp_server_enabled='yes'
  19.130 +	)
  19.131 +if test "x$smtp_server_enabled" = xyes; then
  19.132 +	AC_DEFINE(ENABLE_SMTP_SERVER, 1, [If the SMTP server is enabled])
  19.133 +fi
  19.134 +
  19.135 +dnl pop support (default is use it)
  19.136 +AC_ARG_ENABLE(pop3,
  19.137 +	[  --disable-pop3           disable pop3 support],
  19.138 +	if test "x$enable_pop3" != 'xno'; then
  19.139 +		pop3_enabled='yes'
  19.140 +	fi,
  19.141 +	pop3_enabled='yes'
  19.142 +	)
  19.143 +if test "x$pop3_enabled" = xyes; then
  19.144 +	AC_DEFINE(ENABLE_POP3, 1, [If the POP3 support is enabled])
  19.145 +#	MD5_LIBS='md5/libmd5c.a'
  19.146 +	need_md5='yes'
  19.147 +fi
  19.148 +
  19.149 +dnl auth support (default is to not use it)
  19.150 +AC_ARG_ENABLE(auth,
  19.151 +	[  --enable-auth            enable AUTH (RFC 2554) client support],
  19.152 +	if test "x$enable_auth" != 'xno'; then
  19.153 +		auth_enabled='yes'
  19.154 +	fi,
  19.155 +	)
  19.156 +if test "x$auth_enabled" = xyes; then
  19.157 +	AC_DEFINE(ENABLE_AUTH, 1, [If AUTH is enabled])
  19.158 +	BASE64_LIBS='base64/libbase64.a'
  19.159 +#	MD5_LIBS='md5/libmd5c.a'
  19.160 +	need_md5='yes'
  19.161 +fi
  19.162 +AC_SUBST(BASE64_LIBS)
  19.163 +
  19.164 +dnl maildir support (default is to not use it)
  19.165 +AC_ARG_ENABLE(maildir,
  19.166 +	[  --enable-maildir            enable qmail style maildir support],
  19.167 +	if test "x$enable_maildir" != 'xno'; then
  19.168 +		maildir_enabled='yes'
  19.169 +	fi,
  19.170 +	)
  19.171 +if test "x$maildir_enabled" = xyes; then
  19.172 +	AC_DEFINE(ENABLE_MAILDIR, 1, [If Maildirs are enabled])
  19.173 +fi
  19.174 +
  19.175 +dnl libcrypto
  19.176 +AC_ARG_WITH(libcrypto,
  19.177 +	[  --with-libcrypto         use libcrypto],
  19.178 +	)
  19.179 +if test "x$with_libcrypto" != 'xyes'; then
  19.180 +	with_libcrypto='no'
  19.181 +fi
  19.182 +
  19.183 +if test "x$need_md5" = 'xyes'; then
  19.184 +dnl check whether we have md5 in libcrypto if md5 needed and we shall link with libcrypto
  19.185 +	if test "x$with_libcrypto" = "xyes"; then
  19.186 +		AC_CHECK_LIB(crypto, MD5, has_crypto='yes', AC_MSG_ERROR('no libcrypto'))
  19.187 +		if test "x$has_crypto" = 'xyes'; then
  19.188 +			AC_DEFINE(USE_LIB_CRYPTO, 1, [If libcrypto is available])
  19.189 +			MD5_LIBS='-lcrypto'
  19.190 +		fi
  19.191 +	else
  19.192 +		MD5_LIBS='md5/libmd5c.a'
  19.193 +	fi
  19.194 +fi
  19.195 +AC_SUBST(MD5_LIBS)
  19.196 +
  19.197 +dnl ident support (default is to not use it)
  19.198 +IDENT_LIBS=''
  19.199 +AC_ARG_ENABLE(ident,
  19.200 +	[  --enable-ident           enable ident (RFC 1413) support],
  19.201 +	if test "x$enable_ident" != 'xno'; then
  19.202 +		ident_enabled='yes'
  19.203 +	fi,
  19.204 +	)
  19.205 +AC_SUBST(has_ident)
  19.206 +if test "x$ident_enabled" = xyes; then
  19.207 +	AC_DEFINE(ENABLE_IDENT, 1, [If ident is enabled])
  19.208 +	AC_CHECK_LIB(ident, ident_id, IDENT_LIBS='-lident', IDENT_LIBS='libident/libident.a')
  19.209 +fi
  19.210 +AC_SUBST(IDENT_LIBS)
  19.211 +
  19.212 +dnl mserver support (default is to not use it)
  19.213 +AC_ARG_ENABLE(mserver,
  19.214 +	[  --enable-mserver         enable mserver support],
  19.215 +	if test "x$enable_mserver" != 'xno'; then
  19.216 +		mserver_enabled='yes'
  19.217 +	fi,
  19.218 +	)
  19.219 +if test "x$mserver_enabled" = xyes; then
  19.220 +	AC_DEFINE(ENABLE_MSERVER, 1, [If mserver support is enabled])
  19.221 +fi
  19.222 +
  19.223 +dnl liblockfile
  19.224 +AC_ARG_WITH(liblockfile,
  19.225 +	[  --with-liblockfile       use liblock (for Debian)],
  19.226 +	)
  19.227 +if test "x$with_liblockfile" != 'x'; then
  19.228 +	with_liblockfile='yes'
  19.229 +fi
  19.230 +if test "x$with_liblockfile" = xyes; then
  19.231 +	AC_CHECK_LIB(lockfile, maillock, has_lockfile=yes, AC_MSG_ERROR("no liblockfile"))
  19.232 +	LOCKFILE_LIBS='-llockfile'
  19.233 +	AC_DEFINE(USE_LIBLOCKFILE, 1, [If liblockfile is to be used])
  19.234 +else
  19.235 +	LOCKFILE_LIBS=''
  19.236 +fi
  19.237 +AC_SUBST(LOCKFILE_LIBS)
  19.238 +AC_SUBST(USE_LIBLOCKFILE)
  19.239 +
  19.240 +dnl log and spool directories
  19.241 +AC_ARG_WITH(logdir,
  19.242 +	[  --with-logdir=DIR        set log directory [/var/masqmail]],
  19.243 +	,
  19.244 +        with_logdir='/var/log/masqmail/'
  19.245 +	)
  19.246 +AC_SUBST(with_logdir)
  19.247 +
  19.248 +AC_ARG_WITH(spooldir,
  19.249 +	[  --with-spooldir=DIR      set spool directory [/var/spool/masqmail]],
  19.250 +	,
  19.251 +	with_spooldir='/var/spool/masqmail/'
  19.252 +	)
  19.253 +AC_SUBST(with_spooldir)
  19.254 +
  19.255 +dnl configuration file
  19.256 +AC_ARG_WITH(confdir,
  19.257 +	[  --with-confdir           directory for configuration [/etc/masqmail]],
  19.258 +	,
  19.259 +	with_confdir='/etc/masqmail'
  19.260 +	)
  19.261 +AC_DEFINE_UNQUOTED(CONF_DIR, "${with_confdir}", [The configuration file location])
  19.262 +AC_SUBST(with_confdir)
  19.263 +
  19.264 +dnl well, /me/ thought that autoconf should make things _easy_ ...
  19.265 +test "x$prefix" = xNONE && prefix="$ac_default_prefix"
  19.266 +AC_DEFINE_UNQUOTED(DATA_DIR, "`eval echo \""$datadir"\"`/masqmail", [The data directory])
  19.267 +
  19.268 +dnl gymnastics to get the correct path where masqmail should be installed
  19.269 +dnl we need this to call ourselves in failmsg.c
  19.270 +if test "x${exec_prefix}" != 'xNONE'; then
  19.271 +	AC_DEFINE_UNQUOTED(SBINDIR, "${exec_prefix}/sbin", [The sbin directory])
  19.272 +else
  19.273 +	if test "x${prefix}" != 'xNONE'; then
  19.274 +		AC_DEFINE_UNQUOTED(SBINDIR, "${prefix}/sbin")
  19.275 +	else
  19.276 +		AC_DEFINE_UNQUOTED(SBINDIR, "/usr/sbin")
  19.277 +	fi
  19.278 +fi
  19.279 +
  19.280 +AC_OUTPUT(Makefile \
  19.281 +	debian/Makefile \
  19.282 +	docs/Makefile \
  19.283 +	docs/man/Makefile \
  19.284 +	docs/xml/Makefile \
  19.285 +	tests/Makefile \
  19.286 +	src/Makefile \
  19.287 +	src/base64/Makefile \
  19.288 +	src/md5/Makefile \
  19.289 +	src/libident/Makefile \
  19.290 +	suse/masqmail.spec \
  19.291 +	redhat/masqmail.spec
  19.292 +	)
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/debian/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    20.3 @@ -0,0 +1,24 @@
    20.4 +EXTRA_DIST = \
    20.5 +README.Debian \
    20.6 +README.online \
    20.7 +changelog \
    20.8 +control \
    20.9 +copyright \
   20.10 +dirs \
   20.11 +docs \
   20.12 +mailq.8 \
   20.13 +mailrm.8 \
   20.14 +masqmail.config \
   20.15 +masqmail.init \
   20.16 +masqmail.ip-up \
   20.17 +masqmail.links \
   20.18 +masqmail.logrotate \
   20.19 +masqmail.templates \
   20.20 +newaliases \
   20.21 +newaliases.8 \
   20.22 +postinst \
   20.23 +postrm \
   20.24 +preinst \
   20.25 +rules \
   20.26 +sendmail.8 \
   20.27 +masqmail.lintian
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/debian/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    21.3 @@ -0,0 +1,287 @@
    21.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    21.5 +# @configure_input@
    21.6 +
    21.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    21.8 +# Free Software Foundation, Inc.
    21.9 +# This Makefile.in is free software; the Free Software Foundation
   21.10 +# gives unlimited permission to copy and/or distribute it,
   21.11 +# with or without modifications, as long as this notice is preserved.
   21.12 +
   21.13 +# This program is distributed in the hope that it will be useful,
   21.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   21.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   21.16 +# PARTICULAR PURPOSE.
   21.17 +
   21.18 +@SET_MAKE@
   21.19 +
   21.20 +srcdir = @srcdir@
   21.21 +top_srcdir = @top_srcdir@
   21.22 +VPATH = @srcdir@
   21.23 +pkgdatadir = $(datadir)/@PACKAGE@
   21.24 +pkglibdir = $(libdir)/@PACKAGE@
   21.25 +pkgincludedir = $(includedir)/@PACKAGE@
   21.26 +top_builddir = ..
   21.27 +
   21.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   21.29 +INSTALL = @INSTALL@
   21.30 +install_sh_DATA = $(install_sh) -c -m 644
   21.31 +install_sh_PROGRAM = $(install_sh) -c
   21.32 +install_sh_SCRIPT = $(install_sh) -c
   21.33 +INSTALL_HEADER = $(INSTALL_DATA)
   21.34 +transform = $(program_transform_name)
   21.35 +NORMAL_INSTALL = :
   21.36 +PRE_INSTALL = :
   21.37 +POST_INSTALL = :
   21.38 +NORMAL_UNINSTALL = :
   21.39 +PRE_UNINSTALL = :
   21.40 +POST_UNINSTALL = :
   21.41 +ACLOCAL = @ACLOCAL@
   21.42 +AMDEP_FALSE = @AMDEP_FALSE@
   21.43 +AMDEP_TRUE = @AMDEP_TRUE@
   21.44 +AMTAR = @AMTAR@
   21.45 +AUTOCONF = @AUTOCONF@
   21.46 +AUTOHEADER = @AUTOHEADER@
   21.47 +AUTOMAKE = @AUTOMAKE@
   21.48 +AWK = @AWK@
   21.49 +BASE64_LIBS = @BASE64_LIBS@
   21.50 +CC = @CC@
   21.51 +CCDEPMODE = @CCDEPMODE@
   21.52 +CFLAGS = @CFLAGS@
   21.53 +CPP = @CPP@
   21.54 +CPPFLAGS = @CPPFLAGS@
   21.55 +CYGPATH_W = @CYGPATH_W@
   21.56 +DEFS = @DEFS@
   21.57 +DEPDIR = @DEPDIR@
   21.58 +ECHO_C = @ECHO_C@
   21.59 +ECHO_N = @ECHO_N@
   21.60 +ECHO_T = @ECHO_T@
   21.61 +EGREP = @EGREP@
   21.62 +EXEEXT = @EXEEXT@
   21.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   21.64 +GLIB_LIBS = @GLIB_LIBS@
   21.65 +IDENT_LIBS = @IDENT_LIBS@
   21.66 +INSTALL_DATA = @INSTALL_DATA@
   21.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   21.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   21.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   21.70 +LDFLAGS = @LDFLAGS@
   21.71 +LIBOBJS = @LIBOBJS@
   21.72 +LIBS = @LIBS@
   21.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   21.74 +LTLIBOBJS = @LTLIBOBJS@
   21.75 +MAKEINFO = @MAKEINFO@
   21.76 +MD5_LIBS = @MD5_LIBS@
   21.77 +OBJEXT = @OBJEXT@
   21.78 +PACKAGE = @PACKAGE@
   21.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   21.80 +PACKAGE_NAME = @PACKAGE_NAME@
   21.81 +PACKAGE_STRING = @PACKAGE_STRING@
   21.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   21.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   21.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   21.85 +PKG_CONFIG = @PKG_CONFIG@
   21.86 +RANLIB = @RANLIB@
   21.87 +RESOLV_LIBS = @RESOLV_LIBS@
   21.88 +SET_MAKE = @SET_MAKE@
   21.89 +SHELL = @SHELL@
   21.90 +STRIP = @STRIP@
   21.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   21.92 +VERSION = @VERSION@
   21.93 +ac_ct_CC = @ac_ct_CC@
   21.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   21.95 +ac_ct_STRIP = @ac_ct_STRIP@
   21.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   21.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   21.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   21.99 +am__include = @am__include@
  21.100 +am__leading_dot = @am__leading_dot@
  21.101 +am__quote = @am__quote@
  21.102 +bindir = @bindir@
  21.103 +build_alias = @build_alias@
  21.104 +datadir = @datadir@
  21.105 +exec_prefix = @exec_prefix@
  21.106 +has_ident = @has_ident@
  21.107 +host_alias = @host_alias@
  21.108 +includedir = @includedir@
  21.109 +infodir = @infodir@
  21.110 +install_sh = @install_sh@
  21.111 +libdir = @libdir@
  21.112 +libexecdir = @libexecdir@
  21.113 +localstatedir = @localstatedir@
  21.114 +mandir = @mandir@
  21.115 +oldincludedir = @oldincludedir@
  21.116 +prefix = @prefix@
  21.117 +program_transform_name = @program_transform_name@
  21.118 +sbindir = @sbindir@
  21.119 +sharedstatedir = @sharedstatedir@
  21.120 +sysconfdir = @sysconfdir@
  21.121 +target_alias = @target_alias@
  21.122 +with_confdir = @with_confdir@
  21.123 +with_group = @with_group@
  21.124 +with_logdir = @with_logdir@
  21.125 +with_spooldir = @with_spooldir@
  21.126 +with_user = @with_user@
  21.127 +EXTRA_DIST = \
  21.128 +README.Debian \
  21.129 +README.online \
  21.130 +changelog \
  21.131 +control \
  21.132 +copyright \
  21.133 +dirs \
  21.134 +docs \
  21.135 +mailq.8 \
  21.136 +mailrm.8 \
  21.137 +masqmail.config \
  21.138 +masqmail.init \
  21.139 +masqmail.ip-up \
  21.140 +masqmail.links \
  21.141 +masqmail.logrotate \
  21.142 +masqmail.templates \
  21.143 +newaliases \
  21.144 +newaliases.8 \
  21.145 +postinst \
  21.146 +postrm \
  21.147 +preinst \
  21.148 +rules \
  21.149 +sendmail.8 \
  21.150 +masqmail.lintian
  21.151 +
  21.152 +subdir = debian
  21.153 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  21.154 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  21.155 +CONFIG_HEADER = $(top_builddir)/config.h
  21.156 +CONFIG_CLEAN_FILES =
  21.157 +DIST_SOURCES =
  21.158 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am TODO
  21.159 +all: all-am
  21.160 +
  21.161 +.SUFFIXES:
  21.162 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  21.163 +	cd $(top_srcdir) && \
  21.164 +	  $(AUTOMAKE) --gnu  debian/Makefile
  21.165 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  21.166 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  21.167 +uninstall-info-am:
  21.168 +tags: TAGS
  21.169 +TAGS:
  21.170 +
  21.171 +ctags: CTAGS
  21.172 +CTAGS:
  21.173 +
  21.174 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  21.175 +
  21.176 +top_distdir = ..
  21.177 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  21.178 +
  21.179 +distdir: $(DISTFILES)
  21.180 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  21.181 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  21.182 +	list='$(DISTFILES)'; for file in $$list; do \
  21.183 +	  case $$file in \
  21.184 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  21.185 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  21.186 +	  esac; \
  21.187 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  21.188 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  21.189 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  21.190 +	    dir="/$$dir"; \
  21.191 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  21.192 +	  else \
  21.193 +	    dir=''; \
  21.194 +	  fi; \
  21.195 +	  if test -d $$d/$$file; then \
  21.196 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  21.197 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  21.198 +	    fi; \
  21.199 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  21.200 +	  else \
  21.201 +	    test -f $(distdir)/$$file \
  21.202 +	    || cp -p $$d/$$file $(distdir)/$$file \
  21.203 +	    || exit 1; \
  21.204 +	  fi; \
  21.205 +	done
  21.206 +check-am: all-am
  21.207 +check: check-am
  21.208 +all-am: Makefile
  21.209 +
  21.210 +installdirs:
  21.211 +install: install-am
  21.212 +install-exec: install-exec-am
  21.213 +install-data: install-data-am
  21.214 +uninstall: uninstall-am
  21.215 +
  21.216 +install-am: all-am
  21.217 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  21.218 +
  21.219 +installcheck: installcheck-am
  21.220 +install-strip:
  21.221 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  21.222 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  21.223 +	  `test -z '$(STRIP)' || \
  21.224 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  21.225 +mostlyclean-generic:
  21.226 +
  21.227 +clean-generic:
  21.228 +
  21.229 +distclean-generic:
  21.230 +	-rm -f $(CONFIG_CLEAN_FILES)
  21.231 +
  21.232 +maintainer-clean-generic:
  21.233 +	@echo "This command is intended for maintainers to use"
  21.234 +	@echo "it deletes files that may require special tools to rebuild."
  21.235 +clean: clean-am
  21.236 +
  21.237 +clean-am: clean-generic mostlyclean-am
  21.238 +
  21.239 +distclean: distclean-am
  21.240 +	-rm -f Makefile
  21.241 +distclean-am: clean-am distclean-generic
  21.242 +
  21.243 +dvi: dvi-am
  21.244 +
  21.245 +dvi-am:
  21.246 +
  21.247 +info: info-am
  21.248 +
  21.249 +info-am:
  21.250 +
  21.251 +install-data-am:
  21.252 +
  21.253 +install-exec-am:
  21.254 +
  21.255 +install-info: install-info-am
  21.256 +
  21.257 +install-man:
  21.258 +
  21.259 +installcheck-am:
  21.260 +
  21.261 +maintainer-clean: maintainer-clean-am
  21.262 +	-rm -f Makefile
  21.263 +maintainer-clean-am: distclean-am maintainer-clean-generic
  21.264 +
  21.265 +mostlyclean: mostlyclean-am
  21.266 +
  21.267 +mostlyclean-am: mostlyclean-generic
  21.268 +
  21.269 +pdf: pdf-am
  21.270 +
  21.271 +pdf-am:
  21.272 +
  21.273 +ps: ps-am
  21.274 +
  21.275 +ps-am:
  21.276 +
  21.277 +uninstall-am: uninstall-info-am
  21.278 +
  21.279 +.PHONY: all all-am check check-am clean clean-generic distclean \
  21.280 +	distclean-generic distdir dvi dvi-am info info-am install \
  21.281 +	install-am install-data install-data-am install-exec \
  21.282 +	install-exec-am install-info install-info-am install-man \
  21.283 +	install-strip installcheck installcheck-am installdirs \
  21.284 +	maintainer-clean maintainer-clean-generic mostlyclean \
  21.285 +	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
  21.286 +	uninstall-info-am
  21.287 +
  21.288 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  21.289 +# Otherwise a system limit (for SysV at least) may be exceeded.
  21.290 +.NOEXPORT:
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/debian/README.Debian	Fri Sep 26 17:05:23 2008 +0200
    22.3 @@ -0,0 +1,38 @@
    22.4 +
    22.5 +MasqMail for Debian
    22.6 +-------------------
    22.7 +
    22.8 +This is the Debian package of my MasqMail MTA.
    22.9 +
   22.10 +masqmail is an MTA specially designed for hosts with intermittent
   22.11 +internet connections, i.e. hosts (or networks) at home or notebooks. It has
   22.12 +special support for changing providers. It works both for sending mail
   22.13 +(replacing exim, sendmail, postfix or qmail) and receiving mail (replacing
   22.14 +fetchmail, but it also works in conjunction with fetchmail).
   22.15 +
   22.16 +Special support for 'changing providers' means individual configurations
   22.17 +depending on the current connection to the internet and rewriting of sender
   22.18 +addresses.
   22.19 +
   22.20 +It has been compiled with the options:
   22.21 +                --prefix=/usr --mandir='$${prefix}/share/man' \
   22.22 +                --with-logdir=/var/log/masqmail \
   22.23 +                --with-spooldir=/var/spool/masqmail \
   22.24 +                --with-user=mail --with-group=mail \
   22.25 +                --with-confdir=/etc/masqmail \
   22.26 +                --with-liblockfile \
   22.27 +                --enable-auth \
   22.28 +                --enable-ident \
   22.29 +                --enable-maildir
   22.30 +
   22.31 +i.e. with ESMTP AUTH support, with ident support and with Maildir support.
   22.32 +
   22.33 +You will find all information necessary to configure masqmail in the man
   22.34 +pages masqmail (8), masqmail.conf (5), masqmail.route (5), masqmail.get (5)
   22.35 +and masqmail.aliases (5). Its configuration files live in the directory
   22.36 +/etc/masqmail/ and in /etc/aliases.
   22.37 +
   22.38 +For more information about masqmail see
   22.39 +http://masqmail.cx/masqmail
   22.40 +
   22.41 +Oliver Kurth <oku@masqmail.cx> Tue, 16 Apr 2002 13:44:18 +0200
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/debian/README.online	Fri Sep 26 17:05:23 2008 +0200
    23.3 @@ -0,0 +1,92 @@
    23.4 +Different methods for online detection
    23.5 +--------------------------------------
    23.6 +
    23.7 +/etc/ppp/peers/<provider>
    23.8 +-------------------------
    23.9 +
   23.10 +The scripts /etc/ppp/ip-{up,down}.d/{1,99}masqmail make use of the variable
   23.11 +$IPPARAM, which you can defibe in your /etc/ppp/peers/<provider>
   23.12 +configuration with the ippparam option, eg:
   23.13 +
   23.14 +ippparam arcor
   23.15 +
   23.16 +If this is set, $IPPARAM will be written to a 'route' file. Using some
   23.17 +awk magic, the scripts finds out which file you have defined for
   23.18 +online detection (if online_detect=file) and writes the value of
   23.19 +$IPPARAM to this file. masqmail then uses this file to determine its
   23.20 +online status.
   23.21 +
   23.22 +
   23.23 +/etc/network/interfaces
   23.24 +-----------------------
   23.25 +
   23.26 +You can use the /etc/network/interfaces script to tell masqmail
   23.27 +when a link goes up, and masqmail shall flush its queue and/or fetch mail.
   23.28 +
   23.29 +This is an example for a static interface:
   23.30 +
   23.31 +iface eth0 inet static
   23.32 +        # mroute/name used by ip-up.d/masqmail BDL May02
   23.33 +        name SNRC
   23.34 +        address 130.130.10.233
   23.35 +        netmask 255.255.255.0
   23.36 +        gateway 130.130.10.254
   23.37 +
   23.38 +(This example is from Ben Low. Thanks, Ben :-))
   23.39 +
   23.40 +If you use masqmail on a notebook, you can define several interfaces,
   23.41 +depending on the network you are in. Read
   23.42 +/usr/share/doc/ifupdown/examples/interfaces.gz
   23.43 +for examples.
   23.44 +
   23.45 +The scripts /etc/network/if-{up,down}.d/1masqmail make use of the NAME
   23.46 +in the same way as the /etc/ppp/ip-{up,down}.d/ scripts. See above.
   23.47 +
   23.48 +
   23.49 +guessnet and /etc/network/interfaces
   23.50 +------------------------------------
   23.51 +
   23.52 +Another nice tool is guessnet. See /usr/share/doc/guessnet/README.gz,
   23.53 +if you have guessnet installed. You can use it in combination with the
   23.54 +method described above for /etc/network/interfaces.
   23.55 +
   23.56 +
   23.57 +guessnet and the 'online_pipe' option
   23.58 +-------------------------------------
   23.59 +
   23.60 +Alternatively you can also use guessnet directly to check the online
   23.61 +status. To do this, set in
   23.62 +/etc/masqmail/masqmail.conf
   23.63 +
   23.64 +#
   23.65 +online_detect=pipe
   23.66 +online_pipe="/usr/bin/guessnet < /etc/masqmail/guessnet.conf"
   23.67 +#
   23.68 +
   23.69 +and create a file
   23.70 +/etc/masqmail/guessnet.conf
   23.71 +
   23.72 +Example:
   23.73 +192.168.0.35 00:10:5A:24:C5:B6 192.168.0.1 default
   23.74 +192.168.2.1 00:80:AD:97:D5:2D 192.168.0.1 home
   23.75 +
   23.76 +
   23.77 +masqdialer and the 'online_pipe' option
   23.78 +---------------------------------------
   23.79 +
   23.80 +Yet another possibility for ppp dialups is masqdialer:
   23.81 +
   23.82 +Example:
   23.83 +#
   23.84 +online_detect=pipe
   23.85 +online_pipe="/usr/bin/mservdetect 192.168.1.2 224"
   23.86 +#
   23.87 +
   23.88 +This is useful if you have a gateway with masqdialer running
   23.89 +and masqmail on another host behind ('behind' as seen from the internet)
   23.90 +
   23.91 +Note:
   23.92 +The online detect method 'mserver' is deprecated, and this debian
   23.93 +package comes with that option disabled. You can still recompile the
   23.94 +package with the ./configure option --enable-mserver, but this may be
   23.95 +removed in future version of masqmail.
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/debian/TODO	Fri Sep 26 17:05:23 2008 +0200
    24.3 @@ -0,0 +1,2 @@
    24.4 +- ip-up, ip-down script for online_detect=file
    24.5 +- better Debian docs
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/debian/changelog	Fri Sep 26 17:05:23 2008 +0200
    25.3 @@ -0,0 +1,395 @@
    25.4 +masqmail (0.2.21-1) unstable; urgency=low
    25.5 +
    25.6 +  * security fixes (closes: #329307)
    25.7 +  - do not use shell when executing sub programs
    25.8 +  - do not accept backtick in email adresses
    25.9 +  - write log files as 'mail' user
   25.10 +  * changed default online status file to /var/run/masqmail/masqmail-route
   25.11 +    (closes: #332841)
   25.12 +  * depend on debconf | debconf-2.0 (closes: #332023)
   25.13 +  * add debug.log to logrotate script (closes: #332960)
   25.14 +  * fix typo in templates ('failure') (closes: #224273)
   25.15 +  * use glib2 instead of old glib1.2 (closes: #337921)
   25.16 +
   25.17 + -- Oliver Kurth <oku@debian.org>  Sat, 17 Sep 2005 13:45:11 -0700
   25.18 +
   25.19 +masqmail (0.2.20-1) unstable; urgency=low
   25.20 +
   25.21 +  * new upstream version
   25.22 +  * regard connect_error_fail when failing for pipes (closes: #186364)
   25.23 +
   25.24 + -- Oliver Kurth <oku@debian.org>  Tue, 03 Jun 2003 17:56:07 +0200
   25.25 +
   25.26 +masqmail (0.2.19-1) unstable; urgency=low
   25.27 +
   25.28 +  * new upstream version (closes: #182950)
   25.29 +  * fixed typos (closes: #171780, #178752)
   25.30 +  * added IFUP_IFACES to /etc/default/masqmail
   25.31 +  * changed maintainer address to oku@debian.org
   25.32 +
   25.33 + -- Oliver Kurth <oku@debian.org>  Wed, 12 Mar 2003 21:33:53 +0100
   25.34 +
   25.35 +masqmail (0.2.18-1) unstable; urgency=low
   25.36 +
   25.37 +  * new upstream version (delivery delay warnings also if connection fails)
   25.38 +  * fixed typo in man page (Closes: #171813)
   25.39 +
   25.40 + -- Oliver Kurth <oku@masqmail.cx>  Mon, 02 Dec 2002 16:38:22 +0100
   25.41 +
   25.42 +masqmail (0.2.17-1) unstable; urgency=low
   25.43 +
   25.44 +  * new upstream version (delivery delay warnings)
   25.45 +
   25.46 + -- Oliver Kurth <oku@masqmail.cx>  Thu, 28 Nov 2002 15:05:53 +0100
   25.47 +
   25.48 +masqmail (0.2.16-1) unstable; urgency=low
   25.49 +
   25.50 +  * new upstream version (debugging works again)
   25.51 +
   25.52 + -- Oliver Kurth <oku@masqmail.cx>  Tue, 12 Nov 2002 17:27:13 +0100
   25.53 +
   25.54 +masqmail (0.2.15-1) unstable; urgency=low
   25.55 +
   25.56 +  * new upstream version, other changes see ChangeLog
   25.57 +  * security fixes (buffer overflows)
   25.58 +
   25.59 + -- Oliver Kurth <oku@masqmail.cx>  Wed, 06 Nov 2002 13:27:39 +0100
   25.60 +
   25.61 +masqmail (0.2.14-1) unstable; urgency=low
   25.62 +
   25.63 +  * new upstream version, other changes see ChangeLog
   25.64 +  * included examples for the route locations in masqmail.conf
   25.65 +    (Closes: #166207)
   25.66 +  * removed bashisms from debian/masqmail.config (== -> =)
   25.67 +  * remote_port option works again (Closes: #163850)
   25.68 +    (but it is marked as deprecated)
   25.69 +
   25.70 + -- Oliver Kurth <oku@masqmail.cx>  Wed, 16 Oct 2002 17:51:40 +0200
   25.71 +
   25.72 +masqmail (0.2.11-2) unstable; urgency=low
   25.73 +
   25.74 +  * ip-up scripts: chmod online file only if it exists
   25.75 +  * ip-up scripts: swapped -go and -qo
   25.76 +    (brain dead bug :-(, closes: #158385)
   25.77 +  * init script: tell which services are started/stopped
   25.78 +  (all of these were noted by Christop Hertel. Thanx :-))
   25.79 +  * removed quotes from daemon args in init script (closes: #157164)
   25.80 +    (somehow this bug reappeared)
   25.81 +
   25.82 + -- Oliver Kurth <oku@masqmail.cx>  Thu, 15 Aug 2002 21:43:24 +0200
   25.83 +
   25.84 +masqmail (0.2.11-1) unstable; urgency=low
   25.85 +
   25.86 +  * removed quotes from daemon args in init script
   25.87 +  * deleted emacs local variables from bottom of this file.
   25.88 +  * new upstream version, other changes see ChangeLog
   25.89 +    (closes: #155021)
   25.90 +
   25.91 + -- Oliver Kurth <oku@masqmail.cx>  Mon,  5 Aug 2002 22:12:44 +0200
   25.92 +
   25.93 +masqmail (0.2.10-2) unstable; urgency=low
   25.94 +
   25.95 +  * call /etc/init.d/masqmail stop in config,
   25.96 +    so service is stopped when called with dpkg-reconfigure
   25.97 +    (closes: #151528)
   25.98 +  * removed call to message,
   25.99 +    do not try to write masqmail.conf if user does not want
  25.100 +    to move it away (closes: #151549)
  25.101 +  * remove superfluous 'fi' in ip-up script
  25.102 +
  25.103 + -- Oliver Kurth <oku@masqmail.cx>  Mon,  1 Jul 2002 21:44:57 +0200
  25.104 +
  25.105 +masqmail (0.2.10-1) unstable; urgency=low
  25.106 +
  25.107 +  * make ip-up scripts useful also for detect methods other than file
  25.108 +  * Added a note for the deprecated /etc/pcmcia/ip-up.d/ scripts.
  25.109 +  * use debconf
  25.110 +  * rewrote init and /etc/ppp/ip-up.d/ scripts,
  25.111 +    removed /etc/pcmcia/ip-up.d/ scripts and added
  25.112 +    /etc/network/if-up.d/ scripts (closes: #145500)
  25.113 +    (Thanks, Ben Low :-))
  25.114 +  * new file README.online, which describes various
  25.115 +    methods for online detection
  25.116 +  * new upstream version, other changes see ChangeLog
  25.117 +
  25.118 + -- Oliver Kurth <oku@masqmail.cx>  Thu, 27 Jun 2002 12:36:49 +0200
  25.119 +
  25.120 +masqmail (0.2.9-1) unstable; urgency=low
  25.121 +
  25.122 +  * use dpkg --compare-versions in preinst for upgrades
  25.123 +    from very old versions.
  25.124 +  * fixed segfault when called with -t (closes: #147890)
  25.125 +  * pipe output for reloading masqmail to /dev/null (closes: #146704)
  25.126 +  * listen only on localhost:25 by default (closes: #134384)
  25.127 +  * added mbox_default=mda in conf file (closes: #143592)
  25.128 +  * new upstream version,
  25.129 +    other changes see ChangeLog
  25.130 +
  25.131 + -- Oliver Kurth <oku@masqmail.cx>  Fri, 24 May 2002 16:26:40 +0200
  25.132 +
  25.133 +masqmail (0.2.8-1) unstable; urgency=low
  25.134 +
  25.135 +  * New maintainer: oku@masqmail.cx, sponsored
  25.136 +    by Thimo Neubauer <thimo@debian.org>
  25.137 +  * new upstream version, (closes: #100594),
  25.138 +    other changes see ChangeLog
  25.139 +  * uses ESMTP LOGIN (closes: #129795)
  25.140 +  * use /etc/mailname for host_name (closes: #134385)
  25.141 +  * get daemon (closes: #134422)
  25.142 +  * uncommented alias_file option (closes: #136653)
  25.143 +
  25.144 + -- Oliver Kurth <oku@masqmail.cx>  Mon,  8 Apr 2002 01:00:02 +0200
  25.145 +
  25.146 +masqmail (0.1.16-2) unstable; urgency=low
  25.147 +
  25.148 +  * Orphan the package (maintainer set to qa@packages.debian.org).
  25.149 +  * src/connect.c: If last character of hostname is a digit, we conclude
  25.150 +    that the hostname will be an IP address (closes: #138124).
  25.151 +  * Make masqmail use /var/mail instead of /var/spool/mail (closes: #134383).
  25.152 +
  25.153 + -- Gregor Hoffleit <flight@debian.org>  Tue, 26 Mar 2002 09:53:43 +0100
  25.154 +
  25.155 +masqmail (0.1.16-1) unstable; urgency=low
  25.156 +
  25.157 +  * New upstream version: bug fixes:
  25.158 +    - PowerPC fix for varargs functions
  25.159 +    - g_free fix in src/conf.c
  25.160 +
  25.161 + -- Gregor Hoffleit <flight@debian.org>  Mon, 31 Dec 2001 18:02:29 +0100
  25.162 +
  25.163 +masqmail (0.1.15-1) unstable; urgency=low
  25.164 +
  25.165 +  * New upstream version:
  25.166 +    this is a security fix release. When an alias expansion expands to a 
  25.167 +    pipe, only the effective uid was changed to mail, but not the real uid.
  25.168 +    This way, a command could gain root privileges. This is no longer 
  25.169 +    possible, masqmail drops prvileges completely before executing the pipe
  25.170 +    command (closes: #102092).
  25.171 +  * src/conf.c: Correct a typo (bugfix from upstream). Maybe this fixes the
  25.172 +    spurious segfault on m68k (#100594).
  25.173 +  * Add a dependency on netbase (closes: #101273).
  25.174 +  * Don't install the example configuration file for masqmail.conf in
  25.175 +    /etc/masqmail/, it's available in /usr/share/doc/masqmail/examples
  25.176 +    (closes: #101457).
  25.177 +
  25.178 + -- Gregor Hoffleit <flight@debian.org>  Thu, 19 Jul 2001 22:57:13 +0200
  25.179 +
  25.180 +masqmail (0.1.14-1) unstable; urgency=low
  25.181 +
  25.182 +  * New upstream version:
  25.183 +    - correct error reply for lacking permissions (closes: #92894,
  25.184 +      was already fixed in 0.1.13-2).
  25.185 +    - fixed 'last line missing' bug
  25.186 +    - fixed spool locking bug: lock was deleted if unsuccessful
  25.187 +      (unlocking it)
  25.188 +
  25.189 + -- Gregor Hoffleit <flight@debian.org>  Fri, 27 Apr 2001 21:09:51 +0200
  25.190 +
  25.191 +masqmail (0.1.13-2) unstable; urgency=low
  25.192 +
  25.193 +  * Change priority from optional to extra.
  25.194 +
  25.195 + -- Gregor Hoffleit <flight@debian.org>  Fri,  6 Apr 2001 16:07:36 +0200
  25.196 +
  25.197 +masqmail (0.1.13-1) unstable; urgency=low
  25.198 +
  25.199 +  * New upstream version:
  25.200 +    - qualify address for get configuration.
  25.201 +    - better checking for valid From: address when retrieving mail via pop3
  25.202 +      and this is used as the return path.
  25.203 +
  25.204 + -- Gregor Hoffleit <flight@debian.org>  Wed, 28 Mar 2001 23:09:06 +0200
  25.205 +
  25.206 +masqmail (0.1.12-1) unstable; urgency=low
  25.207 +
  25.208 +  * New upstream version e.g.:
  25.209 +
  25.210 +    - support for pipes in routes
  25.211 +    - a wrapper can now be used for POP and SMTP
  25.212 +    - an MDA for local mail delivery can be used
  25.213 +    - bug fixes
  25.214 +
  25.215 +    For a complete list of changes since 0.1.7, see changelog and NEWS.
  25.216 +
  25.217 +  * Add a patch by Edouard G. Parmelan <egp@free.fr>:
  25.218 +    - run daemon in queue mode.
  25.219 +    - add support for PPP and PCMCIA startup scripts.
  25.220 +    - add /etc/logrotate.d script.
  25.221 +    - suggests logrotate.
  25.222 +
  25.223 + -- Gregor Hoffleit <flight@debian.org>  Wed, 14 Mar 2001 21:31:31 +0100
  25.224 +
  25.225 +masqmail (0.1.7-2) unstable; urgency=low
  25.226 +
  25.227 +  * Add debhelper to Build-Depends (closes: #76380).
  25.228 +
  25.229 + -- Gregor Hoffleit <flight@debian.org>  Mon,  6 Nov 2000 20:59:16 +0100
  25.230 +
  25.231 +masqmail (0.1.7-1) unstable; urgency=low
  25.232 +
  25.233 +  * New upstream version: 
  25.234 +  
  25.235 +    - debug option can be changed for privileged users only
  25.236 +    - fixed a security hole: -C option for unprivileged users now implies
  25.237 +      run_as_user and drops _all_ privileges
  25.238 +    - environment variables for pipe transport
  25.239 +    - wildcards for map_* options
  25.240 +    - rearranged interface handling, IP addresses now possible for
  25.241 +      listen_addresses and mserver_iface
  25.242 +    - beautified masqmail.c
  25.243 +    - revised uid and gid settings in spool.c and local.c (pipe transport)
  25.244 +    - optionally use ident protocol (RFC 1413) and store user id in
  25.245 +      spool file
  25.246 +    - proper spool file locking
  25.247 +
  25.248 +  * i.e. the new upstream version includes fixes for the security problems
  25.249 +    tackled in 0.1.6-2.
  25.250 +  * We have compiled with libident support (--enable-ident).
  25.251 +
  25.252 + -- Gregor Hoffleit <flight@debian.org>  Sun, 22 Oct 2000 09:37:56 +0200
  25.253 +
  25.254 +masqmail (0.1.6-2) unstable; urgency=low
  25.255 +
  25.256 +  * Security bugfix: An unprivileged user could use masqmail -C' 
  25.257 +    (use alternative configuration file) and/or -d' (enable debug output)
  25.258 +    for exploits. We disable these options for non-privileged users 
  25.259 +    (#74422 will be closed by the upload of 0.0.12-3 to stable).
  25.260 +
  25.261 + -- Gregor Hoffleit <flight@debian.org>  Sun, 15 Oct 2000 20:42:04 +0200
  25.262 +
  25.263 +masqmail (0.1.6-1) unstable; urgency=low
  25.264 +
  25.265 +  * New upstream version:
  25.266 +
  25.267 +    - MasqMail can now retrieve mail with pop3 (new option -g)
  25.268 +    - also supports SMTP after POP
  25.269 +    - supports ESMTP AUTH as client (only CRAM-MD5 supported for now)
  25.270 +    - `-qo' without a connection name works now
  25.271 +    - new command line option `-Mrm' to remove mails from queue
  25.272 +    - many bug fixes, e.g.
  25.273 +      - fixed the segfault caused by unqualified recipient addresses
  25.274 +        (closes: #69112)
  25.275 +    - documentation in html format has been removed; instead, there's
  25.276 +      a complete set of man pages.
  25.277 +
  25.278 +    For a complete list of new features and bugs fixed since 0.0.12, please
  25.279 +    refer to the changelog file.
  25.280 +
  25.281 +  * Include Build-Dependencies (closes: #65514).
  25.282 +  * Compiled with POP3 and AUTH support.
  25.283 +  * Fixed a typo in example.route: must be "pop3_login" (not pop_login).
  25.284 +  * configuration file masqmail.conf has been moved into /etc/masqmail/.
  25.285 +
  25.286 + -- Gregor Hoffleit <flight@debian.org>  Sat,  7 Oct 2000 12:49:01 +0200
  25.287 +
  25.288 +masqmail (0.0.12-2) frozen unstable; urgency=low
  25.289 +
  25.290 +  * Just found and fixed another important bug: newaliases (aka
  25.291 +    masqmail -bi) would hang infinitely and therefore break postinst
  25.292 +    scripts of various packages. A very small fix in src/masqmail.c.
  25.293 +
  25.294 + -- Gregor Hoffleit <flight@debian.org>  Wed, 29 Mar 2000 23:34:38 +0200
  25.295 +
  25.296 +masqmail (0.0.12-1) frozen unstable; urgency=low
  25.297 +
  25.298 +  * New upstream version: Bugfixes only (should go into frozen, since it
  25.299 +    fixes an RC bug:)
  25.300 +    - setegid in local.c (closes: #58893)
  25.301 +    - set len for getsockname
  25.302 +    - set local_net_routes to NULL if there is no local net
  25.303 +    - warn if spool file could not be deleted
  25.304 +    - say 'mail queue is empty' if mail queue is empty
  25.305 +  * Moved mailq from /usr/sbin to /usr/bin (cf. exim et al).
  25.306 +
  25.307 + -- Gregor Hoffleit <flight@debian.org>  Wed, 29 Mar 2000 14:25:08 +0200
  25.308 +
  25.309 +masqmail (0.0.11-1) frozen unstable; urgency=low
  25.310 +
  25.311 +  * New upstream version: Bugfixes only compared to 0.0.10.
  25.312 +
  25.313 +  * To the archive maintainer: I think this version should replace the
  25.314 +    version 0.0.8-3, which is currently in frozen:
  25.315 +
  25.316 +    Compared with upstream 0.0.8, the only new features are
  25.317 +    - support to read certain configuration options from files.
  25.318 +    - support for aliases in /etc/aliases. This is a necessary feature
  25.319 +      to comply with Debian policy (closes: #58885).
  25.320 +
  25.321 +    Then, there are a few bug fixes since 0.0.11 wrt RFC 822 compliance.
  25.322 +
  25.323 + -- Gregor Hoffleit <flight@debian.org>  Sat,  4 Mar 2000 17:40:56 +0100
  25.324 +
  25.325 +masqmail (0.0.10-1) unstable; urgency=low
  25.326 +
  25.327 +  * New upstream version:
  25.328 +    - includes our liblockfile support.
  25.329 +    - support for aliases (fixes: #58885).
  25.330 +  * To conform with Debian policy, we include an shell script
  25.331 +    /usr/bin/newaliases, that calls sendmail -bi (which has no effect
  25.332 +    with MasqMail).
  25.333 +
  25.334 + -- Gregor Hoffleit <flight@debian.org>  Tue, 29 Feb 2000 13:37:18 +0100
  25.335 +
  25.336 +masqmail (0.0.9-2) unstable; urgency=low
  25.337 +
  25.338 +  * This release only has a small change in debian/rules that fixes an
  25.339 +    important bug: /usr/sbin/masqmail was not installed setuid root and
  25.340 +    therefore failed to work if suidmanager was not present at install
  25.341 +    time. In frozen, this bug was fixed simultanously by 0.0.8-3.
  25.342 +
  25.343 + -- Gregor Hoffleit <flight@debian.org>  Thu, 24 Feb 2000 22:13:01 +0100
  25.344 +
  25.345 +masqmail (0.0.9-1) unstable; urgency=low
  25.346 +
  25.347 +  * New upstream version.
  25.348 +
  25.349 + -- Gregor Hoffleit <flight@debian.org>  Fri, 11 Feb 2000 13:30:10 +0100
  25.350 +
  25.351 +masqmail (0.0.8-3) frozen; urgency=high
  25.352 +
  25.353 +  * This release only has a small change in debian/rules that fixes an
  25.354 +    important bug: /usr/sbin/masqmail was not installed setuid root and
  25.355 +    therefore failed to work if suidmanager was not present at install
  25.356 +    time (closes: Bug#58886, Bug#58893).
  25.357 +
  25.358 + -- Gregor Hoffleit <flight@debian.org>  Thu, 24 Feb 2000 13:16:41 +0100
  25.359 +
  25.360 +masqmail (0.0.8-2) frozen unstable; urgency=low
  25.361 +
  25.362 +  * Now new code, just a simple fix to the command line parsing,
  25.363 +    therefore this upload is targetted for frozen.
  25.364 +  * Patch to allow '--' on command line before the email adress, mimicking
  25.365 +    sendmail's behavior. Necessary to make Debian's mutt package work with
  25.366 +    masqmail, and therefore should go into frozen (closes: Bug#56341
  25.367 +    masqmail: Mutt can't send emails through masqmail).
  25.368 +  * Therefore updates to the man page.
  25.369 +  * Changed Oliver's address and the MasqMail homepage in all documents.
  25.370 +
  25.371 + -- Gregor Hoffleit <flight@debian.org>  Fri, 28 Jan 2000 11:51:06 +0100
  25.372 +
  25.373 +masqmail (0.0.8-1) unstable; urgency=low
  25.374 +
  25.375 +  * New upstream version.
  25.376 +  * Made the source compile on both slink and potato.
  25.377 +
  25.378 + -- Gregor Hoffleit <flight@debian.org>  Fri,  29 Oct 1999 10:40:27 +0200
  25.379 +
  25.380 +masqmail (0.0.3-1slink) stable; urgency=low
  25.381 +
  25.382 +  * New upstream version.
  25.383 +  * Compiled for slink.
  25.384 +
  25.385 + -- Gregor Hoffleit <flight@debian.org>  Mon,  4 Oct 1999 14:44:27 +0200
  25.386 +
  25.387 +masqmail (0.0.2-1) unstable; urgency=low
  25.388 +
  25.389 +  * New upstream version.
  25.390 +
  25.391 + -- Gregor Hoffleit <flight@debian.org>  Sat, 25 Sep 1999 12:32:02 +0200
  25.392 +
  25.393 +masqmail (0.0.1-1) unstable; urgency=low
  25.394 +
  25.395 +  * Initial Release.
  25.396 +
  25.397 + -- Gregor Hoffleit <flight@debian.org>  Wed, 15 Sep 1999 14:07:55 +0200
  25.398 +
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/debian/control	Fri Sep 26 17:05:23 2008 +0200
    26.3 @@ -0,0 +1,23 @@
    26.4 +Source: masqmail
    26.5 +Section: mail
    26.6 +Priority: extra
    26.7 +Maintainer: Oliver Kurth <oku@debian.org>
    26.8 +Standards-Version: 3.5.7
    26.9 +Build-Depends: debhelper (>> 3.0), liblockfile-dev, libglib2.0-dev, libident-dev
   26.10 +
   26.11 +Package: masqmail
   26.12 +Architecture: any
   26.13 +Depends: ${shlibs:Depends}, debconf (>> 0.5) | debconf-2.0, netbase
   26.14 +Replaces: mail-transport-agent
   26.15 +Provides: mail-transport-agent
   26.16 +Suggests: mail-reader, logrotate
   26.17 +Conflicts: mail-transport-agent
   26.18 +Description: A mailer for hosts without permanent internet connection
   26.19 + MasqMail is a MTA (mail transport agent) and POP3 client for hosts 
   26.20 + that don't have a permanent internet connection, eg. a home network 
   26.21 + or a single host at home and notebooks. It has special support for
   26.22 + connections to different ISPs.
   26.23 + .
   26.24 + In these cases, MasqMail is a slim replacement for full-blown MTAs 
   26.25 + such as sendmail, exim, qmail or postfix. The POP3 client can be
   26.26 + a small replacement for other full-featured tools like fetchmail.
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/debian/copyright	Fri Sep 26 17:05:23 2008 +0200
    27.3 @@ -0,0 +1,29 @@
    27.4 +This is Debian prepackaged version of MasqMail, a small mail transport agent
    27.5 +for hosts without a permanent internet connection.
    27.6 +
    27.7 +This package is maintained by Oliver Kurth <oku@masqmail.cx>. Its source
    27.8 +can be obtained from
    27.9 +
   27.10 +    http://masqmail.cx/masqmail/
   27.11 +
   27.12 +Upstream author: Oliver Kurth <oku@masqmail.cx>
   27.13 +
   27.14 +
   27.15 +    Copyright (C) 1999 Oliver Kurth
   27.16 +
   27.17 +    This program is free software; you can redistribute it and/or modify
   27.18 +    it under the terms of the GNU General Public License as published by
   27.19 +    the Free Software Foundation; either version 2 of the License, or
   27.20 +    (at your option) any later version.
   27.21 +
   27.22 +    This program is distributed in the hope that it will be useful,
   27.23 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.24 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   27.25 +    GNU General Public License for more details.
   27.26 +
   27.27 +    You should have received a copy of the GNU General Public License
   27.28 +    along with this program; if not, write to the Free Software
   27.29 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   27.30 +
   27.31 +On Debian GNU/Linux systems, the complete text of the GNU General
   27.32 +Public License can be found in `/usr/share/common-licenses/GPL'.
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/debian/dirs	Fri Sep 26 17:05:23 2008 +0200
    28.3 @@ -0,0 +1,12 @@
    28.4 +etc/masqmail
    28.5 +usr/sbin
    28.6 +usr/bin
    28.7 +var/log
    28.8 +var/spool
    28.9 +var/run/masqmail
   28.10 +etc/logrotate.d
   28.11 +etc/ppp/ip-up.d
   28.12 +etc/ppp/ip-down.d
   28.13 +etc/network/if-up.d
   28.14 +etc/network/if-down.d
   28.15 +usr/share/lintian/overrides
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/debian/docs	Fri Sep 26 17:05:23 2008 +0200
    29.3 @@ -0,0 +1,1 @@
    29.4 +AUTHORS INSTALL NEWS README TODO debian/README.online
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/debian/mailq.8	Fri Sep 26 17:05:23 2008 +0200
    30.3 @@ -0,0 +1,1 @@
    30.4 +.so man8/masqmail.8
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/debian/mailrm.8	Fri Sep 26 17:05:23 2008 +0200
    31.3 @@ -0,0 +1,1 @@
    31.4 +.so man8/masqmail.8
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/debian/masqmail.config	Fri Sep 26 17:05:23 2008 +0200
    32.3 @@ -0,0 +1,192 @@
    32.4 +#!/bin/bash -e
    32.5 +
    32.6 +# Source debconf library.
    32.7 +. /usr/share/debconf/confmodule
    32.8 +
    32.9 +db_version 2.0
   32.10 +
   32.11 +# This conf script is capable of backing up
   32.12 +db_capb backup
   32.13 +
   32.14 +if [ x"$1" = x"configure" ] ; then
   32.15 +    if [ -n $2 ] ; then
   32.16 +	if dpkg --compare-versions "$2" lt "0.2.10-0.2" ; then
   32.17 +	    PCMCIA_SCRIPT_UP=/etc/pcmcia/ip-up.d/1masqmail
   32.18 +	    PCMCIA_SCRIPT_DOWN=/etc/pcmcia/ip-down.d/99masqmail
   32.19 +	    if [ -x $PCMCIA_SCRIPT_UP ] || [ -x $PCMCIA_SCRIPT_DOWN ] ; then
   32.20 +		chmod -x $PCMCIA_SCRIPT_UP $PCMCIA_SCRIPT_DOWN
   32.21 +		db_input high masqmail/note_pcmcia_scripts || true;
   32.22 +		db_go
   32.23 +	    fi
   32.24 +	fi
   32.25 +    fi
   32.26 +fi
   32.27 +
   32.28 +if [ x"$1" = x"configure" ] ; then
   32.29 +    if [ -n $2 ] ; then
   32.30 +	if dpkg --compare-versions "$2" lt "0.2.17-1" ; then
   32.31 +	    db_input medium masqmail/note_moved_tpl || true;
   32.32 +	    db_go
   32.33 +	fi
   32.34 +    fi
   32.35 +fi
   32.36 +
   32.37 +# shamelessly copied from xserver-common.config.
   32.38 +# Thanks to Branden. :-)
   32.39 +
   32.40 +CONFIGFILE=/etc/masqmail/masqmail.conf
   32.41 +
   32.42 +ASK_TO_REPLACE=
   32.43 +if [ -e $CONFIGFILE ]; then
   32.44 +  # does the file have debconf markers in it?
   32.45 +  if egrep -q '^### BEGIN DEBCONF SECTION' $CONFIGFILE && \
   32.46 +     egrep -q '^### END DEBCONF SECTION' $CONFIGFILE; then
   32.47 +    PRIORITY=medium
   32.48 +  else
   32.49 +    ASK_TO_REPLACE=yes
   32.50 +    PRIORITY=high
   32.51 +  fi
   32.52 +else
   32.53 +  PRIORITY=medium
   32.54 +  # this is for the postinst, which tests this:
   32.55 +  db_set masqmail/move_existing_nondebconf_config "true"
   32.56 +fi
   32.57 +
   32.58 +# use debconf to manage configuration file?
   32.59 +db_input $PRIORITY masqmail/manage_config_with_debconf || true
   32.60 +db_go
   32.61 +db_get masqmail/manage_config_with_debconf
   32.62 +if [ "$RET" = "false" ]; then
   32.63 +  exit 0
   32.64 +fi
   32.65 +
   32.66 +# move existing configuration file out of
   32.67 +# the way?
   32.68 +if [ x"$ASK_TO_REPLACE" = x"yes" ]; then
   32.69 +  db_input $PRIORITY masqmail/move_existing_nondebconf_config || true
   32.70 +  db_go
   32.71 +  db_get masqmail/move_existing_nondebconf_config || true
   32.72 +  if [ "$RET" = "true" ]; then
   32.73 +    mv $CONFIGFILE $CONFIGFILE.debconf-backup
   32.74 +  else
   32.75 +    exit 0
   32.76 +  fi
   32.77 +fi
   32.78 +
   32.79 +if [ -f /etc/mailname ] ; then
   32.80 +  hostfqdn=`cat /etc/mailname`
   32.81 +else
   32.82 +  hostfqdn=`hostname -f`
   32.83 +fi
   32.84 +hostname=`hostname`
   32.85 +
   32.86 +db_fget masqmail/host_name seen
   32.87 +if [ "$RET" = "false" ]; then
   32.88 +    db_set masqmail/host_name ${hostfqdn}
   32.89 +fi
   32.90 +db_fget masqmail/local_hosts seen
   32.91 +if [ "$RET" = "false" ]; then
   32.92 +    db_set masqmail/local_hosts "localhost;${hostname};${hostfqdn}"
   32.93 +fi
   32.94 +
   32.95 +STATE=1
   32.96 +while [ "$STATE" != 0 -a "$STATE" != 19 ]; do
   32.97 +	case "$STATE" in
   32.98 +	1)
   32.99 +		db_input medium masqmail/host_name || true
  32.100 +		;;
  32.101 +	2)
  32.102 +		db_input medium masqmail/local_hosts || true
  32.103 +		;;
  32.104 +	3)
  32.105 +		db_input medium masqmail/local_nets || true
  32.106 +		;;
  32.107 +	4)
  32.108 +		db_input medium masqmail/listen_addresses || true
  32.109 +		;;
  32.110 +	5)
  32.111 +		db_input low masqmail/use_syslog || true
  32.112 +		;;
  32.113 +	6)
  32.114 +		db_input medium masqmail/online_detect || true
  32.115 +		;;
  32.116 +	7)
  32.117 +		db_get masqmail/online_detect
  32.118 +		if [ "$RET" = "file" ] ; then
  32.119 +			db_input low masqmail/online_file || true
  32.120 +		else
  32.121 +			db_input medium masqmail/online_pipe || true
  32.122 +		fi
  32.123 +		;;
  32.124 +	8)
  32.125 +		db_input medium masqmail/mbox_default || true
  32.126 +		;;
  32.127 +	9)
  32.128 +		db_get masqmail/mbox_default
  32.129 +		if [ "$RET" = "mda" ] ; then
  32.130 +		    db_input medium masqmail/mda || true
  32.131 +		else
  32.132 +		    db_input low masqmail/mda || true
  32.133 +		fi
  32.134 +		;;
  32.135 +	10)
  32.136 +		db_input low masqmail/alias_local_caseless || true
  32.137 +		;;
  32.138 +	11)
  32.139 +		db_input low masqmail/init_smtp_daemon || true
  32.140 +		;;
  32.141 +	12)
  32.142 +		db_input low masqmail/init_queue_daemon || true
  32.143 +		;;
  32.144 +	13)
  32.145 +		db_get masqmail/init_queue_daemon
  32.146 +		if [ "$RET" = "true" ] ; then
  32.147 +		    db_input low masqmail/queue_daemon_ival || true
  32.148 +		fi
  32.149 +		;;
  32.150 +	14)
  32.151 +		db_input medium masqmail/init_fetch_daemon || true
  32.152 +		;;
  32.153 +	15)
  32.154 +		db_get masqmail/init_fetch_daemon
  32.155 +		if [ "$RET" = "true" ] ; then
  32.156 +		    db_input low masqmail/fetch_daemon_ival || true
  32.157 +		fi
  32.158 +		;;
  32.159 +	16)
  32.160 +		db_input medium masqmail/ipup_runqueue || true
  32.161 +		;;
  32.162 +	17)
  32.163 +		db_input medium masqmail/ipup_fetch || true
  32.164 +		;;
  32.165 +	18)
  32.166 +		db_input medium masqmail/ifup_ifaces || true
  32.167 +		;;
  32.168 +
  32.169 +	esac			
  32.170 +
  32.171 +	if db_go; then
  32.172 +		STATE=$(($STATE + 1))
  32.173 +	else
  32.174 +		STATE=$(($STATE - 1))
  32.175 +	fi
  32.176 +done
  32.177 + 	
  32.178 +db_input medium masqmail/you_are_not_finished || true
  32.179 +db_go
  32.180 +
  32.181 +# dpkg-reconfigure does not stop services:
  32.182 +# (cause of Bug#151528)
  32.183 +# in debhelper version < 1.2.9
  32.184 +
  32.185 +DH_VERSION=`dpkg -l debconf | awk ' /^ii/ { print $3 }'`
  32.186 +
  32.187 +if dpkg --compare-versions $DH_VERSION lt "1.2.9" ; then
  32.188 +    if [ x"$1" = x"reconfigure" ] ; then
  32.189 +	if [ -x "/etc/init.d/masqmail" ]; then
  32.190 +	    /etc/init.d/masqmail stop || true
  32.191 +	fi
  32.192 +    fi
  32.193 +fi
  32.194 +
  32.195 +exit 0
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/debian/masqmail.init	Fri Sep 26 17:05:23 2008 +0200
    33.3 @@ -0,0 +1,104 @@
    33.4 +#!/bin/sh
    33.5 +# /etc/init.d/masqmail
    33.6 +#
    33.7 +# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
    33.8 +# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
    33.9 +# Modified for exim by Tim Cutts <tjrc1@mole.bio.cam.ac.uk>
   33.10 +# Modified for masqmail by Gregor Hoffleit <flight@debian.org>
   33.11 +# Modified for masqmail by Oliver Kurth <oku@masqmail.cx>
   33.12 +
   33.13 +set -e
   33.14 +
   33.15 +# If you disable this file, masqmail can be run from /etc/inetd.conf
   33.16 +#exit 0
   33.17 +
   33.18 +# defaults, do not edit here but in
   33.19 +# /etc/default/masqmail
   33.20 +INIT_SMTP_DAEMON=true
   33.21 +INIT_QUEUE_DAEMON=true
   33.22 +INIT_FETCH_DAEMON=false
   33.23 +QUEUE_DAEMON_IVAL=-q10m
   33.24 +FETCH_DAEMON_IVAL=-go5m
   33.25 +
   33.26 +RUN_DIR=/var/run/masqmail
   33.27 +
   33.28 +[ -r /etc/default/masqmail ] && . /etc/default/masqmail
   33.29 +
   33.30 +PATH=/sbin:/bin:/usr/sbin:/usr/bin
   33.31 +DAEMON=/usr/sbin/masqmail
   33.32 +NAME=masqmail
   33.33 +DESC="MTA (masqmail)"
   33.34 +
   33.35 +test -x $DAEMON || exit 0
   33.36 +
   33.37 +if [ ! -f /etc/masqmail/masqmail.conf ] ; then
   33.38 +    echo "you have to configure masqmail first."
   33.39 +    exit 0
   33.40 +fi
   33.41 +
   33.42 +if [ x"$INIT_SMTP_DAEMON" = x"true" ] || [ x"$INIT_QUEUE_DAEMON" = x"true" ] ; then
   33.43 +    DAEMON_ARGS=
   33.44 +    if [ x"$INIT_SMTP_DAEMON" = x"true" ] ; then
   33.45 +	DAEMON_ARGS=-bd
   33.46 +    fi
   33.47 +
   33.48 +    if [ x"$INIT_QUEUE_DAEMON" = x"true" ] ; then
   33.49 +	DAEMON_ARGS="$DAEMON_ARGS $QUEUE_DAEMON_IVAL"
   33.50 +    fi
   33.51 +    INIT_DAEMON=true
   33.52 +else
   33.53 +    INIT_DAEMON=false
   33.54 +fi
   33.55 +
   33.56 +case "$1" in
   33.57 +  start)
   33.58 +    echo -n "Starting $DESC: "
   33.59 +    if [ x"$INIT_DAEMON" = x"true" ] ; then
   33.60 +	update-inetd --disable smtp
   33.61 +	start-stop-daemon --start --startas $DAEMON \
   33.62 +	    --pidfile $RUN_DIR/masqmail.pid -- $DAEMON_ARGS
   33.63 +	echo -n " listen/queue"
   33.64 +    fi
   33.65 +    if [ x"$INIT_FETCH_DAEMON" = x"true" ] ; then
   33.66 +	start-stop-daemon --start --startas $DAEMON \
   33.67 +	    --pidfile $RUN_DIR/masqmail-get.pid -- $FETCH_DAEMON_IVAL
   33.68 +	echo -n " fetch"
   33.69 +    fi
   33.70 +    echo "."
   33.71 +    ;;
   33.72 +  stop)
   33.73 +    echo -n "Stopping $DESC: "
   33.74 +    if [ -f $RUN_DIR/masqmail.pid ] ; then
   33.75 +	start-stop-daemon --stop --oknodo --retry 1 --name $NAME --pidfile $RUN_DIR/masqmail.pid
   33.76 +	update-inetd --enable smtp
   33.77 +	echo -n " listen/queue"
   33.78 +    fi
   33.79 +    if [ -f $RUN_DIR/masqmail-get.pid ] ; then
   33.80 +	start-stop-daemon --stop --oknodo --retry 1 --name $NAME --pidfile $RUN_DIR/masqmail-get.pid
   33.81 +	echo -n " fetch"
   33.82 +    fi
   33.83 +    echo "."
   33.84 +      ;;
   33.85 +  restart)
   33.86 +    $0 stop
   33.87 +    $0 start
   33.88 +    ;;
   33.89 +  reload|force-reload)
   33.90 +    echo -n "Reloading $DESC configuration files: "
   33.91 +    if [ -f $RUN_DIR/masqmail.pid ] ; then
   33.92 +	start-stop-daemon --stop --signal 1 --pidfile $RUN_DIR/masqmail.pid
   33.93 +	echo -n " listen/queue"
   33.94 +    fi
   33.95 +    if [ -f $RUN_DIR/masqmail-get.pid ] ; then
   33.96 +	start-stop-daemon --stop --signal 1 --pidfile $RUN_DIR/masqmail-get.pid
   33.97 +	echo -n " fetch"
   33.98 +    fi
   33.99 +    echo "."
  33.100 +    ;;
  33.101 +  *)
  33.102 +    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
  33.103 +    exit 1
  33.104 +    ;;
  33.105 +esac
  33.106 +
  33.107 +exit 0
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/debian/masqmail.ip-up	Fri Sep 26 17:05:23 2008 +0200
    34.3 @@ -0,0 +1,71 @@
    34.4 +#!/bin/sh
    34.5 +
    34.6 +# Exit if package was removed but not purged.
    34.7 +test -x /usr/sbin/masqmail || exit 0
    34.8 +
    34.9 +# defaults, do not edit here but in
   34.10 +# /etc/default/masqmail
   34.11 +IPUP_RUNQUEUE=true
   34.12 +IPUP_FETCH=true
   34.13 +
   34.14 +[ -r /etc/default/masqmail ] && . /etc/default/masqmail
   34.15 +
   34.16 +if [ -n "$PPP_IFACE" ]; then
   34.17 +	SCHEME="$PPP_IPPARAM"
   34.18 +	IFACE=$PPP_IFACE
   34.19 +else
   34.20 +	SCHEME="${IF_MROUTE:-$IF_NAME}"
   34.21 +fi
   34.22 +
   34.23 +if [ ! x"$IFUP_IFACES" = x"all" ] ; then
   34.24 +  echo $IFUP_IFACES | grep $IFACE > /dev/null || exit 0
   34.25 +fi
   34.26 +
   34.27 +DETECT="`awk -F'[ \t]*=[ \t]*' '/^online_detect/ \
   34.28 +	{ print split($2,A,\"\\\"\") == 3 ? A[2] :  $2 }' /etc/masqmail/masqmail.conf`"
   34.29 +
   34.30 +if [ x"$DETECT" = x"file" ] ; then
   34.31 +    ROUTEFILE="`awk -F'[ \t]*=[ \t]*' '/^online_file/ \
   34.32 +	    { print split($2,A,\"\\\"\") == 3 ? A[2] :  $2 }' /etc/masqmail/masqmail.conf`"
   34.33 +
   34.34 +    if [ -z "$ROUTEFILE" ]; then
   34.35 +	    echo "no online_file defined in /etc/masqmail/masqmail.conf"
   34.36 +	    exit 1
   34.37 +    fi
   34.38 +fi
   34.39 +
   34.40 +if [ -z "$MODE" ]; then
   34.41 +	case `dirname "$0"` in
   34.42 +		*/if-up.d|*/ip-up.d)
   34.43 +		    MODE=start;
   34.44 +		    ;;
   34.45 +		*/if-down.d|*/ip-down.d)
   34.46 +		    MODE=stop;
   34.47 +		    ;;
   34.48 +	esac
   34.49 +fi
   34.50 +
   34.51 +case "$MODE" in
   34.52 +	start)
   34.53 +		if [ -n "$SCHEME" ] ; then
   34.54 +		    echo -n "$SCHEME" > "$ROUTEFILE"
   34.55 +		    chmod 0644 "$ROUTEFILE"
   34.56 +		fi
   34.57 +		if [ x"$IPUP_RUNQUEUE" = x"true" ] ; then
   34.58 +		    /usr/sbin/masqmail -qo &
   34.59 +		fi
   34.60 +		if [ x"$IPUP_FETCH" = x"true" ] ; then
   34.61 +		    /usr/sbin/masqmail -go &
   34.62 +		fi
   34.63 +		;;
   34.64 +	stop)
   34.65 +		rm -f "$ROUTEFILE"
   34.66 +		;;
   34.67 +	*)
   34.68 +		echo "$0: unknown MODE"
   34.69 +		;;
   34.70 +esac
   34.71 +
   34.72 +exit 0
   34.73 +
   34.74 +
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/debian/masqmail.links	Fri Sep 26 17:05:23 2008 +0200
    35.3 @@ -0,0 +1,5 @@
    35.4 +/usr/sbin/masqmail /usr/lib/sendmail
    35.5 +/usr/sbin/masqmail /usr/sbin/sendmail
    35.6 +/usr/sbin/masqmail /usr/bin/mailq
    35.7 +/usr/sbin/masqmail /usr/bin/mailrm
    35.8 +
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/debian/masqmail.lintian	Fri Sep 26 17:05:23 2008 +0200
    36.3 @@ -0,0 +1,4 @@
    36.4 +# has to be setuid:
    36.5 +masqmail: setuid-binary usr/sbin/masqmail 4755 root/root
    36.6 +# worked around that in debian/masqmail.config:
    36.7 +masqmail: init-script-suggests-versioned-depends postinst
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/debian/masqmail.logrotate	Fri Sep 26 17:05:23 2008 +0200
    37.3 @@ -0,0 +1,22 @@
    37.4 +/var/log/masqmail/masqmail.log {
    37.5 +	rotate 2
    37.6 +	weekly
    37.7 +	compress
    37.8 +	delaycompress
    37.9 +	missingok
   37.10 +	notifempty
   37.11 +	postrotate
   37.12 +		/etc/init.d/masqmail reload > /dev/null
   37.13 +	endscript
   37.14 +}
   37.15 +/var/log/masqmail/debug.log {
   37.16 +	rotate 2
   37.17 +	weekly
   37.18 +	compress
   37.19 +	delaycompress
   37.20 +	missingok
   37.21 +	notifempty
   37.22 +	postrotate
   37.23 +		/etc/init.d/masqmail reload > /dev/null
   37.24 +	endscript
   37.25 +}
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/debian/masqmail.templates	Fri Sep 26 17:05:23 2008 +0200
    38.3 @@ -0,0 +1,267 @@
    38.4 +Template: masqmail/note_moved_tpl
    38.5 +Type: note
    38.6 +Description: Failure notice templates have been moved
    38.7 + The delivery failure notices that lived in /etc/masqmail/tpl are now in
    38.8 + /usr/share/masqmail/tpl/.
    38.9 + .
   38.10 + You will notice this only if you have changed the location in
   38.11 + masqmail.conf or changed the templates.
   38.12 + .
   38.13 + Since they are no longer conffiles because of the move, you should
   38.14 + give a customized version another name, otherwise it will be
   38.15 + overwritten on the next upgrade.
   38.16 +
   38.17 +Template: masqmail/note_pcmcia_scripts
   38.18 +Type: note
   38.19 +Description: Removed executable bit in scripts in /etc/pcmcia/ip-{up,down}.d/
   38.20 + The scripts in /etc/pcmcia/ip-{up,down}.d/ are deprecated
   38.21 + and are replaced with the scripts /etc/network/if-{up,down}.d/1masqmail, which
   38.22 + will work for _any_ network card (not just pcmcia). The executable bit of the
   38.23 + old scripts has been removed, because otherwise they and the new scripts would be
   38.24 + exececuted, which is not desired.
   38.25 + .
   38.26 + You should remove these scripts from /etc/pcmcia/ip-{up,down}.d/. If you still want
   38.27 + to use them, just reset the executable bit.
   38.28 + .
   38.29 + Whatever you do, you will never see the note again.
   38.30 +
   38.31 +Template: masqmail/manage_config_with_debconf
   38.32 +Type: boolean
   38.33 +Default: true
   38.34 +Description: Manage masqmail.conf using debconf?
   38.35 + The /etc/masqmail/masqmail.conf file can be handled automatically
   38.36 + by debconf, or manually by you.
   38.37 + .
   38.38 + Note that only specific, marked sections of the configuration file will be
   38.39 + handled by debconf if you select this option; if those markers are absent,
   38.40 + you will have to update the file manually, or move or delete the file.
   38.41 +
   38.42 +Template: masqmail/move_existing_nondebconf_config
   38.43 +Type: boolean
   38.44 +Default: false
   38.45 +Description: Replace existing /etc/masqmail/masqmail.conf file?
   38.46 + The existing /etc/masqmail/masqmail.conf file currently on the system does
   38.47 + not contain a marked section for debconf to write its data.
   38.48 + .
   38.49 + If you select this option, the existing configuration
   38.50 + file will be backed up to /etc/masqmail/masqmail.conf.debconf-backup and a
   38.51 + new file written to /etc/masqmail/masqmail.conf.  If you do not select this
   38.52 + option, the existing configuration file will not be managed by debconf,
   38.53 + and no further questions about masqmail configuration will be
   38.54 + asked.
   38.55 +
   38.56 +Template: masqmail/host_name
   38.57 +Type: string
   38.58 +Default:
   38.59 +Description: The name with which masqmail identifies itself to others
   38.60 + This is most likely your hostname. It is used in its SMTP greeting
   38.61 + banner, for expanding unqualified addresses, the Message ID and so on.
   38.62 +
   38.63 +Template: masqmail/local_hosts
   38.64 +Type: string
   38.65 +Default:
   38.66 +Description: hosts considered local
   38.67 + This is a list of hosts, separated with semicolons (;), which are
   38.68 + considered 'local', ie. mail to this host will be delivered to a
   38.69 + mailbox (or Maildir or MDA) on this host.
   38.70 + .
   38.71 + You will most likely insert 'localhost', your hostname in its fully
   38.72 + qualified version, and just the simple hostname here.
   38.73 + .
   38.74 + You can also use wildcard expressions like '*' and '?'.
   38.75 +
   38.76 +Template: masqmail/local_nets
   38.77 +Type: string
   38.78 +Default:
   38.79 +Description: nets considered local, for immediate delivery attempts
   38.80 + This is a list of hosts, separated with semicolons (;), which are
   38.81 + on your local network, ie. they are always reachable, without a
   38.82 + dialup connection. Mail to these hosts will be delivered immediately,
   38.83 + without checking for the online status.
   38.84 + .
   38.85 + You can use wildcards expressions like '*' and '?', eg. *.yournet.local
   38.86 + .
   38.87 + If you have only one box, you can leave this empty. If you do not want
   38.88 + to use masqmail as an offline MTA, and the whole internet or another mail
   38.89 + server which accepts outgoing mail is all time
   38.90 + reachable to you, just insert '*'.
   38.91 +
   38.92 +Template: masqmail/listen_addresses
   38.93 +Type: string
   38.94 +Default: localhost:25
   38.95 +Description: accept connections on these interfaces
   38.96 + masqmail, for security reasons, does not listen an all network interfaces
   38.97 + by default. If there are no other hosts connected to your host, just leave
   38.98 + this 'localhost:25'. If there are other hosts that may want to send SMTP
   38.99 + messages to this host, add the address of you network interface here,
  38.100 + eg.: localhost:25;192.168.1.2:25.
  38.101 + .
  38.102 + Of course you can also replace the '25' with another port number, but
  38.103 + this is unusual.
  38.104 +
  38.105 +Template: masqmail/use_syslog
  38.106 +Type: boolean
  38.107 +Default: false
  38.108 +Description: use syslogd for logs?
  38.109 + You can decide whether masqmail should log via syslog or not. If not,
  38.110 + logs will be written to /var/log/masqmail/masqmail.log.
  38.111 +
  38.112 +Template: masqmail/online_detect
  38.113 +Type: select
  38.114 +Choices: file, pipe
  38.115 +Default: file
  38.116 +Description: the online detection method
  38.117 + masqmail has different methods to determine whether it is online or not,
  38.118 + these are 'file','pipe'.
  38.119 + .
  38.120 + For 'file', masqmail checks for the existence of a file, and, if it
  38.121 + exists, reads from it the name of the connection.
  38.122 + .
  38.123 + For 'pipe', masqmail calls a program or script, which outputs the name
  38.124 + if online or nothing if not. You can use eg. the program guessnet for this.
  38.125 +
  38.126 +Template: masqmail/online_file
  38.127 +Type: string
  38.128 +Default: /var/run/masqmail-route
  38.129 +Description: the name of the file to determine the online status
  38.130 +
  38.131 +Template: masqmail/online_pipe
  38.132 +Type: string
  38.133 +Default:
  38.134 +Description: the name of the program to determine the online status
  38.135 + Note that, when this program is called, masqmail has the user id 'mail'.
  38.136 +
  38.137 +Template: masqmail/mbox_default
  38.138 +Type: select
  38.139 +Choices: mbox, mda, maildir
  38.140 +Default: mbox
  38.141 +Description: local delivery style
  38.142 + Local mail can be delivered to a mailbox, to an MDA (eg. procmail)
  38.143 + or to a qmail style maildir in the users home dir.
  38.144 + .
  38.145 + You can select the default style here. You can configure this also
  38.146 + on a per-user basis with the options mbox_users, mda_users and
  38.147 + maildir_users.
  38.148 +
  38.149 +Template: masqmail/mda
  38.150 +Type: string
  38.151 +Default: /usr/bin/procmail -Y -d ${rcpt_local}
  38.152 +Description: The MDA command line including options
  38.153 + Give here the path to the mda, including its arguments. You can use
  38.154 + substitution values here, eg. ${rcpt_local} for the user name.
  38.155 + .
  38.156 + For other substitutions please see the man page.
  38.157 + .
  38.158 + (This question is also asked if you did not set mbox_default to mda,
  38.159 + since you can use mda for a set of users specially)
  38.160 +
  38.161 +Template: masqmail/alias_local_caseless
  38.162 +Type: boolean
  38.163 +Default: false
  38.164 +Description: Alias expansion regarding case or not
  38.165 + masqmail uses the file /etc/aliases to redirect local addresses.
  38.166 + The search for a match in /etc/aliases can be regarding upper/lower
  38.167 + case or insensitive to case.
  38.168 +
  38.169 +Template: masqmail/init_smtp_daemon
  38.170 +Type: boolean
  38.171 +Default: true
  38.172 +Description: Start SMTP listening daemon?
  38.173 + Select 'yes' if you want masqmail to start as an SMTP listening
  38.174 + daemon. You will need this if:
  38.175 + .
  38.176 + - there are other hosts in your local network that may want to send mail via this host
  38.177 + .
  38.178 + - you use a mail client that sends mail via SMTP (netscape, mozilla are examples)
  38.179 + .
  38.180 + If in doubt, select 'yes'.
  38.181 +
  38.182 +Template: masqmail/init_queue_daemon
  38.183 +Type: boolean
  38.184 +Default: true
  38.185 +Description: Start SMTP queue running daemon?
  38.186 + Select 'yes' if you want masqmail to start as a queue running daemon. You will
  38.187 + need this very likely. It is used for mail that cannot delivered immediately,
  38.188 + either because of delivery failures or because you were not online on
  38.189 + the first attempt to send a mail.
  38.190 + .
  38.191 + If in doubt, select 'yes'.
  38.192 +
  38.193 +Template: masqmail/queue_daemon_ival
  38.194 +Type: string
  38.195 +Default: -q10m
  38.196 +Description: The interval for the queue running daemon
  38.197 + Set the interval for the queue running daemon. -q10m means flush the queue every
  38.198 + 10 minutes.
  38.199 + .
  38.200 + The format is -q, followed by an numeric value and one of the letters s,m,h,d,w for
  38.201 + seconds, minutes, hours, days or weeks respectively.
  38.202 + .
  38.203 + Reasonable values are between 5 minutes (-q5m) and 2 hours (-q2h).
  38.204 +
  38.205 +Template: masqmail/init_fetch_daemon
  38.206 +Type: boolean
  38.207 +Default: false
  38.208 +Description: Start POP3 fetch daemon?
  38.209 + Select 'yes' if you want masqmail to start as a fetch daemon. If you say 'yes',
  38.210 + masqmail will try to fetch mail from pop servers that you configure in regular
  38.211 + intervals, detecting the online status first.
  38.212 + .
  38.213 + No matter what you choose here, you can later select whether you want to fetch
  38.214 + mail the moment you get online.
  38.215 +
  38.216 +Template: masqmail/fetch_daemon_ival
  38.217 +Type: string
  38.218 +Default: -go5m
  38.219 +Description: The interval for the fetch daemon
  38.220 + Set the interval for the fetch daemon. -go5m means try to fetch mail every
  38.221 + 5 minutes.
  38.222 + .
  38.223 + The format is -go, followed by an numeric value and one of the letters s,m,h,d,w for
  38.224 + seconds, minutes, hours, days or weeks respectively.
  38.225 + .
  38.226 + Reasonable values are between 2 minutes (-go2m) and 2 hours (-go2h).
  38.227 +
  38.228 +Template: masqmail/ipup_runqueue
  38.229 +Type: boolean
  38.230 +Default: true
  38.231 +Description: flush mail queue when you get online?
  38.232 + Select 'yes' if you want masqmail to immediately flush its mail queue as soon
  38.233 + as you go online. This will be done in the ip-up script in /etc/ppp/ip-up or
  38.234 + in /etc/network/if-up.d/.
  38.235 +
  38.236 +Template: masqmail/ipup_fetch
  38.237 +Type: boolean
  38.238 +Default: false
  38.239 +Description: fetch mail when you get online?
  38.240 + Select 'yes' if you want masqmail to immediately fetch mail from POP3
  38.241 + servers as soon as you go online. This will be done in the ip-up script
  38.242 + in /etc/ppp/ip-up or in /etc/network/if-up.d/.
  38.243 +
  38.244 +Template: masqmail/ifup_ifaces
  38.245 +Type: string
  38.246 +Default: all
  38.247 +Description: a list of interfaces used for masqmail online detection
  38.248 + Set this to a list of network interfaces. When any of those interfaces go
  38.249 + up, the current online status will be used for queue runs and/or fetching
  38.250 + mails. The list will be used in the /etc/ppp/ip-up and /etc/network/if-up.d/
  38.251 + scripts, when the interface goes up.
  38.252 + .
  38.253 + A reasonable choice is eg. 'ppp0' for a desktop at home, or 'ppp0 eth0' for
  38.254 + a notebook". If this is set to eg. 'ppp0', nothing happens if eth0 goes up.
  38.255 + .
  38.256 + Set to 'all' for all interfaces, or 'none' for no interfaces.
  38.257 +
  38.258 +Template: masqmail/you_are_not_finished
  38.259 +Type: note
  38.260 +Description: You are not finished
  38.261 + Although masqmail is not as feature rich as other MTAs like sendmail
  38.262 + or exim, this debconf does not (yet) do all configurations for you.
  38.263 + .
  38.264 + To make use of masqmail, you still have to create some sub configuration
  38.265 + files for sending mail to some ISP and/or to fetch mail. masqmail has
  38.266 + lots of man pages and examples which are hopefully clear enough to
  38.267 + explain to you how to do it.
  38.268 + .
  38.269 + You should start with the man pages masqmail.conf, masqmail.route
  38.270 + and masqmail.get.
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/debian/newaliases	Fri Sep 26 17:05:23 2008 +0200
    39.3 @@ -0,0 +1,2 @@
    39.4 +#!/bin/sh
    39.5 +/usr/lib/sendmail -bi
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/debian/newaliases.8	Fri Sep 26 17:05:23 2008 +0200
    40.3 @@ -0,0 +1,22 @@
    40.4 +.TH newaliases 8
    40.5 +.SH NAME
    40.6 +newaliases \- update /etc/aliases database
    40.7 +.SH SYNOPSIS
    40.8 +.B newaliases
    40.9 +
   40.10 +.SH DESCRIPTION
   40.11 +newaliases is called by many applications to notify the mail transport
   40.12 +agent of changes to the system mail aliases database.
   40.13 +MasqMail doesn't need to be notified of changes to /etc/aliases, therefore
   40.14 +this script does nothing. It is provided only for compatibility with 
   40.15 +the sendmail program.
   40.16 +
   40.17 +.SH FILES
   40.18 +/etc/aliases
   40.19 +
   40.20 +.SH SEE ALSO
   40.21 +\fBmasqmail.aliases (5)\f1, \fBmasqmail.conf (5)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.get (5)\f1
   40.22 +
   40.23 +.SH AUTHOR
   40.24 +This manual page was stitched together by Gregor Hoffleit
   40.25 +<flight@debian.org> for the Debian project.
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/debian/postinst	Fri Sep 26 17:05:23 2008 +0200
    41.3 @@ -0,0 +1,166 @@
    41.4 +#!/bin/sh -e
    41.5 +
    41.6 +# source debconf library
    41.7 +. /usr/share/debconf/confmodule
    41.8 +
    41.9 +CONFIGFILE=/etc/masqmail/masqmail.conf
   41.10 +WORKTMP=$CONFIGFILE.tmp
   41.11 +DEBCONFTMP=$CONFIGFILE.debconf
   41.12 +
   41.13 +DEFAULTSFILE=/etc/default/masqmail
   41.14 +DEBDEFTMP=$DEFAULTSFILE.debconf
   41.15 +
   41.16 +create_db_conf (){
   41.17 +    rm -f $WORKTMP $DEBCONFTMP
   41.18 +
   41.19 +    cat >> $DEBCONFTMP << EOF
   41.20 +### BEGIN DEBCONF SECTION
   41.21 +# Do not edit within this region if you want your changes to be preserved by
   41.22 +# debconf.  Instead, make changes after the "### END DEBCONF SECTION" line.
   41.23 +EOF
   41.24 +
   41.25 +    db_get masqmail/host_name || true
   41.26 +    echo "host_name=\"$RET\"" >> $DEBCONFTMP
   41.27 +    db_get masqmail/local_hosts || true
   41.28 +    echo "local_hosts=\"$RET\"" >> $DEBCONFTMP
   41.29 +    db_get masqmail/local_nets || true
   41.30 +    echo "local_nets=\"$RET\"" >> $DEBCONFTMP
   41.31 +    db_get masqmail/listen_addresses || true
   41.32 +    echo "listen_addresses=\"$RET\"" >> $DEBCONFTMP
   41.33 +
   41.34 +    echo "spool_dir=\"/var/spool/masqmail\"" >> $DEBCONFTMP
   41.35 +    echo "mail_dir=\"/var/mail\"" >> $DEBCONFTMP
   41.36 +    echo "log_dir=\"/var/log/masqmail\"" >> $DEBCONFTMP
   41.37 +    echo "do_queue=false" >> $DEBCONFTMP
   41.38 +
   41.39 +    db_get masqmail/use_syslog || true
   41.40 +    echo "use_syslog=$RET" >> $DEBCONFTMP
   41.41 +
   41.42 +    db_get masqmail/online_detect || true
   41.43 +    echo "online_detect=$RET" >> $DEBCONFTMP
   41.44 +    if [ "$RET" = "file" ] ; then
   41.45 +	db_get masqmail/online_file || true
   41.46 +	echo "online_file=\"$RET\"" >> $DEBCONFTMP
   41.47 +    else
   41.48 +	db_get masqmail/online_pipe || true
   41.49 +	echo "online_pipe=\"$RET\"" >> $DEBCONFTMP
   41.50 +    fi
   41.51 +
   41.52 +    db_get masqmail/mbox_default || true
   41.53 +    echo "mbox_default=$RET" >> $DEBCONFTMP
   41.54 +    db_get masqmail/mda || true
   41.55 +    echo "mda=\"$RET\"" >> $DEBCONFTMP
   41.56 +
   41.57 +    echo "alias_file=/etc/aliases" >> $DEBCONFTMP
   41.58 +    db_get masqmail/alias_local_caseless || true
   41.59 +    echo "alias_local_caseless=\"$RET\"" >> $DEBCONFTMP
   41.60 +
   41.61 +    cat >> $DEBCONFTMP << EOF
   41.62 +### END DEBCONF SECTION
   41.63 +EOF
   41.64 +}
   41.65 +
   41.66 +write_db_conf (){
   41.67 +
   41.68 +  if [ -e $CONFIGFILE ]; then
   41.69 +    # does the file have debconf markers in it?
   41.70 +    if egrep -q '^### BEGIN DEBCONF SECTION' $CONFIGFILE && \
   41.71 +       egrep -q '^### END DEBCONF SECTION' $CONFIGFILE; then
   41.72 +      # see if the beginning of the file was left alone; sed cannot backtrack in
   41.73 +      # an address range
   41.74 +      if ! head -1 $CONFIGFILE | egrep -q '^### BEGIN DEBCONF SECTION'; then
   41.75 +        # sick, sick, sick
   41.76 +        LINES=$(sed -n '1,/^### BEGIN DEBCONF SECTION/p' < $CONFIGFILE | wc -l)
   41.77 +        sed -n 1,$(( $LINES - 1 ))p < $CONFIGFILE > $WORKTMP
   41.78 +      fi
   41.79 +      cat $DEBCONFTMP >> $WORKTMP
   41.80 +      sed -n '/^### END DEBCONF SECTION/,$p' < $CONFIGFILE | tail +2 >> $WORKTMP
   41.81 +    else
   41.82 +      echo "Existing $CONFIGFILE has missing or half-open debconf region;" >&2;
   41.83 +      echo "not writing masqmail configuration file." >&2;
   41.84 +      exit 1
   41.85 +    fi
   41.86 +  else
   41.87 +    cat >> $DEBCONFTMP << EOF
   41.88 +#
   41.89 +# include the locations of your route and get configurations here.
   41.90 +# Examples:
   41.91 +# online_routes.default = "/etc/masqmail/default.route"
   41.92 +# online_gets.default = "/etc/masqmail/default.get"
   41.93 +# You can have more of those, with '.default' replaced with other
   41.94 +# names. See man 8 masqmail.conf.
   41.95 +#
   41.96 +EOF
   41.97 +    cp $DEBCONFTMP $WORKTMP
   41.98 +  fi
   41.99 +
  41.100 +  mv $WORKTMP $CONFIGFILE
  41.101 +
  41.102 +#  rm -f $WORKTMP $DEBCONFTMP
  41.103 +}
  41.104 +
  41.105 +create_db_defaults () {
  41.106 +    cat >> $DEBDEFTMP << EOF
  41.107 +#
  41.108 +# better use 'dpkg-reconfigure masqmail'
  41.109 +# instead of editing by hand
  41.110 +#
  41.111 +EOF
  41.112 +
  41.113 +    db_get masqmail/init_smtp_daemon || true
  41.114 +    echo "INIT_SMTP_DAEMON=\"$RET\"" >> $DEBDEFTMP
  41.115 +    db_get masqmail/init_queue_daemon || true
  41.116 +    echo "INIT_QUEUE_DAEMON=\"$RET\"" >> $DEBDEFTMP
  41.117 +    db_get masqmail/init_fetch_daemon || true
  41.118 +    echo "INIT_FETCH_DAEMON=\"$RET\"" >> $DEBDEFTMP
  41.119 +
  41.120 +    echo "#" >> $DEBDEFTMP
  41.121 +
  41.122 +    db_get masqmail/queue_daemon_ival || true
  41.123 +    echo "QUEUE_DAEMON_IVAL=\"$RET\"" >> $DEBDEFTMP
  41.124 +    db_get masqmail/fetch_daemon_ival || true
  41.125 +    echo "FETCH_DAEMON_IVAL=\"$RET\"" >> $DEBDEFTMP
  41.126 +
  41.127 +    echo "#" >> $DEBDEFTMP
  41.128 +
  41.129 +    db_get masqmail/ipup_runqueue || true
  41.130 +    echo "IPUP_RUNQUEUE=\"$RET\"" >> $DEBDEFTMP
  41.131 +    db_get masqmail/ipup_fetch || true
  41.132 +    echo "IPUP_FETCH=\"$RET\"" >> $DEBDEFTMP
  41.133 +
  41.134 +    db_get masqmail/ifup_ifaces || true
  41.135 +    echo "IFUP_IFACES=\"$RET\"" >> $DEBDEFTMP
  41.136 +}
  41.137 +   
  41.138 +write_db_defaults () {
  41.139 +    mv $DEBDEFTMP $DEFAULTSFILE
  41.140 +}
  41.141 +
  41.142 +case "$1" in
  41.143 +    configure)
  41.144 +
  41.145 +        # Create spool and log directories
  41.146 +        install -d -omail -gmail /var/log/masqmail
  41.147 +        install -d -omail -gmail /var/spool/masqmail
  41.148 +        install -d -omail -gmail /var/spool/masqmail/input
  41.149 +        install -d -omail -gmail /var/spool/masqmail/lock
  41.150 +        install -d -omail -gmail /var/spool/masqmail/popuidl
  41.151 +
  41.152 +	db_get masqmail/manage_config_with_debconf || true
  41.153 +	if [ "$RET" = "true" ]; then
  41.154 +	    db_get masqmail/move_existing_nondebconf_config || true
  41.155 +	    if [ "$RET" = "true" ]; then
  41.156 +		create_db_conf
  41.157 +		write_db_conf
  41.158 +	    fi
  41.159 +	    create_db_defaults
  41.160 +	    write_db_defaults
  41.161 +	fi
  41.162 +
  41.163 +        ;;
  41.164 +
  41.165 +    abort-upgrade|abort-remove|abort-deconfigure)
  41.166 +        ;;
  41.167 +esac
  41.168 +
  41.169 +#DEBHELPER#
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/debian/postrm	Fri Sep 26 17:05:23 2008 +0200
    42.3 @@ -0,0 +1,17 @@
    42.4 +#!/bin/sh -e
    42.5 +
    42.6 +case "$1" in
    42.7 +	purge)
    42.8 +		# On a purge we also...
    42.9 +		# Remove spool and config file
   42.10 +		rm -rf /var/log/masqmail /var/spool/masqmail /etc/masqmail
   42.11 +		rm -f /etc/default/masqmail
   42.12 +		# Remove from inetd.conf
   42.13 +		##update-inetd --remove masqmail
   42.14 +		;;
   42.15 +
   42.16 +	upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
   42.17 +		;;
   42.18 +esac
   42.19 +
   42.20 +#DEBHELPER#
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/debian/preinst	Fri Sep 26 17:05:23 2008 +0200
    43.3 @@ -0,0 +1,23 @@
    43.4 +#!/bin/sh -e
    43.5 +
    43.6 +##$DEBIAN_SCRIPT_DEBUG || set -v -x 
    43.7 +
    43.8 +if [ "$1" = "upgrade" ] ; then
    43.9 +  if dpkg --compare-versions "$2" lt "0.1.6-1" ; then
   43.10 +
   43.11 +    # move config file to new location
   43.12 +    if [ -e /etc/masqmail.conf ]; then
   43.13 +	if [ ! -d /etc/masqmail ]; then
   43.14 +	    mkdir /etc/masqmail
   43.15 +	    mv -f /etc/masqmail.conf /etc/masqmail/
   43.16 +	fi
   43.17 +    fi
   43.18 +  fi
   43.19 +
   43.20 +  if dpkg --compare-versions "$2" le "0.2.20-1" ; then
   43.21 +    [ -d /var/log/masqmail ] && chown -R mail:mail /var/log/masqmail/
   43.22 +  fi
   43.23 +
   43.24 +fi
   43.25 +
   43.26 +#DEBHELPER#
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/debian/rules	Fri Sep 26 17:05:23 2008 +0200
    44.3 @@ -0,0 +1,118 @@
    44.4 +#!/usr/bin/make -f
    44.5 +
    44.6 +export DH_COMPAT=3
    44.7 +
    44.8 +# Uncomment this to turn on verbose mode.
    44.9 +#export DH_VERBOSE=1
   44.10 +DOC = usr/doc
   44.11 +MAN = usr/man
   44.12 +DAT = usr/lib
   44.13 +
   44.14 +export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
   44.15 +export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
   44.16 +# FOR AUTOCONF 2.52 AND NEWER ONLY
   44.17 +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
   44.18 +  confflags += --build $(DEB_HOST_GNU_TYPE)
   44.19 +else
   44.20 +  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
   44.21 +endif
   44.22 +
   44.23 +build: build-stamp
   44.24 +build-stamp:
   44.25 +	dh_testdir
   44.26 +
   44.27 +	# Add here commands to compile the package.
   44.28 +	./configure $(confflags) \
   44.29 +		--prefix=/usr --mandir='$${prefix}/share/man' \
   44.30 +		--with-logdir=/var/log/masqmail \
   44.31 +		--with-spooldir=/var/spool/masqmail \
   44.32 +		--with-user=mail --with-group=mail \
   44.33 +		--with-confdir=/etc/masqmail \
   44.34 +		--with-liblockfile \
   44.35 +		--enable-auth \
   44.36 +		--enable-ident \
   44.37 +		--enable-maildir
   44.38 +	$(MAKE)
   44.39 +
   44.40 +	touch build-stamp
   44.41 +
   44.42 +clean:
   44.43 +	dh_testdir
   44.44 +	dh_testroot
   44.45 +	rm -f build-stamp
   44.46 +
   44.47 +	# Add here commands to clean up after the build process.
   44.48 +	-$(MAKE) clean
   44.49 +	-$(MAKE) distclean
   44.50 +	rm -f tests/{test.conf,local.sh,smtpout.sh}
   44.51 +	# see /usr/share/doc/autotools-dev/README.Debian.gz
   44.52 +	-test -r /usr/share/misc/config.sub && \
   44.53 +		cp -f /usr/share/misc/config.sub config.sub
   44.54 +	-test -r /usr/share/misc/config.guess && \
   44.55 +		cp -f /usr/share/misc/config.guess config.guess
   44.56 +	rm -f config.log
   44.57 +
   44.58 +	dh_clean
   44.59 +
   44.60 +install: build
   44.61 +	dh_testdir
   44.62 +	dh_testroot
   44.63 +	dh_clean -k
   44.64 +	dh_installdirs
   44.65 +
   44.66 +	# Add here commands to install the package into debian/masqmail.
   44.67 +	$(MAKE) DESTDIR=`pwd`/debian/masqmail install
   44.68 +	rmdir debian/masqmail/var/spool/masqmail/input \
   44.69 +                debian/masqmail/var/spool/masqmail/lock \
   44.70 +                debian/masqmail/var/spool/masqmail/popuidl \
   44.71 +		debian/masqmail/var/spool/masqmail debian/masqmail/var/spool \
   44.72 +		debian/masqmail/var/log/masqmail debian/masqmail/var/log
   44.73 +
   44.74 +	rm -f debian/masqmail/usr/bin/expandtest debian/masqmail/usr/bin/readtest
   44.75 +	install -m 755 debian/newaliases debian/masqmail/usr/bin/.
   44.76 +	install -m 755 debian/masqmail.ip-up debian/masqmail/etc/ppp/ip-up.d/1masqmail
   44.77 +	install -m 755 debian/masqmail.ip-up debian/masqmail/etc/network/if-up.d/1masqmail
   44.78 +	install -m 755 debian/masqmail.ip-up debian/masqmail/etc/ppp/ip-down.d/99masqmail
   44.79 +	install -m 755 debian/masqmail.ip-up debian/masqmail/etc/network/if-down.d/99masqmail
   44.80 +
   44.81 +	install -m 644 debian/masqmail.logrotate debian/masqmail/etc/logrotate.d/masqmail
   44.82 +
   44.83 +
   44.84 +# Build architecture-independent files here.
   44.85 +binary-indep: build install
   44.86 +# We have nothing to do by default.
   44.87 +
   44.88 +# Build architecture-dependent files here.
   44.89 +binary-arch: build install
   44.90 +	cp debian/masqmail.lintian debian/masqmail/usr/share/lintian/overrides/masqmail
   44.91 +#	dh_testversion
   44.92 +	dh_testdir
   44.93 +	dh_testroot
   44.94 +	dh_installdebconf     
   44.95 +	dh_installdocs
   44.96 +	rm -f debian/masqmail/usr/share/doc/masqmail/INSTALL
   44.97 +	##cp -r docs debian/masqmail/$(DOC)/masqmail/html
   44.98 +	dh_installexamples examples/* tests
   44.99 +#	dh_installmenu
  44.100 +#	dh_installemacsen
  44.101 +	dh_installinit
  44.102 +#	dh_installcron
  44.103 +	dh_installman debian/mailq.8 debian/mailrm.8 debian/newaliases.8 debian/sendmail.8
  44.104 +#	dh_undocumented
  44.105 +	dh_installchangelogs ChangeLog
  44.106 +	dh_link
  44.107 +	dh_strip
  44.108 +	dh_compress
  44.109 +	dh_fixperms -X/usr/sbin/masqmail
  44.110 +	dh_installdeb
  44.111 +	dh_shlibdeps
  44.112 +	dh_gencontrol
  44.113 +#	dh_makeshlibs
  44.114 +	dh_md5sums
  44.115 +	dh_builddeb
  44.116 +
  44.117 +source diff:                                                                  
  44.118 +	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
  44.119 +
  44.120 +binary: binary-indep binary-arch
  44.121 +.PHONY: build clean binary-indep binary-arch binary install
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/debian/sendmail.8	Fri Sep 26 17:05:23 2008 +0200
    45.3 @@ -0,0 +1,1 @@
    45.4 +.so man8/masqmail.8
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/depcomp	Fri Sep 26 17:05:23 2008 +0200
    46.3 @@ -0,0 +1,479 @@
    46.4 +#! /bin/sh
    46.5 +
    46.6 +# depcomp - compile a program generating dependencies as side-effects
    46.7 +# Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
    46.8 +
    46.9 +# This program is free software; you can redistribute it and/or modify
   46.10 +# it under the terms of the GNU General Public License as published by
   46.11 +# the Free Software Foundation; either version 2, or (at your option)
   46.12 +# any later version.
   46.13 +
   46.14 +# This program is distributed in the hope that it will be useful,
   46.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   46.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   46.17 +# GNU General Public License for more details.
   46.18 +
   46.19 +# You should have received a copy of the GNU General Public License
   46.20 +# along with this program; if not, write to the Free Software
   46.21 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   46.22 +# 02111-1307, USA.
   46.23 +
   46.24 +# As a special exception to the GNU General Public License, if you
   46.25 +# distribute this file as part of a program that contains a
   46.26 +# configuration script generated by Autoconf, you may include it under
   46.27 +# the same distribution terms that you use for the rest of that program.
   46.28 +
   46.29 +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
   46.30 +
   46.31 +if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   46.32 +  echo "depcomp: Variables source, object and depmode must be set" 1>&2
   46.33 +  exit 1
   46.34 +fi
   46.35 +# `libtool' can also be set to `yes' or `no'.
   46.36 +
   46.37 +if test -z "$depfile"; then
   46.38 +   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
   46.39 +   dir=`echo "$object" | sed 's,/.*$,/,'`
   46.40 +   if test "$dir" = "$object"; then
   46.41 +      dir=
   46.42 +   fi
   46.43 +   # FIXME: should be _deps on DOS.
   46.44 +   depfile="$dir.deps/$base"
   46.45 +fi
   46.46 +
   46.47 +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
   46.48 +
   46.49 +rm -f "$tmpdepfile"
   46.50 +
   46.51 +# Some modes work just like other modes, but use different flags.  We
   46.52 +# parameterize here, but still list the modes in the big case below,
   46.53 +# to make depend.m4 easier to write.  Note that we *cannot* use a case
   46.54 +# here, because this file can only contain one case statement.
   46.55 +if test "$depmode" = hp; then
   46.56 +  # HP compiler uses -M and no extra arg.
   46.57 +  gccflag=-M
   46.58 +  depmode=gcc
   46.59 +fi
   46.60 +
   46.61 +if test "$depmode" = dashXmstdout; then
   46.62 +   # This is just like dashmstdout with a different argument.
   46.63 +   dashmflag=-xM
   46.64 +   depmode=dashmstdout
   46.65 +fi
   46.66 +
   46.67 +case "$depmode" in
   46.68 +gcc3)
   46.69 +## gcc 3 implements dependency tracking that does exactly what
   46.70 +## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
   46.71 +## it if -MD -MP comes after the -MF stuff.  Hmm.
   46.72 +  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
   46.73 +  stat=$?
   46.74 +  if test $stat -eq 0; then :
   46.75 +  else
   46.76 +    rm -f "$tmpdepfile"
   46.77 +    exit $stat
   46.78 +  fi
   46.79 +  mv "$tmpdepfile" "$depfile"
   46.80 +  ;;
   46.81 +
   46.82 +gcc)
   46.83 +## There are various ways to get dependency output from gcc.  Here's
   46.84 +## why we pick this rather obscure method:
   46.85 +## - Don't want to use -MD because we'd like the dependencies to end
   46.86 +##   up in a subdir.  Having to rename by hand is ugly.
   46.87 +##   (We might end up doing this anyway to support other compilers.)
   46.88 +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
   46.89 +##   -MM, not -M (despite what the docs say).
   46.90 +## - Using -M directly means running the compiler twice (even worse
   46.91 +##   than renaming).
   46.92 +  if test -z "$gccflag"; then
   46.93 +    gccflag=-MD,
   46.94 +  fi
   46.95 +  "$@" -Wp,"$gccflag$tmpdepfile"
   46.96 +  stat=$?
   46.97 +  if test $stat -eq 0; then :
   46.98 +  else
   46.99 +    rm -f "$tmpdepfile"
  46.100 +    exit $stat
  46.101 +  fi
  46.102 +  rm -f "$depfile"
  46.103 +  echo "$object : \\" > "$depfile"
  46.104 +  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
  46.105 +## The second -e expression handles DOS-style file names with drive letters.
  46.106 +  sed -e 's/^[^:]*: / /' \
  46.107 +      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
  46.108 +## This next piece of magic avoids the `deleted header file' problem.
  46.109 +## The problem is that when a header file which appears in a .P file
  46.110 +## is deleted, the dependency causes make to die (because there is
  46.111 +## typically no way to rebuild the header).  We avoid this by adding
  46.112 +## dummy dependencies for each header file.  Too bad gcc doesn't do
  46.113 +## this for us directly.
  46.114 +  tr ' ' '
  46.115 +' < "$tmpdepfile" |
  46.116 +## Some versions of gcc put a space before the `:'.  On the theory
  46.117 +## that the space means something, we add a space to the output as
  46.118 +## well.
  46.119 +## Some versions of the HPUX 10.20 sed can't process this invocation
  46.120 +## correctly.  Breaking it into two sed invocations is a workaround.
  46.121 +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
  46.122 +  rm -f "$tmpdepfile"
  46.123 +  ;;
  46.124 +
  46.125 +hp)
  46.126 +  # This case exists only to let depend.m4 do its work.  It works by
  46.127 +  # looking at the text of this script.  This case will never be run,
  46.128 +  # since it is checked for above.
  46.129 +  exit 1
  46.130 +  ;;
  46.131 +
  46.132 +sgi)
  46.133 +  if test "$libtool" = yes; then
  46.134 +    "$@" "-Wp,-MDupdate,$tmpdepfile"
  46.135 +  else
  46.136 +    "$@" -MDupdate "$tmpdepfile"
  46.137 +  fi
  46.138 +  stat=$?
  46.139 +  if test $stat -eq 0; then :
  46.140 +  else
  46.141 +    rm -f "$tmpdepfile"
  46.142 +    exit $stat
  46.143 +  fi
  46.144 +  rm -f "$depfile"
  46.145 +
  46.146 +  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
  46.147 +    echo "$object : \\" > "$depfile"
  46.148 +
  46.149 +    # Clip off the initial element (the dependent).  Don't try to be
  46.150 +    # clever and replace this with sed code, as IRIX sed won't handle
  46.151 +    # lines with more than a fixed number of characters (4096 in
  46.152 +    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
  46.153 +    # the IRIX cc adds comments like `#:fec' to the end of the
  46.154 +    # dependency line.
  46.155 +    tr ' ' '
  46.156 +' < "$tmpdepfile" \
  46.157 +    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
  46.158 +    tr '
  46.159 +' ' ' >> $depfile
  46.160 +    echo >> $depfile
  46.161 +
  46.162 +    # The second pass generates a dummy entry for each header file.
  46.163 +    tr ' ' '
  46.164 +' < "$tmpdepfile" \
  46.165 +   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
  46.166 +   >> $depfile
  46.167 +  else
  46.168 +    # The sourcefile does not contain any dependencies, so just
  46.169 +    # store a dummy comment line, to avoid errors with the Makefile
  46.170 +    # "include basename.Plo" scheme.
  46.171 +    echo "#dummy" > "$depfile"
  46.172 +  fi
  46.173 +  rm -f "$tmpdepfile"
  46.174 +  ;;
  46.175 +
  46.176 +aix)
  46.177 +  # The C for AIX Compiler uses -M and outputs the dependencies
  46.178 +  # in a .u file.  In older versions, this file always lives in the
  46.179 +  # current directory.  Also, the AIX compiler puts `$object:' at the
  46.180 +  # start of each line; $object doesn't have directory information.
  46.181 +  # Version 6 uses the directory in both cases.
  46.182 +  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
  46.183 +  tmpdepfile="$stripped.u"
  46.184 +  if test "$libtool" = yes; then
  46.185 +    "$@" -Wc,-M
  46.186 +  else
  46.187 +    "$@" -M
  46.188 +  fi
  46.189 +  stat=$?
  46.190 +
  46.191 +  if test -f "$tmpdepfile"; then :
  46.192 +  else
  46.193 +    stripped=`echo "$stripped" | sed 's,^.*/,,'`
  46.194 +    tmpdepfile="$stripped.u"
  46.195 +  fi
  46.196 +
  46.197 +  if test $stat -eq 0; then :
  46.198 +  else
  46.199 +    rm -f "$tmpdepfile"
  46.200 +    exit $stat
  46.201 +  fi
  46.202 +
  46.203 +  if test -f "$tmpdepfile"; then
  46.204 +    outname="$stripped.o"
  46.205 +    # Each line is of the form `foo.o: dependent.h'.
  46.206 +    # Do two passes, one to just change these to
  46.207 +    # `$object: dependent.h' and one to simply `dependent.h:'.
  46.208 +    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
  46.209 +    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
  46.210 +  else
  46.211 +    # The sourcefile does not contain any dependencies, so just
  46.212 +    # store a dummy comment line, to avoid errors with the Makefile
  46.213 +    # "include basename.Plo" scheme.
  46.214 +    echo "#dummy" > "$depfile"
  46.215 +  fi
  46.216 +  rm -f "$tmpdepfile"
  46.217 +  ;;
  46.218 +
  46.219 +icc)
  46.220 +  # Intel's C compiler understands `-MD -MF file'.  However on
  46.221 +  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
  46.222 +  # ICC 7.0 will fill foo.d with something like
  46.223 +  #    foo.o: sub/foo.c
  46.224 +  #    foo.o: sub/foo.h
  46.225 +  # which is wrong.  We want:
  46.226 +  #    sub/foo.o: sub/foo.c
  46.227 +  #    sub/foo.o: sub/foo.h
  46.228 +  #    sub/foo.c:
  46.229 +  #    sub/foo.h:
  46.230 +  # ICC 7.1 will output
  46.231 +  #    foo.o: sub/foo.c sub/foo.h
  46.232 +  # and will wrap long lines using \ :
  46.233 +  #    foo.o: sub/foo.c ... \
  46.234 +  #     sub/foo.h ... \
  46.235 +  #     ...
  46.236 +
  46.237 +  "$@" -MD -MF "$tmpdepfile"
  46.238 +  stat=$?
  46.239 +  if test $stat -eq 0; then :
  46.240 +  else
  46.241 +    rm -f "$tmpdepfile"
  46.242 +    exit $stat
  46.243 +  fi
  46.244 +  rm -f "$depfile"
  46.245 +  # Each line is of the form `foo.o: dependent.h',
  46.246 +  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
  46.247 +  # Do two passes, one to just change these to
  46.248 +  # `$object: dependent.h' and one to simply `dependent.h:'.
  46.249 +  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
  46.250 +  # Some versions of the HPUX 10.20 sed can't process this invocation
  46.251 +  # correctly.  Breaking it into two sed invocations is a workaround.
  46.252 +  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
  46.253 +    sed -e 's/$/ :/' >> "$depfile"
  46.254 +  rm -f "$tmpdepfile"
  46.255 +  ;;
  46.256 +
  46.257 +tru64)
  46.258 +   # The Tru64 compiler uses -MD to generate dependencies as a side
  46.259 +   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
  46.260 +   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
  46.261 +   # dependencies in `foo.d' instead, so we check for that too.
  46.262 +   # Subdirectories are respected.
  46.263 +   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  46.264 +   test "x$dir" = "x$object" && dir=
  46.265 +   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  46.266 +
  46.267 +   if test "$libtool" = yes; then
  46.268 +      tmpdepfile1="$dir.libs/$base.lo.d"
  46.269 +      tmpdepfile2="$dir.libs/$base.d"
  46.270 +      "$@" -Wc,-MD
  46.271 +   else
  46.272 +      tmpdepfile1="$dir$base.o.d"
  46.273 +      tmpdepfile2="$dir$base.d"
  46.274 +      "$@" -MD
  46.275 +   fi
  46.276 +
  46.277 +   stat=$?
  46.278 +   if test $stat -eq 0; then :
  46.279 +   else
  46.280 +      rm -f "$tmpdepfile1" "$tmpdepfile2"
  46.281 +      exit $stat
  46.282 +   fi
  46.283 +
  46.284 +   if test -f "$tmpdepfile1"; then
  46.285 +      tmpdepfile="$tmpdepfile1"
  46.286 +   else
  46.287 +      tmpdepfile="$tmpdepfile2"
  46.288 +   fi
  46.289 +   if test -f "$tmpdepfile"; then
  46.290 +      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
  46.291 +      # That's a tab and a space in the [].
  46.292 +      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
  46.293 +   else
  46.294 +      echo "#dummy" > "$depfile"
  46.295 +   fi
  46.296 +   rm -f "$tmpdepfile"
  46.297 +   ;;
  46.298 +
  46.299 +#nosideeffect)
  46.300 +  # This comment above is used by automake to tell side-effect
  46.301 +  # dependency tracking mechanisms from slower ones.
  46.302 +
  46.303 +dashmstdout)
  46.304 +  # Important note: in order to support this mode, a compiler *must*
  46.305 +  # always write the preprocessed file to stdout, regardless of -o.
  46.306 +  "$@" || exit $?
  46.307 +
  46.308 +  # Remove the call to Libtool.
  46.309 +  if test "$libtool" = yes; then
  46.310 +    while test $1 != '--mode=compile'; do
  46.311 +      shift
  46.312 +    done
  46.313 +    shift
  46.314 +  fi
  46.315 +
  46.316 +  # Remove `-o $object'.
  46.317 +  IFS=" "
  46.318 +  for arg
  46.319 +  do
  46.320 +    case $arg in
  46.321 +    -o)
  46.322 +      shift
  46.323 +      ;;
  46.324 +    $object)
  46.325 +      shift
  46.326 +      ;;
  46.327 +    *)
  46.328 +      set fnord "$@" "$arg"
  46.329 +      shift # fnord
  46.330 +      shift # $arg
  46.331 +      ;;
  46.332 +    esac
  46.333 +  done
  46.334 +
  46.335 +  test -z "$dashmflag" && dashmflag=-M
  46.336 +  # Require at least two characters before searching for `:'
  46.337 +  # in the target name.  This is to cope with DOS-style filenames:
  46.338 +  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
  46.339 +  "$@" $dashmflag |
  46.340 +    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
  46.341 +  rm -f "$depfile"
  46.342 +  cat < "$tmpdepfile" > "$depfile"
  46.343 +  tr ' ' '
  46.344 +' < "$tmpdepfile" | \
  46.345 +## Some versions of the HPUX 10.20 sed can't process this invocation
  46.346 +## correctly.  Breaking it into two sed invocations is a workaround.
  46.347 +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
  46.348 +  rm -f "$tmpdepfile"
  46.349 +  ;;
  46.350 +
  46.351 +dashXmstdout)
  46.352 +  # This case only exists to satisfy depend.m4.  It is never actually
  46.353 +  # run, as this mode is specially recognized in the preamble.
  46.354 +  exit 1
  46.355 +  ;;
  46.356 +
  46.357 +makedepend)
  46.358 +  "$@" || exit $?
  46.359 +  # Remove any Libtool call
  46.360 +  if test "$libtool" = yes; then
  46.361 +    while test $1 != '--mode=compile'; do
  46.362 +      shift
  46.363 +    done
  46.364 +    shift
  46.365 +  fi
  46.366 +  # X makedepend
  46.367 +  shift
  46.368 +  cleared=no
  46.369 +  for arg in "$@"; do
  46.370 +    case $cleared in
  46.371 +    no)
  46.372 +      set ""; shift
  46.373 +      cleared=yes ;;
  46.374 +    esac
  46.375 +    case "$arg" in
  46.376 +    -D*|-I*)
  46.377 +      set fnord "$@" "$arg"; shift ;;
  46.378 +    # Strip any option that makedepend may not understand.  Remove
  46.379 +    # the object too, otherwise makedepend will parse it as a source file.
  46.380 +    -*|$object)
  46.381 +      ;;
  46.382 +    *)
  46.383 +      set fnord "$@" "$arg"; shift ;;
  46.384 +    esac
  46.385 +  done
  46.386 +  obj_suffix="`echo $object | sed 's/^.*\././'`"
  46.387 +  touch "$tmpdepfile"
  46.388 +  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
  46.389 +  rm -f "$depfile"
  46.390 +  cat < "$tmpdepfile" > "$depfile"
  46.391 +  sed '1,2d' "$tmpdepfile" | tr ' ' '
  46.392 +' | \
  46.393 +## Some versions of the HPUX 10.20 sed can't process this invocation
  46.394 +## correctly.  Breaking it into two sed invocations is a workaround.
  46.395 +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
  46.396 +  rm -f "$tmpdepfile" "$tmpdepfile".bak
  46.397 +  ;;
  46.398 +
  46.399 +cpp)
  46.400 +  # Important note: in order to support this mode, a compiler *must*
  46.401 +  # always write the preprocessed file to stdout.
  46.402 +  "$@" || exit $?
  46.403 +
  46.404 +  # Remove the call to Libtool.
  46.405 +  if test "$libtool" = yes; then
  46.406 +    while test $1 != '--mode=compile'; do
  46.407 +      shift
  46.408 +    done
  46.409 +    shift
  46.410 +  fi
  46.411 +
  46.412 +  # Remove `-o $object'.
  46.413 +  IFS=" "
  46.414 +  for arg
  46.415 +  do
  46.416 +    case $arg in
  46.417 +    -o)
  46.418 +      shift
  46.419 +      ;;
  46.420 +    $object)
  46.421 +      shift
  46.422 +      ;;
  46.423 +    *)
  46.424 +      set fnord "$@" "$arg"
  46.425 +      shift # fnord
  46.426 +      shift # $arg
  46.427 +      ;;
  46.428 +    esac
  46.429 +  done
  46.430 +
  46.431 +  "$@" -E |
  46.432 +    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
  46.433 +    sed '$ s: \\$::' > "$tmpdepfile"
  46.434 +  rm -f "$depfile"
  46.435 +  echo "$object : \\" > "$depfile"
  46.436 +  cat < "$tmpdepfile" >> "$depfile"
  46.437 +  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
  46.438 +  rm -f "$tmpdepfile"
  46.439 +  ;;
  46.440 +
  46.441 +msvisualcpp)
  46.442 +  # Important note: in order to support this mode, a compiler *must*
  46.443 +  # always write the preprocessed file to stdout, regardless of -o,
  46.444 +  # because we must use -o when running libtool.
  46.445 +  "$@" || exit $?
  46.446 +  IFS=" "
  46.447 +  for arg
  46.448 +  do
  46.449 +    case "$arg" in
  46.450 +    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
  46.451 +	set fnord "$@"
  46.452 +	shift
  46.453 +	shift
  46.454 +	;;
  46.455 +    *)
  46.456 +	set fnord "$@" "$arg"
  46.457 +	shift
  46.458 +	shift
  46.459 +	;;
  46.460 +    esac
  46.461 +  done
  46.462 +  "$@" -E |
  46.463 +  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
  46.464 +  rm -f "$depfile"
  46.465 +  echo "$object : \\" > "$depfile"
  46.466 +  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
  46.467 +  echo "	" >> "$depfile"
  46.468 +  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
  46.469 +  rm -f "$tmpdepfile"
  46.470 +  ;;
  46.471 +
  46.472 +none)
  46.473 +  exec "$@"
  46.474 +  ;;
  46.475 +
  46.476 +*)
  46.477 +  echo "Unknown depmode $depmode" 1>&2
  46.478 +  exit 1
  46.479 +  ;;
  46.480 +esac
  46.481 +
  46.482 +exit 0
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/docs/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    47.3 @@ -0,0 +1,46 @@
    47.4 +SUBDIRS=man xml
    47.5 +
    47.6 +man: man/masqmail.8 man/mservdetect.8 man/masqmail.conf.5 man/masqmail.route.5 man/masqmail.get.5 man/masqmail.aliases.5
    47.7 +
    47.8 +html: html/masqmail.8.html html/mservdetect.8.html html/masqmail.conf.5.html html/masqmail.route.5.html html/masqmail.get.5.html html/masqmail.aliases.5.html
    47.9 +
   47.10 +man/masqmail.8:	xml/masqmail.8.xml
   47.11 +	xmltoman $< >$@
   47.12 +
   47.13 +man/mservdetect.8:	xml/mservdetect.8.xml
   47.14 +	xmltoman $< >$@
   47.15 +
   47.16 +man/masqmail.conf.5:	xml/masqmail.conf.5.xml
   47.17 +	xmltoman $< >$@
   47.18 +
   47.19 +man/masqmail.route.5:	xml/masqmail.route.5.xml
   47.20 +	xmltoman $< >$@
   47.21 +
   47.22 +man/masqmail.get.5:	xml/masqmail.get.5.xml
   47.23 +	xmltoman $< >$@
   47.24 +
   47.25 +man/masqmail.aliases.5:	xml/masqmail.aliases.5.xml
   47.26 +	xmltoman $< >$@
   47.27 +
   47.28 +
   47.29 +html/masqmail.8.html:	xml/masqmail.8.xml
   47.30 +	xmlmantohtml $< >$@
   47.31 +
   47.32 +html/mservdetect.8.html:	xml/mservdetect.8.xml
   47.33 +	xmlmantohtml $< >$@
   47.34 +
   47.35 +html/masqmail.conf.5.html:	xml/masqmail.conf.5.xml
   47.36 +	xmlmantohtml $< >$@
   47.37 +
   47.38 +html/masqmail.route.5.html:	xml/masqmail.route.5.xml
   47.39 +	xmlmantohtml $< >$@
   47.40 +
   47.41 +html/masqmail.get.5.html:	xml/masqmail.get.5.xml
   47.42 +	xmlmantohtml $< >$@
   47.43 +
   47.44 +html/masqmail.aliases.5.html:	xml/masqmail.aliases.5.xml
   47.45 +	xmlmantohtml $< >$@
   47.46 +
   47.47 +#clean:
   47.48 +#	rm -f man/*.[58]
   47.49 +#	rm -r html/*.html
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/docs/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    48.3 @@ -0,0 +1,454 @@
    48.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    48.5 +# @configure_input@
    48.6 +
    48.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    48.8 +# Free Software Foundation, Inc.
    48.9 +# This Makefile.in is free software; the Free Software Foundation
   48.10 +# gives unlimited permission to copy and/or distribute it,
   48.11 +# with or without modifications, as long as this notice is preserved.
   48.12 +
   48.13 +# This program is distributed in the hope that it will be useful,
   48.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   48.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   48.16 +# PARTICULAR PURPOSE.
   48.17 +
   48.18 +@SET_MAKE@
   48.19 +
   48.20 +srcdir = @srcdir@
   48.21 +top_srcdir = @top_srcdir@
   48.22 +VPATH = @srcdir@
   48.23 +pkgdatadir = $(datadir)/@PACKAGE@
   48.24 +pkglibdir = $(libdir)/@PACKAGE@
   48.25 +pkgincludedir = $(includedir)/@PACKAGE@
   48.26 +top_builddir = ..
   48.27 +
   48.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   48.29 +INSTALL = @INSTALL@
   48.30 +install_sh_DATA = $(install_sh) -c -m 644
   48.31 +install_sh_PROGRAM = $(install_sh) -c
   48.32 +install_sh_SCRIPT = $(install_sh) -c
   48.33 +INSTALL_HEADER = $(INSTALL_DATA)
   48.34 +transform = $(program_transform_name)
   48.35 +NORMAL_INSTALL = :
   48.36 +PRE_INSTALL = :
   48.37 +POST_INSTALL = :
   48.38 +NORMAL_UNINSTALL = :
   48.39 +PRE_UNINSTALL = :
   48.40 +POST_UNINSTALL = :
   48.41 +ACLOCAL = @ACLOCAL@
   48.42 +AMDEP_FALSE = @AMDEP_FALSE@
   48.43 +AMDEP_TRUE = @AMDEP_TRUE@
   48.44 +AMTAR = @AMTAR@
   48.45 +AUTOCONF = @AUTOCONF@
   48.46 +AUTOHEADER = @AUTOHEADER@
   48.47 +AUTOMAKE = @AUTOMAKE@
   48.48 +AWK = @AWK@
   48.49 +BASE64_LIBS = @BASE64_LIBS@
   48.50 +CC = @CC@
   48.51 +CCDEPMODE = @CCDEPMODE@
   48.52 +CFLAGS = @CFLAGS@
   48.53 +CPP = @CPP@
   48.54 +CPPFLAGS = @CPPFLAGS@
   48.55 +CYGPATH_W = @CYGPATH_W@
   48.56 +DEFS = @DEFS@
   48.57 +DEPDIR = @DEPDIR@
   48.58 +ECHO_C = @ECHO_C@
   48.59 +ECHO_N = @ECHO_N@
   48.60 +ECHO_T = @ECHO_T@
   48.61 +EGREP = @EGREP@
   48.62 +EXEEXT = @EXEEXT@
   48.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   48.64 +GLIB_LIBS = @GLIB_LIBS@
   48.65 +IDENT_LIBS = @IDENT_LIBS@
   48.66 +INSTALL_DATA = @INSTALL_DATA@
   48.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   48.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   48.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   48.70 +LDFLAGS = @LDFLAGS@
   48.71 +LIBOBJS = @LIBOBJS@
   48.72 +LIBS = @LIBS@
   48.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   48.74 +LTLIBOBJS = @LTLIBOBJS@
   48.75 +MAKEINFO = @MAKEINFO@
   48.76 +MD5_LIBS = @MD5_LIBS@
   48.77 +OBJEXT = @OBJEXT@
   48.78 +PACKAGE = @PACKAGE@
   48.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   48.80 +PACKAGE_NAME = @PACKAGE_NAME@
   48.81 +PACKAGE_STRING = @PACKAGE_STRING@
   48.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   48.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   48.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   48.85 +PKG_CONFIG = @PKG_CONFIG@
   48.86 +RANLIB = @RANLIB@
   48.87 +RESOLV_LIBS = @RESOLV_LIBS@
   48.88 +SET_MAKE = @SET_MAKE@
   48.89 +SHELL = @SHELL@
   48.90 +STRIP = @STRIP@
   48.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   48.92 +VERSION = @VERSION@
   48.93 +ac_ct_CC = @ac_ct_CC@
   48.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   48.95 +ac_ct_STRIP = @ac_ct_STRIP@
   48.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   48.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   48.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   48.99 +am__include = @am__include@
  48.100 +am__leading_dot = @am__leading_dot@
  48.101 +am__quote = @am__quote@
  48.102 +bindir = @bindir@
  48.103 +build_alias = @build_alias@
  48.104 +datadir = @datadir@
  48.105 +exec_prefix = @exec_prefix@
  48.106 +has_ident = @has_ident@
  48.107 +host_alias = @host_alias@
  48.108 +includedir = @includedir@
  48.109 +infodir = @infodir@
  48.110 +install_sh = @install_sh@
  48.111 +libdir = @libdir@
  48.112 +libexecdir = @libexecdir@
  48.113 +localstatedir = @localstatedir@
  48.114 +mandir = @mandir@
  48.115 +oldincludedir = @oldincludedir@
  48.116 +prefix = @prefix@
  48.117 +program_transform_name = @program_transform_name@
  48.118 +sbindir = @sbindir@
  48.119 +sharedstatedir = @sharedstatedir@
  48.120 +sysconfdir = @sysconfdir@
  48.121 +target_alias = @target_alias@
  48.122 +with_confdir = @with_confdir@
  48.123 +with_group = @with_group@
  48.124 +with_logdir = @with_logdir@
  48.125 +with_spooldir = @with_spooldir@
  48.126 +with_user = @with_user@
  48.127 +SUBDIRS = man xml
  48.128 +subdir = docs
  48.129 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  48.130 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  48.131 +CONFIG_HEADER = $(top_builddir)/config.h
  48.132 +CONFIG_CLEAN_FILES =
  48.133 +DIST_SOURCES =
  48.134 +
  48.135 +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
  48.136 +	ps-recursive install-info-recursive uninstall-info-recursive \
  48.137 +	all-recursive install-data-recursive install-exec-recursive \
  48.138 +	installdirs-recursive install-recursive uninstall-recursive \
  48.139 +	check-recursive installcheck-recursive
  48.140 +DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am
  48.141 +DIST_SUBDIRS = $(SUBDIRS)
  48.142 +all: all-recursive
  48.143 +
  48.144 +.SUFFIXES:
  48.145 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  48.146 +	cd $(top_srcdir) && \
  48.147 +	  $(AUTOMAKE) --gnu  docs/Makefile
  48.148 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  48.149 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  48.150 +uninstall-info-am:
  48.151 +
  48.152 +# This directory's subdirectories are mostly independent; you can cd
  48.153 +# into them and run `make' without going through this Makefile.
  48.154 +# To change the values of `make' variables: instead of editing Makefiles,
  48.155 +# (1) if the variable is set in `config.status', edit `config.status'
  48.156 +#     (which will cause the Makefiles to be regenerated when you run `make');
  48.157 +# (2) otherwise, pass the desired values on the `make' command line.
  48.158 +$(RECURSIVE_TARGETS):
  48.159 +	@set fnord $$MAKEFLAGS; amf=$$2; \
  48.160 +	dot_seen=no; \
  48.161 +	target=`echo $@ | sed s/-recursive//`; \
  48.162 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  48.163 +	  echo "Making $$target in $$subdir"; \
  48.164 +	  if test "$$subdir" = "."; then \
  48.165 +	    dot_seen=yes; \
  48.166 +	    local_target="$$target-am"; \
  48.167 +	  else \
  48.168 +	    local_target="$$target"; \
  48.169 +	  fi; \
  48.170 +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
  48.171 +	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  48.172 +	done; \
  48.173 +	if test "$$dot_seen" = "no"; then \
  48.174 +	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
  48.175 +	fi; test -z "$$fail"
  48.176 +
  48.177 +mostlyclean-recursive clean-recursive distclean-recursive \
  48.178 +maintainer-clean-recursive:
  48.179 +	@set fnord $$MAKEFLAGS; amf=$$2; \
  48.180 +	dot_seen=no; \
  48.181 +	case "$@" in \
  48.182 +	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
  48.183 +	  *) list='$(SUBDIRS)' ;; \
  48.184 +	esac; \
  48.185 +	rev=''; for subdir in $$list; do \
  48.186 +	  if test "$$subdir" = "."; then :; else \
  48.187 +	    rev="$$subdir $$rev"; \
  48.188 +	  fi; \
  48.189 +	done; \
  48.190 +	rev="$$rev ."; \
  48.191 +	target=`echo $@ | sed s/-recursive//`; \
  48.192 +	for subdir in $$rev; do \
  48.193 +	  echo "Making $$target in $$subdir"; \
  48.194 +	  if test "$$subdir" = "."; then \
  48.195 +	    local_target="$$target-am"; \
  48.196 +	  else \
  48.197 +	    local_target="$$target"; \
  48.198 +	  fi; \
  48.199 +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
  48.200 +	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  48.201 +	done && test -z "$$fail"
  48.202 +tags-recursive:
  48.203 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  48.204 +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
  48.205 +	done
  48.206 +ctags-recursive:
  48.207 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  48.208 +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
  48.209 +	done
  48.210 +
  48.211 +ETAGS = etags
  48.212 +ETAGSFLAGS =
  48.213 +
  48.214 +CTAGS = ctags
  48.215 +CTAGSFLAGS =
  48.216 +
  48.217 +tags: TAGS
  48.218 +
  48.219 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  48.220 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  48.221 +	unique=`for i in $$list; do \
  48.222 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  48.223 +	  done | \
  48.224 +	  $(AWK) '    { files[$$0] = 1; } \
  48.225 +	       END { for (i in files) print i; }'`; \
  48.226 +	mkid -fID $$unique
  48.227 +
  48.228 +TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  48.229 +		$(TAGS_FILES) $(LISP)
  48.230 +	tags=; \
  48.231 +	here=`pwd`; \
  48.232 +	if (etags --etags-include --version) >/dev/null 2>&1; then \
  48.233 +	  include_option=--etags-include; \
  48.234 +	else \
  48.235 +	  include_option=--include; \
  48.236 +	fi; \
  48.237 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  48.238 +	  if test "$$subdir" = .; then :; else \
  48.239 +	    test -f $$subdir/TAGS && \
  48.240 +	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
  48.241 +	  fi; \
  48.242 +	done; \
  48.243 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  48.244 +	unique=`for i in $$list; do \
  48.245 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  48.246 +	  done | \
  48.247 +	  $(AWK) '    { files[$$0] = 1; } \
  48.248 +	       END { for (i in files) print i; }'`; \
  48.249 +	test -z "$(ETAGS_ARGS)$$tags$$unique" \
  48.250 +	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  48.251 +	     $$tags $$unique
  48.252 +
  48.253 +ctags: CTAGS
  48.254 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  48.255 +		$(TAGS_FILES) $(LISP)
  48.256 +	tags=; \
  48.257 +	here=`pwd`; \
  48.258 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  48.259 +	unique=`for i in $$list; do \
  48.260 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  48.261 +	  done | \
  48.262 +	  $(AWK) '    { files[$$0] = 1; } \
  48.263 +	       END { for (i in files) print i; }'`; \
  48.264 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
  48.265 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  48.266 +	     $$tags $$unique
  48.267 +
  48.268 +GTAGS:
  48.269 +	here=`$(am__cd) $(top_builddir) && pwd` \
  48.270 +	  && cd $(top_srcdir) \
  48.271 +	  && gtags -i $(GTAGS_ARGS) $$here
  48.272 +
  48.273 +distclean-tags:
  48.274 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  48.275 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  48.276 +
  48.277 +top_distdir = ..
  48.278 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  48.279 +
  48.280 +distdir: $(DISTFILES)
  48.281 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  48.282 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  48.283 +	list='$(DISTFILES)'; for file in $$list; do \
  48.284 +	  case $$file in \
  48.285 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  48.286 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  48.287 +	  esac; \
  48.288 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  48.289 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  48.290 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  48.291 +	    dir="/$$dir"; \
  48.292 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  48.293 +	  else \
  48.294 +	    dir=''; \
  48.295 +	  fi; \
  48.296 +	  if test -d $$d/$$file; then \
  48.297 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  48.298 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  48.299 +	    fi; \
  48.300 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  48.301 +	  else \
  48.302 +	    test -f $(distdir)/$$file \
  48.303 +	    || cp -p $$d/$$file $(distdir)/$$file \
  48.304 +	    || exit 1; \
  48.305 +	  fi; \
  48.306 +	done
  48.307 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  48.308 +	  if test "$$subdir" = .; then :; else \
  48.309 +	    test -d $(distdir)/$$subdir \
  48.310 +	    || mkdir $(distdir)/$$subdir \
  48.311 +	    || exit 1; \
  48.312 +	    (cd $$subdir && \
  48.313 +	      $(MAKE) $(AM_MAKEFLAGS) \
  48.314 +	        top_distdir="$(top_distdir)" \
  48.315 +	        distdir=../$(distdir)/$$subdir \
  48.316 +	        distdir) \
  48.317 +	      || exit 1; \
  48.318 +	  fi; \
  48.319 +	done
  48.320 +check-am: all-am
  48.321 +check: check-recursive
  48.322 +all-am: Makefile
  48.323 +installdirs: installdirs-recursive
  48.324 +installdirs-am:
  48.325 +
  48.326 +install: install-recursive
  48.327 +install-exec: install-exec-recursive
  48.328 +install-data: install-data-recursive
  48.329 +uninstall: uninstall-recursive
  48.330 +
  48.331 +install-am: all-am
  48.332 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  48.333 +
  48.334 +installcheck: installcheck-recursive
  48.335 +install-strip:
  48.336 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  48.337 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  48.338 +	  `test -z '$(STRIP)' || \
  48.339 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  48.340 +mostlyclean-generic:
  48.341 +
  48.342 +clean-generic:
  48.343 +
  48.344 +distclean-generic:
  48.345 +	-rm -f $(CONFIG_CLEAN_FILES)
  48.346 +
  48.347 +maintainer-clean-generic:
  48.348 +	@echo "This command is intended for maintainers to use"
  48.349 +	@echo "it deletes files that may require special tools to rebuild."
  48.350 +clean: clean-recursive
  48.351 +
  48.352 +clean-am: clean-generic mostlyclean-am
  48.353 +
  48.354 +distclean: distclean-recursive
  48.355 +	-rm -f Makefile
  48.356 +distclean-am: clean-am distclean-generic distclean-tags
  48.357 +
  48.358 +dvi: dvi-recursive
  48.359 +
  48.360 +dvi-am:
  48.361 +
  48.362 +info: info-recursive
  48.363 +
  48.364 +info-am:
  48.365 +
  48.366 +install-data-am:
  48.367 +
  48.368 +install-exec-am:
  48.369 +
  48.370 +install-info: install-info-recursive
  48.371 +
  48.372 +install-man:
  48.373 +
  48.374 +installcheck-am:
  48.375 +
  48.376 +maintainer-clean: maintainer-clean-recursive
  48.377 +	-rm -f Makefile
  48.378 +maintainer-clean-am: distclean-am maintainer-clean-generic
  48.379 +
  48.380 +mostlyclean: mostlyclean-recursive
  48.381 +
  48.382 +mostlyclean-am: mostlyclean-generic
  48.383 +
  48.384 +pdf: pdf-recursive
  48.385 +
  48.386 +pdf-am:
  48.387 +
  48.388 +ps: ps-recursive
  48.389 +
  48.390 +ps-am:
  48.391 +
  48.392 +uninstall-am: uninstall-info-am
  48.393 +
  48.394 +uninstall-info: uninstall-info-recursive
  48.395 +
  48.396 +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
  48.397 +	clean-generic clean-recursive ctags ctags-recursive distclean \
  48.398 +	distclean-generic distclean-recursive distclean-tags distdir \
  48.399 +	dvi dvi-am dvi-recursive info info-am info-recursive install \
  48.400 +	install-am install-data install-data-am install-data-recursive \
  48.401 +	install-exec install-exec-am install-exec-recursive \
  48.402 +	install-info install-info-am install-info-recursive install-man \
  48.403 +	install-recursive install-strip installcheck installcheck-am \
  48.404 +	installdirs installdirs-am installdirs-recursive \
  48.405 +	maintainer-clean maintainer-clean-generic \
  48.406 +	maintainer-clean-recursive mostlyclean mostlyclean-generic \
  48.407 +	mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
  48.408 +	ps-recursive tags tags-recursive uninstall uninstall-am \
  48.409 +	uninstall-info-am uninstall-info-recursive uninstall-recursive
  48.410 +
  48.411 +
  48.412 +man: man/masqmail.8 man/mservdetect.8 man/masqmail.conf.5 man/masqmail.route.5 man/masqmail.get.5 man/masqmail.aliases.5
  48.413 +
  48.414 +html: html/masqmail.8.html html/mservdetect.8.html html/masqmail.conf.5.html html/masqmail.route.5.html html/masqmail.get.5.html html/masqmail.aliases.5.html
  48.415 +
  48.416 +man/masqmail.8:	xml/masqmail.8.xml
  48.417 +	xmltoman $< >$@
  48.418 +
  48.419 +man/mservdetect.8:	xml/mservdetect.8.xml
  48.420 +	xmltoman $< >$@
  48.421 +
  48.422 +man/masqmail.conf.5:	xml/masqmail.conf.5.xml
  48.423 +	xmltoman $< >$@
  48.424 +
  48.425 +man/masqmail.route.5:	xml/masqmail.route.5.xml
  48.426 +	xmltoman $< >$@
  48.427 +
  48.428 +man/masqmail.get.5:	xml/masqmail.get.5.xml
  48.429 +	xmltoman $< >$@
  48.430 +
  48.431 +man/masqmail.aliases.5:	xml/masqmail.aliases.5.xml
  48.432 +	xmltoman $< >$@
  48.433 +
  48.434 +html/masqmail.8.html:	xml/masqmail.8.xml
  48.435 +	xmlmantohtml $< >$@
  48.436 +
  48.437 +html/mservdetect.8.html:	xml/mservdetect.8.xml
  48.438 +	xmlmantohtml $< >$@
  48.439 +
  48.440 +html/masqmail.conf.5.html:	xml/masqmail.conf.5.xml
  48.441 +	xmlmantohtml $< >$@
  48.442 +
  48.443 +html/masqmail.route.5.html:	xml/masqmail.route.5.xml
  48.444 +	xmlmantohtml $< >$@
  48.445 +
  48.446 +html/masqmail.get.5.html:	xml/masqmail.get.5.xml
  48.447 +	xmlmantohtml $< >$@
  48.448 +
  48.449 +html/masqmail.aliases.5.html:	xml/masqmail.aliases.5.xml
  48.450 +	xmlmantohtml $< >$@
  48.451 +
  48.452 +#clean:
  48.453 +#	rm -f man/*.[58]
  48.454 +#	rm -r html/*.html
  48.455 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  48.456 +# Otherwise a system limit (for SysV at least) may be exceeded.
  48.457 +.NOEXPORT:
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/docs/README	Fri Sep 26 17:05:23 2008 +0200
    49.3 @@ -0,0 +1,11 @@
    49.4 +Since version 0.1.1 the documentation within the masqmail package is
    49.5 +in man pages. The source is in in xml, the xml sources can be
    49.6 +converted to man pages or html pages with the perl scripts xml2man and
    49.7 +xmlman2html.
    49.8 +
    49.9 +The xml sources are availabe in another package.
   49.10 +
   49.11 +The perl scripts will be available at http://masqmail.cx/xml2man/
   49.12 +
   49.13 +If you want to conribute to the documentation, please use the xml
   49.14 +sources, changes in html or man pages will be lost.
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/docs/man/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    50.3 @@ -0,0 +1,1 @@
    50.4 +man_MANS=masqmail.8 mservdetect.8 masqmail.conf.5 masqmail.route.5 masqmail.get.5 masqmail.aliases.5
    50.5 \ No newline at end of file
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/docs/man/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    51.3 @@ -0,0 +1,364 @@
    51.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    51.5 +# @configure_input@
    51.6 +
    51.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    51.8 +# Free Software Foundation, Inc.
    51.9 +# This Makefile.in is free software; the Free Software Foundation
   51.10 +# gives unlimited permission to copy and/or distribute it,
   51.11 +# with or without modifications, as long as this notice is preserved.
   51.12 +
   51.13 +# This program is distributed in the hope that it will be useful,
   51.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   51.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   51.16 +# PARTICULAR PURPOSE.
   51.17 +
   51.18 +@SET_MAKE@
   51.19 +
   51.20 +srcdir = @srcdir@
   51.21 +top_srcdir = @top_srcdir@
   51.22 +VPATH = @srcdir@
   51.23 +pkgdatadir = $(datadir)/@PACKAGE@
   51.24 +pkglibdir = $(libdir)/@PACKAGE@
   51.25 +pkgincludedir = $(includedir)/@PACKAGE@
   51.26 +top_builddir = ../..
   51.27 +
   51.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   51.29 +INSTALL = @INSTALL@
   51.30 +install_sh_DATA = $(install_sh) -c -m 644
   51.31 +install_sh_PROGRAM = $(install_sh) -c
   51.32 +install_sh_SCRIPT = $(install_sh) -c
   51.33 +INSTALL_HEADER = $(INSTALL_DATA)
   51.34 +transform = $(program_transform_name)
   51.35 +NORMAL_INSTALL = :
   51.36 +PRE_INSTALL = :
   51.37 +POST_INSTALL = :
   51.38 +NORMAL_UNINSTALL = :
   51.39 +PRE_UNINSTALL = :
   51.40 +POST_UNINSTALL = :
   51.41 +ACLOCAL = @ACLOCAL@
   51.42 +AMDEP_FALSE = @AMDEP_FALSE@
   51.43 +AMDEP_TRUE = @AMDEP_TRUE@
   51.44 +AMTAR = @AMTAR@
   51.45 +AUTOCONF = @AUTOCONF@
   51.46 +AUTOHEADER = @AUTOHEADER@
   51.47 +AUTOMAKE = @AUTOMAKE@
   51.48 +AWK = @AWK@
   51.49 +BASE64_LIBS = @BASE64_LIBS@
   51.50 +CC = @CC@
   51.51 +CCDEPMODE = @CCDEPMODE@
   51.52 +CFLAGS = @CFLAGS@
   51.53 +CPP = @CPP@
   51.54 +CPPFLAGS = @CPPFLAGS@
   51.55 +CYGPATH_W = @CYGPATH_W@
   51.56 +DEFS = @DEFS@
   51.57 +DEPDIR = @DEPDIR@
   51.58 +ECHO_C = @ECHO_C@
   51.59 +ECHO_N = @ECHO_N@
   51.60 +ECHO_T = @ECHO_T@
   51.61 +EGREP = @EGREP@
   51.62 +EXEEXT = @EXEEXT@
   51.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   51.64 +GLIB_LIBS = @GLIB_LIBS@
   51.65 +IDENT_LIBS = @IDENT_LIBS@
   51.66 +INSTALL_DATA = @INSTALL_DATA@
   51.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   51.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   51.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   51.70 +LDFLAGS = @LDFLAGS@
   51.71 +LIBOBJS = @LIBOBJS@
   51.72 +LIBS = @LIBS@
   51.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   51.74 +LTLIBOBJS = @LTLIBOBJS@
   51.75 +MAKEINFO = @MAKEINFO@
   51.76 +MD5_LIBS = @MD5_LIBS@
   51.77 +OBJEXT = @OBJEXT@
   51.78 +PACKAGE = @PACKAGE@
   51.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   51.80 +PACKAGE_NAME = @PACKAGE_NAME@
   51.81 +PACKAGE_STRING = @PACKAGE_STRING@
   51.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   51.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   51.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   51.85 +PKG_CONFIG = @PKG_CONFIG@
   51.86 +RANLIB = @RANLIB@
   51.87 +RESOLV_LIBS = @RESOLV_LIBS@
   51.88 +SET_MAKE = @SET_MAKE@
   51.89 +SHELL = @SHELL@
   51.90 +STRIP = @STRIP@
   51.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   51.92 +VERSION = @VERSION@
   51.93 +ac_ct_CC = @ac_ct_CC@
   51.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   51.95 +ac_ct_STRIP = @ac_ct_STRIP@
   51.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   51.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   51.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   51.99 +am__include = @am__include@
  51.100 +am__leading_dot = @am__leading_dot@
  51.101 +am__quote = @am__quote@
  51.102 +bindir = @bindir@
  51.103 +build_alias = @build_alias@
  51.104 +datadir = @datadir@
  51.105 +exec_prefix = @exec_prefix@
  51.106 +has_ident = @has_ident@
  51.107 +host_alias = @host_alias@
  51.108 +includedir = @includedir@
  51.109 +infodir = @infodir@
  51.110 +install_sh = @install_sh@
  51.111 +libdir = @libdir@
  51.112 +libexecdir = @libexecdir@
  51.113 +localstatedir = @localstatedir@
  51.114 +mandir = @mandir@
  51.115 +oldincludedir = @oldincludedir@
  51.116 +prefix = @prefix@
  51.117 +program_transform_name = @program_transform_name@
  51.118 +sbindir = @sbindir@
  51.119 +sharedstatedir = @sharedstatedir@
  51.120 +sysconfdir = @sysconfdir@
  51.121 +target_alias = @target_alias@
  51.122 +with_confdir = @with_confdir@
  51.123 +with_group = @with_group@
  51.124 +with_logdir = @with_logdir@
  51.125 +with_spooldir = @with_spooldir@
  51.126 +with_user = @with_user@
  51.127 +man_MANS = masqmail.8 mservdetect.8 masqmail.conf.5 masqmail.route.5 masqmail.get.5 masqmail.aliases.5
  51.128 +subdir = docs/man
  51.129 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  51.130 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  51.131 +CONFIG_HEADER = $(top_builddir)/config.h
  51.132 +CONFIG_CLEAN_FILES =
  51.133 +DIST_SOURCES =
  51.134 +
  51.135 +NROFF = nroff
  51.136 +MANS = $(man_MANS)
  51.137 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
  51.138 +all: all-am
  51.139 +
  51.140 +.SUFFIXES:
  51.141 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  51.142 +	cd $(top_srcdir) && \
  51.143 +	  $(AUTOMAKE) --gnu  docs/man/Makefile
  51.144 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  51.145 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  51.146 +uninstall-info-am:
  51.147 +
  51.148 +man5dir = $(mandir)/man5
  51.149 +install-man5: $(man5_MANS) $(man_MANS)
  51.150 +	@$(NORMAL_INSTALL)
  51.151 +	$(mkinstalldirs) $(DESTDIR)$(man5dir)
  51.152 +	@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
  51.153 +	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
  51.154 +	for i in $$l2; do \
  51.155 +	  case "$$i" in \
  51.156 +	    *.5*) list="$$list $$i" ;; \
  51.157 +	  esac; \
  51.158 +	done; \
  51.159 +	for i in $$list; do \
  51.160 +	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
  51.161 +	  else file=$$i; fi; \
  51.162 +	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
  51.163 +	  case "$$ext" in \
  51.164 +	    5*) ;; \
  51.165 +	    *) ext='5' ;; \
  51.166 +	  esac; \
  51.167 +	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
  51.168 +	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
  51.169 +	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
  51.170 +	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
  51.171 +	  $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
  51.172 +	done
  51.173 +uninstall-man5:
  51.174 +	@$(NORMAL_UNINSTALL)
  51.175 +	@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
  51.176 +	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
  51.177 +	for i in $$l2; do \
  51.178 +	  case "$$i" in \
  51.179 +	    *.5*) list="$$list $$i" ;; \
  51.180 +	  esac; \
  51.181 +	done; \
  51.182 +	for i in $$list; do \
  51.183 +	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
  51.184 +	  case "$$ext" in \
  51.185 +	    5*) ;; \
  51.186 +	    *) ext='5' ;; \
  51.187 +	  esac; \
  51.188 +	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
  51.189 +	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
  51.190 +	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
  51.191 +	  echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
  51.192 +	  rm -f $(DESTDIR)$(man5dir)/$$inst; \
  51.193 +	done
  51.194 +
  51.195 +man8dir = $(mandir)/man8
  51.196 +install-man8: $(man8_MANS) $(man_MANS)
  51.197 +	@$(NORMAL_INSTALL)
  51.198 +	$(mkinstalldirs) $(DESTDIR)$(man8dir)
  51.199 +	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
  51.200 +	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
  51.201 +	for i in $$l2; do \
  51.202 +	  case "$$i" in \
  51.203 +	    *.8*) list="$$list $$i" ;; \
  51.204 +	  esac; \
  51.205 +	done; \
  51.206 +	for i in $$list; do \
  51.207 +	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
  51.208 +	  else file=$$i; fi; \
  51.209 +	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
  51.210 +	  case "$$ext" in \
  51.211 +	    8*) ;; \
  51.212 +	    *) ext='8' ;; \
  51.213 +	  esac; \
  51.214 +	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
  51.215 +	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
  51.216 +	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
  51.217 +	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
  51.218 +	  $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
  51.219 +	done
  51.220 +uninstall-man8:
  51.221 +	@$(NORMAL_UNINSTALL)
  51.222 +	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
  51.223 +	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
  51.224 +	for i in $$l2; do \
  51.225 +	  case "$$i" in \
  51.226 +	    *.8*) list="$$list $$i" ;; \
  51.227 +	  esac; \
  51.228 +	done; \
  51.229 +	for i in $$list; do \
  51.230 +	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
  51.231 +	  case "$$ext" in \
  51.232 +	    8*) ;; \
  51.233 +	    *) ext='8' ;; \
  51.234 +	  esac; \
  51.235 +	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
  51.236 +	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
  51.237 +	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
  51.238 +	  echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
  51.239 +	  rm -f $(DESTDIR)$(man8dir)/$$inst; \
  51.240 +	done
  51.241 +tags: TAGS
  51.242 +TAGS:
  51.243 +
  51.244 +ctags: CTAGS
  51.245 +CTAGS:
  51.246 +
  51.247 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  51.248 +
  51.249 +top_distdir = ../..
  51.250 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  51.251 +
  51.252 +distdir: $(DISTFILES)
  51.253 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  51.254 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  51.255 +	list='$(DISTFILES)'; for file in $$list; do \
  51.256 +	  case $$file in \
  51.257 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  51.258 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  51.259 +	  esac; \
  51.260 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  51.261 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  51.262 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  51.263 +	    dir="/$$dir"; \
  51.264 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  51.265 +	  else \
  51.266 +	    dir=''; \
  51.267 +	  fi; \
  51.268 +	  if test -d $$d/$$file; then \
  51.269 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  51.270 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  51.271 +	    fi; \
  51.272 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  51.273 +	  else \
  51.274 +	    test -f $(distdir)/$$file \
  51.275 +	    || cp -p $$d/$$file $(distdir)/$$file \
  51.276 +	    || exit 1; \
  51.277 +	  fi; \
  51.278 +	done
  51.279 +check-am: all-am
  51.280 +check: check-am
  51.281 +all-am: Makefile $(MANS)
  51.282 +
  51.283 +installdirs:
  51.284 +	$(mkinstalldirs) $(DESTDIR)$(man5dir) $(DESTDIR)$(man8dir)
  51.285 +install: install-am
  51.286 +install-exec: install-exec-am
  51.287 +install-data: install-data-am
  51.288 +uninstall: uninstall-am
  51.289 +
  51.290 +install-am: all-am
  51.291 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  51.292 +
  51.293 +installcheck: installcheck-am
  51.294 +install-strip:
  51.295 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  51.296 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  51.297 +	  `test -z '$(STRIP)' || \
  51.298 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  51.299 +mostlyclean-generic:
  51.300 +
  51.301 +clean-generic:
  51.302 +
  51.303 +distclean-generic:
  51.304 +	-rm -f $(CONFIG_CLEAN_FILES)
  51.305 +
  51.306 +maintainer-clean-generic:
  51.307 +	@echo "This command is intended for maintainers to use"
  51.308 +	@echo "it deletes files that may require special tools to rebuild."
  51.309 +clean: clean-am
  51.310 +
  51.311 +clean-am: clean-generic mostlyclean-am
  51.312 +
  51.313 +distclean: distclean-am
  51.314 +	-rm -f Makefile
  51.315 +distclean-am: clean-am distclean-generic
  51.316 +
  51.317 +dvi: dvi-am
  51.318 +
  51.319 +dvi-am:
  51.320 +
  51.321 +info: info-am
  51.322 +
  51.323 +info-am:
  51.324 +
  51.325 +install-data-am: install-man
  51.326 +
  51.327 +install-exec-am:
  51.328 +
  51.329 +install-info: install-info-am
  51.330 +
  51.331 +install-man: install-man5 install-man8
  51.332 +
  51.333 +installcheck-am:
  51.334 +
  51.335 +maintainer-clean: maintainer-clean-am
  51.336 +	-rm -f Makefile
  51.337 +maintainer-clean-am: distclean-am maintainer-clean-generic
  51.338 +
  51.339 +mostlyclean: mostlyclean-am
  51.340 +
  51.341 +mostlyclean-am: mostlyclean-generic
  51.342 +
  51.343 +pdf: pdf-am
  51.344 +
  51.345 +pdf-am:
  51.346 +
  51.347 +ps: ps-am
  51.348 +
  51.349 +ps-am:
  51.350 +
  51.351 +uninstall-am: uninstall-info-am uninstall-man
  51.352 +
  51.353 +uninstall-man: uninstall-man5 uninstall-man8
  51.354 +
  51.355 +.PHONY: all all-am check check-am clean clean-generic distclean \
  51.356 +	distclean-generic distdir dvi dvi-am info info-am install \
  51.357 +	install-am install-data install-data-am install-exec \
  51.358 +	install-exec-am install-info install-info-am install-man \
  51.359 +	install-man5 install-man8 install-strip installcheck \
  51.360 +	installcheck-am installdirs maintainer-clean \
  51.361 +	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
  51.362 +	pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
  51.363 +	uninstall-man uninstall-man5 uninstall-man8
  51.364 +
  51.365 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  51.366 +# Otherwise a system limit (for SysV at least) may be exceeded.
  51.367 +.NOEXPORT:
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/docs/man/masqmail.8	Fri Sep 26 17:05:23 2008 +0200
    52.3 @@ -0,0 +1,213 @@
    52.4 +.TH masqmail 8 User Manuals
    52.5 +.SH NAME
    52.6 +masqmail \- An offline Mail Transfer Agent
    52.7 +.SH SYNOPSIS
    52.8 +\fB/usr/sbin/masqmail [-C \fIfile\f1\fB] [-odq] [-bd] [-q\fIinterval\f1\fB]
    52.9 +
   52.10 +\fB/usr/sbin/masqmail [-odq] [-bs]
   52.11 +
   52.12 +\fB/usr/sbin/masqmail [-bp]
   52.13 +
   52.14 +\fB/usr/sbin/masqmail [-q]
   52.15 +
   52.16 +\fB/usr/sbin/masqmail [-qo [\fIname\f1\fB]]
   52.17 +
   52.18 +\fB/usr/sbin/masqmail [-odq] [-g [\fIname\f1\fB]]
   52.19 +
   52.20 +\fB/usr/sbin/masqmail [-odq] [-go [\fIname\f1\fB]]
   52.21 +
   52.22 +\fB/usr/sbin/masqmail [-t] [-oi] [-f \fIaddress\f1\fB] [--] \fIaddress...\f1\fB
   52.23 +
   52.24 +\fB/usr/sbin/mailq
   52.25 +
   52.26 +\fB
   52.27 +.SH DESCRIPTION
   52.28 +
   52.29 +MasqMail is a mail server designed for hosts that do not have a permanent internet connection eg. a home network or a single host at home. It has special support for connections to different ISPs. It replaces sendmail or other MTAs such as qmail or exim. It can also act as a pop3 client.
   52.30 +
   52.31 +.SH OPTIONS
   52.32 +
   52.33 +Since masqmail is intended to replace sendmail, it uses the same command line options, but not all are implemented. There are also two additional options, which are unique to masqmail (-qo \fIconnection\f1 and -g)
   52.34 +.TP
   52.35 +
   52.36 +\fB--\f1
   52.37 +
   52.38 +Not a 'real' option, it means that all following arguments are to be understood as arguments and not as options even if they begin with a leading dash '-'. Mutt is known to call sendmail with this option.
   52.39 +.TP
   52.40 +
   52.41 +\fB-bd\f1
   52.42 +
   52.43 +Run as daemon, accepting connections, usually on port 25 if not configured differently. This is usually used in the startup script at system boot and together with the -q option (see below).
   52.44 +.TP
   52.45 +
   52.46 +\fB-bi\f1
   52.47 +
   52.48 +Old sendmail rebuilds its alias database when invoked with this option. Masqmail ignores it. Masqmail reads directly from the file given with alias_file in the config file.
   52.49 +.TP
   52.50 +
   52.51 +\fB-bp\f1
   52.52 +
   52.53 +Show the messages in the queue. Same as calling masqmail as 'mailq'.
   52.54 +.TP
   52.55 +
   52.56 +\fB-bs\f1
   52.57 +
   52.58 +Accept SMTP commands from stdin. Some mailers (eg pine) use this option as an interface. It can also be used to call masqmail from inetd.
   52.59 +.TP
   52.60 +
   52.61 +\fB-B \fIarg\f1\fB\f1
   52.62 +
   52.63 +\fIarg\f1 is usually 8BITMIME. Some mailers use this to indicate that the message contains characters > 127. Masqmail is 8-bit clean and ignores this, so you do not have to recompile elm, which is very painful ;-). Note though that this violates some conventions: masqmail does not convert 8 bit messages to any MIME format if it encounters a mail server which does not advertise its 8BITMIME capability, masqmail does not advertise this itself. This is the same practice as that of exim (but different to sendmail).
   52.64 +.TP
   52.65 +
   52.66 +\fB-bV \f1
   52.67 +
   52.68 +Show version information.
   52.69 +.TP
   52.70 +
   52.71 +\fB-C \f1\fIfilename\f1
   52.72 +
   52.73 +Use another configuration than \fI/etc/masqmail/masqmail.conf\f1. Useful for debugging purposes. If not invoked by a privileged user, masqmail will drop all privileges.
   52.74 +.TP
   52.75 +
   52.76 +\fB-d \fInumber\f1\fB\f1
   52.77 +
   52.78 +Set the debug level. This takes precedence before the value ofdebug_level in the configuration file. Read the warning in the description of the latter.
   52.79 +.TP
   52.80 +
   52.81 +\fB-f [\fIaddress\f1\fB]\f1
   52.82 +
   52.83 +Set the return path address to \fIaddress\f1. Only root, the user mail and anyoune in group trusted is allowed to do that.
   52.84 +.TP
   52.85 +
   52.86 +\fB-F [\fIstring\f1\fB]\f1
   52.87 +
   52.88 +Set the full sender name (in the From: header) to \fIstring\f1.
   52.89 +.TP
   52.90 +
   52.91 +\fB-g [\fIname\f1\fB]\f1
   52.92 +
   52.93 +Get mail (using pop3 or apop), using the configurations given with get.\fIname\f1 in the main configuration. Without \fIname\f1, all get configurations will be used. See also \fBmasqmail.get (5)\f1
   52.94 +.TP
   52.95 +
   52.96 +\fB-go [\fIinterval\f1\fB] [\fIname\f1\fB]\f1
   52.97 +
   52.98 +Can be followed by a connection name. Use this option in your script which starts as soon as a link to the internet has been set up (usually ip-up). When masqmail is called with this option, the specified get configuration(s) is(are) read and mail will be retrieved from servers on the internet. The \fIname\f1 is defined in the configuration (see \fBonline_gets.\fIname\f1\fB\f1).
   52.99 +
  52.100 +If called with an interval option (recognized by a digit as the first characater), masqmail starts as a daemon and tries to get mail in these intervals. It checks for the online status first. Example: masqmail -go 5m will retrieve mail all five minutes.
  52.101 +
  52.102 +If called without \fIname\f1 the online status is determined with the configured method (see \fBonline_detect\f1 in config.html).
  52.103 +.TP
  52.104 +
  52.105 +\fB-i\f1
  52.106 +
  52.107 +Same as -oi, see below.
  52.108 +.TP
  52.109 +
  52.110 +\fB-Mrm \fIlist\f1\fB\f1
  52.111 +
  52.112 +Remove given messages from the queue. Only allowed for privileged users.
  52.113 +.TP
  52.114 +
  52.115 +\fB-oem\f1
  52.116 +
  52.117 +If the -oi ist not also given, always return with a non zero return code. Maybe someone tells me what this is good for...
  52.118 +.TP
  52.119 +
  52.120 +\fB-odb\f1
  52.121 +
  52.122 +Deliver in background. Masqmail always does this, which makes this option pretty much useless.
  52.123 +.TP
  52.124 +
  52.125 +\fB-odq\f1
  52.126 +
  52.127 +Do not attempt to deliver immediately. Any messages will be queued until the next queue running process picks them up and delivers them. You get the same effect by setting the do_queue option in /etc/masqmail/masqmail.conf.
  52.128 +.TP
  52.129 +
  52.130 +\fB-oi\f1
  52.131 +
  52.132 +A dot as a single character in a line does not terminate the message.
  52.133 +.TP
  52.134 +
  52.135 +\fB-q [\fIinterval\f1\fB]\f1
  52.136 +
  52.137 +If not given with an argument, run a queue process, ie. try to deliver all messages in the queue. Masqmail sends only to those addresses that are on the local net, not to those that are outside. Use -qo for those.
  52.138 +
  52.139 +If you have configured inetd to start masqmail, you can use this option in a cron job which starts in regular time intervals, to mimic the same effect as starting masqmail with -bd -q30m.
  52.140 +
  52.141 +An argument may be a time interval ie. a numerical value followed by one of the letters. s,m,h,d,w which are interpreted as seconds, minutes, hours, days or weeks respectively. Example: -q30m. Masqmail starts as a daemon and a queue runner process will be started automatically once in this time interval. This is usually used together with -bd (see above).
  52.142 +.TP
  52.143 +
  52.144 +\fB-qo [\fIname\f1\fB]\f1
  52.145 +
  52.146 +Can be followed by a connection name. Use this option in your script which starts as soon as a link to the internet has been set up (usually ip-up). When masqmail is called with this option, the specified route configuration is read and the queued mail with destinations on the internet will be sent. The \fIname\f1 is defined in the configuration (see \fBonline_routes.\fIname\f1\fB\f1).
  52.147 +
  52.148 +If called without \fIname\f1 the online status is determined with the configured method (see \fBonline_detect\f1 in config.html)
  52.149 +.TP
  52.150 +
  52.151 +\fB-t\f1
  52.152 +
  52.153 +Read recipients from headers. Delete 'Bcc:' headers. If any arguments are given, these are interpreted as recipient addresses and the message will not be sent to these.
  52.154 +.TP
  52.155 +
  52.156 +\fB-v\f1
  52.157 +
  52.158 +Log also to stdout. Currently, some log messages are marked as 'write to stdout' and additionally, all messages with priority 'LOG_ALERT' and 'LOG_WARNING' will be written to stdout if this option is given. It is disabled in daemon mode.
  52.159 +.SH ENVIRONMENT FOR PIPES AND MDAS
  52.160 +
  52.161 +For security reasons, before any pipe command from an alias expansion or an mda is called, the environment variables will be completely discarded and newly set up. These are:
  52.162 +
  52.163 +SENDER, RETURN_PATH - the return path.
  52.164 +
  52.165 +SENDER_DOMAIN - the domain part of the return path.
  52.166 +
  52.167 +SENDER_LOCAL - the local part of the return path.
  52.168 +
  52.169 +RECEIVED_HOST - the host the message was received from (unless local).
  52.170 +
  52.171 +LOCAL_PART, USER, LOGNAME - the local part of the (original) recipient.
  52.172 +
  52.173 +MESSAGE_ID - the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header.
  52.174 +
  52.175 +QUALIFY_DOMAIN - the domain which will be appended to unqualified addresses.
  52.176 +
  52.177 +.SH FILES
  52.178 +
  52.179 +\fI/etc/masqmail/masqmail.conf\f1 is the main configuration for masqmail. Depending on the settings in this file, you will also have other configuration files in \fI/etc/masqmail/\f1.
  52.180 +
  52.181 +\fI/etc/aliases\f1 is the alias file, if not set differently in \fI/etc/masqmail/masqmail.conf\f1.
  52.182 +
  52.183 +\fI/var/spool/masqmail/\f1 is the spool directory where masqmail stores its spooled messages and the uniq pop ids.
  52.184 +
  52.185 +\fI/var/spool/mail/\f1 is the directory where locally delivered mail will be put, if not configured differently in \fImasqmail.conf\f1.
  52.186 +
  52.187 +\fI/var/log/masqmail/\f1 is the directory where masqmail stores its log mesages. This can also be somewhere else if configured differently by your sysadmin or the package mantainer.
  52.188 +
  52.189 +.SH CONFORMING TO
  52.190 +
  52.191 +RFC 821, 822, 1869, 1870, 2197, 2554 (SMTP)
  52.192 +
  52.193 +RFC 1725, 1939 (POP3)
  52.194 +
  52.195 +RFC 1321 (MD5)
  52.196 +
  52.197 +RFC 2195 (CRAM-MD5)
  52.198 +
  52.199 +.SH AUTHOR
  52.200 +
  52.201 +masqmail was written by Oliver Kurth <oku@masqmail.cx>
  52.202 +
  52.203 +You will find the newest version of masqmail at \fBhttp://masqmail.cx/masqmail/\f1 or search for it in freshmeat (\fBhttp://www.freshmeat.net\f1). There is also a mailing list, you will find information about it at masqmails main site.
  52.204 +
  52.205 +.SH BUGS
  52.206 +
  52.207 +You should report them to the mailing list.
  52.208 +
  52.209 +.SH SEE ALSO
  52.210 +
  52.211 +\fBmasqmail.conf (5)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.get (5)\f1, \fBmasqmail.aliases (5)\f1
  52.212 +
  52.213 +.SH COMMENTS
  52.214 +
  52.215 +This man page was written using \fBxml2man (1)\f1 by the same author.
  52.216 +
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/docs/man/masqmail.aliases.5	Fri Sep 26 17:05:23 2008 +0200
    53.3 @@ -0,0 +1,41 @@
    53.4 +.TH masqmail.aliases 5 User Manuals
    53.5 +.SH NAME
    53.6 +masqmail.aliases \- masqmail alias file format
    53.7 +.SH DESCRIPTION
    53.8 +
    53.9 +This man page describes the format of the masqmail alias file. Its usual location is \fI/etc/aliases\f1.
   53.10 +
   53.11 +.SH FILE FORMAT
   53.12 +
   53.13 +The alias file consists of lines of the form:
   53.14 +local_part: item1, item2, ...
   53.15 +Items can be surrounded by quotes '"'. If within the quotes other quotes are needed for an address they can be escaped with a leading backslash '\'.
   53.16 +
   53.17 +A leading '\' indicates that this address shall not be further expanded.
   53.18 +
   53.19 +A leading pipe symbol '|' indicates that the item shall be treated as a pipe command. The content of the message will then be sent to the standard input of a command. The command will run under the user id and group id masqmail is running as. If quotes are needed, the pipe symbol must appear within the quotes.
   53.20 +
   53.21 +Loops will be detected, the offending address will be ignored.
   53.22 +
   53.23 +Aliases will be expanded at delivery time. This means that if there is a message still in the queue and you change any alias which matches one of the recipient addresses, the change will have effect next time a delivery is attemped.
   53.24 +
   53.25 +There is no need to restart masqmail or run any command when the alias file has been changed.
   53.26 +
   53.27 +.SH AUTHOR
   53.28 +
   53.29 +masqmail was written by Oliver Kurth <oku@masqmail.cx>
   53.30 +
   53.31 +You will find the newest version of masqmail at \fBhttp://masqmail.cx/masqmail/\f1 or search for it in freshmeat (\fBhttp://www.freshmeat.net\f1). There is also a mailing list, you will find information about it at masqmails main site.
   53.32 +
   53.33 +.SH BUGS
   53.34 +
   53.35 +You should report them to the mailing list.
   53.36 +
   53.37 +.SH SEE ALSO
   53.38 +
   53.39 +\fBmasqmail.conf (5)\f1, \fBmasqmail (8)\f1, 
   53.40 +
   53.41 +.SH COMMENTS
   53.42 +
   53.43 +This man page was written using \fBxml2man (1)\f1 by the same author.
   53.44 +
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/docs/man/masqmail.conf.5	Fri Sep 26 17:05:23 2008 +0200
    54.3 @@ -0,0 +1,345 @@
    54.4 +.TH masqmail.conf 5 User Manuals
    54.5 +.SH NAME
    54.6 +masqmail.conf \- masqmail configuration file
    54.7 +.SH DESCRIPTION
    54.8 +
    54.9 +This man page describes the syntax of the main configuration file of masqmail. Its usual location is \fI/etc/masqmail/masqmail.conf\f1
   54.10 +
   54.11 +The configuration consists of lines of the form
   54.12 +
   54.13 +\fBval\f1 = \fIexpression\f1
   54.14 +
   54.15 +Where \fBval\f1 is a variable name and \fIexpression\f1 a string, which can be quoted with '"'. If the expression is on multiple lines or contains characters other than letters, digits or the characters '.', '-', '_', '/', it must be quoted. You can use quotes inside quotes by escaping them with a backslash.
   54.16 +
   54.17 +Each val has a type, which can be boolean, numeric, string or list. A boolean variable can be set with one of the values 'on', 'yes', and 'true' or 'off', 'no' and 'false'. List items are separated with ';'. For some values patterns (like '*','?') can be used. The spaces before and after the '=' are optional.
   54.18 +
   54.19 +Most lists (exceptions: \fBlocal_hosts\f1,\fBlocal_nets\f1, \fBlisten_addresses\f1, \fBonline_routes\f1 and \fBonline_gets\f1) accept files. These will be recognized by a leading slash '/'. The contents of these files will be included at the position of the file name, there can be items or other files before and after the file entry. The format of the files is different though, within these files each entry is on another line. (And not separated by semicolons). This makes it easy to include large lists which are common in different configuration files, so they do not have to appear in every configuration file.
   54.20 +
   54.21 +Blank lines and lines starting with '#' are ignored.
   54.22 +
   54.23 +.SH OPTIONS
   54.24 +.TP
   54.25 +
   54.26 +\fBrun_as_user = \fIboolean\f1\fB\f1
   54.27 +
   54.28 +If this is set, masqmail runs with the user id of the user who invoked it and never changes it. This is for debugging purposes only. If the user is not root, masqmail will not be able to listen on a port < 1024 and will not be able to deliver local mail to others than the user.
   54.29 +.TP
   54.30 +
   54.31 +\fBuse_syslog = \fIboolean\f1\fB\f1
   54.32 +
   54.33 +If this is set, masqmail uses syslogd for logging. It uses facility MAIL. You still have to set \fBlog_dir\f1 for debug files.
   54.34 +.TP
   54.35 +
   54.36 +\fBdebug_level = \fIn\f1\fB\f1
   54.37 +
   54.38 +Set the debug level. Valid values are 0 to 6, increasing it further makes no difference. Be careful if you set this as high as 5 or higher, the logs may very soon fill your hard drive.
   54.39 +.TP
   54.40 +
   54.41 +\fBmail_dir = \fIfile\f1\fB\f1
   54.42 +
   54.43 +The directory where local mail is stored, usually \fI/var/spool/mail\f1 or \fI/var/mail\f1.
   54.44 +.TP
   54.45 +
   54.46 +\fBspool_dir = \fIfile\f1\fB\f1
   54.47 +
   54.48 +The directory where masqmail stores its spool files (and later also other stuff). It must have a subdirectory \fIinput\f1. Masqmail needs read and write permissions for this directory. I suggest to use \fI/var/spool/masqmail\f1.
   54.49 +.TP
   54.50 +
   54.51 +\fBhost_name = \fIstring\f1\fB\f1
   54.52 +
   54.53 +This is used in different places: Masqmail identifies itself in the greeting banner on incoming connections and in the HELO/EHLO command for outgoing connections with this name, it is used in the Received: header and to qualify the sender of a locally originating message.
   54.54 +
   54.55 +If the string begins with a slash '/', it it assumed that it is a filename, and the first line of this file will be used. Usually this will be '/etc/mailname' to make masqmail conform to Debian policies.
   54.56 +
   54.57 +It is not used to find whether an address is local. Use \fBlocal_hosts\f1 for that.
   54.58 +.TP
   54.59 +
   54.60 +\fBremote_port = \fIn\f1\fB\f1
   54.61 +
   54.62 +The remote port number to be used. This defaults to port 25.
   54.63 +
   54.64 +This option is deprecated. Use \fBhost_name\f1 in the route configuration instead. See \fBmasqmail.route (5)\f1.
   54.65 +.TP
   54.66 +
   54.67 +\fBlocal_hosts = \fIlist\f1\fB\f1
   54.68 +
   54.69 +A semicolon ';' separated list of hostnames which are considered local. Normally you set it to "localhost;foo;foo.bar.com" if your host has the fully qualified domain name 'foo.bar.com'.
   54.70 +.TP
   54.71 +
   54.72 +\fBlocal_nets = \fIlist\f1\fB\f1
   54.73 +
   54.74 +A semicolon ';' separated list of hostnames which are on the 'local' net. Delivery to these hosts is attempted immediately. You can use patterns with '*', eg. "*.bar.com".
   54.75 +.TP
   54.76 +
   54.77 +\fBlocal_addresses = \fIlist\f1\fB\f1
   54.78 +
   54.79 +A semicolon ';' separated list of fully qualified email-addresses which are considered local although their domain name part is not in the list of \fBlocal_hosts\f1. 
   54.80 +
   54.81 +For example: There are two people working at your LAN: person1@yourdomain and person2@yourdomain. But there are other persons @yourdomain which are NOT local. So you can not put yourdomain to the list of local_hosts. If person1 now wants to write to person2@yourdomain and this mail should not leave the LAN then you can put
   54.82 +
   54.83 +local_addresses = "person1@yourdomain;person2@yourdomain"
   54.84 +
   54.85 +to your masqmail.conf.
   54.86 +.TP
   54.87 +
   54.88 +\fBnot_local_addresses = \fIlist\f1\fB\f1
   54.89 +
   54.90 +A semicolon ';' separated list of fully qualified email-addresses which are considered not local although their domain name part is in the list of \fBlocal_hosts\f1. 
   54.91 +
   54.92 +This ist the opposite of the previous case. The majority of addresses of a specific domain are local. But some users are not. With this option you can easily exclude these users.
   54.93 +
   54.94 +Example:
   54.95 +
   54.96 +local_hosts = "localhost;myhost;mydomain.net"
   54.97 +
   54.98 +not_local_addresses = "eric@mydomain.net"
   54.99 +.TP
  54.100 +
  54.101 +\fBlisten_addresses = \fIlist\f1\fB\f1
  54.102 +
  54.103 +A semicolon ';' separated list of interfaces on which connections will be accepted. An interface ist defined by a hostname, optionally followed by a colon ':' and a number for the port. If this is left out, port 25 will be used.
  54.104 +
  54.105 +You can set this to "localhost:25;foo:25" if your hostname is 'foo'.
  54.106 +
  54.107 +Note that the names are resolved to IP addreses. If your host has different names which resolve to the same IP, use only one of them, otherwise you will get an error message.
  54.108 +.TP
  54.109 +
  54.110 +\fBdo_save_envelope_to = \fIboolean\f1\fB\f1
  54.111 +
  54.112 +If this is set to true, a possibly existing Envelope-to: header in an incoming mail which is received via either pop3 or smtp will be saved as an X-Orig-Envelope-to: header.
  54.113 +
  54.114 +This is useful if you retrieve mail from a pop3 server with either masqmail or fetchmail, and the server supports Envelope-to: headers, and you want to make use of those with a mail filtering tool, eg. procmail. It cannot be preserved because masqmail sets such a header by itself.
  54.115 +
  54.116 +Default is false.
  54.117 +.TP
  54.118 +
  54.119 +\fBdo_relay = \fIboolean\f1\fB\f1
  54.120 +
  54.121 +If this is set to false, mail with a return path that is not local and a destination that is also not local will not be accepted via smtp and a 550 reply will be given. Default is true.
  54.122 +
  54.123 +Note that this will not protect you from spammers using open relays, but from users unable to set their address in their mail clients.
  54.124 +.TP
  54.125 +
  54.126 +\fBdo_queue = \fIboolean\f1\fB\f1
  54.127 +
  54.128 +If this is set, mail will not be delivered immediately when accepted. Same as calling masqmail with the \fB-odq\f1 option.
  54.129 +.TP
  54.130 +
  54.131 +\fBonline_routes.\fIname\f1\fB = \fIlist\f1\fB\f1
  54.132 +
  54.133 +Replace \fIname\f1 with a name to identify a connection. Set this to a filename (or a list of filenames) for the special route configuration for that connection. You will use that name to call masqmail with the\fB-qo\f1 option every time a connection to your ISP is set up.
  54.134 +
  54.135 +Example: Your ISP has the name FastNet. Then you write the following line in the main configuration:
  54.136 +
  54.137 +\fBonline_routes.FastNet\f1 = \fI"/etc/masqmail/fastnet.route"\f1
  54.138 +
  54.139 +\fI/etc/masqmail/fastnet.route\f1 is the route configuration file, see \fBmasqmail.route (5)\f1. As soon as a link to FastNet has been set up, you call masqmail \fB-qo\f1 \fIFastNet\f1. Masqmail will then read the specified file and send the mails.
  54.140 +.TP
  54.141 +
  54.142 +\fBconnect_route.\fIname\f1\fB = \fIlist\f1\fB\f1
  54.143 +
  54.144 +Old name for \fBonline_routes\f1.
  54.145 +.TP
  54.146 +
  54.147 +\fBlocal_net_route = \fIfile\f1\fB\f1
  54.148 +
  54.149 +This is similar to \fBonline_routes.\fIname\f1\fB\f1 but for the local net. Recipient addresses that are in local_nets will be routed using this route configuration. Main purpose is to define a mail server with mail_host in your local network. In simple environments this can be left unset. If unset, a default route configuration will be used.
  54.150 +.TP
  54.151 +
  54.152 +\fBalias_file = \fIfile\f1\fB\f1
  54.153 +
  54.154 +Set this to the location of your alias file. If unset, no aliasing will be done.
  54.155 +.TP
  54.156 +
  54.157 +\fBalias_local_caseless = \fIboolean\f1\fB\f1
  54.158 +
  54.159 +If this is set, local parts in the alias file will be matched disregarding upper/lower case.
  54.160 +.TP
  54.161 +
  54.162 +\fBpipe_fromline = \fIboolean\f1\fB\f1
  54.163 +
  54.164 +If this is set, a from line will be prepended to the output stream whenever a pipe command is called after an alias expansion. Default is false.
  54.165 +.TP
  54.166 +
  54.167 +\fBpipe_fromhack = \fIboolean\f1\fB\f1
  54.168 +
  54.169 +If this is set, each line beginning with 'From ' is replaced with '>From ' whenever a pipe command is called after an alias expansion. You probably want this if you have set \fBpipe_fromline\f1 above. Default is false.
  54.170 +.TP
  54.171 +
  54.172 +\fBmbox_default = \fIstring\f1\fB\f1
  54.173 +
  54.174 +The default local delivery method. Can be one of mbox, mda or maildir (the latter only if maildir support is enabled at compile time). Default is mbox. You can override this for each user by using the \fBmbox_users\f1, \fBmda_users\f1 or \fBmaildir_users\f1 options (see below).
  54.175 +.TP
  54.176 +
  54.177 +\fBmbox_users = \fIlist\f1\fB\f1
  54.178 +
  54.179 +A list of users which wish delivery to an mbox style mail folder.
  54.180 +.TP
  54.181 +
  54.182 +\fBmda_users = \fIlist\f1\fB\f1
  54.183 +
  54.184 +A list of users which wish local delivery to an mda. You have to set \fBmda\f1 (see below) as well.
  54.185 +.TP
  54.186 +
  54.187 +\fBmaildir_users = \fIlist\f1\fB\f1
  54.188 +
  54.189 +A list of users which wish delivery to a qmail style maildir. The path to maildir is ~/Maildir/. The maildir will be created if it does not exist.
  54.190 +.TP
  54.191 +
  54.192 +\fBmda = \fIexpand string\f1\fB\f1
  54.193 +
  54.194 +If you want local delivery to be transferred to an mda (Mail Delivery Agent), set this to a command. The argument will be expanded on delivery time, you can use variables beginning with a '$' sign, optionally enclosed in curly braces. Variables you can use are:
  54.195 +
  54.196 +uid - the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header.
  54.197 +
  54.198 +received_host - the host the mail was received from
  54.199 +
  54.200 +ident - the ident, this is either the ident delivered by the ident protocol or the user id of the sender if the message was received locally.
  54.201 +
  54.202 +return_path_local - the local part of the return path (sender).
  54.203 +
  54.204 +return_path_domain - the domain part of the return path (sender).
  54.205 +
  54.206 +return_path - the complete return path (sender).
  54.207 +
  54.208 +rcpt_local - the local part of the recipient.
  54.209 +
  54.210 +rcpt_domain - the domain part of the recipient.
  54.211 +
  54.212 +rcpt - the complete recipient address.
  54.213 +
  54.214 +Example:
  54.215 +
  54.216 +mda="/usr/bin/procmail -Y -d ${rcpt_local}"
  54.217 +
  54.218 +For the mda, as for pipe commands, a few environment variables will be set as well. See \fBmasqmail (8)\f1. To use environment variables for the mda, the '$' sign has to be escaped with a backslash, otherwise they will be tried to be expanded with the internal variables.
  54.219 +.TP
  54.220 +
  54.221 +\fBmda_fromline = \fIboolean\f1\fB\f1
  54.222 +
  54.223 +If this is set, a from line will be prepended to the output stream whenever a message is delivered to an mda. Default is false.
  54.224 +.TP
  54.225 +
  54.226 +\fBmda_fromhack = \fIboolean\f1\fB\f1
  54.227 +
  54.228 +If this is set, each line beginning with 'From ' is replaced with '>From ' whenever a message is delivered to an mda. You probably want this if you have set \fBmda_fromline\f1 above. Default is false.
  54.229 +.TP
  54.230 +
  54.231 +\fBonline_detect = \fIstring\f1\fB\f1
  54.232 +
  54.233 +Defines the method MasqMail uses to detect whether there is currently an online connection. It can have the values \fBfile\f1, \fBpipe\f1 or \fBmserver\f1.
  54.234 +
  54.235 +When it is set to \fBfile\f1, MasqMail first checks for the existence of \fBonline_file\f1 (see below) and if it exists, it reads it. The content of the file should be the name of the current connection as defined with \fBconnect_route.\fIname\f1\fB\f1 (without a trailing newline character).
  54.236 +
  54.237 +When it is set to \fBpipe\f1, MasqMail calls the executable given by the \fBonline_pipe\f1 option (see below) and reads the current online status from its standard output.
  54.238 +
  54.239 +When it is set to \fBmserver\f1, MasqMail connects to the masqdialer server using the value of \fBmserver_iface\f1 and asks it whether a connection exists and for the name, which should be the name of the current connection as defined with \fBconnect_route.\fIname\f1\fB\f1.
  54.240 +
  54.241 +No matter how MasqMail detects the online status, only messages that are accepted at online time will be delivered using the connection. The spool still has to be emptied with masqmail \fB-qo\f1\fIconnection\f1.
  54.242 +.TP
  54.243 +
  54.244 +\fBonline_file = \fIfile\f1\fB\f1
  54.245 +
  54.246 +This is the name of the file checked for when MasqMail determines whether it is online. The file should only exist when there is currently a connection. Create it in your ip-up script with eg.
  54.247 +
  54.248 +echo -n <name> > /tmp/connect_route
  54.249 +
  54.250 +chmod 0644 /tmp/connect_route
  54.251 +
  54.252 +Do not forget to delete it in your ip-down script.
  54.253 +.TP
  54.254 +
  54.255 +\fBonline_pipe = \fIfile\f1\fB\f1
  54.256 +
  54.257 +This is the name of the executable which will be called to determine the online status. This executable should just print the name oif the current connection to the standard output and return a zero status code. masqmail assumes it is offline if the script returns with a non zero status. Simple example:
  54.258 +
  54.259 +#!/bin/sh
  54.260 +
  54.261 +
  54.262 +
  54.263 +[ -e /tmp/connect_route ] || exit 1
  54.264 +
  54.265 +cat /tmp/connect_route
  54.266 +
  54.267 +exit 0
  54.268 +
  54.269 +Of course, instead of the example above you could as well use \fBfile\f1 as the online detection method, but you can do something more sophisticated.
  54.270 +.TP
  54.271 +
  54.272 +\fBmserver_iface = \fIinterface\f1\fB\f1
  54.273 +
  54.274 +The interface the masqdialer server is listening to. Usually this will be "localhost:224" if mserver is running on the same host as masqmail. But using this option, you can also let masqmail run on another host by setting \fBmserver_iface\f1 to another hostname, eg. "foo:224".
  54.275 +.TP
  54.276 +
  54.277 +\fBget.\fIname\f1\fB = \fIfile\f1\fB\f1
  54.278 +
  54.279 +Replace \fIname\f1 with a name to identify a get configuration. Set this to a filename for the get configuration. These files will be used to retrieve mail when called with the -g option.
  54.280 +.TP
  54.281 +
  54.282 +\fBonline_gets.\fIname\f1\fB = \fIlist\f1\fB\f1
  54.283 +
  54.284 +Replace \fIname\f1 with a name to identify an online configuration. Set this to a filename (or a list of filenames) for the get configuration. These files will be used to retrieve mail when called with the -go option.
  54.285 +.TP
  54.286 +
  54.287 +\fBident_trusted_nets = \fIlist\f1\fB\f1
  54.288 +
  54.289 +\fIlist\f1 is a list of networks of the form a.b.c.d/e (eg. 192.168.1.0/24), from which the ident given by the ident protocol will be trusted, so a user can delete his mail from the queue if the ident is identical to his login name.
  54.290 +.TP
  54.291 +
  54.292 +\fBerrmsg_file = \fIfile\f1\fB\f1
  54.293 +
  54.294 +Set this to a template which will be used to generate delivery failure reports. Variable parts within the template begin with a dollar sign and are identical to those which can be used as arguments for the mda command, see \fBmda\f1 above. Additional information can be included with @failed_rcpts, @msg_headers and @msg_body, these must be at the beginning of a line and will be replaced with the list of the failed recipients, the message headers and the message body of the failed message.
  54.295 +
  54.296 +Default is /usr/share/masqmail/tpl/failmsg.tpl.
  54.297 +.TP
  54.298 +
  54.299 +\fBwarnmsg_file = \fIfile\f1\fB\f1
  54.300 +
  54.301 +Set this to a template which will be used to generate delivery warning reports. It uses the same mechanisms for variables as \fBerrmsg_file\f1, see above.
  54.302 +
  54.303 +Default is /usr/share/masqmail/tpl/warnmsg.tpl.
  54.304 +.TP
  54.305 +
  54.306 +\fBwarn_intervals\f1 = \fIlist\f1
  54.307 +
  54.308 +Set this to a list of time intervals, at which delivery warnings (starting with the receiving time of the message) shall be generated.
  54.309 +
  54.310 +A warning will only be generated just after an attempt to deliver the mail and if that attempt failed temporarily. So a warning may be generated after a longer time, if there was no attempt before.
  54.311 +
  54.312 +Default is "1h;4h;8h;1d;2d;3d"
  54.313 +.TP
  54.314 +
  54.315 +\fBmax_defer_time\f1 = \fItime\f1
  54.316 +
  54.317 +This is the maximum time, in which a temporarily failed mail will be kept in the spool. When this time is exceeded, it will be handled as a delivery failure, and the message will be bounced.
  54.318 +
  54.319 +The excedence of this time will only be noticed if the message was actually tried to be delivered. If, for example, the message can only be delivered when online, but you have not been online for that time, no bounce will be generated.
  54.320 +
  54.321 +Default is 4d (4 days)
  54.322 +.TP
  54.323 +
  54.324 +\fBlog_user = \fIname\f1\fB\f1
  54.325 +
  54.326 +Replace \fIname\f1 with a valid local or remote mail address.
  54.327 +
  54.328 +If this option is not empty, then a copy of every mail, that passes trough the masqmail system will also be sent to the given mail address.
  54.329 +
  54.330 +For example you can feed your mails into a program like hypermail for archiving purpose by placing an appropriate pipe command in masqmail.alias
  54.331 +.SH AUTHOR
  54.332 +
  54.333 +masqmail was written by Oliver Kurth <oku@masqmail.cx>
  54.334 +
  54.335 +You will find the newest version of masqmail at \fBhttp://masqmail.cx/masqmail/\f1 or search for it in freshmeat (\fBhttp://www.freshmeat.net\f1). There is also a mailing list, you will find information about it at masqmails main site.
  54.336 +
  54.337 +.SH BUGS
  54.338 +
  54.339 +You should report them to the mailing list.
  54.340 +
  54.341 +.SH SEE ALSO
  54.342 +
  54.343 +\fBmasqmail (8)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.get (5)\f1
  54.344 +
  54.345 +.SH COMMENTS
  54.346 +
  54.347 +This man page was written using \fBxml2man (1)\f1 by the same author.
  54.348 +
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/docs/man/masqmail.get.5	Fri Sep 26 17:05:23 2008 +0200
    55.3 @@ -0,0 +1,99 @@
    55.4 +.TH masqmail.get 5 User Manuals
    55.5 +.SH NAME
    55.6 +masqmail.get \- masqmail get configuration file
    55.7 +.SH DESCRIPTION
    55.8 + 
    55.9 +This man page describes the options available for the masqmail get configuration.
   55.10 +
   55.11 +.SH OPTIONS
   55.12 +.TP
   55.13 +
   55.14 +\fBprotocol\f1 = \fIstring\f1
   55.15 +
   55.16 +The protocol with which you retrieve your mail. Currently only 'pop3' and 'apop' are supported. There is no default.
   55.17 +.TP
   55.18 +
   55.19 +\fBserver\f1 = \fIstring\f1
   55.20 +
   55.21 +The server you get your mail from.
   55.22 +.TP
   55.23 +
   55.24 +\fBresolve_list\f1 = \fIlist\f1
   55.25 +
   55.26 +Specify the method how the domain of the server is resolved. Possible values are dns_mx, dns_a, byname. For 'dns_mx', the domain is assumed to be an MX pointer to a list of host names, these will be tried each in order (lowest preference value first, equal preference values in random order). For 'dns_a', the domain is assumed to be an A pointer. For 'byname', the library function \fBgethostbyname (3)\f1 will be used.
   55.27 +
   55.28 +The default is "dns_a;byname". It does not make much sense here to use 'dns_mx'.
   55.29 +.TP
   55.30 +
   55.31 +\fBuser\f1 = \fIstring\f1
   55.32 +
   55.33 +Your login name.
   55.34 +.TP
   55.35 +
   55.36 +\fBpass\f1 = \fIstring\f1
   55.37 +
   55.38 +Your password.
   55.39 +.TP
   55.40 +
   55.41 +\fBaddress\f1 = \fIaddress\f1
   55.42 +
   55.43 +The address where the retrieved mail should be sent to. It can be any address, but you probably want to set this to a local address on your LAN.
   55.44 +.TP
   55.45 +
   55.46 +\fBreturn_path\f1 = \fIaddress\f1
   55.47 +
   55.48 +If set, masqmail sets the return path to this address. Bounces generated during further delivery will be sent to this address. If unset, masqmail looks for the Return-Path: header in the mail, if this does not exist it uses the From: address and if this fails, postmaster will be used.
   55.49 +
   55.50 +It is in most cases not useful to set this to the same address as the 'address' option as this may generate multiple bounces. postmaster is recommended.
   55.51 +.TP
   55.52 +
   55.53 +\fBdo_keep\f1 = \fIboolean\f1
   55.54 +
   55.55 +If you want to keep your mail on the server after you retrieved it, set this to true. It is recommended that you also set do_uidl, otherwise you will get the mail again each time you connect to the server. Masqmail does not check any headers before it retrieves mail, which may mark it as already fetched. Note that this behaviour is different to that of fetchmail. The default is false.
   55.56 +.TP
   55.57 +
   55.58 +\fBdo_uidl\f1 = \fIboolean\f1
   55.59 +
   55.60 +If set, MasqMail keeps a list of unique IDs of mails already fetched, so that they will not be retrieved again. Default is false.
   55.61 +.TP
   55.62 +
   55.63 +\fBdo_uidl_dele\f1 = \fIboolean\f1
   55.64 +
   55.65 +If set, and \fBdo_uidl\f1 is also set, MasqMail sends a delete (DELE) command to the server for each message uid in the uid listing at the beginning of the session. This prevents mail to be left on the server if masqmail gets interrupted during a session before it can send the QUIT command to the server. Default is false.
   55.66 +.TP
   55.67 +
   55.68 +\fBmax_size\f1 = \fInumeric\f1
   55.69 +
   55.70 +If set to a value > 0, only messages smaller than this in bytes will be retrieved. The default is 0.
   55.71 +.TP
   55.72 +
   55.73 +\fBmax_count\f1 = \fInumeric\f1
   55.74 +
   55.75 +If set to a value > 0, only \fBmax_count\f1 messages will be retrieved. The default is 0.
   55.76 +.TP
   55.77 +
   55.78 +\fBwrapper\f1 = \fIcommand\f1
   55.79 +
   55.80 +If set, instead of opening a connection to a remote server, \fIcommand\f1 will be called and all traffic will be piped to its stdin and from its stdout. Purpose is to tunnel ip traffic, eg. for ssl.
   55.81 +
   55.82 +Example for ssl tunneling:
   55.83 +
   55.84 +wrapper="/usr/bin/openssl s_client -quiet -connect pop.gmx.net:995 2>/dev/null"
   55.85 +.SH AUTHOR
   55.86 +
   55.87 +masqmail was written by Oliver Kurth <oku@masqmail.cx>
   55.88 +
   55.89 +You will find the newest version of masqmail at \fBhttp://masqmail.cx/masqmail/\f1 or search for it in freshmeat (\fBhttp://www.freshmeat.net\f1). There is also a mailing list, you will find information about it at masqmails main site.
   55.90 +
   55.91 +.SH BUGS
   55.92 +
   55.93 +You should report them to the mailing list.
   55.94 +
   55.95 +.SH SEE ALSO
   55.96 +
   55.97 +\fBmasqmail (8)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.conf (5)\f1
   55.98 +
   55.99 +.SH COMMENTS
  55.100 +
  55.101 +This man page was written using \fBxml2man (1)\f1 by the same author.
  55.102 +
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/docs/man/masqmail.route.5	Fri Sep 26 17:05:23 2008 +0200
    56.3 @@ -0,0 +1,212 @@
    56.4 +.TH masqmail.route 5 User Manuals
    56.5 +.SH NAME
    56.6 +masqmail.route \- masqmail route configuration file
    56.7 +.SH DESCRIPTION
    56.8 +
    56.9 +This man page describes the syntax of the route configuration files of \fBmasqmail (8)\f1. Their usual locations are in \fI/etc/masqmail/\f1.
   56.10 +
   56.11 +.SH OPTIONS
   56.12 +.TP
   56.13 +
   56.14 +\fBprotocol\f1 = \fIstring\f1
   56.15 +
   56.16 +\fIstring\f1 can be one of 'smtp' or 'pipe', default is 'smtp'. If set to 'smtp', mail will be sent with the SMTP protocol to its destination. If set to 'pipe', you also have to set 'pipe' to a command, the message will then be piped to a program. See option 'pipe' below.
   56.17 +.TP
   56.18 +
   56.19 +\fBmail_host\f1 = \fIstring\f1
   56.20 +
   56.21 +This is preferably the mail server of your ISP. All outgoing messages will be sent to this host which will distribute them to their destinations. If you do not set this mails will be sent directly. Because the mail server is probably 'near' to you, mail transfer will be much faster if you use it.
   56.22 +
   56.23 +You can optionally give a port number following the host name and a colon, eg mail_host="mail.foo.com:25".
   56.24 +.TP
   56.25 +
   56.26 +\fBresolve_list\f1 = \fIlist\f1
   56.27 +
   56.28 +Specify the method how the domain of the server is resolved. Possible values are dns_mx, dns_a, byname. For 'dns_mx', the domain is assumed to be an MX pointer to a list of host names, these will be tried each in order (lowest preference value first, equal preference values in random order). For 'dns_a', the domain is assumed to be an A pointer. For 'byname', the library function \fBgethostbyname (3)\f1 will be used.
   56.29 +
   56.30 +The default is "dns_mx;dns_a;byname".
   56.31 +.TP
   56.32 +
   56.33 +\fBconnect_error_fail\f1 = \fIboolean\f1
   56.34 +
   56.35 +If this is set, a connection error will cause a mail delivery to fail, ie. it will be bounced. If it is unset, it will just be defered.
   56.36 +
   56.37 +Default is false. The reason for this is that masqmail is designed for non permanent internet connections, where such errors may occur quite often, and a bounce would be annoying.
   56.38 +
   56.39 +For the default local_net route is is set to true.
   56.40 +.TP
   56.41 +
   56.42 +\fBhelo_name\f1 = \fIstring\f1
   56.43 +
   56.44 +Set the name given with the HELO/EHLO command. If this is not set, \fBhost_name\f1 from \fImasqmail.conf\f1 will be used, if the \fBdo_correct_helo\f1 option (see below) is unset.
   56.45 +.TP
   56.46 +
   56.47 +\fBdo_correct_helo\f1 = \fIboolean\f1
   56.48 +
   56.49 +If this is set, masqmail tries to look up your host name as it appears on the internet and sends this in the HELO/EHLO command. Some servers are so picky that they want this. Which is really crazy. It just does not make any sense to lie about ones own identity, because it can always be looked up by the server. Nobody should believe in the name given by HELO/EHLO anyway. If this is not set, \fBhost_name\f1 from \fImasqmail.conf\f1 or as given with the \fBhelo_name\f1 (see above) will be used.
   56.50 +.TP
   56.51 +
   56.52 +\fBdo_pipelining\f1 = \fIboolean\f1
   56.53 +
   56.54 +If this is set to false, masqmail will not use ESMTP PIPELINING, even if the server announces that it is able to cope with it. Default is true.
   56.55 +
   56.56 +You do not want to set this to false unless the mail setup on the remote server side is really broken. Keywords: wingate.
   56.57 +.TP
   56.58 +
   56.59 +\fBallowed_mail_locals\f1 = \fIlist\f1
   56.60 +
   56.61 +This is a semicolon ';' separated list of local parts which will be allowed to send mail through this connection. If unset and \fBnot_allowed_mail_locals\f1 is also unset, all users are allowed.
   56.62 +.TP
   56.63 +
   56.64 +\fBnot_allowed_mail_locals\f1 = \fIlist\f1
   56.65 +
   56.66 +This is a semicolon ';' separated list of local parts which will be not allowed to send mail through this connection. Local parts in this list will not be allowed to use this route even if they are part of \fBallowed_mail_locals\f1 (see above).
   56.67 +.TP
   56.68 +
   56.69 +\fBallowed_return_paths\f1 = \fIlist\f1
   56.70 +
   56.71 +This is a semicolon ';' separated list of addresses. Messages which have one one of these addresses as the return path will be used using this route (if not also in \fBnot_allowed_return_paths\f1 or an item in \fBnot_allowed_mail_locals\f1 matches).
   56.72 +
   56.73 +Patterns containing '?' and '*' can be used. The special item "<>" matches the null sender address (eg. failure notices or delivery notifications).
   56.74 +.TP
   56.75 +
   56.76 +\fBnot_allowed_return_paths\f1 = \fIlist\f1
   56.77 +
   56.78 +This is a semicolon ';' separated list of addresses. Messages which have one one of these addresses as the return path will not be used using this route (even if also in \fBallowed_return_paths\f1 or an item in \fBallowed_mail_locals\f1 matches).
   56.79 +
   56.80 +Patterns containing '?' and '*' can be used. The special item "<>" matches the null sender address (eg. failure notices or delivery notifications).
   56.81 +.TP
   56.82 +
   56.83 +\fBallowed_rcpt_domains\f1 = \fIlist\f1
   56.84 +
   56.85 +A list of recipient domains where mail will be sent to. This is for example useful if you use this route configuration when connected to another LAN via ppp. Patterns containing '?' and '*' can be used.
   56.86 +.TP
   56.87 +
   56.88 +\fBnot_allowed_rcpt_domains\f1 = \fIlist\f1
   56.89 +
   56.90 +A list of recipient domains where mail will not be sent to. This is for example useful if you send mail directly (\fBmail_host\f1 is not set) and you know of hosts that will not accept mail from you because they use a dialup list (eg. \fBhttp://maps.vix.com/dul/\f1. If any domain matches both \fBallowed_rcpt_domains\f1 and \fBnot_allowed_rcpt_domains\f1, mail will not be sent to this domain. Patterns containing '?' and '*' can be used.
   56.91 +.TP
   56.92 +
   56.93 +\fBset_h_from_domain\f1 = \fIstring\f1
   56.94 +
   56.95 +Replace the domain part in 'From:' headers with this value. This may be useful if you use a private, outside unknown address on your local LAN and want this to be replaced by the domain of the address of your email addrsss on the internet. Note that this is different to \fBset_return_path_domain\f1, see below.
   56.96 +.TP
   56.97 +
   56.98 +\fBset_return_path_domain\f1 = \fIstring\f1
   56.99 +
  56.100 +Sets the domain part of the envelope from address. Some hosts check whether this is the same as the net the connection is coming from. If not, they reject the mail because they suspect spamming. It should be a valid address, because some mail servers also check that. You can also use this to set it to your usual address on the internet and put a local address only known on your LAN in the configuration of your mailer. Only the domain part will be changed, the local part remains unchanged. Use \fBmap_return_path_addresses\f1 for rewriting local parts.
  56.101 +.TP
  56.102 +
  56.103 +\fBmap_h_from_addresses\f1 = \fIlist\f1
  56.104 +
  56.105 +This is similar to \fBset_h_from_domain\f1, but more flexible. Set this to a list which maps local parts to a full RFC 822 compliant email address, the local parts (the keys) are separated from the addresses (the values) by colons (':').
  56.106 +
  56.107 +Example:
  56.108 +
  56.109 +map_h_from_addresses = "john: John Smith <jsmith@mail.academic.edu>; charlie: Charlie Miller <cmiller@mx.commercial.com>"
  56.110 +
  56.111 +You can use patterns, eg. * as keys.
  56.112 +.TP
  56.113 +
  56.114 +\fBmap_h_reply_to_addresses\f1 = \fIlist\f1
  56.115 +
  56.116 +Same as \fBmap_h_from_addresses\f1, but for the 'Reply-To:' header.
  56.117 +.TP
  56.118 +
  56.119 +\fBmap_h_mail_followup_to_addresses\f1 = \fIlist\f1
  56.120 +
  56.121 +Same as \fBmap_h_from_addresses\f1, but for the 'Mail-Followup-To:' header. Useful when replying to mailing lists.
  56.122 +.TP
  56.123 +
  56.124 +\fBmap_return_path_addresses\f1 = \fIlist\f1
  56.125 +
  56.126 +This is similar to \fBset_return_path_domain\f1, but more flexible. Set this to a list which maps local parts to a full RFC 821 compliant email address, the local parts (the keys) are separated from the addresses (the values) by colons (':'). Note that this option takes RFC 821 addresses while \fBmap_h_from_addresses\f1 takes RFC 822 addresses. The most important difference is that RFC 821 addresses have no full name.
  56.127 +
  56.128 +Example:
  56.129 +
  56.130 +map_return_path_addresses = "john: <jsmith@mail.academic.edu>; charlie: <cmiller@mx.commercial.com>"
  56.131 +
  56.132 +You can use patterns, eg. * as keys.
  56.133 +.TP
  56.134 +
  56.135 +\fBexpand_h_sender_address\f1 = \fIboolean\f1
  56.136 +
  56.137 +This sets the domain of the sender address as given by the Sender: header to the same address as in the envelope return path address (which can be set by either \fBset_return_path_domain\f1 or \fBmap_return_path_addresses\f1). This is for mail clients (eg. Microsoft Outlook) which use this address as the sender address. Though they should use the From: address, see RFC 821. If \fBfetchmail (1)\f1 encounters an unqualified Sender: address, it will be expanded to the domain of the pop server, which is almost never correct. Default is true.
  56.138 +.TP
  56.139 +
  56.140 +\fBexpand_h_sender_domain\f1 = \fIboolean\f1
  56.141 +
  56.142 +Like \fBexpand_h_sender_address\f1, but sets the domain only. Deprecated, will be removed in a later version.
  56.143 +.TP
  56.144 +
  56.145 +\fBlast_route\f1 = \fIboolean\f1
  56.146 +
  56.147 +If this is set, a mail which would have been delivered using this route, but has failed temporarily, will not be tried to be delivered using the next route.
  56.148 +
  56.149 +If you have set up a special route with filters using the lists 'allowed_rcpt_domains', 'allowed_return_paths', and 'allowed_mail_locals' or their complements (not_), and the mail passing these rules should be delivered using this route only, you should set this to 'true'. Otherwise the mail would be passed to the next route (if any), unless that route has rules which prevent that.
  56.150 +
  56.151 +Default is false.
  56.152 +.TP
  56.153 +
  56.154 +\fBauth_name\f1 = \fIstring\f1
  56.155 +
  56.156 +Set the authentication type for ESMTP AUTH authentification. Currently only 'cram-md5' and 'login' are supported.
  56.157 +.TP
  56.158 +
  56.159 +\fBauth_login\f1 = \fIstring\f1
  56.160 +
  56.161 +Your account name for ESMTP AUTH authentification.
  56.162 +.TP
  56.163 +
  56.164 +\fBauth_secret\f1 = \fIstring\f1
  56.165 +
  56.166 +Your secret for ESMTP AUTH authentification.
  56.167 +.TP
  56.168 +
  56.169 +\fBpop3_login\f1 = \fIfile\f1
  56.170 +
  56.171 +If your Mail server requires SMTP-after-POP, set this to a get configuration (see \fBmasqmail.get (5)\f1). If you login to the POP server before you send, this is not necessary.
  56.172 +.TP
  56.173 +
  56.174 +\fBwrapper\f1 = \fIcommand\f1
  56.175 +
  56.176 +If set, instead of opening a connection to a remote server, \fIcommand\f1 will be called and all traffic will be piped to its stdin and from its stdout. Purpose is to tunnel ip traffic, eg. for ssl.
  56.177 +
  56.178 +Example for ssl tunneling:
  56.179 +
  56.180 +wrapper="/usr/bin/openssl s_client -quiet -connect pop.gmx.net:995 2>/dev/null"
  56.181 +.TP
  56.182 +
  56.183 +\fBpipe\f1 = \fIcommand\f1
  56.184 +
  56.185 +If set, and protocol is set to 'pipe', \fIcommand\f1 will be called and the message will be piped to its stdin. Purpose is to use gateways to uucp, fax, sms or whatever else.
  56.186 +
  56.187 +You can use variables to give as arguments to the command, these are the same as for the mda in the main configuration, see \fBmasqmail.conf (5)\f1.
  56.188 +.TP
  56.189 +
  56.190 +\fBpipe_fromline = \fIboolean\f1\fB\f1
  56.191 +
  56.192 +If this is set, and protocol is set to 'pipe', a from line will be prepended to the output stream whenever a pipe command is called. Default is false.
  56.193 +.TP
  56.194 +
  56.195 +\fBpipe_fromhack = \fIboolean\f1\fB\f1
  56.196 +
  56.197 +If this is set, and protocol is set to 'pipe', each line beginning with 'From ' is replaced with '>From ' whenever a pipe command is called. You probably want this if you have set \fBpipe_fromline\f1 above. Default is false.
  56.198 +.SH AUTHOR
  56.199 +
  56.200 +masqmail was written by Oliver Kurth <oku@masqmail.cx>
  56.201 +
  56.202 +You will find the newest version of masqmail at \fBhttp://masqmail.cx/masqmail/\f1 or search for it in freshmeat (\fBhttp://www.freshmeat.net\f1). There is also a mailing list, you will find information about it at masqmails main site.
  56.203 +
  56.204 +.SH BUGS
  56.205 +
  56.206 +You should report them to the mailing list.
  56.207 +
  56.208 +.SH SEE ALSO
  56.209 +
  56.210 +\fBmasqmail (8)\f1, \fBmasqmail.conf (5)\f1, \fBmasqmail.get (5)\f1
  56.211 +
  56.212 +.SH COMMENTS
  56.213 +
  56.214 +This man page was written using \fBxml2man (1)\f1 by the same author.
  56.215 +
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/docs/man/mservdetect.8	Fri Sep 26 17:05:23 2008 +0200
    57.3 @@ -0,0 +1,42 @@
    57.4 +.TH mservdetect 8 User Manuals
    57.5 +.SH NAME
    57.6 +mservdetect \- Helper for masqmail and masqdialer
    57.7 +.SH SYNOPSIS
    57.8 +\fB/usr/bin/masqmail \fIhost\f1\fB \fIport\f1\fB
    57.9 +
   57.10 +\fB
   57.11 +.SH DESCRIPTION
   57.12 +
   57.13 +mservdetect is a small helper application for masqmail to detect its online status if the modem server masqdialer is used. It connects to the\fIhost\f1 at \fIport\f1 and prints the connection name to stdout.
   57.14 +
   57.15 +If you want to use it, set \fBonline_detect\f1=\fIpipe\f1 and \fBonline_pipe\f1=\fI"/usr/bin/mservdetect host port"\f1.
   57.16 +
   57.17 +.SH OPTIONS
   57.18 +.TP
   57.19 +
   57.20 +\fBhost\f1
   57.21 +
   57.22 +The hostname where the masqdialer server is running.
   57.23 +.TP
   57.24 +
   57.25 +\fBport\f1
   57.26 +
   57.27 +The port number where the masqdialer server is listening.
   57.28 +.SH AUTHOR
   57.29 +
   57.30 +masqmail was written by Oliver Kurth <oku@masqmail.cx>
   57.31 +
   57.32 +You will find the newest version of masqmail at \fBhttp://masqmail.cx/masqmail/\f1 or search for it in freshmeat (\fBhttp://www.freshmeat.net\f1). There is also a mailing list, you will find information about it at masqmails main site.
   57.33 +
   57.34 +.SH BUGS
   57.35 +
   57.36 +You should report them to the mailing list.
   57.37 +
   57.38 +.SH SEE ALSO
   57.39 +
   57.40 +\fBmasqmail.conf (5)\f1
   57.41 +
   57.42 +.SH COMMENTS
   57.43 +
   57.44 +This man page was written using \fBxml2man (1)\f1 by the same author.
   57.45 +
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/docs/xml/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    58.3 @@ -0,0 +1,1 @@
    58.4 +EXTRA_DIST = *.xml
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/docs/xml/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    59.3 @@ -0,0 +1,263 @@
    59.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    59.5 +# @configure_input@
    59.6 +
    59.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    59.8 +# Free Software Foundation, Inc.
    59.9 +# This Makefile.in is free software; the Free Software Foundation
   59.10 +# gives unlimited permission to copy and/or distribute it,
   59.11 +# with or without modifications, as long as this notice is preserved.
   59.12 +
   59.13 +# This program is distributed in the hope that it will be useful,
   59.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   59.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   59.16 +# PARTICULAR PURPOSE.
   59.17 +
   59.18 +@SET_MAKE@
   59.19 +
   59.20 +srcdir = @srcdir@
   59.21 +top_srcdir = @top_srcdir@
   59.22 +VPATH = @srcdir@
   59.23 +pkgdatadir = $(datadir)/@PACKAGE@
   59.24 +pkglibdir = $(libdir)/@PACKAGE@
   59.25 +pkgincludedir = $(includedir)/@PACKAGE@
   59.26 +top_builddir = ../..
   59.27 +
   59.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   59.29 +INSTALL = @INSTALL@
   59.30 +install_sh_DATA = $(install_sh) -c -m 644
   59.31 +install_sh_PROGRAM = $(install_sh) -c
   59.32 +install_sh_SCRIPT = $(install_sh) -c
   59.33 +INSTALL_HEADER = $(INSTALL_DATA)
   59.34 +transform = $(program_transform_name)
   59.35 +NORMAL_INSTALL = :
   59.36 +PRE_INSTALL = :
   59.37 +POST_INSTALL = :
   59.38 +NORMAL_UNINSTALL = :
   59.39 +PRE_UNINSTALL = :
   59.40 +POST_UNINSTALL = :
   59.41 +ACLOCAL = @ACLOCAL@
   59.42 +AMDEP_FALSE = @AMDEP_FALSE@
   59.43 +AMDEP_TRUE = @AMDEP_TRUE@
   59.44 +AMTAR = @AMTAR@
   59.45 +AUTOCONF = @AUTOCONF@
   59.46 +AUTOHEADER = @AUTOHEADER@
   59.47 +AUTOMAKE = @AUTOMAKE@
   59.48 +AWK = @AWK@
   59.49 +BASE64_LIBS = @BASE64_LIBS@
   59.50 +CC = @CC@
   59.51 +CCDEPMODE = @CCDEPMODE@
   59.52 +CFLAGS = @CFLAGS@
   59.53 +CPP = @CPP@
   59.54 +CPPFLAGS = @CPPFLAGS@
   59.55 +CYGPATH_W = @CYGPATH_W@
   59.56 +DEFS = @DEFS@
   59.57 +DEPDIR = @DEPDIR@
   59.58 +ECHO_C = @ECHO_C@
   59.59 +ECHO_N = @ECHO_N@
   59.60 +ECHO_T = @ECHO_T@
   59.61 +EGREP = @EGREP@
   59.62 +EXEEXT = @EXEEXT@
   59.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   59.64 +GLIB_LIBS = @GLIB_LIBS@
   59.65 +IDENT_LIBS = @IDENT_LIBS@
   59.66 +INSTALL_DATA = @INSTALL_DATA@
   59.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   59.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   59.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   59.70 +LDFLAGS = @LDFLAGS@
   59.71 +LIBOBJS = @LIBOBJS@
   59.72 +LIBS = @LIBS@
   59.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   59.74 +LTLIBOBJS = @LTLIBOBJS@
   59.75 +MAKEINFO = @MAKEINFO@
   59.76 +MD5_LIBS = @MD5_LIBS@
   59.77 +OBJEXT = @OBJEXT@
   59.78 +PACKAGE = @PACKAGE@
   59.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   59.80 +PACKAGE_NAME = @PACKAGE_NAME@
   59.81 +PACKAGE_STRING = @PACKAGE_STRING@
   59.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   59.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   59.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   59.85 +PKG_CONFIG = @PKG_CONFIG@
   59.86 +RANLIB = @RANLIB@
   59.87 +RESOLV_LIBS = @RESOLV_LIBS@
   59.88 +SET_MAKE = @SET_MAKE@
   59.89 +SHELL = @SHELL@
   59.90 +STRIP = @STRIP@
   59.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   59.92 +VERSION = @VERSION@
   59.93 +ac_ct_CC = @ac_ct_CC@
   59.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   59.95 +ac_ct_STRIP = @ac_ct_STRIP@
   59.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   59.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   59.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   59.99 +am__include = @am__include@
  59.100 +am__leading_dot = @am__leading_dot@
  59.101 +am__quote = @am__quote@
  59.102 +bindir = @bindir@
  59.103 +build_alias = @build_alias@
  59.104 +datadir = @datadir@
  59.105 +exec_prefix = @exec_prefix@
  59.106 +has_ident = @has_ident@
  59.107 +host_alias = @host_alias@
  59.108 +includedir = @includedir@
  59.109 +infodir = @infodir@
  59.110 +install_sh = @install_sh@
  59.111 +libdir = @libdir@
  59.112 +libexecdir = @libexecdir@
  59.113 +localstatedir = @localstatedir@
  59.114 +mandir = @mandir@
  59.115 +oldincludedir = @oldincludedir@
  59.116 +prefix = @prefix@
  59.117 +program_transform_name = @program_transform_name@
  59.118 +sbindir = @sbindir@
  59.119 +sharedstatedir = @sharedstatedir@
  59.120 +sysconfdir = @sysconfdir@
  59.121 +target_alias = @target_alias@
  59.122 +with_confdir = @with_confdir@
  59.123 +with_group = @with_group@
  59.124 +with_logdir = @with_logdir@
  59.125 +with_spooldir = @with_spooldir@
  59.126 +with_user = @with_user@
  59.127 +EXTRA_DIST = *.xml
  59.128 +subdir = docs/xml
  59.129 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  59.130 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  59.131 +CONFIG_HEADER = $(top_builddir)/config.h
  59.132 +CONFIG_CLEAN_FILES =
  59.133 +DIST_SOURCES =
  59.134 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
  59.135 +all: all-am
  59.136 +
  59.137 +.SUFFIXES:
  59.138 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  59.139 +	cd $(top_srcdir) && \
  59.140 +	  $(AUTOMAKE) --gnu  docs/xml/Makefile
  59.141 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  59.142 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  59.143 +uninstall-info-am:
  59.144 +tags: TAGS
  59.145 +TAGS:
  59.146 +
  59.147 +ctags: CTAGS
  59.148 +CTAGS:
  59.149 +
  59.150 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  59.151 +
  59.152 +top_distdir = ../..
  59.153 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  59.154 +
  59.155 +distdir: $(DISTFILES)
  59.156 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  59.157 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  59.158 +	list='$(DISTFILES)'; for file in $$list; do \
  59.159 +	  case $$file in \
  59.160 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  59.161 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  59.162 +	  esac; \
  59.163 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  59.164 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  59.165 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  59.166 +	    dir="/$$dir"; \
  59.167 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  59.168 +	  else \
  59.169 +	    dir=''; \
  59.170 +	  fi; \
  59.171 +	  if test -d $$d/$$file; then \
  59.172 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  59.173 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  59.174 +	    fi; \
  59.175 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  59.176 +	  else \
  59.177 +	    test -f $(distdir)/$$file \
  59.178 +	    || cp -p $$d/$$file $(distdir)/$$file \
  59.179 +	    || exit 1; \
  59.180 +	  fi; \
  59.181 +	done
  59.182 +check-am: all-am
  59.183 +check: check-am
  59.184 +all-am: Makefile
  59.185 +
  59.186 +installdirs:
  59.187 +install: install-am
  59.188 +install-exec: install-exec-am
  59.189 +install-data: install-data-am
  59.190 +uninstall: uninstall-am
  59.191 +
  59.192 +install-am: all-am
  59.193 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  59.194 +
  59.195 +installcheck: installcheck-am
  59.196 +install-strip:
  59.197 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  59.198 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  59.199 +	  `test -z '$(STRIP)' || \
  59.200 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  59.201 +mostlyclean-generic:
  59.202 +
  59.203 +clean-generic:
  59.204 +
  59.205 +distclean-generic:
  59.206 +	-rm -f $(CONFIG_CLEAN_FILES)
  59.207 +
  59.208 +maintainer-clean-generic:
  59.209 +	@echo "This command is intended for maintainers to use"
  59.210 +	@echo "it deletes files that may require special tools to rebuild."
  59.211 +clean: clean-am
  59.212 +
  59.213 +clean-am: clean-generic mostlyclean-am
  59.214 +
  59.215 +distclean: distclean-am
  59.216 +	-rm -f Makefile
  59.217 +distclean-am: clean-am distclean-generic
  59.218 +
  59.219 +dvi: dvi-am
  59.220 +
  59.221 +dvi-am:
  59.222 +
  59.223 +info: info-am
  59.224 +
  59.225 +info-am:
  59.226 +
  59.227 +install-data-am:
  59.228 +
  59.229 +install-exec-am:
  59.230 +
  59.231 +install-info: install-info-am
  59.232 +
  59.233 +install-man:
  59.234 +
  59.235 +installcheck-am:
  59.236 +
  59.237 +maintainer-clean: maintainer-clean-am
  59.238 +	-rm -f Makefile
  59.239 +maintainer-clean-am: distclean-am maintainer-clean-generic
  59.240 +
  59.241 +mostlyclean: mostlyclean-am
  59.242 +
  59.243 +mostlyclean-am: mostlyclean-generic
  59.244 +
  59.245 +pdf: pdf-am
  59.246 +
  59.247 +pdf-am:
  59.248 +
  59.249 +ps: ps-am
  59.250 +
  59.251 +ps-am:
  59.252 +
  59.253 +uninstall-am: uninstall-info-am
  59.254 +
  59.255 +.PHONY: all all-am check check-am clean clean-generic distclean \
  59.256 +	distclean-generic distdir dvi dvi-am info info-am install \
  59.257 +	install-am install-data install-data-am install-exec \
  59.258 +	install-exec-am install-info install-info-am install-man \
  59.259 +	install-strip installcheck installcheck-am installdirs \
  59.260 +	maintainer-clean maintainer-clean-generic mostlyclean \
  59.261 +	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
  59.262 +	uninstall-info-am
  59.263 +
  59.264 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  59.265 +# Otherwise a system limit (for SysV at least) may be exceeded.
  59.266 +.NOEXPORT:
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/docs/xml/masqmail.8.xml	Fri Sep 26 17:05:23 2008 +0200
    60.3 @@ -0,0 +1,302 @@
    60.4 +<?xml version="1.0" standalone='no'?>
    60.5 +<!DOCTYPE spec SYSTEM "man.dtd">
    60.6 +
    60.7 +<manpage name="masqmail" section="8" desc="An offline Mail Transfer Agent">
    60.8 +
    60.9 +<synopsis>
   60.10 +<cmd>/usr/sbin/masqmail [-C <arg>file</arg>] [-odq] [-bd] [-q<arg>interval</arg>]</cmd>
   60.11 +<cmd>/usr/sbin/masqmail [-odq] [-bs]</cmd>
   60.12 +<cmd>/usr/sbin/masqmail [-bp]</cmd>
   60.13 +<cmd>/usr/sbin/masqmail [-q]</cmd>
   60.14 +<cmd>/usr/sbin/masqmail [-qo [<arg>name</arg>]]</cmd>
   60.15 +<cmd>/usr/sbin/masqmail [-odq] [-g [<arg>name</arg>]]</cmd>
   60.16 +<cmd>/usr/sbin/masqmail [-odq] [-go [<arg>name</arg>]]</cmd>
   60.17 +<cmd>/usr/sbin/masqmail [-t] [-oi] [-f <arg>address</arg>] [--] <arg>address...</arg></cmd>
   60.18 +<cmd>/usr/sbin/mailq</cmd>
   60.19 +</synopsis>
   60.20 +
   60.21 +<description>
   60.22 +<p>MasqMail is a mail server designed for hosts that do
   60.23 +not have a permanent internet connection eg. a home network or a
   60.24 +single host at home. It has special support for connections to
   60.25 +different ISPs. It replaces sendmail or other MTAs such as qmail or
   60.26 +exim. It can also act as a pop3 client.</p>
   60.27 +</description>
   60.28 +
   60.29 +<options>
   60.30 +<p>Since masqmail is intended to replace sendmail, it uses the same
   60.31 +command line options, but not all are implemented. There are also two
   60.32 +additional options, which are unique to masqmail (-qo <arg>connection</arg> and -g)
   60.33 +</p>
   60.34 +
   60.35 +<option>
   60.36 +<p><opt>--</opt></p>
   60.37 +<optdesc><p>Not a 'real' option, it means that all following arguments are to
   60.38 +be understood as arguments and not as options even if they begin with a
   60.39 +leading dash '-'. Mutt is known to call sendmail with this option.</p></optdesc>
   60.40 +</option>
   60.41 +
   60.42 +<option>
   60.43 +<p><opt>-bd</opt></p>
   60.44 +<optdesc><p>Run as daemon, accepting connections, usually on port 25 if not
   60.45 +configured differently. This is usually used in the startup script at system boot and
   60.46 +together with the -q option (see below).</p></optdesc>
   60.47 +</option>
   60.48 +
   60.49 +<option>
   60.50 +<p><opt>-bi</opt></p>
   60.51 +<optdesc><p>Old sendmail rebuilds its alias database when invoked with this
   60.52 +option. Masqmail ignores it. Masqmail reads directly from the file
   60.53 +given with <b>alias_file</b> in the config file.</p></optdesc>
   60.54 +</option>
   60.55 +
   60.56 +<option>
   60.57 +<p><opt>-bp</opt></p>
   60.58 +<optdesc><p>Show the messages in the queue. Same as calling masqmail as
   60.59 +'mailq'.</p></optdesc>
   60.60 +</option>
   60.61 +
   60.62 +<option>
   60.63 +<p><opt>-bs</opt></p>
   60.64 +<optdesc><p>Accept SMTP commands from stdin. Some mailers (eg pine) use this
   60.65 +option as an interface. It can also be used to call masqmail from
   60.66 +inetd.</p></optdesc>
   60.67 +</option>
   60.68 +
   60.69 +<option>
   60.70 +<p><opt>-B <arg>arg</arg></opt></p>
   60.71 +<optdesc><p><arg>arg</arg> is usually 8BITMIME. Some mailers use this
   60.72 +to indicate that the message contains characters &gt; 127. Masqmail is
   60.73 +8-bit clean and ignores this, so you do not have to recompile elm,
   60.74 +which is very painful ;-). Note though that this violates some
   60.75 +conventions: masqmail <em>does not</em> convert 8 bit messages to any
   60.76 +MIME format if it encounters a mail server which does not advertise
   60.77 +its 8BITMIME capability, masqmail does not advertise this itself. This
   60.78 +is the same practice as that of exim (but different to
   60.79 +sendmail).</p></optdesc></option>
   60.80 +
   60.81 +<option>
   60.82 +<p><opt>-bV </opt></p>
   60.83 +<optdesc><p>Show version information.</p>
   60.84 +</optdesc>
   60.85 +</option>
   60.86 +
   60.87 +<option>
   60.88 +<p><opt>-C </opt><arg>filename</arg></p>
   60.89 +<optdesc><p>Use another configuration than <file>/etc/masqmail/masqmail.conf</file>. Useful for
   60.90 +debugging purposes. If not invoked by a privileged user, masqmail will drop all privileges.
   60.91 +</p></optdesc>
   60.92 +</option>
   60.93 +
   60.94 +<option>
   60.95 +<p><opt>-d <arg>number</arg></opt></p>
   60.96 +<optdesc>
   60.97 +<p>Set the debug level. This takes precedence before the value of
   60.98 +<b>debug_level</b> in the configuration file. Read the warning in the
   60.99 +description of the latter.
  60.100 +</p>
  60.101 +</optdesc>
  60.102 +</option>
  60.103 +
  60.104 +<option>
  60.105 +<p><opt>-f [<arg>address</arg>]</opt></p>
  60.106 +<optdesc>
  60.107 +<p>Set the return path address to <arg>address</arg>. Only root, the
  60.108 +user mail and anyoune in group trusted is allowed to do that.</p>
  60.109 +</optdesc>
  60.110 +</option>
  60.111 +
  60.112 +<option>
  60.113 +<p><opt>-F [<arg>string</arg>]</opt></p>
  60.114 +<optdesc>
  60.115 +<p>Set the full sender name (in the From: header)
  60.116 +to <arg>string</arg>.</p>
  60.117 +</optdesc>
  60.118 +</option>
  60.119 +
  60.120 +<option>
  60.121 +<p><opt>-g [<arg>name</arg>]</opt></p>
  60.122 +<optdesc>
  60.123 +<p>Get mail (using pop3 or apop), using the configurations given
  60.124 +with <b>get.<arg>name</arg></b> in the main configuration. Without <arg>name</arg>,
  60.125 +all get configurations will be used. See also <manref
  60.126 +name = "masqmail.get" section="5" href="masqmail.get.5.html"/></p>
  60.127 +</optdesc>
  60.128 +</option>
  60.129 +
  60.130 +<option>
  60.131 +<p><opt>-go [<arg>interval</arg>] [<arg>name</arg>]</opt></p>
  60.132 +<optdesc>
  60.133 +<p>Can be followed by a connection name. Use this option in your
  60.134 +script which starts as soon as a link to the internet has been set up
  60.135 +(usually ip-up). When masqmail is called with this option, the
  60.136 +specified get configuration(s) is(are) read and mail will be
  60.137 +retrieved from servers on the internet.
  60.138 +The <arg>name</arg> is defined
  60.139 +in the configuration (see <opt>online_gets.<arg>name</arg></opt>).
  60.140 +</p><p>
  60.141 +If called with an interval option (recognized by a digit
  60.142 +as the first characater), masqmail starts as a daemon and tries to
  60.143 +get mail in these intervals. It checks for the online status first.
  60.144 +Example: masqmail -go 5m will retrieve mail
  60.145 +all five minutes.
  60.146 +</p><p>
  60.147 +If called without <arg>name</arg> the online status is determined with
  60.148 +the configured method (see <opt>online_detect</opt> in <a
  60.149 +href="config.html">config.html</a>).
  60.150 +</p>
  60.151 +</optdesc>
  60.152 +</option>
  60.153 +
  60.154 +<option>
  60.155 +<p><opt>-i</opt></p>
  60.156 +<optdesc><p>Same as <b>-oi</b>, see below.</p></optdesc>
  60.157 +</option>
  60.158 +
  60.159 +<option>
  60.160 +<p><opt>-Mrm <arg>list</arg></opt></p>
  60.161 +<optdesc><p>Remove given messages from the queue. Only allowed for privileged users.</p></optdesc>
  60.162 +</option>
  60.163 +
  60.164 +<option>
  60.165 +<p><opt>-oem</opt></p>
  60.166 +<optdesc><p>If the <b>-oi</b> ist not also given, always return with a non zero
  60.167 +return code. Maybe someone tells me what this is good for...</p></optdesc>
  60.168 +</option>
  60.169 +
  60.170 +<option>
  60.171 +<p><opt>-odb</opt></p>
  60.172 +<optdesc><p>Deliver in background. Masqmail always does this, which
  60.173 +makes this option pretty much useless.</p></optdesc>
  60.174 +</option>
  60.175 +
  60.176 +<option>
  60.177 +<p><opt>-odq</opt></p>
  60.178 +<optdesc><p>Do not attempt to deliver immediately. Any messages will be queued
  60.179 +until the next queue running process picks them up and delivers
  60.180 +them. You get the same effect by setting the <i>do_queue</i> option in
  60.181 +/etc/masqmail/masqmail.conf.</p></optdesc>
  60.182 +</option>
  60.183 +
  60.184 +<option>
  60.185 +<p><opt>-oi</opt></p>
  60.186 +<optdesc><p>A dot as a single character in a line does <em>not</em> terminate
  60.187 +the message.</p></optdesc>
  60.188 +</option>
  60.189 +
  60.190 +<option>
  60.191 +<p><opt>-q [<arg>interval</arg>]</opt></p>
  60.192 +<optdesc><p>If not given with an argument, run a queue process, ie. try to
  60.193 +deliver all messages in the queue. Masqmail sends only to those
  60.194 +addresses that are on the <em>local</em> net, not to those that are
  60.195 +outside. Use -qo for those.</p>
  60.196 +<p>
  60.197 +If you have configured inetd to start masqmail, you can use this
  60.198 +option in a cron job which starts in regular time intervals, to mimic
  60.199 +the same effect as starting masqmail with -bd -q30m.
  60.200 +</p><p>
  60.201 +An argument may be a time interval ie. a numerical value followed
  60.202 +by one of the letters. s,m,h,d,w which are interpreted as seconds,
  60.203 +minutes, hours, days or weeks respectively. Example: -q30m. Masqmail
  60.204 +starts as a daemon and a queue runner process will be started
  60.205 +automatically once in this time interval. This is usually used
  60.206 +together with -bd (see above).
  60.207 +</p>
  60.208 +</optdesc>
  60.209 +</option>
  60.210 +
  60.211 +<option>
  60.212 +<p><opt>-qo [<arg>name</arg>]</opt></p>
  60.213 +<optdesc>
  60.214 +<p>Can be followed by a connection name. Use this option in your
  60.215 +script which starts as soon as a link to the internet has been set up
  60.216 +(usually ip-up). When masqmail is called with this option, the
  60.217 +specified route configuration is read and the queued mail with
  60.218 +destinations on the internet will be sent. The <arg>name</arg> is defined
  60.219 +in the configuration (see <opt>online_routes.<arg>name</arg></opt>).
  60.220 +</p><p>
  60.221 +If called without <arg>name</arg> the online status is determined with
  60.222 +the configured method (see <opt>online_detect</opt> in <a
  60.223 +href="config.html">config.html</a>)
  60.224 +</p>
  60.225 +</optdesc>
  60.226 +</option>
  60.227 +
  60.228 +<option>
  60.229 +<p><opt>-t</opt></p>
  60.230 +<optdesc><p>Read recipients from headers. Delete 'Bcc:' headers. If any
  60.231 +arguments are given, these are interpreted as recipient addresses and
  60.232 +the message will <em>not</em> be sent to these.</p></optdesc>
  60.233 +</option>
  60.234 +
  60.235 +<option>
  60.236 +<p><opt>-v</opt></p>
  60.237 +<optdesc><p>Log also to stdout. Currently, some log messages are
  60.238 +marked as 'write to stdout' and additionally, all messages with
  60.239 +priority 'LOG_ALERT' and 'LOG_WARNING' will be written to stdout
  60.240 +if this option is given. It is disabled in daemon mode.
  60.241 +</p></optdesc>
  60.242 +</option>
  60.243 +
  60.244 +</options>
  60.245 +
  60.246 +<section name = "Environment for pipes and mdas">
  60.247 +
  60.248 +<p>For security reasons, before any pipe command from an alias
  60.249 +expansion or an mda is called, the environment variables will be
  60.250 +completely discarded and newly set up. These are:</p>
  60.251 +<p>SENDER, RETURN_PATH - the return path.</p>
  60.252 +<p>SENDER_DOMAIN - the domain part of the return path.</p>
  60.253 +<p>SENDER_LOCAL - the local part of the return path.</p>
  60.254 +<p>RECEIVED_HOST - the host the message was received from (unless local).</p>
  60.255 +<p>LOCAL_PART, USER, LOGNAME - the local part of the (original) recipient.</p>
  60.256 +<p>MESSAGE_ID - the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header.</p>
  60.257 +<p>QUALIFY_DOMAIN - the domain which will be appended to unqualified addresses.</p>
  60.258 +
  60.259 +</section>
  60.260 +
  60.261 +<section name = "Files">
  60.262 +<p><file>/etc/masqmail/masqmail.conf</file> is the main configuration
  60.263 +for masqmail. Depending on the settings in this file, you will also
  60.264 +have other configuration files in <file>/etc/masqmail/</file>.</p>
  60.265 +<p><file>/etc/aliases</file> is the alias file, if not set differently
  60.266 +in <file>/etc/masqmail/masqmail.conf</file>.</p>
  60.267 +<p><file>/var/spool/masqmail/</file> is the spool directory where masqmail
  60.268 +stores its spooled messages and the uniq pop ids.</p>
  60.269 +<p><file>/var/spool/mail/</file> is the directory where locally delivered mail will be put, if not configured differently in <file>masqmail.conf</file>.</p>
  60.270 +<p><file>/var/log/masqmail/</file> is the directory where masqmail stores
  60.271 +its log mesages. This can also be somewhere else if configured
  60.272 +differently by your sysadmin or the package mantainer.</p>
  60.273 +</section>
  60.274 +
  60.275 +<section name="Conforming to">
  60.276 +<p><b>RFC 821, 822, 1869, 1870, 2197, 2554</b> (SMTP)</p>
  60.277 +<p><b>RFC 1725, 1939</b> (POP3)</p>
  60.278 +<p><b>RFC 1321</b> (MD5)</p>
  60.279 +<p><b>RFC 2195</b> (CRAM-MD5)</p>
  60.280 +</section>
  60.281 +
  60.282 +<section name = "Author">
  60.283 +<p>masqmail was written by Oliver Kurth
  60.284 +&lt;oku@masqmail.cx&gt;</p><p>You will find the newest version of
  60.285 +masqmail at <url href="http://masqmail.cx/masqmail/"/> or search for it
  60.286 +in freshmeat (<url href="http://www.freshmeat.net"/>). There is also a mailing list,
  60.287 +you will find information about it at masqmails main site.</p>
  60.288 +</section>
  60.289 +
  60.290 +<section name = "Bugs">
  60.291 +<p>You should report them to the mailing list.</p>
  60.292 +</section>
  60.293 +
  60.294 +<section name = "See also">
  60.295 +<p>
  60.296 +<manref name="masqmail.conf" section="5" href="masqmail.conf.5.html"/>, <manref name="masqmail.route" section="5" href="masqmail.route.5.html"/>, <manref name="masqmail.get" section="5" href="masqmail.get.5.html"/>, <manref name="masqmail.aliases" section="5" href="masqmail.aliases.5.html"/>
  60.297 +</p>
  60.298 +</section>
  60.299 +
  60.300 +<section name = "Comments">
  60.301 +<p>This man page was written using <manref name="xml2man" section="1"
  60.302 +href="http://masqmail.cx/xml2man/"/> by the same author.</p>
  60.303 +</section>
  60.304 +
  60.305 +</manpage>
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/docs/xml/masqmail.aliases.5.xml	Fri Sep 26 17:05:23 2008 +0200
    61.3 @@ -0,0 +1,63 @@
    61.4 +<?xml version="1.0" standalone='no'?>
    61.5 +<!DOCTYPE spec SYSTEM "man.dtd">
    61.6 +
    61.7 +<manpage name="masqmail.aliases" section="5" desc="masqmail alias file format">
    61.8 +
    61.9 +<description>
   61.10 +<p>This man page describes the format of the masqmail alias file. Its usual location is <file>/etc/aliases</file>.</p>
   61.11 +</description>
   61.12 +
   61.13 +<section name="File Format">
   61.14 +<p>The alias file consists of lines of the form:</p>
   61.15 +<pre>
   61.16 +local_part: item1, item2, ...
   61.17 +</pre>
   61.18 +
   61.19 +<p>Items can be surrounded by quotes '"'. If within the quotes other
   61.20 +quotes are needed for an address they can be escaped with a leading
   61.21 +backslash '\'.</p>
   61.22 +
   61.23 +<p>A leading '\' indicates that this address shall not be further
   61.24 +expanded.</p>
   61.25 +
   61.26 +<p>A leading pipe symbol '|' indicates that the item shall be treated
   61.27 +as a pipe command. The content of the message will then be sent to the
   61.28 +standard input of a command. The command will run under the user id
   61.29 +and group id masqmail is running as. If quotes are needed, the pipe
   61.30 +symbol must appear <i>within</i> the quotes.</p>
   61.31 +
   61.32 +<p>Loops will be detected, the offending address will be ignored.</p>
   61.33 +
   61.34 +<p>Aliases will be expanded at <i>delivery</i> time. This means that
   61.35 +if there is a message still in the queue and you change any alias
   61.36 +which matches one of the recipient addresses, the change will have
   61.37 +effect next time a delivery is attemped.</p>
   61.38 +
   61.39 +<p>There is no need to restart masqmail or run any command when the
   61.40 +alias file has been changed.</p>
   61.41 +</section>
   61.42 +
   61.43 +<section name = "Author">
   61.44 +<p>masqmail was written by Oliver Kurth
   61.45 +&lt;oku@masqmail.cx&gt;</p><p>You will find the newest version of
   61.46 +masqmail at <url href="http://masqmail.cx/masqmail/"/> or search for it
   61.47 +in freshmeat (<url href="http://www.freshmeat.net"/>). There is also a mailing list,
   61.48 +you will find information about it at masqmails main site.</p>
   61.49 +</section>
   61.50 +
   61.51 +<section name = "Bugs">
   61.52 +<p>You should report them to the mailing list.</p>
   61.53 +</section>
   61.54 +
   61.55 +<section name = "See also">
   61.56 +<p>
   61.57 +<manref name="masqmail.conf" section="5" href="masqmail.conf.5.html"/>, <manref name="masqmail" section="8" href="masqmail.8.html"/>, 
   61.58 +</p>
   61.59 +</section>
   61.60 +
   61.61 +<section name = "Comments">
   61.62 +<p>This man page was written using <manref name="xml2man" section="1"
   61.63 + href="http://masqmail.cx/xml2man/"/> by the same author.</p>
   61.64 +</section>
   61.65 +
   61.66 +</manpage>
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/docs/xml/masqmail.conf.5.xml	Fri Sep 26 17:05:23 2008 +0200
    62.3 @@ -0,0 +1,561 @@
    62.4 +<?xml version="1.0" standalone='no'?>
    62.5 +<!DOCTYPE spec SYSTEM "man.dtd">
    62.6 +
    62.7 +<manpage name="masqmail.conf" section="5" desc="masqmail configuration file">
    62.8 +
    62.9 +<description>
   62.10 +<p>This man page describes the syntax of the main configuration file
   62.11 +of masqmail. Its usual location is <file>/etc/masqmail/masqmail.conf</file></p>
   62.12 +
   62.13 +<p>The configuration consists of lines of the form</p>
   62.14 +
   62.15 +<p><opt>val</opt> = <arg>expression</arg></p>
   62.16 +
   62.17 +<p>Where <opt>val</opt> is a variable name and <arg>expression</arg> a string,
   62.18 +which can be quoted with '"'. If the expression is on multiple lines
   62.19 +or contains characters other than letters, digits or the characters
   62.20 +'.', '-', '_', '/', it <em>must</em> be quoted. You can use quotes inside quotes
   62.21 +by escaping them with a backslash.</p>
   62.22 +
   62.23 +<p>Each val has a <i>type</i>, which can be boolean, numeric, string
   62.24 +or list. A boolean variable can be set with one of the values 'on',
   62.25 +'yes', and 'true' or 'off', 'no' and 'false'. List items are separated
   62.26 +with ';'. For some values patterns (like '*','?') can be used. The
   62.27 +spaces before and after the '=' are optional.</p>
   62.28 +
   62.29 +<p>Most lists (exceptions: <opt>local_hosts</opt>,
   62.30 +<opt>local_nets</opt>, <opt>listen_addresses</opt>, <opt>online_routes</opt> and <opt>online_gets</opt>) accept
   62.31 +files. These will be recognized by a leading slash '/'. The contents
   62.32 +of these files will be included at the position of the file name,
   62.33 +there can be items or other files before and after the file entry. The
   62.34 +format of the files is different though, within these files each entry
   62.35 +is on another line. (And not separated by semicolons). This makes it
   62.36 +easy to include large lists which are common in different
   62.37 +configuration files, so they do not have to appear in every
   62.38 +configuration file.</p>
   62.39 +
   62.40 +<p>Blank lines and lines starting with '#' are ignored.</p>
   62.41 +
   62.42 +</description>
   62.43 +
   62.44 +<options>
   62.45 +<option>
   62.46 +<p><opt>run_as_user = <arg>boolean</arg></opt></p>
   62.47 +<optdesc>
   62.48 +<p>If this is set, masqmail runs with the user id of the user who
   62.49 +invoked it and never changes it. This is for debugging purposes 
   62.50 +<em>only</em>. If the user is not root, masqmail will not be able to
   62.51 +listen on a port &lt; 1024 and will not be able to deliver local mail
   62.52 +to others than the user.</p>
   62.53 +</optdesc>
   62.54 +</option>
   62.55 +
   62.56 +<option>
   62.57 +<p><opt>use_syslog = <arg>boolean</arg></opt></p>
   62.58 +<optdesc>
   62.59 +<p>If this is set, masqmail uses syslogd for logging. It uses facility
   62.60 +MAIL. You still have to set <opt>log_dir</opt> for debug files.</p>
   62.61 +</optdesc>
   62.62 +</option>
   62.63 +
   62.64 +<option>
   62.65 +<p><opt>debug_level = <arg>n</arg></opt></p>
   62.66 +<optdesc>
   62.67 +<p>Set the debug level. Valid values are 0 to 6, increasing it further
   62.68 +makes no difference. Be careful if you set this as high as 5 or higher,
   62.69 +the logs may very soon fill your hard drive.</p>
   62.70 +</optdesc>
   62.71 +</option>
   62.72 +
   62.73 +<option>
   62.74 +<p><opt>mail_dir = <arg>file</arg></opt></p>
   62.75 +<optdesc>
   62.76 +<p>The directory where local mail is stored,
   62.77 +usually <file>/var/spool/mail</file> or <file>/var/mail</file>.</p>
   62.78 +</optdesc>
   62.79 +</option>
   62.80 +
   62.81 +<option>
   62.82 +<p><opt>spool_dir = <arg>file</arg></opt></p>
   62.83 +<optdesc>
   62.84 +<p>The directory where masqmail stores its spool files (and later also
   62.85 +other stuff). It <em>must</em> have a subdirectory <file>input</file>.
   62.86 +Masqmail needs read and write permissions for this
   62.87 +directory. I suggest to use <file>/var/spool/masqmail</file>.</p>
   62.88 +</optdesc>
   62.89 +</option>
   62.90 +
   62.91 +<option>
   62.92 +<p><opt>host_name = <arg>string</arg></opt></p>
   62.93 +<optdesc>
   62.94 +<p>This is used in different places: Masqmail identifies itself in the
   62.95 +greeting banner on incoming connections and in the HELO/EHLO command
   62.96 +for outgoing connections with this name, it is used in the Received:
   62.97 +header and to qualify the sender of a locally originating message.</p>
   62.98 +
   62.99 +<p>If the string begins with a slash '/', it it assumed that it is a
  62.100 +filename, and the first line of this file will be used. Usually this will
  62.101 +be '/etc/mailname' to make masqmail conform to Debian policies.</p>
  62.102 +
  62.103 +<p>It is <em>not</em> used to find whether an address is local.
  62.104 +Use <opt>local_hosts</opt> for that.</p>
  62.105 +</optdesc>
  62.106 +</option>
  62.107 +
  62.108 +<option>
  62.109 +<p><opt>remote_port = <arg>n</arg></opt></p>
  62.110 +<optdesc>
  62.111 +<p>The remote port number to be used. This defaults to port 25.</p>
  62.112 +<p>This option is deprecated. Use <opt>host_name</opt> in the route
  62.113 +configuration instead. See <manref name="masqmail.route" section="5"
  62.114 +href="masqmail.route.5.html"/>.</p>
  62.115 +</optdesc>
  62.116 +</option>
  62.117 +
  62.118 +<option>
  62.119 +<p><opt>local_hosts = <arg>list</arg></opt></p>
  62.120 +<optdesc>
  62.121 +<p>A semicolon ';' separated list of hostnames which are considered
  62.122 +local. Normally you set it to "localhost;foo;foo.bar.com" if your host
  62.123 +has the fully qualified domain name 'foo.bar.com'.</p>
  62.124 +</optdesc>
  62.125 +</option>
  62.126 +
  62.127 +<option>
  62.128 +<p><opt>local_nets = <arg>list</arg></opt></p>
  62.129 +<optdesc>
  62.130 +<p>A semicolon ';' separated list of hostnames which are on the
  62.131 +'local' net. Delivery to these hosts is attempted immediately. You can
  62.132 +use patterns with '*', eg. "*.bar.com".</p>
  62.133 +</optdesc>
  62.134 +</option>
  62.135 +
  62.136 +<option>
  62.137 +<p><opt>local_addresses = <arg>list</arg></opt></p>
  62.138 +<optdesc>
  62.139 +<p>A semicolon ';' separated list of fully qualified email-addresses
  62.140 +which are considered local although their domain name part is not in
  62.141 +the list of <opt>local_hosts</opt>. </p>
  62.142 +<p>For example: There are two people working at your
  62.143 +LAN: person1@yourdomain and person2@yourdomain. But there are
  62.144 +other persons @yourdomain which are NOT local. So you can not put
  62.145 +yourdomain to the list of local_hosts. If person1 now wants
  62.146 +to write to person2@yourdomain and this mail should not leave the LAN
  62.147 +then you can put</p>
  62.148 +<p>local_addresses = "person1@yourdomain;person2@yourdomain"</p>
  62.149 +<p>to your masqmail.conf.</p>
  62.150 +</optdesc>
  62.151 +</option>
  62.152 +
  62.153 +<option>
  62.154 +<p><opt>not_local_addresses = <arg>list</arg></opt></p>
  62.155 +<optdesc>
  62.156 +<p>A semicolon ';' separated list of fully qualified email-addresses
  62.157 +which are considered not local although their domain name part is in
  62.158 +the list of <opt>local_hosts</opt>. </p>
  62.159 +<p>This ist the opposite of the previous case. The majority of addresses
  62.160 +of a specific domain are local. But some users are not. With this
  62.161 +option you can easily exclude these users.</p>
  62.162 +<p>Example:</p>
  62.163 +<p>local_hosts = "localhost;myhost;mydomain.net"</p>
  62.164 +<p>not_local_addresses = "eric@mydomain.net"</p>
  62.165 +</optdesc>
  62.166 +</option>
  62.167 +
  62.168 +<option>
  62.169 +<p><opt>listen_addresses = <arg>list</arg></opt></p>
  62.170 +<optdesc>
  62.171 +<p>A semicolon ';' separated list of interfaces on which connections
  62.172 +will be accepted. An interface ist defined by a hostname, optionally
  62.173 +followed by a colon ':' and a number for the port. If this is left out,
  62.174 +port 25 will be used.</p>
  62.175 +<p>You can set this to "localhost:25;foo:25" if your hostname is 'foo'.</p>
  62.176 +<p>Note that the names are resolved to IP addreses. If your host has
  62.177 +different names which resolve to the same IP, use only one of them,
  62.178 +otherwise you will get an error message.
  62.179 +</p>
  62.180 +</optdesc>
  62.181 +</option>
  62.182 +
  62.183 +<option>
  62.184 +<p><opt>do_save_envelope_to = <arg>boolean</arg></opt></p>
  62.185 +<optdesc>
  62.186 +<p>If this is set to true, a possibly existing Envelope-to: header in an
  62.187 +incoming mail which is received via either pop3 or smtp will be saved as
  62.188 +an X-Orig-Envelope-to: header.</p>
  62.189 +<p>This is useful if you retrieve mail from a pop3 server with either masqmail
  62.190 +or fetchmail, and the server supports Envelope-to: headers, and you want to make use
  62.191 +of those with a mail filtering tool, eg. procmail. It cannot be preserved because
  62.192 +masqmail sets such a header by itself.</p>
  62.193 +<p>Default is false.</p>
  62.194 +</optdesc>
  62.195 +</option>
  62.196 +
  62.197 +<option>
  62.198 +<p><opt>do_relay = <arg>boolean</arg></opt></p>
  62.199 +<optdesc>
  62.200 +<p>If this is set to false, mail with a return path that is not local and a
  62.201 +destination that is also not local will not be accepted via smtp and a 550
  62.202 +reply will be given. Default is true.</p>
  62.203 +<p>Note that this will not protect you from spammers using open relays, but from
  62.204 +users unable to set their address in their mail clients.</p>
  62.205 +</optdesc>
  62.206 +</option>
  62.207 +
  62.208 +<option>
  62.209 +<p><opt>do_queue = <arg>boolean</arg></opt></p>
  62.210 +<optdesc>
  62.211 +<p>If this is set, mail will not be delivered immediately when
  62.212 +accepted. Same as calling masqmail with the <opt>-odq</opt> option.</p>
  62.213 +</optdesc>
  62.214 +</option>
  62.215 +
  62.216 +<option>
  62.217 +<p><opt>online_routes.<arg>name</arg> = <arg>list</arg></opt></p>
  62.218 +<optdesc>
  62.219 +
  62.220 +<p>Replace <arg>name</arg> with a name to identify a connection. Set this
  62.221 +to a filename (or a list of filenames) for the special route configuration for that
  62.222 +connection. You will use that name to call masqmail with the
  62.223 + <opt>-qo</opt> option every time a connection to your ISP is set
  62.224 +up.</p>
  62.225 +
  62.226 +<p>Example: Your ISP has the name <i>FastNet</i>. Then you write the
  62.227 +following line in the main configuration:</p>
  62.228 +
  62.229 +<p><opt>online_routes.FastNet</opt> = <arg>"/etc/masqmail/fastnet.route"</arg></p>
  62.230 +
  62.231 +<p><file>/etc/masqmail/fastnet.route</file> is the route configuration
  62.232 +file, see <manref name="masqmail.route" section="5" href="masqmail.route.5.html"/>. As soon as a link to FastNet has been set up, you
  62.233 +call masqmail <opt>-qo</opt> <arg>FastNet</arg>. Masqmail will then
  62.234 +read the specified file and send the mails.</p>
  62.235 +
  62.236 +</optdesc>
  62.237 +</option>
  62.238 +
  62.239 +<option>
  62.240 +<p><opt>connect_route.<arg>name</arg> = <arg>list</arg></opt></p>
  62.241 +<optdesc>
  62.242 +<p>Old name for <opt>online_routes</opt>.</p>
  62.243 +</optdesc>
  62.244 +</option>
  62.245 +
  62.246 +
  62.247 +<option>
  62.248 +<p><opt>local_net_route = <arg>file</arg></opt></p>
  62.249 +<optdesc>
  62.250 +<p>This is similar to <opt>online_routes.<arg>name</arg></opt> but for the
  62.251 +local net. Recipient addresses that are in <b>local_nets</b> will be
  62.252 +routed using this route configuration. Main purpose is to define a
  62.253 +mail server with <b>mail_host</b> in your local network. In simple
  62.254 +environments this can be left unset. If unset, a default route
  62.255 +configuration will be used.</p>
  62.256 +</optdesc>
  62.257 +</option>
  62.258 +
  62.259 +<option>
  62.260 +<p><opt>alias_file = <arg>file</arg></opt></p>
  62.261 +<optdesc>
  62.262 +<p>Set this to the location of your alias file. If unset, no aliasing
  62.263 +will be done.</p>
  62.264 +</optdesc>
  62.265 +</option>
  62.266 +
  62.267 +<option>
  62.268 +<p><opt>alias_local_caseless = <arg>boolean</arg></opt></p>
  62.269 +<optdesc>
  62.270 +<p>If this is set, local parts in the alias file will be matched
  62.271 +disregarding upper/lower case.</p>
  62.272 +</optdesc>
  62.273 +</option>
  62.274 +
  62.275 +<option>
  62.276 +<p><opt>pipe_fromline = <arg>boolean</arg></opt></p>
  62.277 +<optdesc>
  62.278 +<p>If this is set, a from line will be prepended to the output stream whenever
  62.279 +a pipe command is called after an alias expansion. Default is false.</p>
  62.280 +</optdesc>
  62.281 +</option>
  62.282 +
  62.283 +<option>
  62.284 +<p><opt>pipe_fromhack = <arg>boolean</arg></opt></p>
  62.285 +<optdesc>
  62.286 +<p>If this is set, each line beginning with 'From ' is replaced with '>From ' whenever
  62.287 +a pipe command is called after an alias expansion. You probably want this if you have
  62.288 +set <opt>pipe_fromline</opt> above. Default is false.</p>
  62.289 +</optdesc>
  62.290 +</option>
  62.291 +
  62.292 +<option>
  62.293 +<p><opt>mbox_default = <arg>string</arg></opt></p>
  62.294 +<optdesc>
  62.295 +<p>The default local delivery method. Can be one of mbox, mda or
  62.296 +maildir (the latter only if maildir support is enabled at compile
  62.297 +time). Default is mbox. You can override this for each user by using
  62.298 +the <opt>mbox_users</opt>, <opt>mda_users</opt> or <opt>maildir_users</opt> options
  62.299 +(see below).
  62.300 +</p>
  62.301 +</optdesc>
  62.302 +</option>
  62.303 +
  62.304 +<option>
  62.305 +<p><opt>mbox_users = <arg>list</arg></opt></p>
  62.306 +<optdesc>
  62.307 +<p>A list of users which wish delivery to an mbox style mail folder.</p>
  62.308 +</optdesc>
  62.309 +</option>
  62.310 +
  62.311 +<option>
  62.312 +<p><opt>mda_users = <arg>list</arg></opt></p>
  62.313 +<optdesc>
  62.314 +<p>A list of users which wish local delivery to an mda. You have to
  62.315 +set <opt>mda</opt> (see below) as well.</p>
  62.316 +</optdesc>
  62.317 +</option>
  62.318 +
  62.319 +<option>
  62.320 +<p><opt>maildir_users = <arg>list</arg></opt></p>
  62.321 +<optdesc>
  62.322 +<p>A list of users which wish delivery to a qmail style maildir. The
  62.323 +path to maildir is ~/Maildir/. The maildir will be created if it
  62.324 +does not exist.</p>
  62.325 +</optdesc>
  62.326 +</option>
  62.327 +
  62.328 +<option>
  62.329 +<p><opt>mda = <arg>expand string</arg></opt></p>
  62.330 +<optdesc>
  62.331 +<p>If you want local delivery to be transferred to an mda (Mail
  62.332 +Delivery Agent), set this to a command. The argument will be expanded
  62.333 +on delivery time, you can use variables beginning with a '$' sign,
  62.334 +optionally enclosed in curly braces. Variables you can use are:</p>
  62.335 +<p>uid - the unique message id. This is not necessarily identical with
  62.336 +the Message ID as given in the Message ID: header.</p>
  62.337 +<p>received_host - the host the mail was received from</p>
  62.338 +<p>ident - the ident, this is either the ident delivered by the ident
  62.339 +protocol or the user id of the sender if the message was received locally.</p>
  62.340 +<p>return_path_local - the local part of the return path (sender).</p>
  62.341 +<p>return_path_domain - the domain part of the return path (sender).</p>
  62.342 +<p>return_path - the complete return path (sender).</p>
  62.343 +<p>rcpt_local - the local part of the recipient.</p>
  62.344 +<p>rcpt_domain - the domain part of the recipient.</p>
  62.345 +<p>rcpt - the complete recipient address.</p>
  62.346 +<p>Example:</p><p>mda="/usr/bin/procmail -Y -d ${rcpt_local}"</p>
  62.347 +<p>For the mda, as for pipe commands, a few environment variables will
  62.348 +be set as well. See <manref name="masqmail" section="8"
  62.349 +href="masqmail.8.html"/>. To use environment variables for the mda,
  62.350 +the '$' sign has to be escaped with a backslash, otherwise they will
  62.351 +be tried to be expanded with the internal variables.</p>
  62.352 +
  62.353 +</optdesc>
  62.354 +</option>
  62.355 +
  62.356 +<option>
  62.357 +<p><opt>mda_fromline = <arg>boolean</arg></opt></p>
  62.358 +<optdesc>
  62.359 +<p>If this is set, a from line will be prepended to the output stream whenever
  62.360 +a message is delivered to an mda. Default is false.</p>
  62.361 +</optdesc>
  62.362 +</option>
  62.363 +
  62.364 +<option>
  62.365 +<p><opt>mda_fromhack = <arg>boolean</arg></opt></p>
  62.366 +<optdesc>
  62.367 +<p>If this is set, each line beginning with 'From ' is replaced with '>From ' whenever
  62.368 +a message is delivered to an mda. You probably want this if you have
  62.369 +set <opt>mda_fromline</opt> above. Default is false.</p>
  62.370 +</optdesc>
  62.371 +</option>
  62.372 +
  62.373 +<option>
  62.374 +<p><opt>online_detect = <arg>string</arg></opt></p>
  62.375 +<optdesc>
  62.376 +<p>Defines the method MasqMail uses to detect whether there is
  62.377 +currently an online connection. It can have the
  62.378 +values <opt>file</opt>, <opt>pipe</opt> or <opt>mserver</opt>.</p>
  62.379 +
  62.380 +<p>When it is set to <opt>file</opt>, MasqMail first checks for the
  62.381 +existence of <opt>online_file</opt> (see below) and if it exists, it reads
  62.382 +it. The content of the file should be the name of the current
  62.383 +connection as defined with <opt>connect_route.<arg>name</arg></opt> (without
  62.384 +a trailing newline character).</p>
  62.385 +
  62.386 +<p>When it is set to <opt>pipe</opt>, MasqMail calls the executable given by
  62.387 +the <opt>online_pipe</opt> option (see below) and reads the current online
  62.388 +status from its standard output.</p>
  62.389 +
  62.390 +<p>When it is set to <opt>mserver</opt>, MasqMail connects to the
  62.391 +masqdialer server using the value of <opt>mserver_iface</opt> and asks it
  62.392 +whether a connection exists and for the name, which should be the name
  62.393 +of the current connection as defined with <opt>connect_route.<arg>name</arg></opt>.</p>
  62.394 +
  62.395 +<p>No matter how MasqMail detects the online status, only messages
  62.396 +that are accepted at online time will be delivered using the
  62.397 +connection. The spool still has to be emptied with masqmail <opt>-qo</opt>
  62.398 +<arg>connection</arg>.</p>
  62.399 +</optdesc>
  62.400 +</option>
  62.401 +
  62.402 +<option>
  62.403 +<p><opt>online_file = <arg>file</arg></opt></p>
  62.404 +<optdesc>
  62.405 +<p>This is the name of the file checked for when MasqMail determines
  62.406 +whether it is online. The file should only exist when there is
  62.407 +currently a connection. Create it in your ip-up script with eg.</p>
  62.408 +
  62.409 +<p>echo -n &lt;name&gt; &gt; /tmp/connect_route</p>
  62.410 +<p>chmod 0644 /tmp/connect_route</p>
  62.411 +
  62.412 +<p>Do not forget to delete it in your ip-down script.</p>
  62.413 +</optdesc>
  62.414 +</option>
  62.415 +
  62.416 +<option>
  62.417 +<p><opt>online_pipe = <arg>file</arg></opt></p>
  62.418 +<optdesc>
  62.419 +<p>This is the name of the executable which will be called to determine
  62.420 +the online status. This executable should just print the name oif the current
  62.421 +connection to the standard output and return a zero status code. masqmail assumes
  62.422 +it is offline if the script returns with a non zero status. Simple example:</p>
  62.423 +
  62.424 +<p>#!/bin/sh</p>
  62.425 +<p></p>
  62.426 +<p>[ -e /tmp/connect_route ] || exit 1</p>
  62.427 +<p>cat /tmp/connect_route</p>
  62.428 +<p>exit 0</p>
  62.429 +
  62.430 +<p>Of course, instead of the example above you could as well use <opt>file</opt> as
  62.431 +the online detection method, but you can do something more sophisticated.</p>
  62.432 +</optdesc>
  62.433 +</option>
  62.434 +
  62.435 +<option>
  62.436 +<p><opt>mserver_iface = <arg>interface</arg></opt></p>
  62.437 +<optdesc>
  62.438 +<p>The interface the masqdialer server is listening to. Usually this
  62.439 +will be "localhost:224" if mserver is running on the same host as
  62.440 +masqmail. But using this option, you can also let masqmail run on
  62.441 +another host by setting <opt>mserver_iface</opt> to another hostname,
  62.442 +eg. "foo:224".</p>
  62.443 +</optdesc>
  62.444 +</option>
  62.445 +
  62.446 +<option>
  62.447 +<p><opt>get.<arg>name</arg> = <arg>file</arg></opt></p>
  62.448 +<optdesc>
  62.449 +<p>Replace <arg>name</arg> with a name to identify a get
  62.450 +configuration. Set this to a filename for the get configuration. These
  62.451 +files will be used to retrieve mail when called with the -g option.</p>
  62.452 +</optdesc>
  62.453 +</option>
  62.454 +
  62.455 +<option>
  62.456 +<p><opt>online_gets.<arg>name</arg> = <arg>list</arg></opt></p>
  62.457 +<optdesc>
  62.458 +<p>Replace <arg>name</arg> with a name to identify an online
  62.459 +configuration. Set this to a filename (or a list of filenames) for the get configuration. These
  62.460 +files will be used to retrieve mail when called with the -go option.</p>
  62.461 +</optdesc>
  62.462 +</option>
  62.463 +
  62.464 +<option>
  62.465 +<p><opt>ident_trusted_nets = <arg>list</arg></opt></p>
  62.466 +<optdesc>
  62.467 +<p><arg>list</arg> is a list of networks of the form a.b.c.d/e
  62.468 +(eg. 192.168.1.0/24), from which the ident given by the ident protocol
  62.469 +will be trusted, so a user can delete his mail from the queue if the
  62.470 +ident is identical to his login name.</p>
  62.471 +</optdesc>
  62.472 +</option>
  62.473 +
  62.474 +<option>
  62.475 +<p><opt>errmsg_file = <arg>file</arg></opt></p>
  62.476 +<optdesc>
  62.477 +<p>Set this to a template which will be used to generate delivery failure
  62.478 +reports. Variable parts within the template begin with a dollar sign and
  62.479 +are identical to those which can be used as arguments for the mda command,
  62.480 +see <opt>mda</opt> above. Additional information can be included with
  62.481 +@failed_rcpts, @msg_headers and @msg_body, these <b>must</b> be at the
  62.482 +beginning of a line and will be replaced with the list of the failed recipients,
  62.483 +the message headers and the message body of the failed message.</p>
  62.484 +<p>Default is /usr/share/masqmail/tpl/failmsg.tpl.</p>
  62.485 +</optdesc>
  62.486 +</option>
  62.487 +
  62.488 +<option>
  62.489 +<p><opt>warnmsg_file = <arg>file</arg></opt></p>
  62.490 +<optdesc>
  62.491 +<p>Set this to a template which will be used to generate delivery warning
  62.492 +reports. It uses the same mechanisms for variables as <opt>errmsg_file</opt>,
  62.493 +see above.
  62.494 +</p>
  62.495 +<p>Default is /usr/share/masqmail/tpl/warnmsg.tpl.</p>
  62.496 +</optdesc>
  62.497 +</option>
  62.498 +
  62.499 +<option>
  62.500 +<p><opt>warn_intervals</opt> = <arg>list</arg></p>
  62.501 +<optdesc>
  62.502 +<p>Set this to a list of time intervals, at which delivery warnings (starting
  62.503 +with the receiving time of the message) shall be generated.</p>
  62.504 +<p>A warning will only be generated just after an attempt to deliver the
  62.505 +mail and if that attempt failed temporarily. So a warning may be generated after
  62.506 +a longer time, if there was no attempt before.</p>
  62.507 +<p>Default is "1h;4h;8h;1d;2d;3d"</p>
  62.508 +</optdesc>
  62.509 +</option>
  62.510 +
  62.511 +<option>
  62.512 +<p><opt>max_defer_time</opt> = <arg>time</arg></p>
  62.513 +<optdesc>
  62.514 +<p>This is the maximum time, in which a temporarily failed mail will be kept
  62.515 +in the spool. When this time is exceeded, it will be handled as a delivery failure,
  62.516 +and the message will be bounced.</p>
  62.517 +<p>The excedence of this time will only be noticed if the message was actually
  62.518 +tried to be delivered. If, for example, the message can only be delivered when
  62.519 +online, but you have not been online for that time, no bounce will be generated.</p>
  62.520 +<p>Default is 4d (4 days)</p>
  62.521 +</optdesc>
  62.522 +</option>
  62.523 +
  62.524 +<option>
  62.525 +<p><opt>log_user = <arg>name</arg></opt></p>
  62.526 +<optdesc>
  62.527 +<p>Replace <arg>name</arg> with a valid local or remote mail address.</p>
  62.528 +<p>If this option is not empty, then a copy of every mail,
  62.529 +that passes trough the masqmail system will also be sent to the
  62.530 +given mail address.</p>
  62.531 +<p>For example you can feed your mails into a program like <i>hypermail</i> for
  62.532 +archiving purpose by placing an appropriate pipe command in masqmail.alias</p>
  62.533 +</optdesc>
  62.534 +</option>
  62.535 +
  62.536 +</options>
  62.537 +
  62.538 +<section name = "Author">
  62.539 +<p>masqmail was written by Oliver Kurth
  62.540 +&lt;oku@masqmail.cx&gt;</p><p>You will find the newest version of
  62.541 +masqmail at <url href="http://masqmail.cx/masqmail/"/> or search for it
  62.542 +in freshmeat (<url href="http://www.freshmeat.net"/>). There is also a mailing list,
  62.543 +you will find information about it at masqmails main site.</p>
  62.544 +</section>
  62.545 +
  62.546 +<section name = "Bugs">
  62.547 +<p>You should report them to the mailing list.</p>
  62.548 +</section>
  62.549 +
  62.550 +<section name = "See also">
  62.551 +<p>
  62.552 +<manref name="masqmail" section="8" href="masqmail.8.html"/>, <manref name="masqmail.route" section="5" href="masqmail.route.5.html"/>, <manref name="masqmail.get" section="5" href="masqmail.get.5.html"/>
  62.553 +</p>
  62.554 +</section>
  62.555 +
  62.556 +
  62.557 +<section name = "Comments">
  62.558 +<p>This man page was written using <manref name="xml2man" section="1"
  62.559 +href="http://masqmail.cx/xml2man/"/> by the same
  62.560 +author.</p>
  62.561 +</section>
  62.562 +
  62.563 +</manpage>
  62.564 +
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/docs/xml/masqmail.get.5.xml	Fri Sep 26 17:05:23 2008 +0200
    63.3 @@ -0,0 +1,165 @@
    63.4 +<?xml version="1.0" standalone='no'?>
    63.5 +<!DOCTYPE spec SYSTEM "man.dtd">
    63.6 +
    63.7 +<manpage name="masqmail.get" section="5" desc="masqmail get configuration file">
    63.8 +
    63.9 +<description> <p>This man page describes the options available for the
   63.10 +masqmail get configuration.</p>
   63.11 +
   63.12 +</description>
   63.13 +
   63.14 +<options>
   63.15 +
   63.16 +<option>
   63.17 +<p><opt>protocol</opt> = <arg>string</arg></p>
   63.18 +<optdesc>
   63.19 +<p>The protocol with which you retrieve your mail. Currently only
   63.20 +'pop3' and 'apop' are supported. There is no default.</p>
   63.21 +</optdesc>
   63.22 +</option>
   63.23 +
   63.24 +<option>
   63.25 +<p><opt>server</opt> = <arg>string</arg></p>
   63.26 +<optdesc>
   63.27 +<p>The server you get your mail from.</p>
   63.28 +</optdesc>
   63.29 +</option>
   63.30 +
   63.31 +<option>
   63.32 +<p><opt>resolve_list</opt> = <arg>list</arg></p>
   63.33 +<optdesc>
   63.34 +<p>Specify the method how the domain of the server is resolved. Possible values are
   63.35 +dns_mx, dns_a, byname. For 'dns_mx', the domain is assumed to be an MX
   63.36 +pointer to a list of host names, these will be tried each in order
   63.37 +(lowest preference value first, equal preference values in random
   63.38 +order). For 'dns_a', the domain is assumed to be an A pointer. For
   63.39 +'byname', the library function <manref name="gethostbyname" section="3"/> will be used.</p>
   63.40 +<p>The default is "dns_a;byname". It does not make much sense here to use 'dns_mx'.</p>
   63.41 +</optdesc>
   63.42 +</option>
   63.43 +
   63.44 +<option>
   63.45 +<p><opt>user</opt> = <arg>string</arg></p>
   63.46 +<optdesc>
   63.47 +<p>Your login name.</p>
   63.48 +</optdesc>
   63.49 +</option>
   63.50 +
   63.51 +<option>
   63.52 +<p><opt>pass</opt> = <arg>string</arg></p>
   63.53 +<optdesc>
   63.54 +<p>Your password.</p>
   63.55 +</optdesc>
   63.56 +</option>
   63.57 +
   63.58 +<option>
   63.59 +<p><opt>address</opt> = <arg>address</arg></p>
   63.60 +<optdesc>
   63.61 +<p>The address where the retrieved mail should be sent to. It can be
   63.62 +any address, but you probably want to set this to a local address on
   63.63 +your LAN.</p>
   63.64 +</optdesc>
   63.65 +</option>
   63.66 +
   63.67 +<option>
   63.68 +<p><opt>return_path</opt> = <arg>address</arg></p>
   63.69 +<optdesc>
   63.70 +<p>If set, masqmail sets the return path to this address. Bounces
   63.71 +generated during further delivery will be sent to this address. If
   63.72 +unset, masqmail looks for the Return-Path: header in the mail, if
   63.73 +this does not exist it uses the From: address and if this fails,
   63.74 +postmaster will be used.
   63.75 +</p><p>
   63.76 +It is in most cases not useful to set this to the same address as
   63.77 +the 'address' option as this may generate multiple bounces.
   63.78 +postmaster is recommended.</p>
   63.79 +</optdesc>
   63.80 +</option>
   63.81 +
   63.82 +<option>
   63.83 +<p><opt>do_keep</opt> = <arg>boolean</arg></p>
   63.84 +<optdesc>
   63.85 +<p>If you want to keep your mail on the server after you retrieved it,
   63.86 +set this to true. It is recommended that you also set <b>do_uidl</b>,
   63.87 +otherwise you will get the mail again each time you connect to the
   63.88 +server. Masqmail does not check any headers before it retrieves mail,
   63.89 +which may mark it as already fetched.  Note that this behaviour is
   63.90 +different to that of fetchmail. The default is false.</p>
   63.91 +</optdesc>
   63.92 +</option>
   63.93 +
   63.94 +<option>
   63.95 +<p><opt>do_uidl</opt> = <arg>boolean</arg></p>
   63.96 +<optdesc>
   63.97 +<p>If set, MasqMail keeps a list of unique IDs of mails already
   63.98 +fetched, so that they will not be retrieved again. Default is false.</p>
   63.99 +</optdesc>
  63.100 +</option>
  63.101 +
  63.102 +<option>
  63.103 +<p><opt>do_uidl_dele</opt> = <arg>boolean</arg></p>
  63.104 +<optdesc>
  63.105 +<p>If set, and <opt>do_uidl</opt> is also set, MasqMail sends a delete (DELE)
  63.106 +command to the server for each message uid in the uid listing at the
  63.107 +beginning of the session. This prevents mail to be left on the server if
  63.108 +masqmail gets interrupted during a session before it can send the QUIT
  63.109 +command to the server. Default is false.
  63.110 +</p>
  63.111 +</optdesc>
  63.112 +</option>
  63.113 +
  63.114 +<option>
  63.115 +<p><opt>max_size</opt> = <arg>numeric</arg></p>
  63.116 +<optdesc>
  63.117 +<p>If set to a value > 0, only messages smaller than this in bytes will be
  63.118 +retrieved. The default is 0.</p>
  63.119 +</optdesc>
  63.120 +</option>
  63.121 +
  63.122 +<option>
  63.123 +<p><opt>max_count</opt> = <arg>numeric</arg></p>
  63.124 +<optdesc>
  63.125 +<p>If set to a value > 0, only <opt>max_count</opt> messages will be retrieved.
  63.126 +The default is 0.</p>
  63.127 +</optdesc>
  63.128 +</option>
  63.129 +
  63.130 +<option>
  63.131 +<p><opt>wrapper</opt> = <arg>command</arg></p>
  63.132 +<optdesc>
  63.133 +<p>If set, instead of opening a connection to a remote server, <arg>command</arg> will
  63.134 +be called and all traffic will be piped to its
  63.135 +stdin and from its stdout. Purpose is to tunnel ip traffic, eg. for ssl.</p>
  63.136 +<p>Example for ssl tunneling:</p>
  63.137 +<p>wrapper="/usr/bin/openssl s_client -quiet -connect pop.gmx.net:995 2>/dev/null"</p>
  63.138 +</optdesc>
  63.139 +</option>
  63.140 +
  63.141 +</options>
  63.142 +
  63.143 +<section name = "Author">
  63.144 +<p>masqmail was written by Oliver Kurth
  63.145 +&lt;oku@masqmail.cx&gt;</p><p>You will find the newest version of
  63.146 +masqmail at <url href="http://masqmail.cx/masqmail/"/> or search for it
  63.147 +in freshmeat (<url href="http://www.freshmeat.net"/>). There is also a mailing list,
  63.148 +you will find information about it at masqmails main site.</p>
  63.149 +</section>
  63.150 +
  63.151 +<section name = "Bugs">
  63.152 +<p>You should report them to the mailing list.</p>
  63.153 +</section>
  63.154 +
  63.155 +<section name = "See also">
  63.156 +<p>
  63.157 +<manref name="masqmail" section="8" href="masqmail.8.html"/>, <manref name="masqmail.route" section="5" href="masqmail.route.5.html"/>, <manref name="masqmail.conf" section="5" href="masqmail.conf.5.html"/>
  63.158 +</p>
  63.159 +</section>
  63.160 +
  63.161 +<section name = "Comments">
  63.162 +<p>This man page was written using <manref name="xml2man" section="1"
  63.163 +href="http://masqmail.cx/xml2man/"/> by the same
  63.164 +author.</p>
  63.165 +</section>
  63.166 +
  63.167 +</manpage>
  63.168 +
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/docs/xml/masqmail.route.5.xml	Fri Sep 26 17:05:23 2008 +0200
    64.3 @@ -0,0 +1,376 @@
    64.4 +<?xml version="1.0" standalone='no'?>
    64.5 +<!DOCTYPE spec SYSTEM "man.dtd">
    64.6 +
    64.7 +<manpage name="masqmail.route" section="5" desc="masqmail route configuration file">
    64.8 +
    64.9 +<description>
   64.10 +<p>This man page describes the syntax of the route configuration files
   64.11 +of <manref name = "masqmail" section="8" href="masqmail.8.html"/>. Their usual locations are in <file>/etc/masqmail/</file>.</p>
   64.12 +</description>
   64.13 +
   64.14 +<options>
   64.15 +
   64.16 +<option>
   64.17 +<p><opt>protocol</opt> = <arg>string</arg></p>
   64.18 +<optdesc>
   64.19 +<p><arg>string</arg> can be one of 'smtp' or 'pipe', default is
   64.20 +'smtp'. If set to 'smtp', mail will be sent with the SMTP protocol to
   64.21 +its destination. If set to 'pipe', you also have to set 'pipe'
   64.22 +to a command, the message will then be piped to a program. See option 'pipe' below.</p>
   64.23 +</optdesc>
   64.24 +</option>
   64.25 +
   64.26 +<option>
   64.27 +<p><opt>mail_host</opt> = <arg>string</arg></p>
   64.28 +<optdesc>
   64.29 +<p>This is preferably the mail server of your ISP. All outgoing
   64.30 +messages will be sent to this host which will distribute them to their
   64.31 +destinations. If you do not set this mails will be sent
   64.32 +directly. Because the mail server is probably 'near' to you, mail
   64.33 +transfer will be much faster if you use it.</p>
   64.34 +<p>You can optionally give a port number following the host name
   64.35 +and a colon, eg mail_host="mail.foo.com:25".</p>
   64.36 +</optdesc>
   64.37 +</option>
   64.38 +
   64.39 +<option>
   64.40 +<p><opt>resolve_list</opt> = <arg>list</arg></p>
   64.41 +<optdesc>
   64.42 +<p>Specify the method how the domain of the server is resolved. Possible values are
   64.43 +dns_mx, dns_a, byname. For 'dns_mx', the domain is assumed to be an MX
   64.44 +pointer to a list of host names, these will be tried each in order
   64.45 +(lowest preference value first, equal preference values in random
   64.46 +order). For 'dns_a', the domain is assumed to be an A pointer. For
   64.47 +'byname', the library function <manref name="gethostbyname" section="3"/> will be used.</p>
   64.48 +<p>The default is "dns_mx;dns_a;byname".</p>
   64.49 +</optdesc>
   64.50 +</option>
   64.51 +
   64.52 +<option>
   64.53 +<p><opt>connect_error_fail</opt> = <arg>boolean</arg></p>
   64.54 +<optdesc>
   64.55 +<p>If this is set, a connection error will cause a mail delivery to
   64.56 +fail, ie. it will be bounced. If it is unset, it will just be defered.</p>
   64.57 +<p>Default is false. The reason for this is that masqmail is designed
   64.58 +for non permanent internet connections, where such errors may occur
   64.59 +quite often, and a bounce would be annoying.</p>
   64.60 +<p>For the default local_net route is is set to true.</p>
   64.61 +</optdesc>
   64.62 +</option>
   64.63 +
   64.64 +<option>
   64.65 +<p><opt>helo_name</opt> = <arg>string</arg></p>
   64.66 +<optdesc>
   64.67 +<p>Set the name given with the HELO/EHLO command. If this is not
   64.68 +set, <opt>host_name</opt> from <file>masqmail.conf</file> will be used, if
   64.69 +the <opt>do_correct_helo</opt> option (see below) is unset.</p>
   64.70 +</optdesc>
   64.71 +</option>
   64.72 +
   64.73 +<option>
   64.74 +<p><opt>do_correct_helo</opt> = <arg>boolean</arg></p>
   64.75 +<optdesc>
   64.76 +<p>If this is set, masqmail tries to look up your host name as it
   64.77 +appears on the internet and sends this in the HELO/EHLO command. Some
   64.78 +servers are so picky that they want this. Which is really
   64.79 +crazy. It just does not make any sense to lie about ones own identity,
   64.80 +because it can always be looked up by the server. Nobody should
   64.81 +believe in the name given by HELO/EHLO anyway. If this is not
   64.82 +set, <opt>host_name</opt> from <file>masqmail.conf</file> or as given with
   64.83 +the <opt>helo_name</opt> (see above) will be used.</p>
   64.84 +</optdesc>
   64.85 +</option>
   64.86 +
   64.87 +<option>
   64.88 +<p><opt>do_pipelining</opt> = <arg>boolean</arg></p>
   64.89 +<optdesc>
   64.90 +<p>If this is set to false, masqmail will not use ESMTP PIPELINING, even
   64.91 +if the server announces that it is able to cope with it. Default is true.</p>
   64.92 +<p>You do not want to set this to false unless the mail setup on the
   64.93 +remote server side is really broken. Keywords: wingate.</p>
   64.94 +</optdesc>
   64.95 +</option>
   64.96 +
   64.97 +<option>
   64.98 +<p><opt>allowed_mail_locals</opt> = <arg>list</arg></p>
   64.99 +<optdesc>
  64.100 +<p>This is a semicolon ';' separated list of local parts which will be
  64.101 +allowed to send mail through this connection. If unset
  64.102 +and <opt>not_allowed_mail_locals</opt> is also unset, all users are
  64.103 +allowed.</p>
  64.104 +</optdesc>
  64.105 +</option>
  64.106 +
  64.107 +<option>
  64.108 +<p><opt>not_allowed_mail_locals</opt> = <arg>list</arg></p>
  64.109 +<optdesc>
  64.110 +<p>This is a semicolon ';' separated list of local parts which will be
  64.111 +not allowed to send mail through this connection. Local
  64.112 +parts in this list will not be allowed to use this route even if they
  64.113 +are part of <opt>allowed_mail_locals</opt> (see above).</p>
  64.114 +</optdesc>
  64.115 +</option>
  64.116 +
  64.117 +<option>
  64.118 +<p><opt>allowed_return_paths</opt> = <arg>list</arg></p>
  64.119 +<optdesc>
  64.120 +<p>This is a semicolon ';' separated list of addresses. Messages which
  64.121 +have one one of these addresses as the return path will be used using
  64.122 +this route (if not also in <opt>not_allowed_return_paths</opt> or an item
  64.123 +in <opt>not_allowed_mail_locals</opt> matches).</p>
  64.124 +<p>Patterns containing '?' and '*' can be used. The special item "&lt;&gt;" matches
  64.125 +the null sender address (eg. failure notices or delivery notifications).</p>
  64.126 +</optdesc>
  64.127 +</option>
  64.128 +
  64.129 +<option>
  64.130 +<p><opt>not_allowed_return_paths</opt> = <arg>list</arg></p>
  64.131 +<optdesc>
  64.132 +<p>This is a semicolon ';' separated list of addresses. Messages which
  64.133 +have one one of these addresses as the return path will <em>not</em> be used using
  64.134 +this route (even if also in <opt>allowed_return_paths</opt> or an item
  64.135 +in <opt>allowed_mail_locals</opt> matches).</p>
  64.136 +<p>Patterns containing '?' and '*' can be used. The special item "&lt;&gt;" matches
  64.137 +the null sender address (eg. failure notices or delivery notifications).</p>
  64.138 +</optdesc>
  64.139 +</option>
  64.140 +
  64.141 +<option>
  64.142 +<p><opt>allowed_rcpt_domains</opt> = <arg>list</arg></p>
  64.143 +<optdesc>
  64.144 +<p>A list of recipient domains where mail will be sent to. This is for
  64.145 +example useful if you use this route configuration when connected to
  64.146 +another LAN via ppp. Patterns containing '?' and '*' can be used.</p>
  64.147 +</optdesc>
  64.148 +</option>
  64.149 +
  64.150 +<option>
  64.151 +<p><opt>not_allowed_rcpt_domains</opt> = <arg>list</arg></p>
  64.152 +<optdesc>
  64.153 +<p>A list of recipient domains where mail will <em>not</em> be sent
  64.154 +to. This is for example useful if you send mail directly (<opt>mail_host</opt> is
  64.155 +not set) and you know of hosts that will not accept mail from you
  64.156 +because they use a dialup list (eg. <url href="http://maps.vix.com/dul/"/>. If any domain
  64.157 +matches both <opt>allowed_rcpt_domains</opt> and <opt>not_allowed_rcpt_domains</opt>,
  64.158 +mail will not be sent to this domain. Patterns containing '?' and '*' can be used.</p>
  64.159 +</optdesc>
  64.160 +</option>
  64.161 +
  64.162 +<option>
  64.163 +<p><opt>set_h_from_domain</opt> = <arg>string</arg></p>
  64.164 +<optdesc>
  64.165 +<p>Replace the domain part in 'From:' headers with this value. This
  64.166 +may be useful if you use a private, outside unknown address on your
  64.167 +local LAN and want this to be replaced by the domain of the address of
  64.168 +your email addrsss on the internet. Note that this is different to <opt>
  64.169 +set_return_path_domain</opt>, see below.</p>
  64.170 +</optdesc>
  64.171 +</option>
  64.172 +
  64.173 +<option>
  64.174 +<p><opt>set_return_path_domain</opt> = <arg>string</arg></p>
  64.175 +<optdesc>
  64.176 +<p>Sets the domain part of the envelope from address. Some hosts check
  64.177 +whether this is the same as the net the connection is coming from. If
  64.178 +not, they reject the mail because they suspect spamming. It should be
  64.179 +a valid address, because some mail servers also check
  64.180 +that. You can also use this to set it to your usual address on the
  64.181 +internet and put a local address only known on your LAN in the
  64.182 +configuration of your mailer. Only the domain part will
  64.183 +be changed, the local part remains unchanged. Use <opt>
  64.184 +map_return_path_addresses</opt> for rewriting local parts.</p>
  64.185 +</optdesc>
  64.186 +</option>
  64.187 +
  64.188 +<option>
  64.189 +<p><opt>map_h_from_addresses</opt> = <arg>list</arg></p>
  64.190 +<optdesc>
  64.191 +<p>This is similar to <opt>set_h_from_domain</opt>, but more flexible. Set
  64.192 +this to a list which maps local parts to a full RFC 822 compliant
  64.193 +email address, the local parts (the <em>keys</em>) are separated from
  64.194 +the addresses (the <em>values</em>) by colons (':').</p>
  64.195 +
  64.196 +<p>Example:</p>
  64.197 +
  64.198 +<p>map_h_from_addresses = "john: John Smith &lt;jsmith@mail.academic.edu&gt;;
  64.199 +charlie: Charlie Miller &lt;cmiller@mx.commercial.com&gt;"</p>
  64.200 +<p>You can use patterns, eg. * as keys.</p>
  64.201 +</optdesc>
  64.202 +</option>
  64.203 +
  64.204 +<option>
  64.205 +<p><opt>map_h_reply_to_addresses</opt> = <arg>list</arg></p>
  64.206 +<optdesc>
  64.207 +<p>Same as <opt>map_h_from_addresses</opt>, but for the 'Reply-To:' header.</p>
  64.208 +</optdesc>
  64.209 +</option>
  64.210 +
  64.211 +<option>
  64.212 +<p><opt>map_h_mail_followup_to_addresses</opt> = <arg>list</arg></p>
  64.213 +<optdesc>
  64.214 +<p>Same as <opt>map_h_from_addresses</opt>, but for the 'Mail-Followup-To:'
  64.215 +header. Useful when replying to mailing lists.</p>
  64.216 +</optdesc>
  64.217 +</option>
  64.218 +
  64.219 +<option>
  64.220 +<p><opt>map_return_path_addresses</opt> = <arg>list</arg></p>
  64.221 +<optdesc>
  64.222 +<p>This is similar to <opt>set_return_path_domain</opt>, but more
  64.223 +flexible. Set this to a list which maps local parts to a full RFC 821
  64.224 +compliant email address, the local parts (the keys) are
  64.225 +separated from the addresses (the values) by colons
  64.226 +(':'). Note that this option takes RFC 821 addresses
  64.227 +while <opt>map_h_from_addresses</opt> takes RFC 822 addresses. The
  64.228 +most important difference is that RFC 821 addresses have no full
  64.229 +name.</p>
  64.230 +
  64.231 +<p>Example:</p>
  64.232 +<p>
  64.233 +map_return_path_addresses =
  64.234 +"john: &lt;jsmith@mail.academic.edu&gt;;
  64.235 +charlie: &lt;cmiller@mx.commercial.com&gt;"
  64.236 +</p>
  64.237 +<p>You can use patterns, eg. * as keys.</p>
  64.238 +</optdesc>
  64.239 +</option>
  64.240 +
  64.241 +<option>
  64.242 +<p><opt>expand_h_sender_address</opt> = <arg>boolean</arg></p>
  64.243 +<optdesc>
  64.244 +<p>This sets the domain of the sender address as given by the Sender:
  64.245 +header to the same address as in the envelope return path address
  64.246 +(which can be set by either <opt>set_return_path_domain</opt> or <opt>map_return_path_addresses</opt>).
  64.247 +This is for mail clients (eg. Microsoft Outlook) which use this address as the sender
  64.248 +address. Though they should use the From: address, see RFC
  64.249 +821. If <manref name="fetchmail" section="1" href="http://www.fetchmail.org"/> encounters an unqualified Sender:
  64.250 +address, it will be expanded to the domain of the pop server, which is
  64.251 +almost never correct. Default is true.</p>
  64.252 +</optdesc>
  64.253 +</option>
  64.254 +
  64.255 +<option>
  64.256 +<p><opt>expand_h_sender_domain</opt> = <arg>boolean</arg></p>
  64.257 +<optdesc>
  64.258 +<p>Like <opt>expand_h_sender_address</opt>, but sets the domain only.
  64.259 +Deprecated, will be removed in a later version.</p>
  64.260 +</optdesc>
  64.261 +</option>
  64.262 +
  64.263 +<option>
  64.264 +<p><opt>last_route</opt> = <arg>boolean</arg></p>
  64.265 +<optdesc>
  64.266 +<p>If this is set, a mail which would have been delivered using this
  64.267 +route, but has failed temporarily, will not be tried to be delivered
  64.268 +using the next route.</p>
  64.269 +<p>If you have set up a special route with filters using the lists
  64.270 +'allowed_rcpt_domains', 'allowed_return_paths', and
  64.271 +'allowed_mail_locals' or their complements (not_), and the mail
  64.272 +passing these rules should be delivered using this route only, you
  64.273 +should set this to 'true'. Otherwise the mail would be passed to the
  64.274 +next route (if any), unless that route has rules which prevent
  64.275 +that.</p>
  64.276 +<p>Default is false.</p>
  64.277 +</optdesc>
  64.278 +</option>
  64.279 +
  64.280 +<option>
  64.281 +<p><opt>auth_name</opt> = <arg>string</arg></p>
  64.282 +<optdesc>
  64.283 +<p>Set the authentication type for ESMTP AUTH authentification.
  64.284 +Currently only 'cram-md5' and 'login' are supported.</p>
  64.285 +</optdesc>
  64.286 +</option>
  64.287 +
  64.288 +<option>
  64.289 +<p><opt>auth_login</opt> = <arg>string</arg></p>
  64.290 +<optdesc>
  64.291 +<p>Your account name for ESMTP AUTH authentification.</p>
  64.292 +</optdesc>
  64.293 +</option>
  64.294 +
  64.295 +<option>
  64.296 +<p><opt>auth_secret</opt> = <arg>string</arg></p>
  64.297 +<optdesc>
  64.298 +<p>Your secret for ESMTP AUTH authentification.</p>
  64.299 +</optdesc>
  64.300 +</option>
  64.301 +
  64.302 +<option>
  64.303 +<p><opt>pop3_login</opt> = <arg>file</arg></p>
  64.304 +<optdesc>
  64.305 +<p>If your Mail server requires SMTP-after-POP, set this to a
  64.306 +get configuration (see <manref name="masqmail.get" section="5" href="masqmail.get.5.html"/>).
  64.307 +If you login to the POP server
  64.308 +before you send, this is not necessary.</p>
  64.309 +</optdesc>
  64.310 +</option>
  64.311 +
  64.312 +<option>
  64.313 +<p><opt>wrapper</opt> = <arg>command</arg></p>
  64.314 +<optdesc>
  64.315 +<p>If set, instead of opening a connection to a remote server, <arg>command</arg> will
  64.316 +be called and all traffic will be piped to its
  64.317 +stdin and from its stdout. Purpose is to tunnel ip traffic, eg. for ssl.</p>
  64.318 +<p>Example for ssl tunneling:</p>
  64.319 +<p>wrapper="/usr/bin/openssl s_client -quiet -connect pop.gmx.net:995 2>/dev/null"</p>
  64.320 +</optdesc>
  64.321 +</option>
  64.322 +
  64.323 +<option>
  64.324 +<p><opt>pipe</opt> = <arg>command</arg></p>
  64.325 +<optdesc>
  64.326 +<p>If set, and protocol is set to 'pipe', <arg>command</arg> will be
  64.327 +called and the message will be piped to its stdin. Purpose is to use
  64.328 +gateways to uucp, fax, sms or whatever else.</p>
  64.329 +<p>You can use variables to give as arguments to the command, these
  64.330 +are the same as for the mda in the main configuration, see <manref
  64.331 +name="masqmail.conf" section="5" href="masqmail.conf.5.html"/>.</p>
  64.332 +</optdesc>
  64.333 +</option>
  64.334 +
  64.335 +<option>
  64.336 +<p><opt>pipe_fromline = <arg>boolean</arg></opt></p>
  64.337 +<optdesc>
  64.338 +<p>If this is set, and protocol is set to 'pipe', a from line will be prepended to the output stream whenever
  64.339 +a pipe command is called. Default is false.</p>
  64.340 +</optdesc>
  64.341 +</option>
  64.342 +
  64.343 +<option>
  64.344 +<p><opt>pipe_fromhack = <arg>boolean</arg></opt></p>
  64.345 +<optdesc>
  64.346 +<p>If this is set, and protocol is set to 'pipe', each line beginning with 'From '
  64.347 +is replaced with '>From ' whenever a pipe command is called. You probably want this if you have
  64.348 +set <opt>pipe_fromline</opt> above. Default is false.</p>
  64.349 +</optdesc>
  64.350 +</option>
  64.351 +
  64.352 +</options>
  64.353 +
  64.354 +<section name = "Author">
  64.355 +<p>masqmail was written by Oliver Kurth
  64.356 +&lt;oku@masqmail.cx&gt;</p><p>You will find the newest version of
  64.357 +masqmail at <url href="http://masqmail.cx/masqmail/"/> or search for it
  64.358 +in freshmeat (<url href="http://www.freshmeat.net"/>). There is also a mailing list,
  64.359 +you will find information about it at masqmails main site.</p>
  64.360 +</section>
  64.361 +
  64.362 +<section name = "Bugs">
  64.363 +<p>You should report them to the mailing list.</p>
  64.364 +</section>
  64.365 +
  64.366 +<section name = "See also">
  64.367 +<p>
  64.368 +<manref name="masqmail" section="8" href="masqmail.8.html"/>, <manref name="masqmail.conf" section="5" href="masqmail.conf.5.html"/>, <manref name="masqmail.get" section="5" href="masqmail.get.5.html"/>
  64.369 +</p>
  64.370 +</section>
  64.371 +
  64.372 +<section name = "Comments">
  64.373 +<p>This man page was written using <manref name="xml2man" section="1"
  64.374 +href="http://masqmail.cx/xml2man/"/> by the same
  64.375 +author.</p>
  64.376 +</section>
  64.377 +
  64.378 +</manpage>
  64.379 +
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/docs/xml/mservdetect.8.xml	Fri Sep 26 17:05:23 2008 +0200
    65.3 @@ -0,0 +1,60 @@
    65.4 +<?xml version="1.0" standalone='no'?>
    65.5 +<!DOCTYPE spec SYSTEM "man.dtd">
    65.6 +
    65.7 +<manpage name="mservdetect" section="8" desc="Helper for masqmail and masqdialer">
    65.8 +
    65.9 +<synopsis>
   65.10 +<cmd>/usr/bin/masqmail <arg>host</arg> <arg>port</arg></cmd>
   65.11 +</synopsis>
   65.12 +
   65.13 +<description>
   65.14 +<p>
   65.15 +mservdetect is a small helper application for masqmail to detect its online
   65.16 +status if the modem server masqdialer is used. It connects to the
   65.17 +<arg>host</arg> at <arg>port</arg> and prints the connection name to
   65.18 +stdout.</p>
   65.19 +<p>If you want to use it, set <opt>online_detect</opt>=<arg>pipe</arg> and <opt>online_pipe</opt>=<arg>"/usr/bin/mservdetect host port"</arg>.</p>
   65.20 +</description>
   65.21 +
   65.22 +<options>
   65.23 +
   65.24 +<option>
   65.25 +<p><opt>host</opt></p>
   65.26 +<optdesc><p>
   65.27 +The hostname where the masqdialer server is running.
   65.28 +</p></optdesc>
   65.29 +</option>
   65.30 +
   65.31 +<option>
   65.32 +<p><opt>port</opt></p>
   65.33 +<optdesc><p>
   65.34 +The port number where the masqdialer server is listening.
   65.35 +</p></optdesc>
   65.36 +</option>
   65.37 +
   65.38 +</options>
   65.39 +
   65.40 +<section name = "Author">
   65.41 +<p>masqmail was written by Oliver Kurth
   65.42 +&lt;oku@masqmail.cx&gt;</p><p>You will find the newest version of
   65.43 +masqmail at <url href="http://masqmail.cx/masqmail/"/> or search for it
   65.44 +in freshmeat (<url href="http://www.freshmeat.net"/>). There is also a mailing list,
   65.45 +you will find information about it at masqmails main site.</p>
   65.46 +</section>
   65.47 +
   65.48 +<section name = "Bugs">
   65.49 +<p>You should report them to the mailing list.</p>
   65.50 +</section>
   65.51 +
   65.52 +<section name = "See also">
   65.53 +<p>
   65.54 +<manref name="masqmail.conf" section="5" href="masqmail.conf.5.html"/>
   65.55 +</p>
   65.56 +</section>
   65.57 +
   65.58 +<section name = "Comments">
   65.59 +<p>This man page was written using <manref name="xml2man" section="1"
   65.60 +href="http://masqmail.cx/xml2man/"/> by the same author.</p>
   65.61 +</section>
   65.62 +
   65.63 +</manpage>
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/examples/example.get	Fri Sep 26 17:05:23 2008 +0200
    66.3 @@ -0,0 +1,32 @@
    66.4 +# example 'mail get' configuration
    66.5 +#
    66.6 +# the protocol, only 'pop3' or 'apop' are supported. apop is
    66.7 +# recommended if the server supports it (password encryption).
    66.8 +# Unfortunately most do not.
    66.9 +protocol=apop
   66.10 +
   66.11 +# the server:
   66.12 +server = pop.example.org
   66.13 +
   66.14 +# the account name:
   66.15 +user=okurth
   66.16 +
   66.17 +# and the password:
   66.18 +pass="keepInMind"
   66.19 +
   66.20 +# if you just use this for SMTP after POP, you do not need the settings below:
   66.21 +
   66.22 +# the (local) address, where the retrieved mail should be sent to:
   66.23 +address=okurth@localhost
   66.24 +
   66.25 +# should we keep the mail on server?
   66.26 +do_keep=false
   66.27 +
   66.28 +# if we do keep the mail, you should really set this to true,
   66.29 +# otherwise you will get it again next time you fetch mail.
   66.30 +# masqmail completely ignores any headers (which may mark a mail as read).
   66.31 +do_uidl=false
   66.32 +
   66.33 +# optionally, you can set the maximum size of a mail. Setting it to 0
   66.34 +# means get all, disregarding size.
   66.35 +max_size=50000
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/examples/example.route	Fri Sep 26 17:05:23 2008 +0200
    67.3 @@ -0,0 +1,92 @@
    67.4 +# Example route file for masqmail
    67.5 +# see also: man 5 masqmail.route
    67.6 +
    67.7 +#
    67.8 +# mail properties tested for:
    67.9 +#
   67.10 +
   67.11 +# users that can send mail over this connection:
   67.12 +# this is a list of the local parts of the original return addresses, as they are
   67.13 +# configured with your mail client. If not set, anybody may send.
   67.14 +
   67.15 +allowed_mail_locals = "okurth"
   67.16 +
   67.17 +# local_hosts and local_nets will be checked before this.
   67.18 +# cpwright.com uses the dialup up list of dul.maps.vix.com,
   67.19 +# so I cannot send any mail over this connection to that domain.
   67.20 +# There are probably many others... :-( (No, this is okay. Nobody
   67.21 +# wants his mailbox stuffed to the ceiling with spam...)
   67.22 +# 
   67.23 +# You will find this necessary only if you send mail directly
   67.24 +# (if mail_host is not set below)
   67.25 +
   67.26 +not_allowed_rcpt_domains = "cpwright.com"
   67.27 +
   67.28 +#
   67.29 +# settings:
   67.30 +#
   67.31 +
   67.32 +# the mail server which relays mail for you:
   67.33 +# if this is not set, mail will be sent directly.
   67.34 +# If your ISP gives has a mail server, it is wiser to use it:
   67.35 +
   67.36 +mail_host = "mail.isp.com"
   67.37 +
   67.38 +# Make picky servers happy:
   67.39 +# If set, we look up our own name as seen from the network
   67.40 +# and send this in our HELO/EHLO message. Otherwise we send our host name,
   67.41 +# which is probably different for dialup conections and may be unknown outside.
   67.42 +# Some servers complain,
   67.43 +# which is really crazy, since it is senseless to lie about it...
   67.44 +# Unfortunately, some ISPs do not give you a name, just an ip address. In this case,
   67.45 +# we have a delay until the DNS lookup fails.
   67.46 +
   67.47 +do_correct_helo = true
   67.48 +
   67.49 +# 'forge' headers:
   67.50 +
   67.51 +# return path and From: address are TWO different things:
   67.52 +#
   67.53 +# the return path is address where delivery failure messages will go
   67.54 +# to, and this address will be checked by many MTAs in the outside
   67.55 +# world, so it should be valid. It canNOT contain a real name:
   67.56 +# 'miller@foo.com' is a valid return path, but 'Charlie Miller <miller@foo.com>' is NOT.
   67.57 +#
   67.58 +# The From: address is the address the recipient sees, and where
   67.59 +# replies will go to (if you do not set a Reply-to header). In most
   67.60 +# cases it corresponds to the return path, but this is not
   67.61 +# required. It CAN have a real name, both examples for Charlie above
   67.62 +# are correct, and it is more pretty to include a real name.
   67.63 +#
   67.64 +# The return path:
   67.65 +# if we send the mail directly, we can set any valid address here,
   67.66 +# use the one you prefer to get error messages to:
   67.67 +# Use EITHER set_return_path_domain OR map_return_path_addresses
   67.68 +#
   67.69 +# this sets the return path kurth@anywhere.org to kurth@innominate.de
   67.70 +#set_return_path_domain = "innominate.de"
   67.71 +# this sets okurth@somewhere.else.org to kurth@innominate.de, and
   67.72 +# leaves all other addresses untouched:
   67.73 +map_return_path_addresses = "okurth: kurth@innominate.de"
   67.74 +
   67.75 +# 'From:' header:
   67.76 +# Use EITHER set_h_from_domain OR map_h_from_addresses
   67.77 +#set_h_from_domain = "uni-sw.gwdg.de"
   67.78 +map_h_from_addresses = "okurth: Oliver Kurth <kurth@innominate.de>"
   67.79 +
   67.80 +# if your mail server outside uses the AUTH machanism, set the following.
   67.81 +# You need to compile masqmail with AUTH support (--enable-auth option for ./configure):
   67.82 +# for auth_name, only 'cram-md5' and 'login' are supported.
   67.83 +# see also: man 5 masqmail.route
   67.84 +
   67.85 +#auth_name="cram-md5"
   67.86 +#auth_login="yourname"
   67.87 +#auth_secret="dontTellAnyBody"
   67.88 +
   67.89 +# if your mail server requires smtp after POP (eg. gmx), set this.
   67.90 +# It is not necessary if you fetch from the pop server just before you
   67.91 +# send mail (either masqmail, fetchmail or any other pop client).
   67.92 +# Set it to a get file.
   67.93 +# You need to compile masqmail with pop3 support (default)
   67.94 +# pop3_login = "/etc/masqmail/example.get"
   67.95 +# see also: man 5 masqmail.route, man 5 masqmail.get
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/examples/masqmail.conf	Fri Sep 26 17:05:23 2008 +0200
    68.3 @@ -0,0 +1,102 @@
    68.4 +# Example configuration for MasqMail
    68.5 +# Copyright (C) 1999 Oliver Kurth
    68.6 +#
    68.7 +# This program is free software; you can redistribute it and/or modify
    68.8 +# it under the terms of the GNU General Public License as published by
    68.9 +# the Free Software Foundation; either version 2 of the License, or
   68.10 +# (at your option) any later version.
   68.11 +
   68.12 +# This program is distributed in the hope that it will be useful,
   68.13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   68.14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   68.15 +# GNU General Public License for more details.
   68.16 +
   68.17 +# You should have received a copy of the GNU General Public License
   68.18 +# along with this program; if not, write to the Free Software
   68.19 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   68.20 +#
   68.21 +
   68.22 +# The name with which MasqMail identifies itself to others:
   68.23 +# CHANGING THIS IS REQUIRED!
   68.24 +host_name="striped.patchwork.net"
   68.25 +
   68.26 +# Hosts considered local:
   68.27 +# CHANGING THIS IS REQUIRED!
   68.28 +local_hosts="striped;striped.patchwork.net;localhost"
   68.29 +
   68.30 +# Nets considered local, for immediate delivery attempts:
   68.31 +# ALL hosts not included in either local_host or local_nets are
   68.32 +# considered to be 'outside', meaning that messages to them will be queued
   68.33 +# CHANGING THIS IS REQUIRED!
   68.34 +#local_nets="*.patchwork.net;blue;striped"
   68.35 +
   68.36 +# accept connections on these interfaces:
   68.37 +# CHANGING THIS IS REQUIRED!
   68.38 +listen_addresses="localhost:25"
   68.39 +
   68.40 +# send messages to this port:
   68.41 +# probably this will also be configurable on host basis in future versions.
   68.42 +remote_port=25
   68.43 +
   68.44 +# where MasqMail stores its spool files and other stuff:
   68.45 +spool_dir="/var/spool/masqmail"
   68.46 +
   68.47 +# where local mail will be written to:
   68.48 +mail_dir="/var/mail"
   68.49 +
   68.50 +# use syslogd for logs?
   68.51 +use_syslog=false
   68.52 +
   68.53 +# directory for log files:
   68.54 +log_dir="/var/log/masqmail"
   68.55 +
   68.56 +# if set, accepted mail will not be delivered immediately but on the next queue run:
   68.57 +do_queue=false
   68.58 +
   68.59 +# online detection:
   68.60 +#
   68.61 +# for 'mserver' uncomment next 2 lines and optionally change mserver_iface:
   68.62 +#online_detect = mserver
   68.63 +#mserver_iface = "localhost:222"
   68.64 +
   68.65 +# for 'file' uncomment next 2 lines
   68.66 +#online_detect = file
   68.67 +#online_file = "/tmp/connect_route"
   68.68 +
   68.69 +#
   68.70 +# example for local delivery to an mda:
   68.71 +#
   68.72 +#mbox_default=mda
   68.73 +#mda="/usr/bin/procmail -Y -d ${rcpt_local}"
   68.74 +# default is false for these:
   68.75 +#mda_fromline=true
   68.76 +#mda_fromhack=true
   68.77 +
   68.78 +#
   68.79 +# alias expansion:
   68.80 +#
   68.81 +alias_file = "/etc/aliases"
   68.82 +# default is false:
   68.83 +#alias_local_caseless = true
   68.84 +
   68.85 +#
   68.86 +# configuration concerning pipes (after an alias expansion)
   68.87 +#
   68.88 +# default is false for these:
   68.89 +# pipe_fromline=true
   68.90 +# pipe_fromhack=true
   68.91 +
   68.92 +# special routes:
   68.93 +
   68.94 +# CHANGING THIS IS REQUIRED!
   68.95 +# You can use as many routes (one for each provider) as you like:
   68.96 +connect_route.GWDG = "/etc/masqmail/example.route"
   68.97 +
   68.98 +# you can also give a list of routes for a single connection:
   68.99 +#connect_route.foo = "/etc/masqmail/foo.route;/etc/masqmail/bar.route"
  68.100 +
  68.101 +# you can also set routes for the local net:
  68.102 +#local_net_route = "/etc/masqmail/local.route;/etc/masqmail/other_lan.route"
  68.103 +
  68.104 +# if you use masqmail to get mail, set some 'get' files:
  68.105 +#get.anyname = /etc/masqmail/example.get
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/install-sh	Fri Sep 26 17:05:23 2008 +0200
    69.3 @@ -0,0 +1,251 @@
    69.4 +#!/bin/sh
    69.5 +#
    69.6 +# install - install a program, script, or datafile
    69.7 +# This comes from X11R5 (mit/util/scripts/install.sh).
    69.8 +#
    69.9 +# Copyright 1991 by the Massachusetts Institute of Technology
   69.10 +#
   69.11 +# Permission to use, copy, modify, distribute, and sell this software and its
   69.12 +# documentation for any purpose is hereby granted without fee, provided that
   69.13 +# the above copyright notice appear in all copies and that both that
   69.14 +# copyright notice and this permission notice appear in supporting
   69.15 +# documentation, and that the name of M.I.T. not be used in advertising or
   69.16 +# publicity pertaining to distribution of the software without specific,
   69.17 +# written prior permission.  M.I.T. makes no representations about the
   69.18 +# suitability of this software for any purpose.  It is provided "as is"
   69.19 +# without express or implied warranty.
   69.20 +#
   69.21 +# Calling this script install-sh is preferred over install.sh, to prevent
   69.22 +# `make' implicit rules from creating a file called install from it
   69.23 +# when there is no Makefile.
   69.24 +#
   69.25 +# This script is compatible with the BSD install script, but was written
   69.26 +# from scratch.  It can only install one file at a time, a restriction
   69.27 +# shared with many OS's install programs.
   69.28 +
   69.29 +
   69.30 +# set DOITPROG to echo to test this script
   69.31 +
   69.32 +# Don't use :- since 4.3BSD and earlier shells don't like it.
   69.33 +doit="${DOITPROG-}"
   69.34 +
   69.35 +
   69.36 +# put in absolute paths if you don't have them in your path; or use env. vars.
   69.37 +
   69.38 +mvprog="${MVPROG-mv}"
   69.39 +cpprog="${CPPROG-cp}"
   69.40 +chmodprog="${CHMODPROG-chmod}"
   69.41 +chownprog="${CHOWNPROG-chown}"
   69.42 +chgrpprog="${CHGRPPROG-chgrp}"
   69.43 +stripprog="${STRIPPROG-strip}"
   69.44 +rmprog="${RMPROG-rm}"
   69.45 +mkdirprog="${MKDIRPROG-mkdir}"
   69.46 +
   69.47 +transformbasename=""
   69.48 +transform_arg=""
   69.49 +instcmd="$mvprog"
   69.50 +chmodcmd="$chmodprog 0755"
   69.51 +chowncmd=""
   69.52 +chgrpcmd=""
   69.53 +stripcmd=""
   69.54 +rmcmd="$rmprog -f"
   69.55 +mvcmd="$mvprog"
   69.56 +src=""
   69.57 +dst=""
   69.58 +dir_arg=""
   69.59 +
   69.60 +while [ x"$1" != x ]; do
   69.61 +    case $1 in
   69.62 +	-c) instcmd="$cpprog"
   69.63 +	    shift
   69.64 +	    continue;;
   69.65 +
   69.66 +	-d) dir_arg=true
   69.67 +	    shift
   69.68 +	    continue;;
   69.69 +
   69.70 +	-m) chmodcmd="$chmodprog $2"
   69.71 +	    shift
   69.72 +	    shift
   69.73 +	    continue;;
   69.74 +
   69.75 +	-o) chowncmd="$chownprog $2"
   69.76 +	    shift
   69.77 +	    shift
   69.78 +	    continue;;
   69.79 +
   69.80 +	-g) chgrpcmd="$chgrpprog $2"
   69.81 +	    shift
   69.82 +	    shift
   69.83 +	    continue;;
   69.84 +
   69.85 +	-s) stripcmd="$stripprog"
   69.86 +	    shift
   69.87 +	    continue;;
   69.88 +
   69.89 +	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
   69.90 +	    shift
   69.91 +	    continue;;
   69.92 +
   69.93 +	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
   69.94 +	    shift
   69.95 +	    continue;;
   69.96 +
   69.97 +	*)  if [ x"$src" = x ]
   69.98 +	    then
   69.99 +		src=$1
  69.100 +	    else
  69.101 +		# this colon is to work around a 386BSD /bin/sh bug
  69.102 +		:
  69.103 +		dst=$1
  69.104 +	    fi
  69.105 +	    shift
  69.106 +	    continue;;
  69.107 +    esac
  69.108 +done
  69.109 +
  69.110 +if [ x"$src" = x ]
  69.111 +then
  69.112 +	echo "install:	no input file specified"
  69.113 +	exit 1
  69.114 +else
  69.115 +	true
  69.116 +fi
  69.117 +
  69.118 +if [ x"$dir_arg" != x ]; then
  69.119 +	dst=$src
  69.120 +	src=""
  69.121 +	
  69.122 +	if [ -d $dst ]; then
  69.123 +		instcmd=:
  69.124 +		chmodcmd=""
  69.125 +	else
  69.126 +		instcmd=mkdir
  69.127 +	fi
  69.128 +else
  69.129 +
  69.130 +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
  69.131 +# might cause directories to be created, which would be especially bad 
  69.132 +# if $src (and thus $dsttmp) contains '*'.
  69.133 +
  69.134 +	if [ -f $src -o -d $src ]
  69.135 +	then
  69.136 +		true
  69.137 +	else
  69.138 +		echo "install:  $src does not exist"
  69.139 +		exit 1
  69.140 +	fi
  69.141 +	
  69.142 +	if [ x"$dst" = x ]
  69.143 +	then
  69.144 +		echo "install:	no destination specified"
  69.145 +		exit 1
  69.146 +	else
  69.147 +		true
  69.148 +	fi
  69.149 +
  69.150 +# If destination is a directory, append the input filename; if your system
  69.151 +# does not like double slashes in filenames, you may need to add some logic
  69.152 +
  69.153 +	if [ -d $dst ]
  69.154 +	then
  69.155 +		dst="$dst"/`basename $src`
  69.156 +	else
  69.157 +		true
  69.158 +	fi
  69.159 +fi
  69.160 +
  69.161 +## this sed command emulates the dirname command
  69.162 +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
  69.163 +
  69.164 +# Make sure that the destination directory exists.
  69.165 +#  this part is taken from Noah Friedman's mkinstalldirs script
  69.166 +
  69.167 +# Skip lots of stat calls in the usual case.
  69.168 +if [ ! -d "$dstdir" ]; then
  69.169 +defaultIFS='	
  69.170 +'
  69.171 +IFS="${IFS-${defaultIFS}}"
  69.172 +
  69.173 +oIFS="${IFS}"
  69.174 +# Some sh's can't handle IFS=/ for some reason.
  69.175 +IFS='%'
  69.176 +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
  69.177 +IFS="${oIFS}"
  69.178 +
  69.179 +pathcomp=''
  69.180 +
  69.181 +while [ $# -ne 0 ] ; do
  69.182 +	pathcomp="${pathcomp}${1}"
  69.183 +	shift
  69.184 +
  69.185 +	if [ ! -d "${pathcomp}" ] ;
  69.186 +        then
  69.187 +		$mkdirprog "${pathcomp}"
  69.188 +	else
  69.189 +		true
  69.190 +	fi
  69.191 +
  69.192 +	pathcomp="${pathcomp}/"
  69.193 +done
  69.194 +fi
  69.195 +
  69.196 +if [ x"$dir_arg" != x ]
  69.197 +then
  69.198 +	$doit $instcmd $dst &&
  69.199 +
  69.200 +	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
  69.201 +	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
  69.202 +	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
  69.203 +	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
  69.204 +else
  69.205 +
  69.206 +# If we're going to rename the final executable, determine the name now.
  69.207 +
  69.208 +	if [ x"$transformarg" = x ] 
  69.209 +	then
  69.210 +		dstfile=`basename $dst`
  69.211 +	else
  69.212 +		dstfile=`basename $dst $transformbasename | 
  69.213 +			sed $transformarg`$transformbasename
  69.214 +	fi
  69.215 +
  69.216 +# don't allow the sed command to completely eliminate the filename
  69.217 +
  69.218 +	if [ x"$dstfile" = x ] 
  69.219 +	then
  69.220 +		dstfile=`basename $dst`
  69.221 +	else
  69.222 +		true
  69.223 +	fi
  69.224 +
  69.225 +# Make a temp file name in the proper directory.
  69.226 +
  69.227 +	dsttmp=$dstdir/#inst.$$#
  69.228 +
  69.229 +# Move or copy the file name to the temp name
  69.230 +
  69.231 +	$doit $instcmd $src $dsttmp &&
  69.232 +
  69.233 +	trap "rm -f ${dsttmp}" 0 &&
  69.234 +
  69.235 +# and set any options; do chmod last to preserve setuid bits
  69.236 +
  69.237 +# If any of these fail, we abort the whole thing.  If we want to
  69.238 +# ignore errors from any of these, just make sure not to ignore
  69.239 +# errors from the above "$doit $instcmd $src $dsttmp" command.
  69.240 +
  69.241 +	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
  69.242 +	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
  69.243 +	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
  69.244 +	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
  69.245 +
  69.246 +# Now rename the file to the real destination.
  69.247 +
  69.248 +	$doit $rmcmd -f $dstdir/$dstfile &&
  69.249 +	$doit $mvcmd $dsttmp $dstdir/$dstfile 
  69.250 +
  69.251 +fi &&
  69.252 +
  69.253 +
  69.254 +exit 0
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/missing	Fri Sep 26 17:05:23 2008 +0200
    70.3 @@ -0,0 +1,336 @@
    70.4 +#! /bin/sh
    70.5 +# Common stub for a few missing GNU programs while installing.
    70.6 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
    70.7 +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
    70.8 +
    70.9 +# This program is free software; you can redistribute it and/or modify
   70.10 +# it under the terms of the GNU General Public License as published by
   70.11 +# the Free Software Foundation; either version 2, or (at your option)
   70.12 +# any later version.
   70.13 +
   70.14 +# This program is distributed in the hope that it will be useful,
   70.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   70.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   70.17 +# GNU General Public License for more details.
   70.18 +
   70.19 +# You should have received a copy of the GNU General Public License
   70.20 +# along with this program; if not, write to the Free Software
   70.21 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   70.22 +# 02111-1307, USA.
   70.23 +
   70.24 +# As a special exception to the GNU General Public License, if you
   70.25 +# distribute this file as part of a program that contains a
   70.26 +# configuration script generated by Autoconf, you may include it under
   70.27 +# the same distribution terms that you use for the rest of that program.
   70.28 +
   70.29 +if test $# -eq 0; then
   70.30 +  echo 1>&2 "Try \`$0 --help' for more information"
   70.31 +  exit 1
   70.32 +fi
   70.33 +
   70.34 +run=:
   70.35 +
   70.36 +# In the cases where this matters, `missing' is being run in the
   70.37 +# srcdir already.
   70.38 +if test -f configure.ac; then
   70.39 +  configure_ac=configure.ac
   70.40 +else
   70.41 +  configure_ac=configure.in
   70.42 +fi
   70.43 +
   70.44 +case "$1" in
   70.45 +--run)
   70.46 +  # Try to run requested program, and just exit if it succeeds.
   70.47 +  run=
   70.48 +  shift
   70.49 +  "$@" && exit 0
   70.50 +  ;;
   70.51 +esac
   70.52 +
   70.53 +# If it does not exist, or fails to run (possibly an outdated version),
   70.54 +# try to emulate it.
   70.55 +case "$1" in
   70.56 +
   70.57 +  -h|--h|--he|--hel|--help)
   70.58 +    echo "\
   70.59 +$0 [OPTION]... PROGRAM [ARGUMENT]...
   70.60 +
   70.61 +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
   70.62 +error status if there is no known handling for PROGRAM.
   70.63 +
   70.64 +Options:
   70.65 +  -h, --help      display this help and exit
   70.66 +  -v, --version   output version information and exit
   70.67 +  --run           try to run the given command, and emulate it if it fails
   70.68 +
   70.69 +Supported PROGRAM values:
   70.70 +  aclocal      touch file \`aclocal.m4'
   70.71 +  autoconf     touch file \`configure'
   70.72 +  autoheader   touch file \`config.h.in'
   70.73 +  automake     touch all \`Makefile.in' files
   70.74 +  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
   70.75 +  flex         create \`lex.yy.c', if possible, from existing .c
   70.76 +  help2man     touch the output file
   70.77 +  lex          create \`lex.yy.c', if possible, from existing .c
   70.78 +  makeinfo     touch the output file
   70.79 +  tar          try tar, gnutar, gtar, then tar without non-portable flags
   70.80 +  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
   70.81 +    ;;
   70.82 +
   70.83 +  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
   70.84 +    echo "missing 0.4 - GNU automake"
   70.85 +    ;;
   70.86 +
   70.87 +  -*)
   70.88 +    echo 1>&2 "$0: Unknown \`$1' option"
   70.89 +    echo 1>&2 "Try \`$0 --help' for more information"
   70.90 +    exit 1
   70.91 +    ;;
   70.92 +
   70.93 +  aclocal*)
   70.94 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   70.95 +       # We have it, but it failed.
   70.96 +       exit 1
   70.97 +    fi
   70.98 +
   70.99 +    echo 1>&2 "\
  70.100 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.101 +         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
  70.102 +         to install the \`Automake' and \`Perl' packages.  Grab them from
  70.103 +         any GNU archive site."
  70.104 +    touch aclocal.m4
  70.105 +    ;;
  70.106 +
  70.107 +  autoconf)
  70.108 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
  70.109 +       # We have it, but it failed.
  70.110 +       exit 1
  70.111 +    fi
  70.112 +
  70.113 +    echo 1>&2 "\
  70.114 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.115 +         you modified \`${configure_ac}'.  You might want to install the
  70.116 +         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
  70.117 +         archive site."
  70.118 +    touch configure
  70.119 +    ;;
  70.120 +
  70.121 +  autoheader)
  70.122 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
  70.123 +       # We have it, but it failed.
  70.124 +       exit 1
  70.125 +    fi
  70.126 +
  70.127 +    echo 1>&2 "\
  70.128 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.129 +         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
  70.130 +         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
  70.131 +         from any GNU archive site."
  70.132 +    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
  70.133 +    test -z "$files" && files="config.h"
  70.134 +    touch_files=
  70.135 +    for f in $files; do
  70.136 +      case "$f" in
  70.137 +      *:*) touch_files="$touch_files "`echo "$f" |
  70.138 +				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
  70.139 +      *) touch_files="$touch_files $f.in";;
  70.140 +      esac
  70.141 +    done
  70.142 +    touch $touch_files
  70.143 +    ;;
  70.144 +
  70.145 +  automake*)
  70.146 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
  70.147 +       # We have it, but it failed.
  70.148 +       exit 1
  70.149 +    fi
  70.150 +
  70.151 +    echo 1>&2 "\
  70.152 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.153 +         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
  70.154 +         You might want to install the \`Automake' and \`Perl' packages.
  70.155 +         Grab them from any GNU archive site."
  70.156 +    find . -type f -name Makefile.am -print |
  70.157 +	   sed 's/\.am$/.in/' |
  70.158 +	   while read f; do touch "$f"; done
  70.159 +    ;;
  70.160 +
  70.161 +  autom4te)
  70.162 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
  70.163 +       # We have it, but it failed.
  70.164 +       exit 1
  70.165 +    fi
  70.166 +
  70.167 +    echo 1>&2 "\
  70.168 +WARNING: \`$1' is needed, and you do not seem to have it handy on your
  70.169 +         system.  You might have modified some files without having the
  70.170 +         proper tools for further handling them.
  70.171 +         You can get \`$1' as part of \`Autoconf' from any GNU
  70.172 +         archive site."
  70.173 +
  70.174 +    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
  70.175 +    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
  70.176 +    if test -f "$file"; then
  70.177 +	touch $file
  70.178 +    else
  70.179 +	test -z "$file" || exec >$file
  70.180 +	echo "#! /bin/sh"
  70.181 +	echo "# Created by GNU Automake missing as a replacement of"
  70.182 +	echo "#  $ $@"
  70.183 +	echo "exit 0"
  70.184 +	chmod +x $file
  70.185 +	exit 1
  70.186 +    fi
  70.187 +    ;;
  70.188 +
  70.189 +  bison|yacc)
  70.190 +    echo 1>&2 "\
  70.191 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.192 +         you modified a \`.y' file.  You may need the \`Bison' package
  70.193 +         in order for those modifications to take effect.  You can get
  70.194 +         \`Bison' from any GNU archive site."
  70.195 +    rm -f y.tab.c y.tab.h
  70.196 +    if [ $# -ne 1 ]; then
  70.197 +        eval LASTARG="\${$#}"
  70.198 +	case "$LASTARG" in
  70.199 +	*.y)
  70.200 +	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
  70.201 +	    if [ -f "$SRCFILE" ]; then
  70.202 +	         cp "$SRCFILE" y.tab.c
  70.203 +	    fi
  70.204 +	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
  70.205 +	    if [ -f "$SRCFILE" ]; then
  70.206 +	         cp "$SRCFILE" y.tab.h
  70.207 +	    fi
  70.208 +	  ;;
  70.209 +	esac
  70.210 +    fi
  70.211 +    if [ ! -f y.tab.h ]; then
  70.212 +	echo >y.tab.h
  70.213 +    fi
  70.214 +    if [ ! -f y.tab.c ]; then
  70.215 +	echo 'main() { return 0; }' >y.tab.c
  70.216 +    fi
  70.217 +    ;;
  70.218 +
  70.219 +  lex|flex)
  70.220 +    echo 1>&2 "\
  70.221 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.222 +         you modified a \`.l' file.  You may need the \`Flex' package
  70.223 +         in order for those modifications to take effect.  You can get
  70.224 +         \`Flex' from any GNU archive site."
  70.225 +    rm -f lex.yy.c
  70.226 +    if [ $# -ne 1 ]; then
  70.227 +        eval LASTARG="\${$#}"
  70.228 +	case "$LASTARG" in
  70.229 +	*.l)
  70.230 +	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
  70.231 +	    if [ -f "$SRCFILE" ]; then
  70.232 +	         cp "$SRCFILE" lex.yy.c
  70.233 +	    fi
  70.234 +	  ;;
  70.235 +	esac
  70.236 +    fi
  70.237 +    if [ ! -f lex.yy.c ]; then
  70.238 +	echo 'main() { return 0; }' >lex.yy.c
  70.239 +    fi
  70.240 +    ;;
  70.241 +
  70.242 +  help2man)
  70.243 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
  70.244 +       # We have it, but it failed.
  70.245 +       exit 1
  70.246 +    fi
  70.247 +
  70.248 +    echo 1>&2 "\
  70.249 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.250 +	 you modified a dependency of a manual page.  You may need the
  70.251 +	 \`Help2man' package in order for those modifications to take
  70.252 +	 effect.  You can get \`Help2man' from any GNU archive site."
  70.253 +
  70.254 +    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
  70.255 +    if test -z "$file"; then
  70.256 +	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
  70.257 +    fi
  70.258 +    if [ -f "$file" ]; then
  70.259 +	touch $file
  70.260 +    else
  70.261 +	test -z "$file" || exec >$file
  70.262 +	echo ".ab help2man is required to generate this page"
  70.263 +	exit 1
  70.264 +    fi
  70.265 +    ;;
  70.266 +
  70.267 +  makeinfo)
  70.268 +    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
  70.269 +       # We have makeinfo, but it failed.
  70.270 +       exit 1
  70.271 +    fi
  70.272 +
  70.273 +    echo 1>&2 "\
  70.274 +WARNING: \`$1' is missing on your system.  You should only need it if
  70.275 +         you modified a \`.texi' or \`.texinfo' file, or any other file
  70.276 +         indirectly affecting the aspect of the manual.  The spurious
  70.277 +         call might also be the consequence of using a buggy \`make' (AIX,
  70.278 +         DU, IRIX).  You might want to install the \`Texinfo' package or
  70.279 +         the \`GNU make' package.  Grab either from any GNU archive site."
  70.280 +    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
  70.281 +    if test -z "$file"; then
  70.282 +      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
  70.283 +      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
  70.284 +    fi
  70.285 +    touch $file
  70.286 +    ;;
  70.287 +
  70.288 +  tar)
  70.289 +    shift
  70.290 +    if test -n "$run"; then
  70.291 +      echo 1>&2 "ERROR: \`tar' requires --run"
  70.292 +      exit 1
  70.293 +    fi
  70.294 +
  70.295 +    # We have already tried tar in the generic part.
  70.296 +    # Look for gnutar/gtar before invocation to avoid ugly error
  70.297 +    # messages.
  70.298 +    if (gnutar --version > /dev/null 2>&1); then
  70.299 +       gnutar "$@" && exit 0
  70.300 +    fi
  70.301 +    if (gtar --version > /dev/null 2>&1); then
  70.302 +       gtar "$@" && exit 0
  70.303 +    fi
  70.304 +    firstarg="$1"
  70.305 +    if shift; then
  70.306 +	case "$firstarg" in
  70.307 +	*o*)
  70.308 +	    firstarg=`echo "$firstarg" | sed s/o//`
  70.309 +	    tar "$firstarg" "$@" && exit 0
  70.310 +	    ;;
  70.311 +	esac
  70.312 +	case "$firstarg" in
  70.313 +	*h*)
  70.314 +	    firstarg=`echo "$firstarg" | sed s/h//`
  70.315 +	    tar "$firstarg" "$@" && exit 0
  70.316 +	    ;;
  70.317 +	esac
  70.318 +    fi
  70.319 +
  70.320 +    echo 1>&2 "\
  70.321 +WARNING: I can't seem to be able to run \`tar' with the given arguments.
  70.322 +         You may want to install GNU tar or Free paxutils, or check the
  70.323 +         command line arguments."
  70.324 +    exit 1
  70.325 +    ;;
  70.326 +
  70.327 +  *)
  70.328 +    echo 1>&2 "\
  70.329 +WARNING: \`$1' is needed, and you do not seem to have it handy on your
  70.330 +         system.  You might have modified some files without having the
  70.331 +         proper tools for further handling them.  Check the \`README' file,
  70.332 +         it often tells you about the needed prerequisites for installing
  70.333 +         this package.  You may also peek at any GNU archive site, in case
  70.334 +         some other package would contain this missing \`$1' program."
  70.335 +    exit 1
  70.336 +    ;;
  70.337 +esac
  70.338 +
  70.339 +exit 0
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/mkinstalldirs	Fri Sep 26 17:05:23 2008 +0200
    71.3 @@ -0,0 +1,40 @@
    71.4 +#! /bin/sh
    71.5 +# mkinstalldirs --- make directory hierarchy
    71.6 +# Author: Noah Friedman <friedman@prep.ai.mit.edu>
    71.7 +# Created: 1993-05-16
    71.8 +# Public domain
    71.9 +
   71.10 +# $Id: mkinstalldirs,v 1.1.1.1 2001/03/19 15:45:28 okurth Exp $
   71.11 +
   71.12 +errstatus=0
   71.13 +
   71.14 +for file
   71.15 +do
   71.16 +   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
   71.17 +   shift
   71.18 +
   71.19 +   pathcomp=
   71.20 +   for d
   71.21 +   do
   71.22 +     pathcomp="$pathcomp$d"
   71.23 +     case "$pathcomp" in
   71.24 +       -* ) pathcomp=./$pathcomp ;;
   71.25 +     esac
   71.26 +
   71.27 +     if test ! -d "$pathcomp"; then
   71.28 +        echo "mkdir $pathcomp"
   71.29 +
   71.30 +        mkdir "$pathcomp" || lasterr=$?
   71.31 +
   71.32 +        if test ! -d "$pathcomp"; then
   71.33 +  	  errstatus=$lasterr
   71.34 +        fi
   71.35 +     fi
   71.36 +
   71.37 +     pathcomp="$pathcomp/"
   71.38 +   done
   71.39 +done
   71.40 +
   71.41 +exit $errstatus
   71.42 +
   71.43 +# mkinstalldirs ends here
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/redhat/masqmail	Fri Sep 26 17:05:23 2008 +0200
    72.3 @@ -0,0 +1,48 @@
    72.4 +#! /bin/sh
    72.5 +# Author: Oliver Kurth <okurth@uni-sw.gwdg.de>
    72.6 +#         Iain Lea <iain@bricbrac.de>
    72.7 +#
    72.8 +# /etc/rc.d/init.d/masqmail
    72.9 +#
   72.10 +
   72.11 +# Source function library.
   72.12 +. /etc/rc.d/init.d/functions
   72.13 +
   72.14 +if test -z "$MASQMAIL_ARGS" ; then
   72.15 +	MASQMAIL_ARGS="-bd -q30m"
   72.16 +fi
   72.17 +
   72.18 +RETVAL=0
   72.19 +
   72.20 +# See how we were called.
   72.21 +case "$1" in
   72.22 +    start)
   72.23 +	echo -n "Starting SMTP (MasqMail): "
   72.24 +	daemon /usr/sbin/sendmail $MASQMAIL_ARGS
   72.25 +	RETVAL=$?
   72.26 +	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/masqmail
   72.27 +	echo
   72.28 +	;;
   72.29 +    stop)
   72.30 +	echo -n "Shutting down SMTP (MasqMail): "
   72.31 +	killproc sendmail
   72.32 +	RETVAL=$?
   72.33 +	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/masqmail
   72.34 +	echo
   72.35 +	;;
   72.36 +    restart|reload)
   72.37 +	$0 stop
   72.38 +	$0 start
   72.39 +	RETVAL=$?
   72.40 +	;;
   72.41 +    status)
   72.42 +	status sendmail
   72.43 +	RETVAL=$?
   72.44 +	;;
   72.45 +    *)
   72.46 +	echo "Usage: $0 {start|stop|status|restart|reload}"
   72.47 +	exit 1
   72.48 +	;;
   72.49 +esac
   72.50 +
   72.51 +exit $RETVAL
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/redhat/masqmail.spec	Fri Sep 26 17:05:23 2008 +0200
    73.3 @@ -0,0 +1,120 @@
    73.4 +Summary: An offline mail server with pop3 client support
    73.5 +Name: masqmail
    73.6 +Version: 0.2.21
    73.7 +Release: 1
    73.8 +Copyright: GPL
    73.9 +Group: Networking/Daemons
   73.10 +Distribution: innominate
   73.11 +Packager: Iain Lea <iain@bricbrac.de>
   73.12 +Source: http://masqmail.cx/masqmail/download/masqmail-0.2.21.tar.gz
   73.13 +BuildRoot: /var/tmp/masqmail-root/
   73.14 +
   73.15 +%description
   73.16 +MasqMail is a mail server designed for hosts that do not have a
   73.17 +permanent internet connection eg. a home network or a single host at
   73.18 +home. It has special support for connections to different ISPs. It
   73.19 +replaces sendmail or other MTAs such as qmail or exim.
   73.20 +
   73.21 +%prep
   73.22 +
   73.23 +%setup -n masqmail-0.2.21
   73.24 +
   73.25 +%build
   73.26 +#
   73.27 +#choose the a line or a combination:
   73.28 +#
   73.29 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --disable-pop3
   73.30 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-auth
   73.31 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-ident
   73.32 +CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail
   73.33 +
   73.34 +CFLAGS="$RPM_OPT_FLAGS" make
   73.35 +
   73.36 +%install
   73.37 +if [ -d $RPM_BUILD_ROOT ] ; then
   73.38 +	rm -rf $RPM_BUILD_ROOT
   73.39 +fi
   73.40 +
   73.41 +# setup directory environment:
   73.42 +mkdir $RPM_BUILD_ROOT
   73.43 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail
   73.44 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input
   73.45 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl
   73.46 +mkdir -p $RPM_BUILD_ROOT/usr/sbin
   73.47 +mkdir -p $RPM_BUILD_ROOT/usr/bin
   73.48 +mkdir -p $RPM_BUILD_ROOT/usr/lib
   73.49 +mkdir -p $RPM_BUILD_ROOT/etc
   73.50 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail
   73.51 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl
   73.52 +mkdir -p $RPM_BUILD_ROOT/var/masqmail
   73.53 +
   73.54 +# install
   73.55 +make DESTDIR=$RPM_BUILD_ROOT install
   73.56 +/usr/bin/strip $RPM_BUILD_ROOT/usr/sbin/masqmail
   73.57 +
   73.58 +# sendmail links
   73.59 +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail
   73.60 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq
   73.61 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail
   73.62 +
   73.63 +# RedHat specific startup stuff:
   73.64 +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
   73.65 +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc2.d/
   73.66 +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d/
   73.67 +cp -p redhat/masqmail $RPM_BUILD_ROOT/etc/rc.d/init.d/
   73.68 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/S20masqmail
   73.69 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/K20masqmail
   73.70 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S20masqmail
   73.71 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/K20masqmail
   73.72 +ln -fs '../../etc/rc.d/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail
   73.73 +
   73.74 +# configuration examples:
   73.75 +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/
   73.76 +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/
   73.77 +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/
   73.78 +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl
   73.79 +
   73.80 +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/
   73.81 +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/
   73.82 +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/
   73.83 +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/
   73.84 +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/
   73.85 +
   73.86 +# gzip the man pages:
   73.87 +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8
   73.88 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5
   73.89 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5
   73.90 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5
   73.91 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5
   73.92 +
   73.93 +%clean
   73.94 +rm -rf $RPM_BUILD_ROOT
   73.95 +
   73.96 +%files
   73.97 +%defattr(-,root,root)
   73.98 +/usr/sbin/masqmail
   73.99 +/usr/sbin/sendmail
  73.100 +/usr/bin/mailq
  73.101 +/usr/lib/sendmail
  73.102 +/etc/rc.d/init.d/masqmail
  73.103 +/etc/rc.d/rc2.d/S20masqmail
  73.104 +/etc/rc.d/rc2.d/K20masqmail
  73.105 +/etc/rc.d/rc3.d/S20masqmail
  73.106 +/etc/rc.d/rc3.d/K20masqmail
  73.107 +/usr/sbin/rcmasqmail
  73.108 +%config /etc/masqmail.conf /etc/masqmail/tpl/failmsg.tpl
  73.109 +//etc/masqmail/
  73.110 +%doc README INSTALL COPYING NEWS
  73.111 +/usr/man/man8/masqmail.8.gz
  73.112 +/usr/man/man5/masqmail.conf.5.gz
  73.113 +/usr/man/man5/masqmail.route.5.gz
  73.114 +/usr/man/man5/masqmail.get.5.gz
  73.115 +/usr/man/man5/masqmail.aliases.5.gz
  73.116 +
  73.117 +%defattr(-,mail,mail)
  73.118 +%dir /var/masqmail/
  73.119 +%dir /var/spool/masqmail/
  73.120 +%dir /var/spool/masqmail/popuidl/
  73.121 +%dir /var/spool/masqmail/input/
  73.122 +
  73.123 +
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/redhat/masqmail.spec.in	Fri Sep 26 17:05:23 2008 +0200
    74.3 @@ -0,0 +1,120 @@
    74.4 +Summary: An offline mail server with pop3 client support
    74.5 +Name: masqmail
    74.6 +Version: @VERSION@
    74.7 +Release: 1
    74.8 +Copyright: GPL
    74.9 +Group: Networking/Daemons
   74.10 +Distribution: innominate
   74.11 +Packager: Iain Lea <iain@bricbrac.de>
   74.12 +Source: http://masqmail.cx/masqmail/download/masqmail-@VERSION@.tar.gz
   74.13 +BuildRoot: /var/tmp/masqmail-root/
   74.14 +
   74.15 +%description
   74.16 +MasqMail is a mail server designed for hosts that do not have a
   74.17 +permanent internet connection eg. a home network or a single host at
   74.18 +home. It has special support for connections to different ISPs. It
   74.19 +replaces sendmail or other MTAs such as qmail or exim.
   74.20 +
   74.21 +%prep
   74.22 +
   74.23 +%setup -n masqmail-@VERSION@
   74.24 +
   74.25 +%build
   74.26 +#
   74.27 +#choose the a line or a combination:
   74.28 +#
   74.29 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --disable-pop3
   74.30 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-auth
   74.31 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-ident
   74.32 +CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail
   74.33 +
   74.34 +CFLAGS="$RPM_OPT_FLAGS" make
   74.35 +
   74.36 +%install
   74.37 +if [ -d $RPM_BUILD_ROOT ] ; then
   74.38 +	rm -rf $RPM_BUILD_ROOT
   74.39 +fi
   74.40 +
   74.41 +# setup directory environment:
   74.42 +mkdir $RPM_BUILD_ROOT
   74.43 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail
   74.44 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input
   74.45 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl
   74.46 +mkdir -p $RPM_BUILD_ROOT/usr/sbin
   74.47 +mkdir -p $RPM_BUILD_ROOT/usr/bin
   74.48 +mkdir -p $RPM_BUILD_ROOT/usr/lib
   74.49 +mkdir -p $RPM_BUILD_ROOT/etc
   74.50 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail
   74.51 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl
   74.52 +mkdir -p $RPM_BUILD_ROOT/var/masqmail
   74.53 +
   74.54 +# install
   74.55 +make DESTDIR=$RPM_BUILD_ROOT install
   74.56 +/usr/bin/strip $RPM_BUILD_ROOT/usr/sbin/masqmail
   74.57 +
   74.58 +# sendmail links
   74.59 +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail
   74.60 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq
   74.61 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail
   74.62 +
   74.63 +# RedHat specific startup stuff:
   74.64 +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
   74.65 +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc2.d/
   74.66 +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d/
   74.67 +cp -p redhat/masqmail $RPM_BUILD_ROOT/etc/rc.d/init.d/
   74.68 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/S20masqmail
   74.69 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/K20masqmail
   74.70 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S20masqmail
   74.71 +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/K20masqmail
   74.72 +ln -fs '../../etc/rc.d/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail
   74.73 +
   74.74 +# configuration examples:
   74.75 +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/
   74.76 +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/
   74.77 +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/
   74.78 +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl
   74.79 +
   74.80 +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/
   74.81 +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/
   74.82 +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/
   74.83 +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/
   74.84 +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/
   74.85 +
   74.86 +# gzip the man pages:
   74.87 +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8
   74.88 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5
   74.89 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5
   74.90 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5
   74.91 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5
   74.92 +
   74.93 +%clean
   74.94 +rm -rf $RPM_BUILD_ROOT
   74.95 +
   74.96 +%files
   74.97 +%defattr(-,root,root)
   74.98 +/usr/sbin/masqmail
   74.99 +/usr/sbin/sendmail
  74.100 +/usr/bin/mailq
  74.101 +/usr/lib/sendmail
  74.102 +/etc/rc.d/init.d/masqmail
  74.103 +/etc/rc.d/rc2.d/S20masqmail
  74.104 +/etc/rc.d/rc2.d/K20masqmail
  74.105 +/etc/rc.d/rc3.d/S20masqmail
  74.106 +/etc/rc.d/rc3.d/K20masqmail
  74.107 +/usr/sbin/rcmasqmail
  74.108 +%config /etc/masqmail.conf /etc/masqmail/tpl/failmsg.tpl
  74.109 +//etc/masqmail/
  74.110 +%doc README INSTALL COPYING NEWS
  74.111 +/usr/man/man8/masqmail.8.gz
  74.112 +/usr/man/man5/masqmail.conf.5.gz
  74.113 +/usr/man/man5/masqmail.route.5.gz
  74.114 +/usr/man/man5/masqmail.get.5.gz
  74.115 +/usr/man/man5/masqmail.aliases.5.gz
  74.116 +
  74.117 +%defattr(-,mail,mail)
  74.118 +%dir /var/masqmail/
  74.119 +%dir /var/spool/masqmail/
  74.120 +%dir /var/spool/masqmail/popuidl/
  74.121 +%dir /var/spool/masqmail/input/
  74.122 +
  74.123 +
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/src/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    75.3 @@ -0,0 +1,90 @@
    75.4 +SUBDIRS=base64 md5 libident
    75.5 +
    75.6 +AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE -DG_DISABLE_DEPRECATED
    75.7 +
    75.8 +sbin_PROGRAMS=masqmail
    75.9 +bin_PROGRAMS=mservdetect
   75.10 +noinst_PROGRAMS=smtpsend readtest
   75.11 +
   75.12 +masqmail_SOURCES=\
   75.13 +	dotlock.h\
   75.14 +	masqmail.h\
   75.15 +	readsock.h\
   75.16 +	smtp_out.h\
   75.17 +	lookup.h\
   75.18 +	mserver.h\
   75.19 +	accept.c\
   75.20 +	address.c\
   75.21 +	alias.c\
   75.22 +	child.c\
   75.23 +	connect.c\
   75.24 +	conf.c\
   75.25 +	deliver.c\
   75.26 +	dotlock.c\
   75.27 +	expand.c\
   75.28 +	fail_msg.c\
   75.29 +	get.c\
   75.30 +	header.c\
   75.31 +	interface.c\
   75.32 +	local.c\
   75.33 +	log.c\
   75.34 +	listen.c\
   75.35 +	lookup.c\
   75.36 +	masqmail.c\
   75.37 +	message.c\
   75.38 +	mserver.c\
   75.39 +	online.c\
   75.40 +	parse.c\
   75.41 +	peopen.c\
   75.42 +	peopen.h\
   75.43 +	permissions.c\
   75.44 +	pop3_in.c\
   75.45 +	pop3_in.h\
   75.46 +	readsock.c\
   75.47 +	rewrite.c\
   75.48 +	route.c\
   75.49 +	queue.c\
   75.50 +	smtp_in.c\
   75.51 +	smtp_out.c\
   75.52 +	spool.c\
   75.53 +	tables.c\
   75.54 +	timeival.c
   75.55 +
   75.56 +smtpsend_SOURCES=\
   75.57 +	smtpsend.c\
   75.58 +	masqmail.h\
   75.59 +	readsock.h\
   75.60 +	smtp_out.h\
   75.61 +	lookup.h\
   75.62 +	accept.c\
   75.63 +	address.c\
   75.64 +	child.c\
   75.65 +	connect.c\
   75.66 +	header.c\
   75.67 +	interface.c\
   75.68 +	lookup.c\
   75.69 +	message.c\
   75.70 +	parse.c\
   75.71 +	peopen.c\
   75.72 +	readsock.c\
   75.73 +	smtp_out.c
   75.74 +
   75.75 +mservdetect_SOURCES=\
   75.76 +	masqmail.h\
   75.77 +	readsock.h\
   75.78 +	mserver.h\
   75.79 +	mservdetect.c\
   75.80 +	interface.c\
   75.81 +	mserver.c\
   75.82 +	readsock.c\
   75.83 +	peopen.c
   75.84 +
   75.85 +readtest_SOURCES=\
   75.86 +	readsock.c\
   75.87 +	readsock.h\
   75.88 +	readtest.c
   75.89 +
   75.90 +masqmail_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ @LOCKFILE_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ @IDENT_LIBS@
   75.91 +smtpsend_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ @MD5_LIBS@ @BASE64_LIBS@
   75.92 +mservdetect_LDADD=@GLIB_LIBS@
   75.93 +readtest_LDADD=@GLIB_LIBS@
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/src/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    76.3 @@ -0,0 +1,711 @@
    76.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    76.5 +# @configure_input@
    76.6 +
    76.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    76.8 +# Free Software Foundation, Inc.
    76.9 +# This Makefile.in is free software; the Free Software Foundation
   76.10 +# gives unlimited permission to copy and/or distribute it,
   76.11 +# with or without modifications, as long as this notice is preserved.
   76.12 +
   76.13 +# This program is distributed in the hope that it will be useful,
   76.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   76.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   76.16 +# PARTICULAR PURPOSE.
   76.17 +
   76.18 +@SET_MAKE@
   76.19 +
   76.20 +srcdir = @srcdir@
   76.21 +top_srcdir = @top_srcdir@
   76.22 +VPATH = @srcdir@
   76.23 +pkgdatadir = $(datadir)/@PACKAGE@
   76.24 +pkglibdir = $(libdir)/@PACKAGE@
   76.25 +pkgincludedir = $(includedir)/@PACKAGE@
   76.26 +top_builddir = ..
   76.27 +
   76.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   76.29 +INSTALL = @INSTALL@
   76.30 +install_sh_DATA = $(install_sh) -c -m 644
   76.31 +install_sh_PROGRAM = $(install_sh) -c
   76.32 +install_sh_SCRIPT = $(install_sh) -c
   76.33 +INSTALL_HEADER = $(INSTALL_DATA)
   76.34 +transform = $(program_transform_name)
   76.35 +NORMAL_INSTALL = :
   76.36 +PRE_INSTALL = :
   76.37 +POST_INSTALL = :
   76.38 +NORMAL_UNINSTALL = :
   76.39 +PRE_UNINSTALL = :
   76.40 +POST_UNINSTALL = :
   76.41 +ACLOCAL = @ACLOCAL@
   76.42 +AMDEP_FALSE = @AMDEP_FALSE@
   76.43 +AMDEP_TRUE = @AMDEP_TRUE@
   76.44 +AMTAR = @AMTAR@
   76.45 +AUTOCONF = @AUTOCONF@
   76.46 +AUTOHEADER = @AUTOHEADER@
   76.47 +AUTOMAKE = @AUTOMAKE@
   76.48 +AWK = @AWK@
   76.49 +BASE64_LIBS = @BASE64_LIBS@
   76.50 +CC = @CC@
   76.51 +CCDEPMODE = @CCDEPMODE@
   76.52 +CFLAGS = @CFLAGS@
   76.53 +CPP = @CPP@
   76.54 +CPPFLAGS = @CPPFLAGS@
   76.55 +CYGPATH_W = @CYGPATH_W@
   76.56 +DEFS = @DEFS@
   76.57 +DEPDIR = @DEPDIR@
   76.58 +ECHO_C = @ECHO_C@
   76.59 +ECHO_N = @ECHO_N@
   76.60 +ECHO_T = @ECHO_T@
   76.61 +EGREP = @EGREP@
   76.62 +EXEEXT = @EXEEXT@
   76.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   76.64 +GLIB_LIBS = @GLIB_LIBS@
   76.65 +IDENT_LIBS = @IDENT_LIBS@
   76.66 +INSTALL_DATA = @INSTALL_DATA@
   76.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   76.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   76.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   76.70 +LDFLAGS = @LDFLAGS@
   76.71 +LIBOBJS = @LIBOBJS@
   76.72 +LIBS = @LIBS@
   76.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   76.74 +LTLIBOBJS = @LTLIBOBJS@
   76.75 +MAKEINFO = @MAKEINFO@
   76.76 +MD5_LIBS = @MD5_LIBS@
   76.77 +OBJEXT = @OBJEXT@
   76.78 +PACKAGE = @PACKAGE@
   76.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   76.80 +PACKAGE_NAME = @PACKAGE_NAME@
   76.81 +PACKAGE_STRING = @PACKAGE_STRING@
   76.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   76.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   76.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   76.85 +PKG_CONFIG = @PKG_CONFIG@
   76.86 +RANLIB = @RANLIB@
   76.87 +RESOLV_LIBS = @RESOLV_LIBS@
   76.88 +SET_MAKE = @SET_MAKE@
   76.89 +SHELL = @SHELL@
   76.90 +STRIP = @STRIP@
   76.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   76.92 +VERSION = @VERSION@
   76.93 +ac_ct_CC = @ac_ct_CC@
   76.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   76.95 +ac_ct_STRIP = @ac_ct_STRIP@
   76.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   76.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   76.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   76.99 +am__include = @am__include@
  76.100 +am__leading_dot = @am__leading_dot@
  76.101 +am__quote = @am__quote@
  76.102 +bindir = @bindir@
  76.103 +build_alias = @build_alias@
  76.104 +datadir = @datadir@
  76.105 +exec_prefix = @exec_prefix@
  76.106 +has_ident = @has_ident@
  76.107 +host_alias = @host_alias@
  76.108 +includedir = @includedir@
  76.109 +infodir = @infodir@
  76.110 +install_sh = @install_sh@
  76.111 +libdir = @libdir@
  76.112 +libexecdir = @libexecdir@
  76.113 +localstatedir = @localstatedir@
  76.114 +mandir = @mandir@
  76.115 +oldincludedir = @oldincludedir@
  76.116 +prefix = @prefix@
  76.117 +program_transform_name = @program_transform_name@
  76.118 +sbindir = @sbindir@
  76.119 +sharedstatedir = @sharedstatedir@
  76.120 +sysconfdir = @sysconfdir@
  76.121 +target_alias = @target_alias@
  76.122 +with_confdir = @with_confdir@
  76.123 +with_group = @with_group@
  76.124 +with_logdir = @with_logdir@
  76.125 +with_spooldir = @with_spooldir@
  76.126 +with_user = @with_user@
  76.127 +SUBDIRS = base64 md5 libident
  76.128 +
  76.129 +AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE -DG_DISABLE_DEPRECATED
  76.130 +
  76.131 +sbin_PROGRAMS = masqmail
  76.132 +bin_PROGRAMS = mservdetect
  76.133 +noinst_PROGRAMS = smtpsend readtest
  76.134 +
  76.135 +masqmail_SOURCES = \
  76.136 +	dotlock.h\
  76.137 +	masqmail.h\
  76.138 +	readsock.h\
  76.139 +	smtp_out.h\
  76.140 +	lookup.h\
  76.141 +	mserver.h\
  76.142 +	accept.c\
  76.143 +	address.c\
  76.144 +	alias.c\
  76.145 +	child.c\
  76.146 +	connect.c\
  76.147 +	conf.c\
  76.148 +	deliver.c\
  76.149 +	dotlock.c\
  76.150 +	expand.c\
  76.151 +	fail_msg.c\
  76.152 +	get.c\
  76.153 +	header.c\
  76.154 +	interface.c\
  76.155 +	local.c\
  76.156 +	log.c\
  76.157 +	listen.c\
  76.158 +	lookup.c\
  76.159 +	masqmail.c\
  76.160 +	message.c\
  76.161 +	mserver.c\
  76.162 +	online.c\
  76.163 +	parse.c\
  76.164 +	peopen.c\
  76.165 +	peopen.h\
  76.166 +	permissions.c\
  76.167 +	pop3_in.c\
  76.168 +	pop3_in.h\
  76.169 +	readsock.c\
  76.170 +	rewrite.c\
  76.171 +	route.c\
  76.172 +	queue.c\
  76.173 +	smtp_in.c\
  76.174 +	smtp_out.c\
  76.175 +	spool.c\
  76.176 +	tables.c\
  76.177 +	timeival.c
  76.178 +
  76.179 +
  76.180 +smtpsend_SOURCES = \
  76.181 +	smtpsend.c\
  76.182 +	masqmail.h\
  76.183 +	readsock.h\
  76.184 +	smtp_out.h\
  76.185 +	lookup.h\
  76.186 +	accept.c\
  76.187 +	address.c\
  76.188 +	child.c\
  76.189 +	connect.c\
  76.190 +	header.c\
  76.191 +	interface.c\
  76.192 +	lookup.c\
  76.193 +	message.c\
  76.194 +	parse.c\
  76.195 +	peopen.c\
  76.196 +	readsock.c\
  76.197 +	smtp_out.c
  76.198 +
  76.199 +
  76.200 +mservdetect_SOURCES = \
  76.201 +	masqmail.h\
  76.202 +	readsock.h\
  76.203 +	mserver.h\
  76.204 +	mservdetect.c\
  76.205 +	interface.c\
  76.206 +	mserver.c\
  76.207 +	readsock.c\
  76.208 +	peopen.c
  76.209 +
  76.210 +
  76.211 +readtest_SOURCES = \
  76.212 +	readsock.c\
  76.213 +	readsock.h\
  76.214 +	readtest.c
  76.215 +
  76.216 +
  76.217 +masqmail_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ @LOCKFILE_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ @IDENT_LIBS@
  76.218 +smtpsend_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ @MD5_LIBS@ @BASE64_LIBS@
  76.219 +mservdetect_LDADD = @GLIB_LIBS@
  76.220 +readtest_LDADD = @GLIB_LIBS@
  76.221 +subdir = src
  76.222 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  76.223 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  76.224 +CONFIG_HEADER = $(top_builddir)/config.h
  76.225 +CONFIG_CLEAN_FILES =
  76.226 +bin_PROGRAMS = mservdetect$(EXEEXT)
  76.227 +noinst_PROGRAMS = smtpsend$(EXEEXT) readtest$(EXEEXT)
  76.228 +sbin_PROGRAMS = masqmail$(EXEEXT)
  76.229 +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS)
  76.230 +
  76.231 +am_masqmail_OBJECTS = accept.$(OBJEXT) address.$(OBJEXT) alias.$(OBJEXT) \
  76.232 +	child.$(OBJEXT) connect.$(OBJEXT) conf.$(OBJEXT) \
  76.233 +	deliver.$(OBJEXT) dotlock.$(OBJEXT) expand.$(OBJEXT) \
  76.234 +	fail_msg.$(OBJEXT) get.$(OBJEXT) header.$(OBJEXT) \
  76.235 +	interface.$(OBJEXT) local.$(OBJEXT) log.$(OBJEXT) \
  76.236 +	listen.$(OBJEXT) lookup.$(OBJEXT) masqmail.$(OBJEXT) \
  76.237 +	message.$(OBJEXT) mserver.$(OBJEXT) online.$(OBJEXT) \
  76.238 +	parse.$(OBJEXT) peopen.$(OBJEXT) permissions.$(OBJEXT) \
  76.239 +	pop3_in.$(OBJEXT) readsock.$(OBJEXT) rewrite.$(OBJEXT) \
  76.240 +	route.$(OBJEXT) queue.$(OBJEXT) smtp_in.$(OBJEXT) \
  76.241 +	smtp_out.$(OBJEXT) spool.$(OBJEXT) tables.$(OBJEXT) \
  76.242 +	timeival.$(OBJEXT)
  76.243 +masqmail_OBJECTS = $(am_masqmail_OBJECTS)
  76.244 +masqmail_DEPENDENCIES =
  76.245 +masqmail_LDFLAGS =
  76.246 +am_mservdetect_OBJECTS = mservdetect.$(OBJEXT) interface.$(OBJEXT) \
  76.247 +	mserver.$(OBJEXT) readsock.$(OBJEXT) peopen.$(OBJEXT)
  76.248 +mservdetect_OBJECTS = $(am_mservdetect_OBJECTS)
  76.249 +mservdetect_DEPENDENCIES =
  76.250 +mservdetect_LDFLAGS =
  76.251 +am_readtest_OBJECTS = readsock.$(OBJEXT) readtest.$(OBJEXT)
  76.252 +readtest_OBJECTS = $(am_readtest_OBJECTS)
  76.253 +readtest_DEPENDENCIES =
  76.254 +readtest_LDFLAGS =
  76.255 +am_smtpsend_OBJECTS = smtpsend.$(OBJEXT) accept.$(OBJEXT) \
  76.256 +	address.$(OBJEXT) child.$(OBJEXT) connect.$(OBJEXT) \
  76.257 +	header.$(OBJEXT) interface.$(OBJEXT) lookup.$(OBJEXT) \
  76.258 +	message.$(OBJEXT) parse.$(OBJEXT) peopen.$(OBJEXT) \
  76.259 +	readsock.$(OBJEXT) smtp_out.$(OBJEXT)
  76.260 +smtpsend_OBJECTS = $(am_smtpsend_OBJECTS)
  76.261 +smtpsend_DEPENDENCIES =
  76.262 +smtpsend_LDFLAGS =
  76.263 +
  76.264 +DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
  76.265 +depcomp = $(SHELL) $(top_srcdir)/depcomp
  76.266 +am__depfiles_maybe = depfiles
  76.267 +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/address.Po \
  76.268 +@AMDEP_TRUE@	./$(DEPDIR)/alias.Po ./$(DEPDIR)/child.Po \
  76.269 +@AMDEP_TRUE@	./$(DEPDIR)/conf.Po ./$(DEPDIR)/connect.Po \
  76.270 +@AMDEP_TRUE@	./$(DEPDIR)/deliver.Po ./$(DEPDIR)/dotlock.Po \
  76.271 +@AMDEP_TRUE@	./$(DEPDIR)/expand.Po ./$(DEPDIR)/fail_msg.Po \
  76.272 +@AMDEP_TRUE@	./$(DEPDIR)/get.Po ./$(DEPDIR)/header.Po \
  76.273 +@AMDEP_TRUE@	./$(DEPDIR)/interface.Po ./$(DEPDIR)/listen.Po \
  76.274 +@AMDEP_TRUE@	./$(DEPDIR)/local.Po ./$(DEPDIR)/log.Po \
  76.275 +@AMDEP_TRUE@	./$(DEPDIR)/lookup.Po ./$(DEPDIR)/masqmail.Po \
  76.276 +@AMDEP_TRUE@	./$(DEPDIR)/message.Po ./$(DEPDIR)/mservdetect.Po \
  76.277 +@AMDEP_TRUE@	./$(DEPDIR)/mserver.Po ./$(DEPDIR)/online.Po \
  76.278 +@AMDEP_TRUE@	./$(DEPDIR)/parse.Po ./$(DEPDIR)/peopen.Po \
  76.279 +@AMDEP_TRUE@	./$(DEPDIR)/permissions.Po ./$(DEPDIR)/pop3_in.Po \
  76.280 +@AMDEP_TRUE@	./$(DEPDIR)/queue.Po ./$(DEPDIR)/readsock.Po \
  76.281 +@AMDEP_TRUE@	./$(DEPDIR)/readtest.Po ./$(DEPDIR)/rewrite.Po \
  76.282 +@AMDEP_TRUE@	./$(DEPDIR)/route.Po ./$(DEPDIR)/smtp_in.Po \
  76.283 +@AMDEP_TRUE@	./$(DEPDIR)/smtp_out.Po ./$(DEPDIR)/smtpsend.Po \
  76.284 +@AMDEP_TRUE@	./$(DEPDIR)/spool.Po ./$(DEPDIR)/tables.Po \
  76.285 +@AMDEP_TRUE@	./$(DEPDIR)/timeival.Po
  76.286 +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  76.287 +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  76.288 +CCLD = $(CC)
  76.289 +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
  76.290 +DIST_SOURCES = $(masqmail_SOURCES) $(mservdetect_SOURCES) \
  76.291 +	$(readtest_SOURCES) $(smtpsend_SOURCES)
  76.292 +
  76.293 +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
  76.294 +	ps-recursive install-info-recursive uninstall-info-recursive \
  76.295 +	all-recursive install-data-recursive install-exec-recursive \
  76.296 +	installdirs-recursive install-recursive uninstall-recursive \
  76.297 +	check-recursive installcheck-recursive
  76.298 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
  76.299 +DIST_SUBDIRS = $(SUBDIRS)
  76.300 +SOURCES = $(masqmail_SOURCES) $(mservdetect_SOURCES) $(readtest_SOURCES) $(smtpsend_SOURCES)
  76.301 +
  76.302 +all: all-recursive
  76.303 +
  76.304 +.SUFFIXES:
  76.305 +.SUFFIXES: .c .o .obj
  76.306 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  76.307 +	cd $(top_srcdir) && \
  76.308 +	  $(AUTOMAKE) --gnu  src/Makefile
  76.309 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  76.310 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  76.311 +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
  76.312 +install-binPROGRAMS: $(bin_PROGRAMS)
  76.313 +	@$(NORMAL_INSTALL)
  76.314 +	$(mkinstalldirs) $(DESTDIR)$(bindir)
  76.315 +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
  76.316 +	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
  76.317 +	  if test -f $$p \
  76.318 +	  ; then \
  76.319 +	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
  76.320 +	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
  76.321 +	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
  76.322 +	  else :; fi; \
  76.323 +	done
  76.324 +
  76.325 +uninstall-binPROGRAMS:
  76.326 +	@$(NORMAL_UNINSTALL)
  76.327 +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
  76.328 +	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
  76.329 +	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
  76.330 +	  rm -f $(DESTDIR)$(bindir)/$$f; \
  76.331 +	done
  76.332 +
  76.333 +clean-binPROGRAMS:
  76.334 +	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
  76.335 +
  76.336 +clean-noinstPROGRAMS:
  76.337 +	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
  76.338 +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
  76.339 +install-sbinPROGRAMS: $(sbin_PROGRAMS)
  76.340 +	@$(NORMAL_INSTALL)
  76.341 +	$(mkinstalldirs) $(DESTDIR)$(sbindir)
  76.342 +	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
  76.343 +	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
  76.344 +	  if test -f $$p \
  76.345 +	  ; then \
  76.346 +	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
  76.347 +	   echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
  76.348 +	   $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \
  76.349 +	  else :; fi; \
  76.350 +	done
  76.351 +
  76.352 +uninstall-sbinPROGRAMS:
  76.353 +	@$(NORMAL_UNINSTALL)
  76.354 +	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
  76.355 +	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
  76.356 +	  echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
  76.357 +	  rm -f $(DESTDIR)$(sbindir)/$$f; \
  76.358 +	done
  76.359 +
  76.360 +clean-sbinPROGRAMS:
  76.361 +	-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
  76.362 +masqmail$(EXEEXT): $(masqmail_OBJECTS) $(masqmail_DEPENDENCIES) 
  76.363 +	@rm -f masqmail$(EXEEXT)
  76.364 +	$(LINK) $(masqmail_LDFLAGS) $(masqmail_OBJECTS) $(masqmail_LDADD) $(LIBS)
  76.365 +mservdetect$(EXEEXT): $(mservdetect_OBJECTS) $(mservdetect_DEPENDENCIES) 
  76.366 +	@rm -f mservdetect$(EXEEXT)
  76.367 +	$(LINK) $(mservdetect_LDFLAGS) $(mservdetect_OBJECTS) $(mservdetect_LDADD) $(LIBS)
  76.368 +readtest$(EXEEXT): $(readtest_OBJECTS) $(readtest_DEPENDENCIES) 
  76.369 +	@rm -f readtest$(EXEEXT)
  76.370 +	$(LINK) $(readtest_LDFLAGS) $(readtest_OBJECTS) $(readtest_LDADD) $(LIBS)
  76.371 +smtpsend$(EXEEXT): $(smtpsend_OBJECTS) $(smtpsend_DEPENDENCIES) 
  76.372 +	@rm -f smtpsend$(EXEEXT)
  76.373 +	$(LINK) $(smtpsend_LDFLAGS) $(smtpsend_OBJECTS) $(smtpsend_LDADD) $(LIBS)
  76.374 +
  76.375 +mostlyclean-compile:
  76.376 +	-rm -f *.$(OBJEXT) core *.core
  76.377 +
  76.378 +distclean-compile:
  76.379 +	-rm -f *.tab.c
  76.380 +
  76.381 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@
  76.382 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/address.Po@am__quote@
  76.383 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@
  76.384 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/child.Po@am__quote@
  76.385 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@
  76.386 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Po@am__quote@
  76.387 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deliver.Po@am__quote@
  76.388 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dotlock.Po@am__quote@
  76.389 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expand.Po@am__quote@
  76.390 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fail_msg.Po@am__quote@
  76.391 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get.Po@am__quote@
  76.392 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/header.Po@am__quote@
  76.393 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@
  76.394 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Po@am__quote@
  76.395 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local.Po@am__quote@
  76.396 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
  76.397 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup.Po@am__quote@
  76.398 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masqmail.Po@am__quote@
  76.399 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@
  76.400 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mservdetect.Po@am__quote@
  76.401 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mserver.Po@am__quote@
  76.402 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/online.Po@am__quote@
  76.403 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@
  76.404 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peopen.Po@am__quote@
  76.405 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/permissions.Po@am__quote@
  76.406 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_in.Po@am__quote@
  76.407 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Po@am__quote@
  76.408 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readsock.Po@am__quote@
  76.409 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readtest.Po@am__quote@
  76.410 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite.Po@am__quote@
  76.411 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@
  76.412 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp_in.Po@am__quote@
  76.413 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp_out.Po@am__quote@
  76.414 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtpsend.Po@am__quote@
  76.415 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spool.Po@am__quote@
  76.416 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tables.Po@am__quote@
  76.417 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeival.Po@am__quote@
  76.418 +
  76.419 +.c.o:
  76.420 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
  76.421 +@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
  76.422 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
  76.423 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
  76.424 +@am__fastdepCC_TRUE@	fi
  76.425 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  76.426 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
  76.427 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  76.428 +@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
  76.429 +
  76.430 +.c.obj:
  76.431 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
  76.432 +@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
  76.433 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
  76.434 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
  76.435 +@am__fastdepCC_TRUE@	fi
  76.436 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  76.437 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
  76.438 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  76.439 +@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
  76.440 +uninstall-info-am:
  76.441 +
  76.442 +# This directory's subdirectories are mostly independent; you can cd
  76.443 +# into them and run `make' without going through this Makefile.
  76.444 +# To change the values of `make' variables: instead of editing Makefiles,
  76.445 +# (1) if the variable is set in `config.status', edit `config.status'
  76.446 +#     (which will cause the Makefiles to be regenerated when you run `make');
  76.447 +# (2) otherwise, pass the desired values on the `make' command line.
  76.448 +$(RECURSIVE_TARGETS):
  76.449 +	@set fnord $$MAKEFLAGS; amf=$$2; \
  76.450 +	dot_seen=no; \
  76.451 +	target=`echo $@ | sed s/-recursive//`; \
  76.452 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  76.453 +	  echo "Making $$target in $$subdir"; \
  76.454 +	  if test "$$subdir" = "."; then \
  76.455 +	    dot_seen=yes; \
  76.456 +	    local_target="$$target-am"; \
  76.457 +	  else \
  76.458 +	    local_target="$$target"; \
  76.459 +	  fi; \
  76.460 +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
  76.461 +	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  76.462 +	done; \
  76.463 +	if test "$$dot_seen" = "no"; then \
  76.464 +	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
  76.465 +	fi; test -z "$$fail"
  76.466 +
  76.467 +mostlyclean-recursive clean-recursive distclean-recursive \
  76.468 +maintainer-clean-recursive:
  76.469 +	@set fnord $$MAKEFLAGS; amf=$$2; \
  76.470 +	dot_seen=no; \
  76.471 +	case "$@" in \
  76.472 +	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
  76.473 +	  *) list='$(SUBDIRS)' ;; \
  76.474 +	esac; \
  76.475 +	rev=''; for subdir in $$list; do \
  76.476 +	  if test "$$subdir" = "."; then :; else \
  76.477 +	    rev="$$subdir $$rev"; \
  76.478 +	  fi; \
  76.479 +	done; \
  76.480 +	rev="$$rev ."; \
  76.481 +	target=`echo $@ | sed s/-recursive//`; \
  76.482 +	for subdir in $$rev; do \
  76.483 +	  echo "Making $$target in $$subdir"; \
  76.484 +	  if test "$$subdir" = "."; then \
  76.485 +	    local_target="$$target-am"; \
  76.486 +	  else \
  76.487 +	    local_target="$$target"; \
  76.488 +	  fi; \
  76.489 +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
  76.490 +	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  76.491 +	done && test -z "$$fail"
  76.492 +tags-recursive:
  76.493 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  76.494 +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
  76.495 +	done
  76.496 +ctags-recursive:
  76.497 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  76.498 +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
  76.499 +	done
  76.500 +
  76.501 +ETAGS = etags
  76.502 +ETAGSFLAGS =
  76.503 +
  76.504 +CTAGS = ctags
  76.505 +CTAGSFLAGS =
  76.506 +
  76.507 +tags: TAGS
  76.508 +
  76.509 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  76.510 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  76.511 +	unique=`for i in $$list; do \
  76.512 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  76.513 +	  done | \
  76.514 +	  $(AWK) '    { files[$$0] = 1; } \
  76.515 +	       END { for (i in files) print i; }'`; \
  76.516 +	mkid -fID $$unique
  76.517 +
  76.518 +TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  76.519 +		$(TAGS_FILES) $(LISP)
  76.520 +	tags=; \
  76.521 +	here=`pwd`; \
  76.522 +	if (etags --etags-include --version) >/dev/null 2>&1; then \
  76.523 +	  include_option=--etags-include; \
  76.524 +	else \
  76.525 +	  include_option=--include; \
  76.526 +	fi; \
  76.527 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  76.528 +	  if test "$$subdir" = .; then :; else \
  76.529 +	    test -f $$subdir/TAGS && \
  76.530 +	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
  76.531 +	  fi; \
  76.532 +	done; \
  76.533 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  76.534 +	unique=`for i in $$list; do \
  76.535 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  76.536 +	  done | \
  76.537 +	  $(AWK) '    { files[$$0] = 1; } \
  76.538 +	       END { for (i in files) print i; }'`; \
  76.539 +	test -z "$(ETAGS_ARGS)$$tags$$unique" \
  76.540 +	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  76.541 +	     $$tags $$unique
  76.542 +
  76.543 +ctags: CTAGS
  76.544 +CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  76.545 +		$(TAGS_FILES) $(LISP)
  76.546 +	tags=; \
  76.547 +	here=`pwd`; \
  76.548 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  76.549 +	unique=`for i in $$list; do \
  76.550 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  76.551 +	  done | \
  76.552 +	  $(AWK) '    { files[$$0] = 1; } \
  76.553 +	       END { for (i in files) print i; }'`; \
  76.554 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
  76.555 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  76.556 +	     $$tags $$unique
  76.557 +
  76.558 +GTAGS:
  76.559 +	here=`$(am__cd) $(top_builddir) && pwd` \
  76.560 +	  && cd $(top_srcdir) \
  76.561 +	  && gtags -i $(GTAGS_ARGS) $$here
  76.562 +
  76.563 +distclean-tags:
  76.564 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  76.565 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  76.566 +
  76.567 +top_distdir = ..
  76.568 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  76.569 +
  76.570 +distdir: $(DISTFILES)
  76.571 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  76.572 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  76.573 +	list='$(DISTFILES)'; for file in $$list; do \
  76.574 +	  case $$file in \
  76.575 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  76.576 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  76.577 +	  esac; \
  76.578 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  76.579 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  76.580 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  76.581 +	    dir="/$$dir"; \
  76.582 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  76.583 +	  else \
  76.584 +	    dir=''; \
  76.585 +	  fi; \
  76.586 +	  if test -d $$d/$$file; then \
  76.587 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  76.588 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  76.589 +	    fi; \
  76.590 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  76.591 +	  else \
  76.592 +	    test -f $(distdir)/$$file \
  76.593 +	    || cp -p $$d/$$file $(distdir)/$$file \
  76.594 +	    || exit 1; \
  76.595 +	  fi; \
  76.596 +	done
  76.597 +	list='$(SUBDIRS)'; for subdir in $$list; do \
  76.598 +	  if test "$$subdir" = .; then :; else \
  76.599 +	    test -d $(distdir)/$$subdir \
  76.600 +	    || mkdir $(distdir)/$$subdir \
  76.601 +	    || exit 1; \
  76.602 +	    (cd $$subdir && \
  76.603 +	      $(MAKE) $(AM_MAKEFLAGS) \
  76.604 +	        top_distdir="$(top_distdir)" \
  76.605 +	        distdir=../$(distdir)/$$subdir \
  76.606 +	        distdir) \
  76.607 +	      || exit 1; \
  76.608 +	  fi; \
  76.609 +	done
  76.610 +check-am: all-am
  76.611 +check: check-recursive
  76.612 +all-am: Makefile $(PROGRAMS)
  76.613 +installdirs: installdirs-recursive
  76.614 +installdirs-am:
  76.615 +	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir)
  76.616 +
  76.617 +install: install-recursive
  76.618 +install-exec: install-exec-recursive
  76.619 +install-data: install-data-recursive
  76.620 +uninstall: uninstall-recursive
  76.621 +
  76.622 +install-am: all-am
  76.623 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  76.624 +
  76.625 +installcheck: installcheck-recursive
  76.626 +install-strip:
  76.627 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  76.628 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  76.629 +	  `test -z '$(STRIP)' || \
  76.630 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  76.631 +mostlyclean-generic:
  76.632 +
  76.633 +clean-generic:
  76.634 +
  76.635 +distclean-generic:
  76.636 +	-rm -f $(CONFIG_CLEAN_FILES)
  76.637 +
  76.638 +maintainer-clean-generic:
  76.639 +	@echo "This command is intended for maintainers to use"
  76.640 +	@echo "it deletes files that may require special tools to rebuild."
  76.641 +clean: clean-recursive
  76.642 +
  76.643 +clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
  76.644 +	clean-sbinPROGRAMS mostlyclean-am
  76.645 +
  76.646 +distclean: distclean-recursive
  76.647 +	-rm -rf ./$(DEPDIR)
  76.648 +	-rm -f Makefile
  76.649 +distclean-am: clean-am distclean-compile distclean-generic \
  76.650 +	distclean-tags
  76.651 +
  76.652 +dvi: dvi-recursive
  76.653 +
  76.654 +dvi-am:
  76.655 +
  76.656 +info: info-recursive
  76.657 +
  76.658 +info-am:
  76.659 +
  76.660 +install-data-am:
  76.661 +
  76.662 +install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
  76.663 +
  76.664 +install-info: install-info-recursive
  76.665 +
  76.666 +install-man:
  76.667 +
  76.668 +installcheck-am:
  76.669 +
  76.670 +maintainer-clean: maintainer-clean-recursive
  76.671 +	-rm -rf ./$(DEPDIR)
  76.672 +	-rm -f Makefile
  76.673 +maintainer-clean-am: distclean-am maintainer-clean-generic
  76.674 +
  76.675 +mostlyclean: mostlyclean-recursive
  76.676 +
  76.677 +mostlyclean-am: mostlyclean-compile mostlyclean-generic
  76.678 +
  76.679 +pdf: pdf-recursive
  76.680 +
  76.681 +pdf-am:
  76.682 +
  76.683 +ps: ps-recursive
  76.684 +
  76.685 +ps-am:
  76.686 +
  76.687 +uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
  76.688 +	uninstall-sbinPROGRAMS
  76.689 +
  76.690 +uninstall-info: uninstall-info-recursive
  76.691 +
  76.692 +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
  76.693 +	clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
  76.694 +	clean-recursive clean-sbinPROGRAMS ctags ctags-recursive \
  76.695 +	distclean distclean-compile distclean-generic \
  76.696 +	distclean-recursive distclean-tags distdir dvi dvi-am \
  76.697 +	dvi-recursive info info-am info-recursive install install-am \
  76.698 +	install-binPROGRAMS install-data install-data-am \
  76.699 +	install-data-recursive install-exec install-exec-am \
  76.700 +	install-exec-recursive install-info install-info-am \
  76.701 +	install-info-recursive install-man install-recursive \
  76.702 +	install-sbinPROGRAMS install-strip installcheck installcheck-am \
  76.703 +	installdirs installdirs-am installdirs-recursive \
  76.704 +	maintainer-clean maintainer-clean-generic \
  76.705 +	maintainer-clean-recursive mostlyclean mostlyclean-compile \
  76.706 +	mostlyclean-generic mostlyclean-recursive pdf pdf-am \
  76.707 +	pdf-recursive ps ps-am ps-recursive tags tags-recursive \
  76.708 +	uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \
  76.709 +	uninstall-info-recursive uninstall-recursive \
  76.710 +	uninstall-sbinPROGRAMS
  76.711 +
  76.712 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  76.713 +# Otherwise a system limit (for SysV at least) may be exceeded.
  76.714 +.NOEXPORT:
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/src/accept.c	Fri Sep 26 17:05:23 2008 +0200
    77.3 @@ -0,0 +1,478 @@
    77.4 +/*  MasqMail
    77.5 +    Copyright (C) 1999-2001 Oliver Kurth
    77.6 +
    77.7 +    This program is free software; you can redistribute it and/or modify
    77.8 +    it under the terms of the GNU General Public License as published by
    77.9 +    the Free Software Foundation; either version 2 of the License, or
   77.10 +    (at your option) any later version.
   77.11 +
   77.12 +    This program is distributed in the hope that it will be useful,
   77.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   77.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   77.15 +    GNU General Public License for more details.
   77.16 +
   77.17 +    You should have received a copy of the GNU General Public License
   77.18 +    along with this program; if not, write to the Free Software
   77.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   77.20 +*/
   77.21 +
   77.22 +#include "masqmail.h"
   77.23 +#include "readsock.h"
   77.24 +
   77.25 +gchar *prot_names[] =
   77.26 +{
   77.27 +  "local",
   77.28 +  "bsmtp",
   77.29 +  "smtp",
   77.30 +  "esmtp",
   77.31 +  "pop3",
   77.32 +  "apop",
   77.33 +  "(unknown)" /* should not happen, but better than crashing. */
   77.34 +};
   77.35 +
   77.36 +static
   77.37 +gchar *string_base62(gchar *res, guint value, gchar len)
   77.38 +{
   77.39 +  static gchar base62_chars[] =
   77.40 +    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
   77.41 +  gchar *p = res + len;
   77.42 +  *p = 0;
   77.43 +  while (p > res){
   77.44 +    *(--p) = base62_chars[value % 62];
   77.45 +    value /= 62;
   77.46 +  }
   77.47 +  return res;
   77.48 +}
   77.49 +
   77.50 +static gint _g_list_addr_isequal(gconstpointer a, gconstpointer b)
   77.51 +{
   77.52 +  address *addr1 = (address *)a;
   77.53 +  address *addr2 = (address *)b;
   77.54 +  int ret;
   77.55 +
   77.56 +  if((ret = strcasecmp(addr1->domain, addr2->domain)) == 0)
   77.57 +    return strcmp(addr1->local_part, addr2->local_part);
   77.58 +  else
   77.59 +    return ret;
   77.60 +}
   77.61 +
   77.62 +/* accept message from anywhere.
   77.63 +   A locally originating message is indicated by msg->recieved_host == NULL
   77.64 +
   77.65 +   If the flags ACC_DEL_RCPTS is set, recipients in the msg->rcpt_list is
   77.66 +   copied and items occuring in it will be removed from the newly constructed
   77.67 +   (from To/Cc/Bcc headers if ACC_RCPT_TO is set) rcpt_list.
   77.68 +*/
   77.69 +
   77.70 +accept_error accept_message_stream(FILE *in, message *msg, guint flags)
   77.71 +{
   77.72 +  gchar *line, *line1;
   77.73 +  int line_size = MAX_DATALINE;
   77.74 +  gboolean in_headers = TRUE;
   77.75 +  header *hdr = NULL;
   77.76 +  gint line_cnt = 0, data_size = 0;
   77.77 +
   77.78 +  line = g_malloc(line_size);
   77.79 +  line[0] = 0;
   77.80 +
   77.81 +  while(TRUE){
   77.82 +    int len = read_sockline1(in, &line, &line_size, 5*60, READSOCKL_CVT_CRLF);
   77.83 +
   77.84 +    line1 = line;
   77.85 +
   77.86 +    if((line[0] == '.') && (!(flags & ACC_NODOT_TERM))){
   77.87 +      if(line[1] == '\n'){
   77.88 +	g_free(line);
   77.89 +	break;
   77.90 +      }
   77.91 +      line1++;
   77.92 +    }
   77.93 +    
   77.94 +    if(len <= 0){
   77.95 +      if((len == -1) && ((flags & ACC_NODOT_TERM) || (flags & ACC_NODOT_RELAX))){
   77.96 +	/* we got an EOF, and the last line was not terminated by a CR */
   77.97 +	gint len1 = strlen(line1);
   77.98 +	if(len1 > 0){ /* == 0 is 'normal' (EOF after a CR) */
   77.99 +	  if(line1[len1-1] != '\n'){ /* some mail clients allow unterminated lines */
  77.100 +	    line1[len1] = '\n';
  77.101 +	    line1[len1+1] = 0;
  77.102 +	    msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1));
  77.103 +	    data_size += strlen(line1);
  77.104 +	    line_cnt++;
  77.105 +	  }
  77.106 +	}
  77.107 +	break;
  77.108 +      }else{
  77.109 +	g_free(line);
  77.110 +	if(len == -1){
  77.111 +	  return AERR_EOF;
  77.112 +	}else if(len == -2){
  77.113 +	  /* should not happen any more */
  77.114 +	  return AERR_OVERFLOW;
  77.115 +	}else if(len == -3){
  77.116 +	  return AERR_TIMEOUT;
  77.117 +	}else{
  77.118 +	  /* does not happen */
  77.119 +	  DEBUG(5) debugf("read_sockline returned %d\n", len);
  77.120 +	  return AERR_UNKNOWN;
  77.121 +	}
  77.122 +      }
  77.123 +    }
  77.124 +    else{
  77.125 +      if(in_headers){
  77.126 +
  77.127 +	/* some pop servers send the 'From ' line, skip it: */
  77.128 +	if(msg->hdr_list == NULL)
  77.129 +	  if(strncmp(line1, "From ", 5) == 0)
  77.130 +	    continue;
  77.131 +
  77.132 +	if(line1[0] == ' ' || line1[0] == '\t'){
  77.133 +	  /* continuation of 'folded' header: */
  77.134 +	  if(hdr){
  77.135 +	    hdr->header = g_strconcat(hdr->header, line1, NULL);
  77.136 +	  }
  77.137 +
  77.138 +	}else if(line1[0] == '\n'){
  77.139 +	  /* an empty line marks end of headers */
  77.140 +	  in_headers = FALSE;
  77.141 +	}else{
  77.142 +	  /* in all other cases we expect another header */
  77.143 +	  if((hdr = get_header(line1)))
  77.144 +	    msg->hdr_list = g_list_append(msg->hdr_list, hdr);
  77.145 +	  else{
  77.146 +	    /* if get_header() returns NULL, no header was recognized,
  77.147 +	       so this seems to be the first data line of a broken mailer
  77.148 +	       which does not send an empty line after the headers */
  77.149 +	    in_headers = FALSE;
  77.150 +	    msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1));
  77.151 +	  }
  77.152 +	}
  77.153 +      }else{
  77.154 +	msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1));
  77.155 +	data_size += strlen(line1);
  77.156 +	line_cnt++;
  77.157 +      }
  77.158 +    }
  77.159 +  }
  77.160 +
  77.161 +  if(msg->data_list != NULL)
  77.162 +    msg->data_list = g_list_reverse(msg->data_list);
  77.163 +  else
  77.164 +    /* make sure data list is not NULL: */
  77.165 +    msg->data_list = g_list_append(NULL, g_strdup(""));
  77.166 +
  77.167 +  DEBUG(4) debugf("received %d lines of data (%d bytes)\n",
  77.168 +		  line_cnt, data_size);
  77.169 +  /* we get here after we succesfully
  77.170 +     received the mail data */
  77.171 +
  77.172 +  msg->data_size = data_size;
  77.173 +  msg->received_time = time(NULL);
  77.174 +
  77.175 +  return AERR_OK;
  77.176 +}
  77.177 +
  77.178 +accept_error accept_message_prepare(message *msg, guint flags)
  77.179 +{
  77.180 +  struct passwd *passwd = NULL;
  77.181 +  GList *non_rcpt_list = NULL;
  77.182 +  time_t rec_time = time(NULL);
  77.183 +
  77.184 +  DEBUG(5) debugf("accept_message_prepare()\n");
  77.185 +
  77.186 +  /* create unique message id */
  77.187 +  msg->uid = g_malloc(14);
  77.188 +
  77.189 +  string_base62(msg->uid, rec_time, 6);
  77.190 +  msg->uid[6] = '-';
  77.191 +  string_base62(&(msg->uid[7]), getpid(), 3);
  77.192 +  msg->uid[10] = '-';
  77.193 +  string_base62(&(msg->uid[11]), msg->transfer_id, 2);
  77.194 +  msg->uid[13] = 0;
  77.195 +
  77.196 +  /* if local, get password entry */
  77.197 +  if(msg->received_host == NULL){
  77.198 +    passwd = g_memdup(getpwuid(geteuid()), sizeof(struct passwd));
  77.199 +    msg->ident = g_strdup(passwd->pw_name);
  77.200 +  }
  77.201 +
  77.202 +  /* set return path if local */
  77.203 +  if(msg->return_path == NULL){
  77.204 +
  77.205 +    if(msg->received_host == NULL){
  77.206 +      gchar *path = g_strdup_printf("<%s@%s>",
  77.207 +				    passwd->pw_name, conf.host_name);
  77.208 +      DEBUG(3) debugf("setting return_path for local accept: %s\n", path);
  77.209 +      msg->return_path = create_address(path, TRUE);
  77.210 +      g_free(path);
  77.211 +    }
  77.212 +  }
  77.213 +
  77.214 +  /* -t option */
  77.215 +  if(flags & ACC_DEL_RCPTS){
  77.216 +    non_rcpt_list = msg->rcpt_list;
  77.217 +    msg->rcpt_list = NULL;
  77.218 +  }
  77.219 +
  77.220 +  /* scan headers */
  77.221 +  {
  77.222 +    gboolean has_id = FALSE;
  77.223 +    gboolean has_date = FALSE;
  77.224 +    gboolean has_sender = FALSE;
  77.225 +    gboolean has_from = FALSE;
  77.226 +    gboolean has_rcpt = FALSE;
  77.227 +    gboolean has_to_or_cc = FALSE;
  77.228 +    GList *hdr_node, *hdr_node_next;
  77.229 +    header *hdr;
  77.230 +
  77.231 +    for(hdr_node = g_list_first(msg->hdr_list);
  77.232 +	hdr_node != NULL;
  77.233 +	hdr_node = hdr_node_next){
  77.234 +      hdr_node_next = g_list_next(hdr_node);
  77.235 +      hdr = ((header *)(hdr_node->data));
  77.236 +      DEBUG(5) debugf("scanning headers: %s", hdr->header);
  77.237 +      switch(hdr->id){
  77.238 +      case HEAD_MESSAGE_ID:
  77.239 +	has_id = TRUE; break;
  77.240 +      case HEAD_DATE:
  77.241 +	has_date = TRUE; break;
  77.242 +      case HEAD_FROM:
  77.243 +	has_from = TRUE;
  77.244 +	break;
  77.245 +      case HEAD_SENDER:
  77.246 +	has_sender = TRUE;
  77.247 +	break;
  77.248 +      case HEAD_TO:
  77.249 +      case HEAD_CC:
  77.250 +      case HEAD_BCC:
  77.251 +	has_rcpt = TRUE;
  77.252 +	if(flags & ACC_RCPT_FROM_HEAD){
  77.253 +	  DEBUG(5) debugf("hdr->value = %s\n", hdr->value);
  77.254 +	  if(hdr->value){
  77.255 +	    msg->rcpt_list =
  77.256 +	      addr_list_append_rfc822(msg->rcpt_list, hdr->value, conf.host_name);
  77.257 +	  }
  77.258 +	}
  77.259 +	if((flags & ACC_DEL_BCC) && (hdr->id == HEAD_BCC)){
  77.260 +	  DEBUG(3) debugf("removing 'Bcc' header\n");
  77.261 +	  msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node);
  77.262 +	  g_list_free_1(hdr_node);
  77.263 +	  destroy_header(hdr);
  77.264 +	}else
  77.265 +	  has_to_or_cc = TRUE;
  77.266 +	break;
  77.267 +      case HEAD_ENVELOPE_TO:
  77.268 +	if(flags & ACC_SAVE_ENVELOPE_TO){
  77.269 +	  DEBUG(3) debugf("creating 'X-Orig-Envelope-To' header\n");
  77.270 +	  msg->hdr_list =
  77.271 +	    g_list_prepend(msg->hdr_list,
  77.272 +			  create_header(HEAD_UNKNOWN,
  77.273 +					"X-Orig-Envelope-to: %s", hdr->value));
  77.274 +	}
  77.275 +	DEBUG(3) debugf("removing 'Envelope-To' header\n");
  77.276 +	msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node);
  77.277 +	g_list_free_1(hdr_node);
  77.278 +	destroy_header(hdr);
  77.279 +	break;
  77.280 +      case HEAD_RETURN_PATH:
  77.281 +	if(flags & ACC_MAIL_FROM_HEAD){
  77.282 +	  /* usually POP3 accept */
  77.283 +	  msg->return_path = create_address_qualified(hdr->value, TRUE, msg->received_host);
  77.284 +	  DEBUG(3) debugf("setting return_path to %s\n",
  77.285 +			  addr_string(msg->return_path));
  77.286 +	}
  77.287 +	DEBUG(3) debugf("removing 'Return-Path' header\n");
  77.288 +	msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node);
  77.289 +	g_list_free_1(hdr_node);
  77.290 +	destroy_header(hdr);
  77.291 +	break;
  77.292 +      default:
  77.293 +	break; /* make compiler happy */
  77.294 +      }
  77.295 +    }
  77.296 +
  77.297 +    if(msg->return_path == NULL){
  77.298 +      /* this can happen for pop3 accept only
  77.299 +	 and if no Return-path: header was given */
  77.300 +      GList *hdr_list;
  77.301 +      header *hdr;
  77.302 +
  77.303 +      DEBUG(3) debugf("return_path == NULL\n");
  77.304 +
  77.305 +      hdr_list = find_header(msg->hdr_list, HEAD_SENDER, NULL);
  77.306 +      if(!hdr_list) hdr_list = find_header(msg->hdr_list, HEAD_FROM, NULL);
  77.307 +      if(hdr_list){
  77.308 +	gchar *addr;
  77.309 +	hdr = (header *)(g_list_first(hdr_list)->data);
  77.310 +
  77.311 +	DEBUG(5) debugf("hdr->value = '%s'\n", hdr->value);
  77.312 +
  77.313 +	addr = g_strdup(hdr->value);
  77.314 +	g_strchomp(addr);
  77.315 +
  77.316 +	if((msg->return_path =
  77.317 +	    create_address_qualified(addr, FALSE, msg->received_host))
  77.318 +	   != NULL){
  77.319 +	  DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path));
  77.320 +	  msg->hdr_list =
  77.321 +	    g_list_append(msg->hdr_list,
  77.322 +			  create_header(HEAD_UNKNOWN,
  77.323 +					"X-Warning: return path set from %s address\n",
  77.324 +					hdr->id == HEAD_SENDER ? "Sender:" : "From:"));
  77.325 +	}
  77.326 +	g_free(addr);
  77.327 +      }
  77.328 +      if(msg->return_path == NULL){ /* no Sender: or From: or create_address_qualified failed */
  77.329 +	msg->return_path = create_address_qualified("postmaster", TRUE, conf.host_name);
  77.330 +	DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path));
  77.331 +	msg->hdr_list =
  77.332 +	  g_list_append(msg->hdr_list,
  77.333 +			create_header(HEAD_UNKNOWN,
  77.334 +				      "X-Warning: real return path is unkown\n"));
  77.335 +      }
  77.336 +    }
  77.337 +
  77.338 +    if(flags & ACC_DEL_RCPTS){
  77.339 +      GList *rcpt_node;
  77.340 +      foreach(non_rcpt_list, rcpt_node){
  77.341 +	address *rcpt = (address *)(rcpt_node->data);
  77.342 +	GList *node;
  77.343 +	if((node = g_list_find_custom(msg->rcpt_list, rcpt,
  77.344 +				     _g_list_addr_isequal))){
  77.345 +	  DEBUG(3) debugf("removing rcpt address %s\n", addr_string(node->data));
  77.346 +
  77.347 +	  msg->rcpt_list = g_list_remove_link(msg->rcpt_list, node);
  77.348 +	  destroy_address((address *)(node->data));
  77.349 +	  g_list_free_1(node);
  77.350 +	}
  77.351 +      }
  77.352 +    }
  77.353 +
  77.354 +    /* here we should have our recipients, fail if not: */
  77.355 +    if(msg->rcpt_list == NULL){
  77.356 +      logwrite(LOG_WARNING, "no recipients found in message\n");
  77.357 +      return AERR_NORCPT;
  77.358 +    }
  77.359 +
  77.360 +    if(!(has_sender || has_from)){
  77.361 +      DEBUG(3) debugf("adding 'From' header\n");
  77.362 +      msg->hdr_list =
  77.363 +	g_list_append(msg->hdr_list,
  77.364 +		      msg->full_sender_name ?
  77.365 +		      create_header(HEAD_FROM, "From: \"%s\" <%s@%s>\n",
  77.366 +				    msg->full_sender_name,
  77.367 +				    msg->return_path->local_part,
  77.368 +				    msg->return_path->domain) :
  77.369 +		      create_header(HEAD_FROM, "From: <%s@%s>\n",
  77.370 +				    msg->return_path->local_part,
  77.371 +				    msg->return_path->domain)
  77.372 +		      );
  77.373 +    }
  77.374 +    if((flags & ACC_HEAD_FROM_RCPT) && !has_rcpt){
  77.375 +      GList *node;
  77.376 +      DEBUG(3) debugf("adding 'To' header(s)\n");
  77.377 +      for(node = g_list_first(msg->rcpt_list);
  77.378 +	  node;
  77.379 +	  node = g_list_next(node)){
  77.380 +	msg->hdr_list =
  77.381 +	  g_list_append(msg->hdr_list,
  77.382 +			create_header(HEAD_TO, "To: %s\n", addr_string(msg->return_path)));
  77.383 +      }
  77.384 +    }
  77.385 +    if((flags & ACC_DEL_BCC) && !has_to_or_cc){
  77.386 +      /* Bcc headers have been removed, and there are no remaining rcpt headers */
  77.387 +      DEBUG(3) debugf("adding empty 'Bcc:' header\n");
  77.388 +      msg->hdr_list =
  77.389 +	g_list_append(msg->hdr_list, create_header(HEAD_BCC, "Bcc:\n"));
  77.390 +    }
  77.391 +    if(!has_date){
  77.392 +      DEBUG(3) debugf("adding 'Date:' header\n");
  77.393 +      msg->hdr_list =
  77.394 +	g_list_append(msg->hdr_list,
  77.395 +		      create_header(HEAD_DATE, "Date: %s\n", rec_timestamp()));
  77.396 +    }
  77.397 +    if(!has_id){
  77.398 +      DEBUG(3) debugf("adding 'Message-ID:' header\n");
  77.399 +      msg->hdr_list =
  77.400 +	g_list_append(msg->hdr_list,
  77.401 +		      create_header(HEAD_MESSAGE_ID,
  77.402 +				    "Message-ID: <%s@%s>\n",
  77.403 +				    msg->uid, conf.host_name));
  77.404 +    }
  77.405 +  }
  77.406 +
  77.407 +  /* Received header: */
  77.408 +  /* At this point because we have to know the rcpts for the 'for' part */
  77.409 +  if(!(flags & ACC_NO_RECVD_HDR)){
  77.410 +    gchar *for_string = NULL;
  77.411 +    header *hdr = NULL;
  77.412 +
  77.413 +    DEBUG(3) debugf("adding 'Received:' header\n");
  77.414 +
  77.415 +    if(g_list_length(msg->rcpt_list) == 1){
  77.416 +      address *addr = (address *)(g_list_first(msg->rcpt_list)->data);
  77.417 +      for_string = g_strdup_printf(" for %s", addr_string(addr));
  77.418 +    }
  77.419 +
  77.420 +    if(msg->received_host == NULL){
  77.421 +      hdr = create_header(HEAD_RECEIVED,
  77.422 +			  "Received: from %s by %s"
  77.423 +			  " with %s (%s %s) id %s%s;"
  77.424 +			  " %s\n",
  77.425 +			  passwd->pw_name, conf.host_name,
  77.426 +			  prot_names[msg->received_prot],
  77.427 +			  PACKAGE, VERSION,
  77.428 +			  msg->uid, for_string ? for_string : "",
  77.429 +			  rec_timestamp());
  77.430 +    }else{
  77.431 +#ifdef ENABLE_IDENT
  77.432 +      DEBUG(5) debugf("adding 'Received:' header (5)\n");
  77.433 +      hdr = create_header(HEAD_RECEIVED,
  77.434 +			  "Received: from %s (ident=%s) by %s"
  77.435 +			  " with %s (%s %s) id %s%s;"
  77.436 +			  " %s\n",
  77.437 +			  msg->received_host,
  77.438 +			  msg->ident ? msg->ident : "unknown",
  77.439 +			  conf.host_name,
  77.440 +			  prot_names[msg->received_prot],
  77.441 +			  PACKAGE, VERSION,
  77.442 +			  msg->uid, for_string ? for_string : "",
  77.443 +			  rec_timestamp());
  77.444 +#else
  77.445 +      hdr = create_header(HEAD_RECEIVED,
  77.446 +			  "Received: from %s by %s"
  77.447 +			  " with %s (%s %s) id %s%s;"
  77.448 +			  " %s\n",
  77.449 +			  msg->received_host,
  77.450 +			  conf.host_name,
  77.451 +			  prot_names[msg->received_prot],
  77.452 +			  PACKAGE, VERSION,
  77.453 +			  msg->uid, for_string ? for_string : "",
  77.454 +			  rec_timestamp());
  77.455 +#endif
  77.456 +    }
  77.457 +    header_fold(hdr);
  77.458 +    msg->hdr_list = g_list_prepend(msg->hdr_list, hdr);
  77.459 +
  77.460 +    if(for_string) g_free(for_string);
  77.461 +  }
  77.462 +
  77.463 +  /* write message to spool: */
  77.464 +  /* accept is no longer responsible for this
  77.465 +  if(!spool_write(msg, TRUE))
  77.466 +    return AERR_NOSPOOL;
  77.467 +  */
  77.468 +  return AERR_OK;
  77.469 +}
  77.470 +
  77.471 +accept_error accept_message(FILE *in, message *msg, guint flags)
  77.472 +{
  77.473 +  accept_error err;
  77.474 +
  77.475 +  err = accept_message_stream(in, msg, flags);
  77.476 +  if(err == AERR_OK)
  77.477 +    err =  accept_message_prepare(msg, flags);
  77.478 +
  77.479 +  return err;
  77.480 +}
  77.481 +
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/src/address.c	Fri Sep 26 17:05:23 2008 +0200
    78.3 @@ -0,0 +1,189 @@
    78.4 +/*  MasqMail
    78.5 +    Copyright (C) 1999-2001 Oliver Kurth
    78.6 +
    78.7 +    This program is free software; you can redistribute it and/or modify
    78.8 +    it under the terms of the GNU General Public License as published by
    78.9 +    the Free Software Foundation; either version 2 of the License, or
   78.10 +    (at your option) any later version.
   78.11 +
   78.12 +    This program is distributed in the hope that it will be useful,
   78.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   78.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   78.15 +    GNU General Public License for more details.
   78.16 +
   78.17 +    You should have received a copy of the GNU General Public License
   78.18 +    along with this program; if not, write to the Free Software
   78.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   78.20 +*/
   78.21 +
   78.22 +#include "masqmail.h"
   78.23 +#include <fnmatch.h>
   78.24 +
   78.25 +address *create_address(gchar *path, gboolean is_rfc821)
   78.26 +{
   78.27 +  address *addr;
   78.28 +  addr = _create_address(path, NULL, is_rfc821);
   78.29 +  
   78.30 +  if(addr != NULL){
   78.31 +    addr_unmark_delivered(addr);
   78.32 +  }
   78.33 +  return addr;
   78.34 +}
   78.35 +
   78.36 +address *create_address_qualified(gchar *path, gboolean is_rfc821,
   78.37 +				  gchar *domain)
   78.38 +{
   78.39 +  address *addr = create_address(path, is_rfc821);
   78.40 +  if(addr != NULL){
   78.41 +    if(addr->domain == NULL)
   78.42 +      addr->domain = g_strdup(domain);
   78.43 +  }
   78.44 +
   78.45 +  return addr;
   78.46 +}
   78.47 +
   78.48 +/* nothing special about pipes here,
   78.49 +   but its only called for that purpose */
   78.50 +address *create_address_pipe(gchar *path)
   78.51 +{
   78.52 +  address *addr = g_malloc(sizeof(address));
   78.53 +
   78.54 +  if(addr){
   78.55 +    memset(addr, 0, sizeof(address));
   78.56 +    addr->address = g_strchomp(g_strdup(path));
   78.57 +    addr->local_part = g_strdup(addr->address);
   78.58 +  
   78.59 +    addr->domain = g_strdup("localhost"); /* quick hack */
   78.60 +  }
   78.61 +  return addr;
   78.62 +}
   78.63 +
   78.64 +void destroy_address(address *addr)
   78.65 +{
   78.66 +  DEBUG(6) debugf("destroy_address entered\n");
   78.67 +
   78.68 +  g_free(addr->address);
   78.69 +  g_free(addr->local_part);
   78.70 +  g_free(addr->domain);
   78.71 +
   78.72 +  g_free(addr);
   78.73 +}
   78.74 +
   78.75 +address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom)
   78.76 +{
   78.77 +  address *addr = NULL;
   78.78 +
   78.79 +  if(orig){
   78.80 +    addr = g_malloc(sizeof(address));
   78.81 +    if(addr){
   78.82 +      addr->address = g_strdup(orig->address);
   78.83 +
   78.84 +      if(l_part == NULL)
   78.85 +	addr->local_part = g_strdup(orig->local_part);
   78.86 +      else
   78.87 +	addr->local_part = g_strdup(l_part);
   78.88 +
   78.89 +      if(dom == NULL)
   78.90 +	addr->domain = g_strdup(orig->domain);
   78.91 +      else
   78.92 +	addr->domain = g_strdup(dom);
   78.93 +
   78.94 +      addr->flags = 0;
   78.95 +      addr->children = NULL;
   78.96 +      addr->parent = NULL;
   78.97 +    }
   78.98 +  }
   78.99 +  return addr;
  78.100 +}
  78.101 +
  78.102 +gboolean addr_isequal(address *addr1, address *addr2)
  78.103 +{
  78.104 +  return
  78.105 +    (strcmp(addr1->local_part, addr2->local_part) == 0) &&
  78.106 +    (strcasecmp(addr1->domain, addr2->domain) == 0);
  78.107 +}
  78.108 +
  78.109 +/* searches in ancestors of addr1 */
  78.110 +gboolean addr_isequal_parent(address *addr1, address *addr2)
  78.111 +{
  78.112 +  address *addr;
  78.113 +
  78.114 +  for(addr = addr1; addr; addr = addr->parent)
  78.115 +    if(addr_isequal(addr, addr2))
  78.116 +      return TRUE;
  78.117 +
  78.118 +  return FALSE;
  78.119 +}
  78.120 +
  78.121 +/* careful, this is recursive */
  78.122 +/* returns TRUE if ALL children have been delivered */
  78.123 +gboolean addr_is_delivered_children(address *addr)
  78.124 +{
  78.125 +  GList *addr_node;
  78.126 +
  78.127 +  if(addr->children == NULL) return addr_is_delivered(addr);
  78.128 +
  78.129 +  foreach(addr->children, addr_node){
  78.130 +    address *addr = (address *)(addr_node->data);
  78.131 +    if(!addr_is_delivered_children(addr))
  78.132 +      return FALSE;
  78.133 +  }
  78.134 +  return TRUE;
  78.135 +}
  78.136 +
  78.137 +/* careful, this is recursive */
  78.138 +/* returns TRUE if ALL children have been either delivered or have failed */
  78.139 +gboolean addr_is_finished_children(address *addr)
  78.140 +{
  78.141 +  GList *addr_node;
  78.142 +
  78.143 +  if(addr->children == NULL) return (addr_is_failed(addr) || addr_is_delivered(addr));
  78.144 +
  78.145 +  foreach(addr->children, addr_node){
  78.146 +    address *addr = (address *)(addr_node->data);
  78.147 +    if(!addr_is_finished_children(addr))
  78.148 +      return FALSE;
  78.149 +  }
  78.150 +  return TRUE;
  78.151 +}
  78.152 +
  78.153 +/* find original address */
  78.154 +address *addr_find_ancestor(address *addr)
  78.155 +{
  78.156 +  while(addr->parent) addr = addr->parent;
  78.157 +  return addr;
  78.158 +}
  78.159 +
  78.160 +gchar *addr_string(address *addr)
  78.161 +{
  78.162 +  static gchar *buffer = NULL;
  78.163 +
  78.164 +  if(addr == NULL){
  78.165 +    g_free(buffer);
  78.166 +    buffer = NULL;
  78.167 +    return NULL;
  78.168 +  }
  78.169 +  if(buffer)
  78.170 +    g_free(buffer);
  78.171 +
  78.172 +  if(addr->local_part[0] == 0){
  78.173 +    buffer = g_strdup("<>");
  78.174 +  }else{
  78.175 +    buffer = g_strdup_printf("<%s@%s>",
  78.176 +			     addr->local_part ? addr->local_part : "",
  78.177 +			     addr->domain ? addr->domain : "");
  78.178 +  }
  78.179 +  return buffer;
  78.180 +}
  78.181 +
  78.182 +gint addr_match(address *addr1, address *addr2)
  78.183 +{
  78.184 +  int res;
  78.185 +
  78.186 +  if((res = fnmatch(addr1->local_part, addr2->local_part, 0)) == 0){
  78.187 +    if((res = fnmatch(addr1->domain, addr2->domain, FNM_CASEFOLD)) == 0)
  78.188 +      return 0;
  78.189 +  }
  78.190 +  return res;
  78.191 +}
  78.192 +
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/src/alias.c	Fri Sep 26 17:05:23 2008 +0200
    79.3 @@ -0,0 +1,195 @@
    79.4 +/*  MasqMail
    79.5 +    Copyright (C) 2000-2001 Oliver Kurth
    79.6 +
    79.7 +    This program is free software; you can redistribute it and/or modify
    79.8 +    it under the terms of the GNU General Public License as published by
    79.9 +    the Free Software Foundation; either version 2 of the License, or
   79.10 +    (at your option) any later version.
   79.11 +
   79.12 +    This program is distributed in the hope that it will be useful,
   79.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   79.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   79.15 +    GNU General Public License for more details.
   79.16 +
   79.17 +    You should have received a copy of the GNU General Public License
   79.18 +    along with this program; if not, write to the Free Software
   79.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   79.20 +*/
   79.21 +
   79.22 +#include "masqmail.h"
   79.23 +#include <fnmatch.h>
   79.24 +
   79.25 +gboolean addr_is_local(address *addr)
   79.26 +{
   79.27 +  GList *dom_node;
   79.28 +  GList *addr_node;
   79.29 +  address *a;
   79.30 +
   79.31 +  foreach(conf.local_hosts, dom_node){
   79.32 +    if(addr->domain == NULL)
   79.33 +      return TRUE;
   79.34 +    if(fnmatch(dom_node->data, addr->domain, FNM_CASEFOLD) == 0){
   79.35 +      foreach(conf.not_local_addresses,addr_node){
   79.36 +	a = create_address_qualified(addr_node->data, TRUE, conf.host_name);
   79.37 +	if(addr_isequal(a,addr)){
   79.38 +	  destroy_address(a);
   79.39 +	  return FALSE;
   79.40 +	}
   79.41 +	destroy_address(a);
   79.42 +      }
   79.43 +      return TRUE;
   79.44 +    }
   79.45 +  }
   79.46 +  foreach(conf.local_addresses,addr_node){
   79.47 +    a = create_address_qualified(addr_node->data, TRUE, conf.host_name);
   79.48 +    if(addr_isequal(a,addr)){
   79.49 +      destroy_address(a);
   79.50 +      return TRUE;
   79.51 +    }
   79.52 +    destroy_address(a);
   79.53 +  }
   79.54 +  return FALSE;
   79.55 +}
   79.56 +
   79.57 +static
   79.58 +gboolean addr_isequal_alias(address *addr1, address *addr2)
   79.59 +{
   79.60 +  return
   79.61 +    (conf.alias_local_cmp(addr1->local_part, addr2->local_part) == 0) &&
   79.62 +    (strcasecmp(addr1->domain, addr2->domain) == 0);
   79.63 +}
   79.64 +
   79.65 +static
   79.66 +GList *parse_list(gchar *line)
   79.67 +{
   79.68 +  GList *list = NULL;
   79.69 +  gchar buf[256];
   79.70 +  gchar *p, *q;
   79.71 +
   79.72 +  p = line;
   79.73 +  while(*p != 0){
   79.74 +    q = buf;
   79.75 +    while(isspace(*p)) p++;
   79.76 +    if(*p != '\"'){
   79.77 +      while(*p && (*p != ',') && (q < buf+255))
   79.78 +	*(q++) = *(p++);
   79.79 +      *q = 0;
   79.80 +    }else{
   79.81 +      gboolean escape = FALSE;
   79.82 +      p++;
   79.83 +      while(*p && (*p != '\"' || escape) && (q < buf+255)){
   79.84 +	if((*p == '\\') && !escape)
   79.85 +	  escape = TRUE;
   79.86 +	else{
   79.87 +	  escape = FALSE;
   79.88 +	  *(q++) = *p;
   79.89 +	}
   79.90 +	p++;
   79.91 +      }
   79.92 +      *q = 0;
   79.93 +      while(*p && (*p != ',')) p++;
   79.94 +    }
   79.95 +    list = g_list_append(list, g_strdup(g_strchomp(buf)));
   79.96 +    if(*p) p++;
   79.97 +  }
   79.98 +  return list;
   79.99 +}
  79.100 +
  79.101 +GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list)
  79.102 +{
  79.103 +  GList *done_list = NULL;
  79.104 +  GList *rcpt_node = g_list_copy(rcpt_list);
  79.105 +
  79.106 +  while(rcpt_node != NULL){
  79.107 +    address *addr = (address *)(rcpt_node->data);
  79.108 +    DEBUG(5) debugf("alias_expand begin: '%s@%s'\n", addr->local_part, addr->domain);
  79.109 +//    if(addr_is_local(addr) && (addr->local_part[0] != '|') &&
  79.110 +    if(addr_is_local(addr) && 
  79.111 +        !(addr->flags & ADDR_FLAG_NOEXPAND)){
  79.112 +      gchar *val;
  79.113 +      
  79.114 +      /* special handling for postmaster */
  79.115 +      if(strcasecmp(addr->local_part, "postmaster") == 0)
  79.116 +	val = (gchar *)table_find_func(alias_table, addr->local_part, strcasecmp);
  79.117 +      else
  79.118 +	val = (gchar *)table_find_func(alias_table, addr->local_part, conf.alias_local_cmp);
  79.119 +
  79.120 +      DEBUG(5) debugf("alias: '%s' is local\n", addr->local_part);
  79.121 +      if(val != NULL){
  79.122 +	GList *val_list = parse_list(val);
  79.123 +	GList *val_node;
  79.124 +	GList *alias_list = NULL;
  79.125 +
  79.126 +	DEBUG(5) debugf("alias: '%s' -> '%s'\n", addr->local_part, val);
  79.127 +	foreach(val_list, val_node){
  79.128 +	  gchar *val = (gchar *)(val_node->data);
  79.129 +	  address *alias_addr;
  79.130 +	  address *addr_parent = NULL;
  79.131 +
  79.132 +	  if(val[0] == '|'){
  79.133 +	    DEBUG(5) debugf("alias: %s is a pipe address\n", val);
  79.134 +	    alias_addr = create_address_pipe(val);
  79.135 +	    DEBUG(5) debugf("alias_pipe: %s is a pipe address\n", alias_addr->local_part);
  79.136 +	  }else if(val[0] == '\\'){
  79.137 +	    DEBUG(5) debugf("alias: shall not be expanded: '%s'\n", val);
  79.138 +	    alias_addr = create_address_qualified(&(val[1]), TRUE, conf.host_name);
  79.139 +	    alias_addr->flags |= ADDR_FLAG_NOEXPAND;
  79.140 +	    DEBUG(5) debugf("alias: not expanded: '%s'\n",alias_addr->local_part);
  79.141 +	  }else{
  79.142 +	    alias_addr = create_address_qualified(val, TRUE, conf.host_name);
  79.143 +
  79.144 +	    /* search in parents for loops: */
  79.145 +	    for(addr_parent = addr; addr_parent; addr_parent = addr_parent->parent){
  79.146 +	      if(addr_isequal_alias(alias_addr, addr_parent)){
  79.147 +		logwrite(LOG_ALERT, "detected alias loop, (ignoring): %s@%s -> %s@%s\n",
  79.148 +			 addr_parent->local_part, addr_parent->domain,
  79.149 +			 addr->local_part, addr->domain);
  79.150 +		break;
  79.151 +	      }
  79.152 +	    }
  79.153 +	  }
  79.154 +	  if(!addr_parent){
  79.155 +	    alias_list = g_list_append(alias_list, alias_addr);
  79.156 +	    alias_addr->parent = addr;
  79.157 +	  }
  79.158 +	  g_free(val);
  79.159 +	}
  79.160 +	g_list_free(val_list);
  79.161 +	addr->children = g_list_copy(alias_list);
  79.162 +	rcpt_node = g_list_concat(rcpt_node, alias_list);
  79.163 +      }else{
  79.164 +	DEBUG(5) debugf("alias: '%s' is completed\n", addr->local_part);
  79.165 +	done_list = g_list_append(done_list, addr);
  79.166 +      }
  79.167 +    }else{
  79.168 +      DEBUG(5) debugf("alias: '%s@%s' is not local\n", addr->local_part, addr->domain);
  79.169 +      done_list = g_list_append(done_list, addr);
  79.170 +    }
  79.171 +    rcpt_node = g_list_next(rcpt_node);
  79.172 +  }
  79.173 +
  79.174 +  /* delete addresses from done_list if they are in the non_rcpt_list */
  79.175 +  if(non_rcpt_list){
  79.176 +    GList *rcpt_node_next;
  79.177 +    for(rcpt_node = g_list_first(done_list);
  79.178 +	 rcpt_node;
  79.179 +	 rcpt_node = rcpt_node_next){
  79.180 +      address *addr = (address *)(rcpt_node->data);
  79.181 +      GList *non_node;
  79.182 +
  79.183 +      rcpt_node_next = g_list_next(rcpt_node);
  79.184 +
  79.185 +      foreach(non_rcpt_list, non_node){
  79.186 +	address *non_addr = (address *)(non_node->data);
  79.187 +	if(addr_isequal(addr, non_addr)){
  79.188 +	  done_list = g_list_remove_link(done_list, rcpt_node);
  79.189 +	  g_list_free_1(rcpt_node);
  79.190 +	  addr_mark_delivered(addr); /* this address is still in the children lists
  79.191 +				      of the original address */
  79.192 +	  break;
  79.193 +	}
  79.194 +      }
  79.195 +    }
  79.196 +  }
  79.197 +  return done_list;
  79.198 +}
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/src/base64/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    80.3 @@ -0,0 +1,21 @@
    80.4 +AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE
    80.5 +
    80.6 +noinst_LIBRARIES=libbase64.a
    80.7 +noinst_PROGRAMS=base64enc base64dec
    80.8 +
    80.9 +base64enc_SOURCES=\
   80.10 +	base64.h\
   80.11 +	base64enc.c\
   80.12 +	base64.c
   80.13 +
   80.14 +base64dec_SOURCES=\
   80.15 +	base64.h\
   80.16 +	base64dec.c\
   80.17 +	base64.c
   80.18 +
   80.19 +libbase64_a_SOURCES=\
   80.20 +	base64.h\
   80.21 +	base64.c
   80.22 +
   80.23 +base64enc_LDADD=@GLIB_LIBS@
   80.24 +base64dec_LDADD=@GLIB_LIBS@
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/src/base64/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    81.3 @@ -0,0 +1,421 @@
    81.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    81.5 +# @configure_input@
    81.6 +
    81.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    81.8 +# Free Software Foundation, Inc.
    81.9 +# This Makefile.in is free software; the Free Software Foundation
   81.10 +# gives unlimited permission to copy and/or distribute it,
   81.11 +# with or without modifications, as long as this notice is preserved.
   81.12 +
   81.13 +# This program is distributed in the hope that it will be useful,
   81.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   81.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   81.16 +# PARTICULAR PURPOSE.
   81.17 +
   81.18 +@SET_MAKE@
   81.19 +
   81.20 +srcdir = @srcdir@
   81.21 +top_srcdir = @top_srcdir@
   81.22 +VPATH = @srcdir@
   81.23 +pkgdatadir = $(datadir)/@PACKAGE@
   81.24 +pkglibdir = $(libdir)/@PACKAGE@
   81.25 +pkgincludedir = $(includedir)/@PACKAGE@
   81.26 +top_builddir = ../..
   81.27 +
   81.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   81.29 +INSTALL = @INSTALL@
   81.30 +install_sh_DATA = $(install_sh) -c -m 644
   81.31 +install_sh_PROGRAM = $(install_sh) -c
   81.32 +install_sh_SCRIPT = $(install_sh) -c
   81.33 +INSTALL_HEADER = $(INSTALL_DATA)
   81.34 +transform = $(program_transform_name)
   81.35 +NORMAL_INSTALL = :
   81.36 +PRE_INSTALL = :
   81.37 +POST_INSTALL = :
   81.38 +NORMAL_UNINSTALL = :
   81.39 +PRE_UNINSTALL = :
   81.40 +POST_UNINSTALL = :
   81.41 +ACLOCAL = @ACLOCAL@
   81.42 +AMDEP_FALSE = @AMDEP_FALSE@
   81.43 +AMDEP_TRUE = @AMDEP_TRUE@
   81.44 +AMTAR = @AMTAR@
   81.45 +AUTOCONF = @AUTOCONF@
   81.46 +AUTOHEADER = @AUTOHEADER@
   81.47 +AUTOMAKE = @AUTOMAKE@
   81.48 +AWK = @AWK@
   81.49 +BASE64_LIBS = @BASE64_LIBS@
   81.50 +CC = @CC@
   81.51 +CCDEPMODE = @CCDEPMODE@
   81.52 +CFLAGS = @CFLAGS@
   81.53 +CPP = @CPP@
   81.54 +CPPFLAGS = @CPPFLAGS@
   81.55 +CYGPATH_W = @CYGPATH_W@
   81.56 +DEFS = @DEFS@
   81.57 +DEPDIR = @DEPDIR@
   81.58 +ECHO_C = @ECHO_C@
   81.59 +ECHO_N = @ECHO_N@
   81.60 +ECHO_T = @ECHO_T@
   81.61 +EGREP = @EGREP@
   81.62 +EXEEXT = @EXEEXT@
   81.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   81.64 +GLIB_LIBS = @GLIB_LIBS@
   81.65 +IDENT_LIBS = @IDENT_LIBS@
   81.66 +INSTALL_DATA = @INSTALL_DATA@
   81.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   81.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   81.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   81.70 +LDFLAGS = @LDFLAGS@
   81.71 +LIBOBJS = @LIBOBJS@
   81.72 +LIBS = @LIBS@
   81.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   81.74 +LTLIBOBJS = @LTLIBOBJS@
   81.75 +MAKEINFO = @MAKEINFO@
   81.76 +MD5_LIBS = @MD5_LIBS@
   81.77 +OBJEXT = @OBJEXT@
   81.78 +PACKAGE = @PACKAGE@
   81.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   81.80 +PACKAGE_NAME = @PACKAGE_NAME@
   81.81 +PACKAGE_STRING = @PACKAGE_STRING@
   81.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   81.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   81.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   81.85 +PKG_CONFIG = @PKG_CONFIG@
   81.86 +RANLIB = @RANLIB@
   81.87 +RESOLV_LIBS = @RESOLV_LIBS@
   81.88 +SET_MAKE = @SET_MAKE@
   81.89 +SHELL = @SHELL@
   81.90 +STRIP = @STRIP@
   81.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   81.92 +VERSION = @VERSION@
   81.93 +ac_ct_CC = @ac_ct_CC@
   81.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   81.95 +ac_ct_STRIP = @ac_ct_STRIP@
   81.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   81.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   81.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   81.99 +am__include = @am__include@
  81.100 +am__leading_dot = @am__leading_dot@
  81.101 +am__quote = @am__quote@
  81.102 +bindir = @bindir@
  81.103 +build_alias = @build_alias@
  81.104 +datadir = @datadir@
  81.105 +exec_prefix = @exec_prefix@
  81.106 +has_ident = @has_ident@
  81.107 +host_alias = @host_alias@
  81.108 +includedir = @includedir@
  81.109 +infodir = @infodir@
  81.110 +install_sh = @install_sh@
  81.111 +libdir = @libdir@
  81.112 +libexecdir = @libexecdir@
  81.113 +localstatedir = @localstatedir@
  81.114 +mandir = @mandir@
  81.115 +oldincludedir = @oldincludedir@
  81.116 +prefix = @prefix@
  81.117 +program_transform_name = @program_transform_name@
  81.118 +sbindir = @sbindir@
  81.119 +sharedstatedir = @sharedstatedir@
  81.120 +sysconfdir = @sysconfdir@
  81.121 +target_alias = @target_alias@
  81.122 +with_confdir = @with_confdir@
  81.123 +with_group = @with_group@
  81.124 +with_logdir = @with_logdir@
  81.125 +with_spooldir = @with_spooldir@
  81.126 +with_user = @with_user@
  81.127 +AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE
  81.128 +
  81.129 +noinst_LIBRARIES = libbase64.a
  81.130 +noinst_PROGRAMS = base64enc base64dec
  81.131 +
  81.132 +base64enc_SOURCES = \
  81.133 +	base64.h\
  81.134 +	base64enc.c\
  81.135 +	base64.c
  81.136 +
  81.137 +
  81.138 +base64dec_SOURCES = \
  81.139 +	base64.h\
  81.140 +	base64dec.c\
  81.141 +	base64.c
  81.142 +
  81.143 +
  81.144 +libbase64_a_SOURCES = \
  81.145 +	base64.h\
  81.146 +	base64.c
  81.147 +
  81.148 +
  81.149 +base64enc_LDADD = @GLIB_LIBS@
  81.150 +base64dec_LDADD = @GLIB_LIBS@
  81.151 +subdir = src/base64
  81.152 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  81.153 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  81.154 +CONFIG_HEADER = $(top_builddir)/config.h
  81.155 +CONFIG_CLEAN_FILES =
  81.156 +LIBRARIES = $(noinst_LIBRARIES)
  81.157 +
  81.158 +libbase64_a_AR = $(AR) cru
  81.159 +libbase64_a_LIBADD =
  81.160 +am_libbase64_a_OBJECTS = base64.$(OBJEXT)
  81.161 +libbase64_a_OBJECTS = $(am_libbase64_a_OBJECTS)
  81.162 +noinst_PROGRAMS = base64enc$(EXEEXT) base64dec$(EXEEXT)
  81.163 +PROGRAMS = $(noinst_PROGRAMS)
  81.164 +
  81.165 +am_base64dec_OBJECTS = base64dec.$(OBJEXT) base64.$(OBJEXT)
  81.166 +base64dec_OBJECTS = $(am_base64dec_OBJECTS)
  81.167 +base64dec_DEPENDENCIES =
  81.168 +base64dec_LDFLAGS =
  81.169 +am_base64enc_OBJECTS = base64enc.$(OBJEXT) base64.$(OBJEXT)
  81.170 +base64enc_OBJECTS = $(am_base64enc_OBJECTS)
  81.171 +base64enc_DEPENDENCIES =
  81.172 +base64enc_LDFLAGS =
  81.173 +
  81.174 +DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
  81.175 +depcomp = $(SHELL) $(top_srcdir)/depcomp
  81.176 +am__depfiles_maybe = depfiles
  81.177 +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/base64.Po ./$(DEPDIR)/base64dec.Po \
  81.178 +@AMDEP_TRUE@	./$(DEPDIR)/base64enc.Po
  81.179 +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  81.180 +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  81.181 +CCLD = $(CC)
  81.182 +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
  81.183 +DIST_SOURCES = $(libbase64_a_SOURCES) $(base64dec_SOURCES) \
  81.184 +	$(base64enc_SOURCES)
  81.185 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
  81.186 +SOURCES = $(libbase64_a_SOURCES) $(base64dec_SOURCES) $(base64enc_SOURCES)
  81.187 +
  81.188 +all: all-am
  81.189 +
  81.190 +.SUFFIXES:
  81.191 +.SUFFIXES: .c .o .obj
  81.192 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  81.193 +	cd $(top_srcdir) && \
  81.194 +	  $(AUTOMAKE) --gnu  src/base64/Makefile
  81.195 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  81.196 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  81.197 +
  81.198 +AR = ar
  81.199 +
  81.200 +clean-noinstLIBRARIES:
  81.201 +	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
  81.202 +libbase64.a: $(libbase64_a_OBJECTS) $(libbase64_a_DEPENDENCIES) 
  81.203 +	-rm -f libbase64.a
  81.204 +	$(libbase64_a_AR) libbase64.a $(libbase64_a_OBJECTS) $(libbase64_a_LIBADD)
  81.205 +	$(RANLIB) libbase64.a
  81.206 +
  81.207 +clean-noinstPROGRAMS:
  81.208 +	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
  81.209 +base64dec$(EXEEXT): $(base64dec_OBJECTS) $(base64dec_DEPENDENCIES) 
  81.210 +	@rm -f base64dec$(EXEEXT)
  81.211 +	$(LINK) $(base64dec_LDFLAGS) $(base64dec_OBJECTS) $(base64dec_LDADD) $(LIBS)
  81.212 +base64enc$(EXEEXT): $(base64enc_OBJECTS) $(base64enc_DEPENDENCIES) 
  81.213 +	@rm -f base64enc$(EXEEXT)
  81.214 +	$(LINK) $(base64enc_LDFLAGS) $(base64enc_OBJECTS) $(base64enc_LDADD) $(LIBS)
  81.215 +
  81.216 +mostlyclean-compile:
  81.217 +	-rm -f *.$(OBJEXT) core *.core
  81.218 +
  81.219 +distclean-compile:
  81.220 +	-rm -f *.tab.c
  81.221 +
  81.222 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@
  81.223 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64dec.Po@am__quote@
  81.224 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64enc.Po@am__quote@
  81.225 +
  81.226 +.c.o:
  81.227 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
  81.228 +@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
  81.229 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
  81.230 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
  81.231 +@am__fastdepCC_TRUE@	fi
  81.232 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  81.233 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
  81.234 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  81.235 +@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
  81.236 +
  81.237 +.c.obj:
  81.238 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
  81.239 +@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
  81.240 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
  81.241 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
  81.242 +@am__fastdepCC_TRUE@	fi
  81.243 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  81.244 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
  81.245 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  81.246 +@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
  81.247 +uninstall-info-am:
  81.248 +
  81.249 +ETAGS = etags
  81.250 +ETAGSFLAGS =
  81.251 +
  81.252 +CTAGS = ctags
  81.253 +CTAGSFLAGS =
  81.254 +
  81.255 +tags: TAGS
  81.256 +
  81.257 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  81.258 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  81.259 +	unique=`for i in $$list; do \
  81.260 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  81.261 +	  done | \
  81.262 +	  $(AWK) '    { files[$$0] = 1; } \
  81.263 +	       END { for (i in files) print i; }'`; \
  81.264 +	mkid -fID $$unique
  81.265 +
  81.266 +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  81.267 +		$(TAGS_FILES) $(LISP)
  81.268 +	tags=; \
  81.269 +	here=`pwd`; \
  81.270 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  81.271 +	unique=`for i in $$list; do \
  81.272 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  81.273 +	  done | \
  81.274 +	  $(AWK) '    { files[$$0] = 1; } \
  81.275 +	       END { for (i in files) print i; }'`; \
  81.276 +	test -z "$(ETAGS_ARGS)$$tags$$unique" \
  81.277 +	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  81.278 +	     $$tags $$unique
  81.279 +
  81.280 +ctags: CTAGS
  81.281 +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  81.282 +		$(TAGS_FILES) $(LISP)
  81.283 +	tags=; \
  81.284 +	here=`pwd`; \
  81.285 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  81.286 +	unique=`for i in $$list; do \
  81.287 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  81.288 +	  done | \
  81.289 +	  $(AWK) '    { files[$$0] = 1; } \
  81.290 +	       END { for (i in files) print i; }'`; \
  81.291 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
  81.292 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  81.293 +	     $$tags $$unique
  81.294 +
  81.295 +GTAGS:
  81.296 +	here=`$(am__cd) $(top_builddir) && pwd` \
  81.297 +	  && cd $(top_srcdir) \
  81.298 +	  && gtags -i $(GTAGS_ARGS) $$here
  81.299 +
  81.300 +distclean-tags:
  81.301 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  81.302 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  81.303 +
  81.304 +top_distdir = ../..
  81.305 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  81.306 +
  81.307 +distdir: $(DISTFILES)
  81.308 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  81.309 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  81.310 +	list='$(DISTFILES)'; for file in $$list; do \
  81.311 +	  case $$file in \
  81.312 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  81.313 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  81.314 +	  esac; \
  81.315 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  81.316 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  81.317 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  81.318 +	    dir="/$$dir"; \
  81.319 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  81.320 +	  else \
  81.321 +	    dir=''; \
  81.322 +	  fi; \
  81.323 +	  if test -d $$d/$$file; then \
  81.324 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  81.325 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  81.326 +	    fi; \
  81.327 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  81.328 +	  else \
  81.329 +	    test -f $(distdir)/$$file \
  81.330 +	    || cp -p $$d/$$file $(distdir)/$$file \
  81.331 +	    || exit 1; \
  81.332 +	  fi; \
  81.333 +	done
  81.334 +check-am: all-am
  81.335 +check: check-am
  81.336 +all-am: Makefile $(LIBRARIES) $(PROGRAMS)
  81.337 +
  81.338 +installdirs:
  81.339 +install: install-am
  81.340 +install-exec: install-exec-am
  81.341 +install-data: install-data-am
  81.342 +uninstall: uninstall-am
  81.343 +
  81.344 +install-am: all-am
  81.345 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  81.346 +
  81.347 +installcheck: installcheck-am
  81.348 +install-strip:
  81.349 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  81.350 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  81.351 +	  `test -z '$(STRIP)' || \
  81.352 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  81.353 +mostlyclean-generic:
  81.354 +
  81.355 +clean-generic:
  81.356 +
  81.357 +distclean-generic:
  81.358 +	-rm -f $(CONFIG_CLEAN_FILES)
  81.359 +
  81.360 +maintainer-clean-generic:
  81.361 +	@echo "This command is intended for maintainers to use"
  81.362 +	@echo "it deletes files that may require special tools to rebuild."
  81.363 +clean: clean-am
  81.364 +
  81.365 +clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
  81.366 +	mostlyclean-am
  81.367 +
  81.368 +distclean: distclean-am
  81.369 +	-rm -rf ./$(DEPDIR)
  81.370 +	-rm -f Makefile
  81.371 +distclean-am: clean-am distclean-compile distclean-generic \
  81.372 +	distclean-tags
  81.373 +
  81.374 +dvi: dvi-am
  81.375 +
  81.376 +dvi-am:
  81.377 +
  81.378 +info: info-am
  81.379 +
  81.380 +info-am:
  81.381 +
  81.382 +install-data-am:
  81.383 +
  81.384 +install-exec-am:
  81.385 +
  81.386 +install-info: install-info-am
  81.387 +
  81.388 +install-man:
  81.389 +
  81.390 +installcheck-am:
  81.391 +
  81.392 +maintainer-clean: maintainer-clean-am
  81.393 +	-rm -rf ./$(DEPDIR)
  81.394 +	-rm -f Makefile
  81.395 +maintainer-clean-am: distclean-am maintainer-clean-generic
  81.396 +
  81.397 +mostlyclean: mostlyclean-am
  81.398 +
  81.399 +mostlyclean-am: mostlyclean-compile mostlyclean-generic
  81.400 +
  81.401 +pdf: pdf-am
  81.402 +
  81.403 +pdf-am:
  81.404 +
  81.405 +ps: ps-am
  81.406 +
  81.407 +ps-am:
  81.408 +
  81.409 +uninstall-am: uninstall-info-am
  81.410 +
  81.411 +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
  81.412 +	clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \
  81.413 +	distclean-compile distclean-generic distclean-tags distdir dvi \
  81.414 +	dvi-am info info-am install install-am install-data \
  81.415 +	install-data-am install-exec install-exec-am install-info \
  81.416 +	install-info-am install-man install-strip installcheck \
  81.417 +	installcheck-am installdirs maintainer-clean \
  81.418 +	maintainer-clean-generic mostlyclean mostlyclean-compile \
  81.419 +	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
  81.420 +	uninstall-am uninstall-info-am
  81.421 +
  81.422 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  81.423 +# Otherwise a system limit (for SysV at least) may be exceeded.
  81.424 +.NOEXPORT:
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/src/base64/base64.c	Fri Sep 26 17:05:23 2008 +0200
    82.3 @@ -0,0 +1,128 @@
    82.4 +/* base64.c, Copyright 2000 (C) Oliver Kurth,
    82.5 + *
    82.6 + * This program is free software; you can redistribute it and/or modify
    82.7 + * it under the terms of the GNU General Public License as published by
    82.8 + * the Free Software Foundation; either version 2 of the License, or
    82.9 + * (at your option) any later version.
   82.10 + * 
   82.11 + * This program is distributed in the hope that it will be useful,
   82.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   82.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   82.14 + * GNU General Public License for more details.
   82.15 + *
   82.16 + * You should have received a copy of the GNU General Public License
   82.17 + * along with this program; if not, write to the Free Software
   82.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   82.19 + */
   82.20 +
   82.21 +/*
   82.22 + send bugs to: kurth@innominate.de
   82.23 +*/
   82.24 +
   82.25 +/* see also RFC 1341 */
   82.26 +
   82.27 +#include <glib.h>
   82.28 +#include <string.h>
   82.29 +#include "base64.h"
   82.30 +
   82.31 +gchar *base64_encode(guchar *buf, gint len)
   82.32 +{
   82.33 +  guchar *outbuf, *q;
   82.34 +  gchar enc[64];
   82.35 +  gint i = 0, j = 0;
   82.36 +  guint in0, in1, in2;
   82.37 +
   82.38 +  for(; i < 26; i++) enc[i] = (gchar)('A' + j++); j = 0;
   82.39 +  for(; i < 52; i++) enc[i] = (gchar)('a' + j++); j = 0;
   82.40 +  for(; i < 62; i++) enc[i] = (gchar)('0' + j++);
   82.41 +  enc[i++] = '+';
   82.42 +  enc[i++] = '/';
   82.43 +
   82.44 +  outbuf = g_malloc(((len+3) * 8)/6);
   82.45 +  q = outbuf;
   82.46 +
   82.47 +  i = 0;
   82.48 +  while(i < len-2){
   82.49 +    in0 = buf[i++];
   82.50 +    in1 = buf[i++];
   82.51 +    in2 = buf[i++];
   82.52 +
   82.53 +    *(q++) = enc[(in0 >> 2) & 0x3f];
   82.54 +    *(q++) = enc[((in0 << 4) | (in1 >> 4)) & 0x3f];
   82.55 +    *(q++) = enc[((in1 << 2) | (in2 >> 6)) & 0x3f];
   82.56 +    *(q++) = enc[in2 & 0x3f];
   82.57 +  }
   82.58 +  if((len - i) == 1){
   82.59 +    in0 = buf[i++];
   82.60 +    *(q++) = enc[(in0 >> 2) & 0x3f];
   82.61 +    *(q++) = enc[(in0 << 4) & 0x3f];
   82.62 +    *(q++) = '=';
   82.63 +    *(q++) = '=';
   82.64 +  }else if((len - i) == 2){
   82.65 +    in0 = buf[i++];
   82.66 +    in1 = buf[i++];
   82.67 +    *(q++) = enc[(in0 >> 2) & 0x3f];
   82.68 +    *(q++) = enc[((in0 << 4) | (in1 >> 4)) & 0x3f];
   82.69 +    *(q++) = enc[(in1 << 2) & 0x3f];
   82.70 +    *(q++) = '=';
   82.71 +  }
   82.72 +  *q = 0;
   82.73 +  
   82.74 +  return outbuf;
   82.75 +}
   82.76 +    
   82.77 +gchar *base64_decode(gchar *buf, gint *size)
   82.78 +{
   82.79 +  guchar *p = buf, *q;
   82.80 +  guint in[4];
   82.81 +  //  gchar *out = g_malloc(((strlen(buf)+3) * 3) / 4 + 1);
   82.82 +  gchar *out = g_malloc((strlen(buf)+3) + 1);
   82.83 +
   82.84 +  q = out;
   82.85 +  *size = 0;
   82.86 +
   82.87 +  *q = 0;
   82.88 +
   82.89 +  while(*p){
   82.90 +    int i = 0;
   82.91 +    while(i < 4){
   82.92 +      if(!*p) break;
   82.93 +      if((*p >= 'A') && (*p <= 'Z'))
   82.94 +	 in[i++] = *p - 'A';
   82.95 +      else if((*p >= 'a') && (*p <= 'z'))
   82.96 +	in[i++] = (*p - 'a') + 26;
   82.97 +      else if((*p >= '0') && (*p <= '9'))
   82.98 +	in[i++] = (*p - '0') + 52;
   82.99 +      else if(*p == '+')
  82.100 +	in[i++] = 62;
  82.101 +      else if(*p == '/')
  82.102 +	in[i++] = 63;
  82.103 +      else if(*p == '='){
  82.104 +	in[i++] = 0;
  82.105 +	p++;
  82.106 +	break;
  82.107 +      }else if((*p != '\r') && (*p != '\n')){
  82.108 +	p++;
  82.109 +	break;
  82.110 +      }
  82.111 +      p++;
  82.112 +    }
  82.113 +    if((i == 4) || (p[-1] == '=')){
  82.114 +      *(q++) = ((in[0] << 2) | (in[1] >> 4));
  82.115 +      *(q++) = ((in[1] << 4) | (in[2] >> 2));
  82.116 +      *(q++) = ((in[2] << 6) | in[3]);
  82.117 +      if(p[-1] == '='){
  82.118 +	if(i == 3){
  82.119 +	  (*size)++;
  82.120 +	}
  82.121 +	else if(i == 4){
  82.122 +	  (*size) += 2;
  82.123 +	}
  82.124 +      }else{
  82.125 +	*size += 3;
  82.126 +      }
  82.127 +    }
  82.128 +  }
  82.129 +  return out;
  82.130 +}
  82.131 +
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/src/base64/base64.h	Fri Sep 26 17:05:23 2008 +0200
    83.3 @@ -0,0 +1,19 @@
    83.4 +/* base64.h, Copyright 2000 (C) Oliver Kurth,
    83.5 + *
    83.6 + * This program is free software; you can redistribute it and/or modify
    83.7 + * it under the terms of the GNU General Public License as published by
    83.8 + * the Free Software Foundation; either version 2 of the License, or
    83.9 + * (at your option) any later version.
   83.10 + * 
   83.11 + * This program is distributed in the hope that it will be useful,
   83.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   83.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   83.14 + * GNU General Public License for more details.
   83.15 + *
   83.16 + * You should have received a copy of the GNU General Public License
   83.17 + * along with this program; if not, write to the Free Software
   83.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   83.19 + */
   83.20 +
   83.21 +gchar *base64_encode(guchar *buf, gint len);
   83.22 +gchar *base64_decode(gchar *buf, gint *size);
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/src/base64/base64dec.c	Fri Sep 26 17:05:23 2008 +0200
    84.3 @@ -0,0 +1,19 @@
    84.4 +#include <glib.h>
    84.5 +#include <stdio.h>
    84.6 +#include <stdlib.h>
    84.7 +
    84.8 +#include "base64.h"
    84.9 +
   84.10 +int main()
   84.11 +{
   84.12 +  gchar line[100];
   84.13 +  gchar *buf;
   84.14 +  gint size;
   84.15 +
   84.16 +  while(fgets(line, 100, stdin)){
   84.17 +    buf = base64_decode(line, &size);
   84.18 +    fwrite(buf, size, 1, stdout);
   84.19 +    g_free(buf);
   84.20 +  }
   84.21 +  exit(0);
   84.22 +}
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/src/base64/base64enc.c	Fri Sep 26 17:05:23 2008 +0200
    85.3 @@ -0,0 +1,24 @@
    85.4 +
    85.5 +#include <glib.h>
    85.6 +#include <stdio.h>
    85.7 +#include <stdlib.h>
    85.8 +
    85.9 +#include "base64.h"
   85.10 +
   85.11 +int main()
   85.12 +{
   85.13 +  gchar in[58];
   85.14 +  gint size;
   85.15 +
   85.16 +  do{
   85.17 +    gchar *out;
   85.18 +
   85.19 +    size = fread(in, 1, 54, stdin);
   85.20 +    out = base64_encode(in, size);
   85.21 +    fputs(out, stdout);
   85.22 +    putchar('\n');
   85.23 +    g_free(out);
   85.24 +  }while(size == 54);
   85.25 +  exit(0);
   85.26 +}
   85.27 +
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/src/child.c	Fri Sep 26 17:05:23 2008 +0200
    86.3 @@ -0,0 +1,79 @@
    86.4 +/* child.c, Copyright (C) 2000 by Oliver Kurth,
    86.5 + *
    86.6 + * This program is free software; you can redistribute it and/or modify
    86.7 + * it under the terms of the GNU General Public License as published by
    86.8 + * the Free Software Foundation; either version 2 of the License, or
    86.9 + * (at your option) any later version.
   86.10 + * 
   86.11 + * This program is distributed in the hope that it will be useful,
   86.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   86.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   86.14 + * GNU General Public License for more details.
   86.15 + *
   86.16 + * You should have received a copy of the GNU General Public License
   86.17 + * along with this program; if not, write to the Free Software
   86.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   86.19 + */
   86.20 +
   86.21 +#include <errno.h>
   86.22 +#include <stdio.h>
   86.23 +#include <stdlib.h>
   86.24 +#include <unistd.h>
   86.25 +#include <signal.h>
   86.26 +#include <sys/types.h>
   86.27 +#include <sys/socket.h>
   86.28 +#include <syslog.h>
   86.29 +#include <string.h>
   86.30 +
   86.31 +#include "masqmail.h"
   86.32 +
   86.33 +int volatile sigchild_seen = 0;
   86.34 +
   86.35 +static
   86.36 +void sigchild_handler(int sig)
   86.37 +{
   86.38 +  sigchild_seen = 1;
   86.39 +  signal(SIGHUP, sigchild_handler);
   86.40 +}
   86.41 +
   86.42 +int child(const char *command)
   86.43 +{
   86.44 +  int pipe[2];
   86.45 +
   86.46 +  if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe) == 0){
   86.47 +    pid_t pid;
   86.48 +      
   86.49 +    /*
   86.50 +    sigchild_seen = 0;
   86.51 +    signal(SIGCHLD, sigchild_handler);
   86.52 +    */
   86.53 +
   86.54 +    pid = fork();
   86.55 +    if(pid == 0){
   86.56 +      int i, max_fd = sysconf(_SC_OPEN_MAX);
   86.57 +      /* child */
   86.58 +      dup2(pipe[0], 0);
   86.59 +      dup2(pipe[0], 1);
   86.60 +      dup2(pipe[0], 2);
   86.61 +
   86.62 +      if(max_fd <= 0) max_fd = 64;
   86.63 +      for(i = 3; i < max_fd; i++)
   86.64 +	close(i);
   86.65 +
   86.66 +      {
   86.67 +	char *argv [] = { "/bin/sh", "-c", (char*) command, NULL };
   86.68 +	execve (*argv, argv, NULL);
   86.69 +      }
   86.70 +      logwrite(LOG_ALERT, "execve failed: %s\n", strerror(errno));
   86.71 +      _exit(EXIT_FAILURE);
   86.72 +    }else if(pid == -1){
   86.73 +      return -1;
   86.74 +    }else{
   86.75 +      close(pipe[0]);
   86.76 +      return pipe[1];
   86.77 +    }
   86.78 +  }
   86.79 +  return -2;
   86.80 +}
   86.81 +
   86.82 +      
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/src/conf.c	Fri Sep 26 17:05:23 2008 +0200
    87.3 @@ -0,0 +1,995 @@
    87.4 +/*  MasqMail
    87.5 +    Copyright (C) 1999-2001 Oliver Kurth
    87.6 +
    87.7 +    This program is free software; you can redistribute it and/or modify
    87.8 +    it under the terms of the GNU General Public License as published by
    87.9 +    the Free Software Foundation; either version 2 of the License, or
   87.10 +    (at your option) any later version.
   87.11 +
   87.12 +    This program is distributed in the hope that it will be useful,
   87.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   87.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   87.15 +    GNU General Public License for more details.
   87.16 +
   87.17 +    You should have received a copy of the GNU General Public License
   87.18 +    along with this program; if not, write to the Free Software
   87.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   87.20 +*/
   87.21 +
   87.22 +#include "masqmail.h"
   87.23 +
   87.24 +#include "pwd.h"
   87.25 +#include "grp.h"
   87.26 +
   87.27 +masqmail_conf conf;
   87.28 +
   87.29 +void init_conf()
   87.30 +{
   87.31 +  struct passwd *passwd;
   87.32 +  struct group *group;
   87.33 +
   87.34 +  memset(&conf, 0, sizeof(masqmail_conf));
   87.35 +
   87.36 +  conf.orig_uid = getuid();
   87.37 +  conf.orig_gid = getgid();
   87.38 +
   87.39 +  if((passwd = getpwnam(DEF_MAIL_USER)))
   87.40 +    conf.mail_uid = passwd->pw_uid;
   87.41 +  else{
   87.42 +    fprintf(stderr, "user %s not found! (terminating)\n", DEF_MAIL_USER);
   87.43 +    exit(EXIT_FAILURE);
   87.44 +  }
   87.45 +  if((group = getgrnam(DEF_MAIL_GROUP)))
   87.46 +    conf.mail_gid = group->gr_gid;
   87.47 +  else{
   87.48 +    fprintf(stderr, "group %s not found! (terminating)\n", DEF_MAIL_GROUP);
   87.49 +    exit(EXIT_FAILURE);
   87.50 +  }
   87.51 +}
   87.52 +
   87.53 +static gchar *true_strings[] =
   87.54 +{
   87.55 +  "yes", "on", "true", NULL
   87.56 +};
   87.57 +
   87.58 +static gchar *false_strings[] =
   87.59 +{
   87.60 +  "no", "off", "false", NULL
   87.61 +};
   87.62 +
   87.63 +static
   87.64 +gboolean parse_boolean(gchar *rval)
   87.65 +{
   87.66 +  gchar **str;
   87.67 +
   87.68 +  DEBUG(6) fprintf(stderr, "parse_boolean: %s\n", rval);
   87.69 +
   87.70 +  str = true_strings;
   87.71 +  while(*str){
   87.72 +    if(strncasecmp(*str, rval, strlen(*str)) == 0)
   87.73 +      return TRUE;
   87.74 +    str++;
   87.75 +  }
   87.76 +
   87.77 +  str = false_strings;
   87.78 +  while(*str){
   87.79 +    if(strncasecmp(*str, rval, strlen(*str)) == 0)
   87.80 +      return FALSE;
   87.81 +    str++;
   87.82 +  }
   87.83 +
   87.84 +  fprintf(stderr, "cannot parse value '%s'\n", rval);
   87.85 +  exit(EXIT_FAILURE);
   87.86 +}
   87.87 +
   87.88 +/* make a list from each line in a file */
   87.89 +static
   87.90 +GList *parse_list_file(gchar *fname)
   87.91 +{
   87.92 +  GList *list = NULL;
   87.93 +  FILE *fptr;
   87.94 +
   87.95 +  if((fptr = fopen(fname, "rt"))){
   87.96 +    gchar buf[256];
   87.97 +
   87.98 +    while(!feof(fptr)){
   87.99 +      fgets(buf, 255, fptr);
  87.100 +      if(buf[0] && (buf[0] != '#') && (buf[0] != '\n')){
  87.101 +	g_strchomp(buf);
  87.102 +	list = g_list_append(list, g_strdup(buf));
  87.103 +      }
  87.104 +    }
  87.105 +    fclose(fptr);
  87.106 +  }else{
  87.107 +    logwrite(LOG_ALERT, "could not open %s for reading: %s\n", fname, strerror(errno));
  87.108 +    exit(EXIT_FAILURE);
  87.109 +  }
  87.110 +
  87.111 +  return list;
  87.112 +}
  87.113 +
  87.114 +/* given a semicolon separated string, this function
  87.115 +   makes a GList out of it.
  87.116 +*/
  87.117 +GList *parse_list(gchar *line, gboolean read_file)
  87.118 +{
  87.119 +  GList *list = NULL;
  87.120 +  gchar buf[256];
  87.121 +  gchar *p, *q;
  87.122 +
  87.123 +  DEBUG(6) fprintf(stderr, "parsing list %s\n", line);
  87.124 +
  87.125 +  p = line;
  87.126 +  while(*p != 0){
  87.127 +    q = buf;
  87.128 +
  87.129 +    while(*p && (*p != ';') && (q < buf+255))
  87.130 +      *(q++) = *(p++);
  87.131 +    *q = 0;
  87.132 +
  87.133 +    if((buf[0] == '/') && (read_file))
  87.134 +      /* item is a filename, include its contents */
  87.135 +      list = g_list_concat(list, parse_list_file(buf));
  87.136 +    else
  87.137 +      /* just a normal item */
  87.138 +      list = g_list_append(list, g_strdup(buf));
  87.139 +
  87.140 +    DEBUG(6) printf("item = %s\n", buf);
  87.141 +
  87.142 +    if(*p) p++;
  87.143 +  }
  87.144 +  return list;
  87.145 +}
  87.146 +
  87.147 +static
  87.148 +GList *parse_address_list(gchar *line, gboolean read_file)
  87.149 +{
  87.150 +  GList *plain_list = parse_list(line, read_file);
  87.151 +  GList *node;
  87.152 +  GList *list = NULL;
  87.153 +
  87.154 +  foreach(plain_list, node){
  87.155 +    gchar *item = (gchar *)(node->data);
  87.156 +    address *addr = create_address(item, TRUE);
  87.157 +    if(addr)
  87.158 +      list = g_list_append(list, addr);
  87.159 +    g_free(item);
  87.160 +  }
  87.161 +  g_list_free(plain_list);
  87.162 +
  87.163 +  return list;
  87.164 +}
  87.165 +
  87.166 +static
  87.167 +GList *parse_resolve_list(gchar *line)
  87.168 +{
  87.169 +  GList *list;
  87.170 +  GList *list_node;
  87.171 +  GList *res_list = NULL;
  87.172 +
  87.173 +  list = parse_list(line, FALSE);
  87.174 +  if(list){
  87.175 +    foreach(list, list_node){
  87.176 +      gchar *item = (gchar *)(list_node->data);
  87.177 +      if(strcmp(item, "byname") == 0){
  87.178 +	res_list = g_list_append(res_list, resolve_byname);
  87.179 +#ifdef ENABLE_RESOLVER
  87.180 +      }else if(strcmp(item, "dns_a") == 0){
  87.181 +	res_list = g_list_append(res_list, resolve_dns_a);
  87.182 +      }else if(strcmp(item, "dns_mx") == 0){
  87.183 +	res_list = g_list_append(res_list, resolve_dns_mx);
  87.184 +#endif
  87.185 +      }else{
  87.186 +	logwrite(LOG_ALERT, "unknown resolver %s\n", item);
  87.187 +	exit(EXIT_FAILURE);
  87.188 +      }
  87.189 +      g_free(item);
  87.190 +    }
  87.191 +    g_list_free(list);
  87.192 +  }
  87.193 +  return res_list;
  87.194 +}
  87.195 +
  87.196 +static
  87.197 +interface *parse_interface(gchar *line, gint def_port)
  87.198 +{
  87.199 +  gchar buf[256];
  87.200 +  gchar *p, *q;
  87.201 +  interface *iface;
  87.202 +
  87.203 +  DEBUG(6) fprintf(stderr, "parse_interface: %s\n", line);
  87.204 +
  87.205 +  p = line;
  87.206 +  q = buf;
  87.207 +  while((*p != 0) && (*p != ':') && (q < buf+255))
  87.208 +    *(q++) = *(p++);
  87.209 +  *q = 0;
  87.210 +
  87.211 +  iface = g_malloc(sizeof(interface));
  87.212 +  iface->address = g_strdup(buf);
  87.213 +
  87.214 +  if(*p){
  87.215 +    p++;
  87.216 +    iface->port = atoi(p);
  87.217 +  }else
  87.218 +    iface->port = def_port;
  87.219 +
  87.220 +  return iface;
  87.221 +}
  87.222 +
  87.223 +#ifdef ENABLE_IDENT /* so far used for that only */
  87.224 +static
  87.225 +struct in_addr *parse_network(gchar *line, gint def_port)
  87.226 +{
  87.227 +  gchar buf[256];
  87.228 +  gchar *p, *q;
  87.229 +  struct in_addr addr, mask_addr, net_addr, *p_net_addr;
  87.230 +  guint n;
  87.231 +
  87.232 +  DEBUG(6) fprintf(stderr, "parse_network: %s\n", line);
  87.233 +
  87.234 +  p = line;
  87.235 +  q = buf;
  87.236 +  while((*p != 0) && (*p != '/') && (q < buf+255))
  87.237 +    *(q++) = *(p++);
  87.238 +  *q = 0;
  87.239 +
  87.240 +  if((addr.s_addr = inet_addr(buf)) != INADDR_NONE){
  87.241 +    if(*p){
  87.242 +      guint i;
  87.243 +      p++;
  87.244 +      i = atoi(p);
  87.245 +      if((i >= 0) && (i <= 32))
  87.246 +	n = i ? ~((1 << (32 - i)) - 1) : 0;
  87.247 +      else{
  87.248 +	fprintf(stderr, "'%d' is not a valid net mask (must be >= 0 and <= 32)\n", i);
  87.249 +	exit(EXIT_FAILURE);
  87.250 +      }
  87.251 +    }else
  87.252 +      n = 0;
  87.253 +    
  87.254 +    mask_addr.s_addr = htonl(n);
  87.255 +    net_addr.s_addr = mask_addr.s_addr & addr.s_addr;
  87.256 +  }else{
  87.257 +    fprintf(stderr, "'%s' is not a valid address (must be ip)\n", buf);
  87.258 +    exit(EXIT_FAILURE);
  87.259 +  }
  87.260 +
  87.261 +  p_net_addr = g_malloc(sizeof(struct in_addr));
  87.262 +  p_net_addr->s_addr = net_addr.s_addr;
  87.263 +  return p_net_addr;
  87.264 +}
  87.265 +#endif
  87.266 +
  87.267 +static
  87.268 +gboolean eat_comments(FILE *in)
  87.269 +{
  87.270 +  gint c;
  87.271 +
  87.272 +  for(c = fgetc(in); (c == '#' || isspace(c)) && c != EOF; c = fgetc(in)){
  87.273 +    if(c == '#'){
  87.274 +      gint c;
  87.275 +      for(c = fgetc(in); (c != '\n') && (c != EOF); c = fgetc(in));
  87.276 +    }
  87.277 +  }
  87.278 +  if(c == EOF) return FALSE;
  87.279 +  ungetc(c, in);
  87.280 +  return TRUE;
  87.281 +}
  87.282 +
  87.283 +/* after parsing, eat trailing character until LF */
  87.284 +static
  87.285 +gboolean eat_line_trailing(FILE *in)
  87.286 +{
  87.287 +  gint c;
  87.288 +
  87.289 +  for(c = fgetc(in); c != EOF && c != '\n'; c = fgetc(in));
  87.290 +  if(c == EOF) return FALSE;
  87.291 +  return TRUE;
  87.292 +}
  87.293 +
  87.294 +static
  87.295 +gboolean eat_spaces(FILE *in)
  87.296 +{
  87.297 +  gint c;
  87.298 +  
  87.299 +  for(c = fgetc(in); c != EOF && isspace(c); c = fgetc(in));
  87.300 +  if(c == EOF) return FALSE;
  87.301 +  ungetc(c, in);
  87.302 +  return TRUE;
  87.303 +}
  87.304 +
  87.305 +static
  87.306 +gboolean read_lval(FILE *in, gchar *buf, gint size)
  87.307 +{
  87.308 +  gint c;
  87.309 +  gchar *ptr = buf;
  87.310 +  
  87.311 +  DEBUG(6) fprintf(stderr, "read_lval()\n");
  87.312 +
  87.313 +  if(!eat_spaces(in)) return FALSE;
  87.314 +
  87.315 +  c = fgetc(in);
  87.316 +  DEBUG(6) fprintf(stderr, "read_lval() 2\n");
  87.317 +  while((isalnum(c) || c == '_' || c == '-' || c == '.')
  87.318 +	&& (ptr < buf+size-1)
  87.319 +	&& (c != EOF)
  87.320 +	){
  87.321 +    *ptr = c; ptr++;
  87.322 +    c = fgetc(in);
  87.323 +  }
  87.324 +  *ptr = 0;
  87.325 +  ungetc(c, in);
  87.326 +
  87.327 +  if(c == EOF){
  87.328 +    fprintf(stderr, "unexpected EOF after %s\n", buf);
  87.329 +    return FALSE;
  87.330 +  }else if(ptr >= buf+size-1){
  87.331 +    fprintf(stderr, "lval too long\n");
  87.332 +  }
  87.333 +
  87.334 +  eat_spaces(in);
  87.335 +
  87.336 +  DEBUG(6) fprintf(stderr, "lval = %s\n", buf);
  87.337 +
  87.338 +  return buf[0] != 0;
  87.339 +}
  87.340 +
  87.341 +static
  87.342 +gboolean read_rval(FILE *in, gchar *buf, gint size)
  87.343 +{
  87.344 +  gint c;
  87.345 +  gchar *ptr = buf;
  87.346 +  
  87.347 +  DEBUG(6) fprintf(stderr, "read_rval()\n");
  87.348 +
  87.349 +  if(!eat_spaces(in)) return FALSE;
  87.350 +
  87.351 +  c = fgetc(in);
  87.352 +  if(c != '\"'){
  87.353 +    while((isalnum(c) || c == '_' || c == '-' || c == '.' || c == '/' || c == '@' || c == ';')
  87.354 +	  && (ptr < buf+size-1)
  87.355 +	  && (c != EOF)
  87.356 +	  ){
  87.357 +      *ptr = c; ptr++;
  87.358 +      c = fgetc(in);
  87.359 +    }
  87.360 +    *ptr = 0;
  87.361 +    ungetc(c, in);
  87.362 +  }else{
  87.363 +    gboolean escape = FALSE;
  87.364 +    c = fgetc(in);
  87.365 +    while(((c != '\"') || escape) && (ptr < buf+size-1)){
  87.366 +      if(c != '\n'){ /* ignore line breaks */
  87.367 +	if((c == '\\') && (!escape)){
  87.368 +	  escape = TRUE;
  87.369 +	}else{
  87.370 +	  *ptr = c; ptr++;
  87.371 +	  escape = FALSE;
  87.372 +	}
  87.373 +      }
  87.374 +      c = fgetc(in);
  87.375 +    }
  87.376 +    *ptr = 0;
  87.377 +  }
  87.378 +  
  87.379 +  eat_line_trailing(in);
  87.380 +
  87.381 +  DEBUG(6) fprintf(stderr, "rval = %s\n", buf);
  87.382 +
  87.383 +  return TRUE;
  87.384 +}
  87.385 +
  87.386 +static
  87.387 +gboolean read_statement(FILE *in,
  87.388 +			gchar *lval, gint lsize,
  87.389 +			gchar *rval, gint rsize)
  87.390 +{
  87.391 +  gint c;
  87.392 +
  87.393 +  DEBUG(6) fprintf(stderr, "read_statement()\n");
  87.394 +
  87.395 +  /* eat comments and empty lines: */
  87.396 +  if(!eat_comments(in)) return FALSE;
  87.397 +
  87.398 +  DEBUG(6) fprintf(stderr, "read_statement() 1\n");
  87.399 +
  87.400 +  if(read_lval(in, lval, lsize)){
  87.401 +    DEBUG(6) fprintf(stderr, "lval = %s\n", lval);
  87.402 +    if((c = fgetc(in) == '=')){
  87.403 +      if(read_rval(in, rval, rsize)){
  87.404 +	DEBUG(6) fprintf(stderr, "rval = %s\n", rval);
  87.405 +	return TRUE;
  87.406 +      }
  87.407 +    }else{
  87.408 +      fprintf(stderr, "'=' expected after %s, char was '%c'\n", lval, c);
  87.409 +    }
  87.410 +  }
  87.411 +  return FALSE;
  87.412 +}
  87.413 +
  87.414 +gboolean read_conf(gchar *filename)
  87.415 +{
  87.416 +  FILE *in;
  87.417 +
  87.418 +  conf.log_max_pri = 7;
  87.419 +
  87.420 +  conf.remote_port = 25;
  87.421 +
  87.422 +  conf.do_relay = TRUE;
  87.423 +
  87.424 +  conf.alias_local_cmp = strcmp;
  87.425 +
  87.426 +  conf.max_defer_time = 86400*4; /* 4 days */
  87.427 +
  87.428 +  if((in = fopen(filename, "r"))){
  87.429 +    gchar lval[256], rval[2048];
  87.430 +    while(read_statement(in, lval, 256, rval, 2048)){
  87.431 +      if(strcmp(lval, "debug_level") == 0)
  87.432 +	conf.debug_level = atoi(rval);
  87.433 +      else if(strcmp(lval, "run_as_user") == 0){
  87.434 +	if(!conf.run_as_user) /* you should not be able
  87.435 +				 to reset that flag */
  87.436 +	  conf.run_as_user = parse_boolean(rval);
  87.437 +      }else if(strcmp(lval, "use_syslog") == 0)
  87.438 +	conf.use_syslog = parse_boolean(rval);
  87.439 +      else if(strcmp(lval, "mail_dir") == 0)
  87.440 +	conf.mail_dir = g_strdup(rval);
  87.441 +      else if(strcmp(lval, "lock_dir") == 0)
  87.442 +	conf.lock_dir = g_strdup(rval);
  87.443 +      else if(strcmp(lval, "spool_dir") == 0)
  87.444 +	conf.spool_dir = g_strdup(rval);
  87.445 +      else if(strcmp(lval, "log_dir") == 0)
  87.446 +	conf.log_dir = g_strdup(rval);
  87.447 +      else if(strcmp(lval, "host_name") == 0){
  87.448 +	if(rval[0] != '/')
  87.449 +	  conf.host_name = g_strdup(rval);
  87.450 +	else{
  87.451 +	  char buf[256];
  87.452 +	  FILE *fptr = fopen(rval, "rt");
  87.453 +	  if(fptr){
  87.454 +	    fgets(buf, 255, fptr);
  87.455 +	    g_strchomp(buf);
  87.456 +	    conf.host_name = g_strdup(buf);
  87.457 +	    fclose(fptr);
  87.458 +	  }else{
  87.459 +	    fprintf(stderr, "could not open %s: %s\n", rval, strerror(errno));
  87.460 +	    return FALSE;
  87.461 +	  }
  87.462 +	}
  87.463 +      }
  87.464 +      else if(strcmp(lval, "remote_port") == 0){
  87.465 +	fprintf(stderr,
  87.466 +		"the remote_port option is now deprecated. Use 'mail_host' in the\n"
  87.467 +		"route configuration instead. See man masqmail.route\n");
  87.468 +	conf.remote_port = atoi(rval);
  87.469 +      }else if(strcmp(lval, "local_hosts") == 0)
  87.470 +	conf.local_hosts = parse_list(rval, FALSE);
  87.471 +      else if(strcmp(lval, "local_addresses") == 0)
  87.472 +	conf.local_addresses = parse_list(rval, TRUE);
  87.473 +      else if(strcmp(lval, "not_local_addresses") == 0)
  87.474 +	conf.not_local_addresses = parse_list(rval, TRUE);
  87.475 +      else if(strcmp(lval, "local_nets") == 0)
  87.476 +	conf.local_nets = parse_list(rval, FALSE);
  87.477 +      else if(strcmp(lval, "do_save_envelope_to") == 0)
  87.478 +	conf.do_save_envelope_to = parse_boolean(rval);
  87.479 +      else if(strcmp(lval, "defer_all") == 0)
  87.480 +	conf.defer_all = parse_boolean(rval);
  87.481 +      else if(strcmp(lval, "do_relay") == 0)
  87.482 +	conf.do_relay = parse_boolean(rval);
  87.483 +      else if(strcmp(lval, "alias_file") == 0){
  87.484 +	conf.alias_file = g_strdup(rval);
  87.485 +      }else if(strcmp(lval, "alias_local_caseless") == 0){
  87.486 +	conf.alias_local_cmp = parse_boolean(rval) ? strcasecmp : strcmp;
  87.487 +      }else if(strcmp(lval, "mbox_default") == 0){
  87.488 +	conf.mbox_default = g_strdup(rval);
  87.489 +      }else if(strcmp(lval, "mbox_users") == 0){
  87.490 +	conf.mbox_users = parse_list(rval, TRUE);
  87.491 +      }else if(strcmp(lval, "mda_users") == 0){
  87.492 +	conf.mda_users = parse_list(rval, TRUE);
  87.493 +      }else if(strcmp(lval, "maildir_users") == 0){
  87.494 +	conf.maildir_users = parse_list(rval, TRUE);
  87.495 +      }else if(strcmp(lval, "mda") == 0){
  87.496 +	conf.mda = g_strdup(rval);
  87.497 +      }else if(strcmp(lval, "mda_fromline") == 0){
  87.498 +	conf.mda_fromline = parse_boolean(rval);
  87.499 +      }else if(strcmp(lval, "mda_fromhack") == 0){
  87.500 +	conf.mda_fromhack = parse_boolean(rval);
  87.501 +      }else if(strcmp(lval, "pipe_fromline") == 0){
  87.502 +	conf.pipe_fromline = parse_boolean(rval);
  87.503 +      }else if(strcmp(lval, "pipe_fromhack") == 0){
  87.504 +	conf.pipe_fromhack = parse_boolean(rval);
  87.505 +      }else if(strcmp(lval, "listen_addresses") == 0){
  87.506 +	GList *node;
  87.507 +	GList *tmp_list = parse_list(rval, FALSE);
  87.508 +	    
  87.509 +	conf.listen_addresses = NULL;
  87.510 +	foreach(tmp_list, node){
  87.511 +	  conf.listen_addresses =
  87.512 +	    g_list_append(conf.listen_addresses,
  87.513 +			  parse_interface((gchar *)(node->data), 25));
  87.514 +	  g_free(node->data);
  87.515 +	}
  87.516 +	g_list_free(tmp_list);
  87.517 +      }
  87.518 +      else if(strcmp(lval, "ident_trusted_nets") == 0){
  87.519 +#ifdef ENABLE_IDENT
  87.520 +	GList *node;
  87.521 +	GList *tmp_list = parse_list(rval, FALSE);
  87.522 +	    
  87.523 +	conf.ident_trusted_nets = NULL;
  87.524 +	foreach(tmp_list, node){
  87.525 +	  conf.ident_trusted_nets =
  87.526 +	    g_list_append(conf.ident_trusted_nets,
  87.527 +			  parse_network((gchar *)(node->data), 25));
  87.528 +	  g_free(node->data);
  87.529 +	}
  87.530 +	g_list_free(tmp_list);
  87.531 +#else
  87.532 +	fprintf(stderr, "%s ignored: not compiled with ident support\n", lval);
  87.533 +#endif
  87.534 +      }
  87.535 +      else if((strncmp(lval, "connect_route.", 14) == 0) ||
  87.536 +	      (strncmp(lval, "online_routes.", 14) == 0)){
  87.537 +	GList *file_list = parse_list(rval, FALSE);
  87.538 +	table_pair *pair = create_pair(&(lval[14]), file_list);
  87.539 +	conf.connect_routes = g_list_append(conf.connect_routes, pair);
  87.540 +      }
  87.541 +      else if(strcmp(lval, "local_net_route") == 0){
  87.542 +	conf.local_net_routes = parse_list(rval, FALSE);
  87.543 +      }
  87.544 +      else if(strcmp(lval, "online_detect") == 0)
  87.545 +	conf.online_detect = g_strdup(rval);
  87.546 +      else if(strcmp(lval, "online_file") == 0)
  87.547 +	conf.online_file = g_strdup(rval);
  87.548 +      else if(strcmp(lval, "online_pipe") == 0)
  87.549 +	conf.online_pipe = g_strdup(rval);
  87.550 +      else if(strcmp(lval, "mserver_iface") == 0)
  87.551 +	conf.mserver_iface = parse_interface(rval, 224);
  87.552 +      else if(strcmp(lval, "do_queue") == 0)
  87.553 +	conf.do_queue = parse_boolean(rval);
  87.554 +      else if(strncmp(lval, "get.", 4) == 0){
  87.555 +#ifdef ENABLE_POP3
  87.556 +	table_pair *pair = create_pair_string(&(lval[4]), rval);
  87.557 +	conf.get_names = g_list_append(conf.get_names, pair);
  87.558 +#else
  87.559 +	fprintf(stderr, "get.<name> ignored: not compiled with pop support\n");
  87.560 +#endif
  87.561 +      }
  87.562 +      else if(strncmp(lval, "online_gets.", 12) == 0){
  87.563 +#ifdef ENABLE_POP3
  87.564 +	GList *file_list = parse_list(rval, FALSE);
  87.565 +	table_pair *pair = create_pair(&(lval[12]), file_list);
  87.566 +	conf.online_gets = g_list_append(conf.online_gets, pair);
  87.567 +#else
  87.568 +	fprintf(stderr, "online_gets.<name> ignored: not compiled with pop support\n");
  87.569 +#endif
  87.570 +      }
  87.571 +      else if(strcmp(lval, "errmsg_file") == 0)
  87.572 +	conf.errmsg_file = g_strdup(rval);
  87.573 +      else if(strcmp(lval, "warnmsg_file") == 0)
  87.574 +	conf.warnmsg_file = g_strdup(rval);
  87.575 +      else if(strcmp(lval, "warn_intervals") == 0)
  87.576 +	conf.warn_intervals = parse_list(rval, FALSE);
  87.577 +      else if(strcmp(lval, "max_defer_time") == 0){
  87.578 +	gint dummy;
  87.579 +	gint ival = time_interval(rval, &dummy);
  87.580 +	if(ival < 0)
  87.581 +	  fprintf(stderr, "invalid time interval for 'max_defer_time': %s\n", rval);
  87.582 +	else
  87.583 +	  conf.max_defer_time = ival;
  87.584 +      }else if(strcmp(lval, "log_user") == 0)
  87.585 +	conf.log_user = g_strdup(rval);
  87.586 +
  87.587 +      else
  87.588 +	fprintf(stderr, "var '%s' not (yet) known, ignored\n", lval);
  87.589 +    }
  87.590 +    fclose(in);
  87.591 +
  87.592 +    if(conf.errmsg_file == NULL)
  87.593 +      conf.errmsg_file = g_strdup(DATA_DIR"/tpl/failmsg.tpl");
  87.594 +    if(conf.warnmsg_file == NULL)
  87.595 +      conf.warnmsg_file = g_strdup(DATA_DIR"/tpl/warnmsg.tpl");
  87.596 +
  87.597 +    if(conf.lock_dir == NULL)
  87.598 +      conf.lock_dir = g_strdup_printf("%s/lock/", conf.spool_dir);
  87.599 +
  87.600 +    if(conf.mbox_default == NULL)
  87.601 +      conf.mbox_default = g_strdup("mbox");
  87.602 +
  87.603 +    if(conf.warn_intervals == NULL)
  87.604 +      conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE);
  87.605 +
  87.606 +    return TRUE;
  87.607 +  }else
  87.608 +    fprintf(stderr, "could not open config file %s: %s\n", filename, strerror(errno));
  87.609 +  return FALSE;
  87.610 +}
  87.611 +
  87.612 +connect_route *read_route(gchar *filename, gboolean is_local_net)
  87.613 +{
  87.614 +  gboolean ok = FALSE;
  87.615 +  FILE *in;
  87.616 +
  87.617 +  connect_route *route = g_malloc(sizeof(connect_route));
  87.618 +  memset(route, 0, sizeof(connect_route));
  87.619 +
  87.620 +  DEBUG(5) debugf("read_route, filename = %s\n", filename);
  87.621 +
  87.622 +  route->filename = g_strdup(filename);
  87.623 +  route->name = g_strdup(filename); /* quick hack */
  87.624 +
  87.625 +  route->protocol = g_strdup("smtp");
  87.626 +  route->expand_h_sender_address = TRUE;
  87.627 +
  87.628 +  route->is_local_net = is_local_net;
  87.629 +
  87.630 +  route->do_pipelining = TRUE;
  87.631 +
  87.632 +  if((in = fopen(route->filename, "r"))){
  87.633 +    gchar lval[256], rval[2048];
  87.634 +    while(read_statement(in, lval, 256, rval, 2048)){
  87.635 +      if(strcmp(lval, "protocol") == 0)
  87.636 +	route->protocol = g_strdup(rval);
  87.637 +      else if(strcmp(lval, "mail_host") == 0)
  87.638 +	route->mail_host = parse_interface(rval, conf.remote_port);
  87.639 +      else if(strcmp(lval, "helo_name") == 0)
  87.640 +	route->helo_name = g_strdup(rval);
  87.641 +      else if(strcmp(lval, "wrapper") == 0)
  87.642 +	route->wrapper = g_strdup(rval);
  87.643 +      else if(strcmp(lval, "connect_error_fail") == 0)
  87.644 +	route->connect_error_fail = parse_boolean(rval);
  87.645 +      else if(strcmp(lval, "do_correct_helo") == 0)
  87.646 +	route->do_correct_helo = parse_boolean(rval);
  87.647 +      else if(strcmp(lval, "do_pipelining") == 0)
  87.648 +	route->do_pipelining = parse_boolean(rval);
  87.649 +      else if(strcmp(lval, "allowed_return_paths") == 0)
  87.650 +	route->allowed_return_paths = parse_address_list(rval, TRUE);
  87.651 +      else if(strcmp(lval, "allowed_mail_locals") == 0)
  87.652 +	route->allowed_mail_locals = parse_list(rval, TRUE);
  87.653 +      else if(strcmp(lval, "not_allowed_return_paths") == 0)
  87.654 +	route->not_allowed_return_paths = parse_address_list(rval, TRUE);
  87.655 +      else if(strcmp(lval, "not_allowed_mail_locals") == 0)
  87.656 +	route->not_allowed_mail_locals = parse_list(rval, TRUE);
  87.657 +      else if(strcmp(lval, "allowed_rcpt_domains") == 0)
  87.658 +	route->allowed_rcpt_domains = parse_list(rval, TRUE);
  87.659 +      else if(strcmp(lval, "not_allowed_rcpt_domains") == 0)
  87.660 +	route->not_allowed_rcpt_domains = parse_list(rval, TRUE);
  87.661 +      else if(strcmp(lval, "set_h_from_domain") == 0)
  87.662 +	route->set_h_from_domain = g_strdup(rval);
  87.663 +      else if(strcmp(lval, "set_h_reply_to_domain") == 0)
  87.664 +	route->set_h_reply_to_domain = g_strdup(rval);
  87.665 +      else if(strcmp(lval, "set_return_path_domain") == 0)
  87.666 +	route->set_return_path_domain = g_strdup(rval);
  87.667 +      else if(strcmp(lval, "map_return_path_addresses") == 0){
  87.668 +	GList *node, *list;
  87.669 +
  87.670 +	list = parse_list(rval, TRUE);
  87.671 +	foreach(list, node){
  87.672 +	  gchar *item = (gchar *)(node->data);
  87.673 +	  table_pair *pair = parse_table_pair(item, ':');
  87.674 +	  address *addr = create_address((gchar *)(pair->value), TRUE);
  87.675 +	  g_free(pair->value);
  87.676 +	  pair->value = (gpointer *)addr;
  87.677 +	  route->map_return_path_addresses =
  87.678 +	    g_list_append(route->map_return_path_addresses, pair);
  87.679 +	  g_free(item);
  87.680 +	}
  87.681 +	g_list_free(list);
  87.682 +      }
  87.683 +      else if(strcmp(lval, "map_h_from_addresses") == 0){
  87.684 +	GList *list, *node;
  87.685 +
  87.686 +	list = parse_list(rval, TRUE);
  87.687 +	foreach(list, node){
  87.688 +	  gchar *item = (gchar *)(node->data);
  87.689 +	  table_pair *pair = parse_table_pair(item, ':');
  87.690 +	  route->map_h_from_addresses = 
  87.691 +	    g_list_append(route->map_h_from_addresses, pair);
  87.692 +	  g_free(item);
  87.693 +	}
  87.694 +	g_list_free(list);
  87.695 +      }
  87.696 +      else if(strcmp(lval, "map_h_reply_to_addresses") == 0){
  87.697 +	GList *list, *node;
  87.698 +
  87.699 +	list = parse_list(rval, TRUE);
  87.700 +	foreach(list, node){
  87.701 +	  gchar *item = (gchar *)(node->data);
  87.702 +	  table_pair *pair = parse_table_pair(item, ':');
  87.703 +	  route->map_h_reply_to_addresses = 
  87.704 +	    g_list_append(route->map_h_reply_to_addresses, pair);
  87.705 +	  g_free(item);
  87.706 +	}
  87.707 +	g_list_free(list);
  87.708 +      }
  87.709 +      else if(strcmp(lval, "map_h_mail_followup_to_addresses") == 0){
  87.710 +	GList *list, *node;
  87.711 +
  87.712 +	list = parse_list(rval, TRUE);
  87.713 +	foreach(list, node){
  87.714 +	  gchar *item = (gchar *)(node->data);
  87.715 +	  table_pair *pair = parse_table_pair(item, ':');
  87.716 +	  route->map_h_mail_followup_to_addresses = 
  87.717 +	    g_list_append(route->map_h_mail_followup_to_addresses, pair);
  87.718 +	  g_free(item);
  87.719 +	}
  87.720 +	g_list_free(list);
  87.721 +      }
  87.722 +      else if(strcmp(lval, "expand_h_sender_domain") == 0){
  87.723 +	route->expand_h_sender_domain = parse_boolean(rval);	    
  87.724 +      }
  87.725 +      else if(strcmp(lval, "expand_h_sender_address") == 0){
  87.726 +	route->expand_h_sender_address = parse_boolean(rval);	    
  87.727 +      }
  87.728 +      else if(strcmp(lval, "resolve_list") == 0)
  87.729 +	route->resolve_list = parse_resolve_list(rval);
  87.730 +      else if(strcmp(lval, "do_ssl") == 0){
  87.731 +	/* we ignore this. This option is used by sqilconf */
  87.732 +	;
  87.733 +      }
  87.734 +#ifdef ENABLE_AUTH
  87.735 +      else if(strcmp(lval, "auth_name") == 0){
  87.736 +	route->auth_name = g_strdup(rval);
  87.737 +      }
  87.738 +      else if(strcmp(lval, "auth_login") == 0){
  87.739 +	route->auth_login = g_strdup(rval);
  87.740 +      }
  87.741 +      else if(strcmp(lval, "auth_secret") == 0){
  87.742 +	route->auth_secret = g_strdup(rval);
  87.743 +      }
  87.744 +#else
  87.745 +      else if((strcmp(lval, "auth_name") == 0) ||
  87.746 +	      (strcmp(lval, "auth_login") == 0) ||
  87.747 +	      (strcmp(lval, "auth_secret") == 0)){
  87.748 +	logwrite(LOG_WARNING, "%s ignored: not compiled with auth support.\n", lval);
  87.749 +      }
  87.750 +#endif
  87.751 +      else if(strcmp(lval, "pop3_login") == 0){
  87.752 +#ifdef ENABLE_POP3
  87.753 +	route->pop3_login = g_strdup(rval);
  87.754 +#else
  87.755 +	logwrite(LOG_WARNING, "pop3_login ignored: not compiled with pop support.\n");
  87.756 +#endif
  87.757 +      }
  87.758 +      else if(strcmp(lval, "pipe") == 0){
  87.759 +	route->pipe = g_strdup(rval);
  87.760 +      }
  87.761 +      else if(strcmp(lval, "pipe_fromline") == 0){
  87.762 +	route->pipe_fromline = parse_boolean(rval);
  87.763 +      }
  87.764 +      else if(strcmp(lval, "pipe_fromhack") == 0){
  87.765 +	route->pipe_fromhack = parse_boolean(rval);
  87.766 +      }
  87.767 +      else if(strcmp(lval, "last_route") == 0){
  87.768 +	route->last_route = parse_boolean(rval);
  87.769 +      }
  87.770 +      else
  87.771 +	logwrite(LOG_WARNING, "var '%s' not (yet) known, ignored\n", lval);
  87.772 +    }
  87.773 +
  87.774 +    if(route->resolve_list == NULL){
  87.775 +      if(is_local_net){
  87.776 +	route->resolve_list =
  87.777 +	  g_list_append(NULL, resolve_byname);
  87.778 +      }else{
  87.779 +#ifdef ENABLE_RESOLVER
  87.780 +	route->resolve_list =
  87.781 +	  g_list_append(route->resolve_list, resolve_dns_mx);
  87.782 +	route->resolve_list =
  87.783 +	  g_list_append(route->resolve_list, resolve_dns_a);
  87.784 +#endif
  87.785 +	route->resolve_list =
  87.786 +	  g_list_append(route->resolve_list, resolve_byname);
  87.787 +      }
  87.788 +    }
  87.789 +    fclose(in);
  87.790 +    ok = TRUE;
  87.791 +
  87.792 +    /* warn user about misconfigurations: */
  87.793 +    if((route->map_h_from_addresses != NULL) && (route->set_h_from_domain != NULL)){
  87.794 +      logwrite(LOG_WARNING, "'map_h_from_addresses' overrides 'set_h_from_domain'\n");
  87.795 +      g_free(route->set_h_from_domain);
  87.796 +      route->set_h_from_domain = NULL;
  87.797 +    }
  87.798 +    if((route->map_h_reply_to_addresses != NULL) && (route->set_h_reply_to_domain != NULL)){
  87.799 +      logwrite(LOG_WARNING, "'map_h_reply_to_addresses' overrides 'set_h_reply_to_domain'\n");
  87.800 +      g_free(route->set_h_reply_to_domain);
  87.801 +      route->set_h_reply_to_domain = NULL;
  87.802 +    }
  87.803 +  }else{
  87.804 +    logwrite(LOG_ALERT, "could not open route file %s: %s\n",
  87.805 +	     route->filename, strerror(errno));
  87.806 +  }
  87.807 +
  87.808 +  if(!ok){
  87.809 +    g_free(route);
  87.810 +    route = NULL;
  87.811 +  }
  87.812 +
  87.813 +  return route;
  87.814 +}
  87.815 +
  87.816 +static
  87.817 +void _g_list_free_all(GList *list)
  87.818 +{
  87.819 +  GList *node;
  87.820 +  if(list){
  87.821 +    foreach(list, node)
  87.822 +      g_free(node->data);
  87.823 +    g_list_free(list);
  87.824 +  }
  87.825 +}
  87.826 +
  87.827 +void destroy_route(connect_route *r)
  87.828 +{
  87.829 +  if(r->filename) g_free(r->filename);
  87.830 +  if(r->protocol) g_free(r->protocol);
  87.831 +  if(r->mail_host){
  87.832 +    g_free(r->mail_host->address);
  87.833 +    g_free(r->mail_host);
  87.834 +  }
  87.835 +  if(r->wrapper) g_free(r->wrapper);
  87.836 +  if(r->helo_name) g_free(r->helo_name);
  87.837 +  _g_list_free_all(r->allowed_mail_locals);
  87.838 +  _g_list_free_all(r->not_allowed_mail_locals);
  87.839 +  _g_list_free_all(r->allowed_rcpt_domains);
  87.840 +  _g_list_free_all(r->not_allowed_rcpt_domains);
  87.841 +  if(r->set_h_from_domain) g_free(r->set_h_from_domain);
  87.842 +  if(r->set_h_reply_to_domain) g_free(r->set_h_reply_to_domain);
  87.843 +  if(r->set_return_path_domain) g_free(r->set_return_path_domain);
  87.844 +  if(r->map_h_reply_to_addresses) destroy_table(r->map_h_reply_to_addresses);
  87.845 +  if(r->resolve_list) g_list_free(r->resolve_list);
  87.846 +#ifdef ENABLE_AUTH
  87.847 +  if(r->auth_name) g_free(r->auth_name);
  87.848 +  if(r->auth_login) g_free(r->auth_login);
  87.849 +  if(r->auth_secret) g_free(r->auth_secret);
  87.850 +#endif
  87.851 +#ifdef ENABLE_POP3
  87.852 +  if(r->pop3_login) g_free(r->pop3_login);
  87.853 +#endif
  87.854 +  if(r->pipe) g_free(r->pipe);
  87.855 +  g_free(r);
  87.856 +}
  87.857 +
  87.858 +GList *read_route_list(GList *rf_list, gboolean is_local_net)
  87.859 +{
  87.860 +  GList *list = NULL;
  87.861 +  GList *node;
  87.862 +  uid_t saved_uid, saved_gid;
  87.863 +
  87.864 +  if(!conf.run_as_user){
  87.865 +    set_euidgid(0, 0, &saved_uid, &saved_gid);
  87.866 +  }
  87.867 +
  87.868 +  foreach(rf_list, node){
  87.869 +    gchar *fname = (gchar *)(node->data);
  87.870 +    connect_route *route = read_route(fname, is_local_net);
  87.871 +    if(route)
  87.872 +      list = g_list_append(list, route);
  87.873 +    else
  87.874 +      logwrite(LOG_ALERT, "could not read route configuration %s\n", fname);
  87.875 +  }
  87.876 +
  87.877 +  /* set uid and gid back */
  87.878 +  if(!conf.run_as_user){
  87.879 +    set_euidgid(saved_uid, saved_gid, NULL, NULL);
  87.880 +  }
  87.881 +
  87.882 +  return list;
  87.883 +}
  87.884 +
  87.885 +void destroy_route_list(GList *list)
  87.886 +{
  87.887 +  GList *node;
  87.888 +
  87.889 +  foreach(list, node){
  87.890 +    connect_route *route = (connect_route *)(node->data);
  87.891 +    destroy_route(route);
  87.892 +  }
  87.893 +  g_list_free(list);
  87.894 +}
  87.895 +
  87.896 +#ifdef ENABLE_POP3
  87.897 +
  87.898 +get_conf *read_get_conf(gchar *filename)
  87.899 +{
  87.900 +  FILE *in;
  87.901 +
  87.902 +  get_conf *gc = g_malloc(sizeof(get_conf));
  87.903 +  memset(gc, 0, sizeof(get_conf));
  87.904 +
  87.905 +  gc->server_port = 110;
  87.906 +
  87.907 +  if((in = fopen(filename, "r"))){
  87.908 +    gchar lval[256], rval[2048];
  87.909 +    while(read_statement(in, lval, 256, rval, 2048)){
  87.910 +      if(strcmp(lval, "protocol") == 0)
  87.911 +	gc->protocol = g_strdup(rval);
  87.912 +      else if(strcmp(lval, "server") == 0)
  87.913 +	gc->server_name = g_strdup(rval);
  87.914 +      else if(strcmp(lval, "port") == 0)
  87.915 +	gc->server_port = atoi(rval);
  87.916 +      else if(strcmp(lval, "wrapper") == 0)
  87.917 +	gc->wrapper = g_strdup(rval);
  87.918 +      else if(strcmp(lval, "user") == 0)
  87.919 +	gc->login_user = g_strdup(rval);
  87.920 +      else if(strcmp(lval, "pass") == 0)
  87.921 +	gc->login_pass = g_strdup(rval);
  87.922 +      else if(strcmp(lval, "address") == 0)
  87.923 +	gc->address = create_address_qualified(rval, TRUE, conf.host_name);
  87.924 +      else if(strcmp(lval, "return_path") == 0)
  87.925 +	gc->return_path = create_address_qualified(rval, TRUE, conf.host_name);
  87.926 +      else if(strcmp(lval, "do_ssl") == 0)
  87.927 +	/* we ignore this. This option is used by sqilconf */
  87.928 +	;
  87.929 +      else if(strcmp(lval, "do_keep") == 0)
  87.930 +	gc->do_keep = parse_boolean(rval);
  87.931 +      else if(strcmp(lval, "do_uidl") == 0)
  87.932 +	gc->do_uidl = parse_boolean(rval);
  87.933 +      else if(strcmp(lval, "do_uidl_dele") == 0)
  87.934 +	gc->do_uidl_dele = parse_boolean(rval);
  87.935 +      else if(strcmp(lval, "max_size") == 0)
  87.936 +	gc->max_size = atoi(rval);
  87.937 +      else if(strcmp(lval, "max_size_delete") == 0)
  87.938 +	gc->max_size = parse_boolean(rval);
  87.939 +      else if(strcmp(lval, "max_count") == 0)
  87.940 +	gc->max_count = atoi(rval);
  87.941 +      else if(strcmp(lval, "resolve_list") == 0)
  87.942 +	gc->resolve_list = parse_resolve_list(rval);
  87.943 +      else
  87.944 +	logwrite(LOG_WARNING, "var '%s' not (yet) known, ignored\n", lval);
  87.945 +    }
  87.946 +    fclose(in);
  87.947 +
  87.948 +    if(gc->resolve_list == NULL){
  87.949 +#ifdef ENABLE_RESOLVER
  87.950 +      gc->resolve_list =
  87.951 +	g_list_append(NULL, resolve_dns_a);
  87.952 +#endif
  87.953 +      gc->resolve_list =
  87.954 +	g_list_append(NULL, resolve_byname);
  87.955 +    }
  87.956 +    
  87.957 +    if(gc->protocol == NULL)
  87.958 +      gc->protocol = g_strdup("pop3");
  87.959 +    return gc;
  87.960 +  }
  87.961 +  logwrite(LOG_ALERT, "could not open get file %s: %s\n", filename, strerror(errno));
  87.962 +
  87.963 +  g_free(gc);
  87.964 +  return NULL;
  87.965 +}
  87.966 +
  87.967 +void destroy_get_conf(get_conf *gc)
  87.968 +{
  87.969 +  if(gc->protocol) g_free(gc->protocol);
  87.970 +  if(gc->server_name) g_free(gc->server_name);
  87.971 +  if(gc->login_user) g_free(gc->login_user);
  87.972 +  if(gc->login_pass) g_free(gc->login_pass);
  87.973 +  if(gc->wrapper) g_free(gc->wrapper);
  87.974 +  if(gc->address) destroy_address(gc->address);
  87.975 +  if(gc->return_path) destroy_address(gc->return_path);
  87.976 +  if(gc->resolve_list) g_list_free(gc->resolve_list);
  87.977 +  g_free(gc);
  87.978 +}
  87.979 +
  87.980 +#endif
  87.981 +
  87.982 +connect_route *create_local_route()
  87.983 +{
  87.984 +  connect_route *route;
  87.985 +
  87.986 +  route = g_malloc(sizeof(connect_route));
  87.987 +  if(route){
  87.988 +    memset(route, 0, sizeof(connect_route));
  87.989 +    route->protocol = g_strdup("smtp");
  87.990 +    route->is_local_net = TRUE;
  87.991 +    route->name = g_strdup("local_net (default)");
  87.992 +    route->expand_h_sender_address = TRUE;
  87.993 +    route->resolve_list =
  87.994 +      g_list_append(NULL, resolve_byname);
  87.995 +    route->connect_error_fail = TRUE;
  87.996 +  }
  87.997 +  return route;
  87.998 +}
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/src/connect.c	Fri Sep 26 17:05:23 2008 +0200
    88.3 @@ -0,0 +1,151 @@
    88.4 +/*  MasqMail
    88.5 +    Copyright (C) 1999 Oliver Kurth
    88.6 +
    88.7 +    This program is free software; you can redistribute it and/or modify
    88.8 +    it under the terms of the GNU General Public License as published by
    88.9 +    the Free Software Foundation; either version 2 of the License, or
   88.10 +    (at your option) any later version.
   88.11 +
   88.12 +    This program is distributed in the hope that it will be useful,
   88.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   88.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   88.15 +    GNU General Public License for more details.
   88.16 +
   88.17 +    You should have received a copy of the GNU General Public License
   88.18 +    along with this program; if not, write to the Free Software
   88.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   88.20 +*/
   88.21 +#include "masqmail.h"
   88.22 +
   88.23 +static
   88.24 +GList *resolve_ip(GList *list, gchar *ip)
   88.25 +{
   88.26 +  struct in_addr ia;
   88.27 +  if(inet_aton(ip, &ia)){
   88.28 +    mxip_addr mxip;
   88.29 +    
   88.30 +    mxip.name = g_strdup(ip);
   88.31 +    mxip.pref = 0;
   88.32 +    mxip.ip = (guint32) *(guint32 *)(&ia);
   88.33 +    list = g_list_append(list, g_memdup(&mxip, sizeof(mxip)));
   88.34 +  }
   88.35 +  /* logwrite(LOG_ALERT, "invalid address '%s': inet_aton() failed\n", ip);*/
   88.36 +  return NULL;
   88.37 +}
   88.38 +
   88.39 +mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port,
   88.40 +			  GList *addr_list)
   88.41 +{
   88.42 +  GList *addr_node;
   88.43 +  struct sockaddr_in saddr;
   88.44 +
   88.45 +  DEBUG(5) debugf("connect_hostlist entered\n");
   88.46 +
   88.47 +  for(addr_node = g_list_first(addr_list);
   88.48 +      addr_node;
   88.49 +      addr_node = g_list_next(addr_node)){
   88.50 +    mxip_addr *addr = (mxip_addr *)(addr_node->data);
   88.51 +
   88.52 +    *psockfd = socket(PF_INET, SOCK_STREAM, 0);
   88.53 +
   88.54 +    memset(&saddr, 0, sizeof(saddr));
   88.55 +
   88.56 +    saddr.sin_family = AF_INET;
   88.57 +    saddr.sin_port = htons(port);
   88.58 +
   88.59 +    /* clumsy, but makes compiler happy: */
   88.60 +    saddr.sin_addr = *(struct in_addr*)(&(addr->ip));
   88.61 +    DEBUG(5) debugf("trying ip %s port %d\n", inet_ntoa(saddr.sin_addr), port);
   88.62 +    if(connect(*psockfd, (struct sockaddr *)(&saddr), sizeof(saddr)) == 0){
   88.63 +      DEBUG(5) debugf("connected to %s\n", inet_ntoa(saddr.sin_addr));
   88.64 +      return addr;
   88.65 +    }else{
   88.66 +      int saved_errno = errno;
   88.67 +
   88.68 +      close(*psockfd);
   88.69 +
   88.70 +      logwrite(LOG_WARNING, "connection to %s failed: %s\n",
   88.71 +	       inet_ntoa(saddr.sin_addr), strerror(errno));
   88.72 +
   88.73 +      errno = saved_errno;
   88.74 +
   88.75 +      if((saved_errno != ECONNREFUSED) &&
   88.76 +	 (saved_errno != ETIMEDOUT) &&
   88.77 +	 (saved_errno != ENETUNREACH) &&
   88.78 +	 (saved_errno != EHOSTUNREACH))
   88.79 +
   88.80 +	return NULL;
   88.81 +    }
   88.82 +  }
   88.83 +  return NULL;
   88.84 +}
   88.85 +
   88.86 +/* Given a list of resolver functions, this function
   88.87 +   resolve the host and tries to connect to the addresses
   88.88 +   returned. If a connection attemp is timed out or refused,
   88.89 +   the next address is tried.
   88.90 +
   88.91 +   TODO: the resolver functions might return duplicate addresses,
   88.92 +   if attempt failed for one it should not be tried again.
   88.93 +*/
   88.94 +
   88.95 +mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port,
   88.96 +			       GList *res_func_list)
   88.97 +{
   88.98 +  GList *res_node;
   88.99 +  GList *addr_list;
  88.100 +
  88.101 +  DEBUG(5) debugf("connect_resolvelist entered\n");
  88.102 +
  88.103 +  h_errno = 0;
  88.104 +
  88.105 +  if(isdigit(host[0])){
  88.106 +    mxip_addr *addr;
  88.107 +    
  88.108 +    addr_list = resolve_ip(NULL, host);
  88.109 +    if(addr_list){
  88.110 +      addr = connect_hostlist(psockfd, host, port, addr_list);
  88.111 +      g_list_free(addr_list);
  88.112 +      return addr;
  88.113 +    }
  88.114 +    /* previous versions complained, until someone tried to use a hostname
  88.115 +       out there that begins with a digit. eg. '3dwars.de'. */
  88.116 +  }
  88.117 +
  88.118 +  if(res_func_list == NULL){
  88.119 +    logwrite(LOG_ALERT, "res_funcs == NULL !!!\n");
  88.120 +    exit(EXIT_FAILURE);
  88.121 +  }
  88.122 +
  88.123 +  foreach(res_func_list, res_node){
  88.124 +    resolve_func res_func;
  88.125 +    DEBUG(6) debugf("connect_resolvelist 1a\n");
  88.126 +    res_func = (resolve_func)(res_node->data);
  88.127 +      
  88.128 +    if(res_func == NULL){
  88.129 +      logwrite(LOG_ALERT, "res_func == NULL !!!\n");
  88.130 +      exit(EXIT_FAILURE);
  88.131 +    }
  88.132 +      
  88.133 +    errno = 0;
  88.134 +    if((addr_list = res_func(NULL, host))){
  88.135 +	
  88.136 +      mxip_addr *addr;
  88.137 +      if((addr = connect_hostlist(psockfd, host, port, addr_list)))
  88.138 +	return addr;
  88.139 +
  88.140 +      DEBUG(5){
  88.141 +	debugf("connect_hostlist failed: %s\n", strerror(errno));
  88.142 +      }
  88.143 +	
  88.144 +      g_list_free(addr_list);
  88.145 +    }else{
  88.146 +      if(!g_list_next(res_node)){
  88.147 +	logwrite(LOG_ALERT, "could not resolve %s: %s\n", host, hstrerror(h_errno));
  88.148 +      }
  88.149 +    }
  88.150 +  }
  88.151 +  return NULL;
  88.152 +
  88.153 +}
  88.154 +
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/src/deliver.c	Fri Sep 26 17:05:23 2008 +0200
    89.3 @@ -0,0 +1,849 @@
    89.4 +/*  MasqMail
    89.5 +    Copyright (C) 1999-2002 Oliver Kurth
    89.6 +
    89.7 +    This program is free software; you can redistribute it and/or modify
    89.8 +    it under the terms of the GNU General Public License as published by
    89.9 +    the Free Software Foundation; either version 2 of the License, or
   89.10 +    (at your option) any later version.
   89.11 +
   89.12 +    This program is distributed in the hope that it will be useful,
   89.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   89.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   89.15 +    GNU General Public License for more details.
   89.16 +
   89.17 +    You should have received a copy of the GNU General Public License
   89.18 +    along with this program; if not, write to the Free Software
   89.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   89.20 +*/
   89.21 +
   89.22 +#include "masqmail.h"
   89.23 +#include "smtp_out.h"
   89.24 +#include <fnmatch.h>
   89.25 +#include <sysexits.h>
   89.26 +#include <netdb.h>
   89.27 +
   89.28 +/* collect failed/defered rcpts for failure/warning messages */
   89.29 +/* returns TRUE if either there are no failures or a
   89.30 +   failure message has been successfully sent */
   89.31 +gboolean delivery_failures(message *msg, GList *rcpt_list, gchar *err_fmt, ...)
   89.32 +{
   89.33 +  gboolean ok_fail = TRUE, ok_warn = TRUE;
   89.34 +  time_t now = time(NULL);
   89.35 +
   89.36 +  GList *failed_list = NULL, *defered_list = NULL, *rcpt_node;
   89.37 +  va_list args;
   89.38 +  va_start(args, err_fmt);
   89.39 +
   89.40 +  foreach(rcpt_list, rcpt_node){
   89.41 +    address *rcpt = (address *)(rcpt_node->data);
   89.42 +    
   89.43 +    if(addr_is_defered(rcpt)){
   89.44 +      if((now - msg->received_time) >= conf.max_defer_time){
   89.45 +	addr_mark_failed(rcpt);
   89.46 +      }else
   89.47 +	defered_list = g_list_prepend(defered_list, rcpt);
   89.48 +    }
   89.49 +    if(addr_is_failed(rcpt))
   89.50 +      failed_list = g_list_prepend(failed_list, rcpt);
   89.51 +  }
   89.52 +  if(failed_list != NULL){
   89.53 +    ok_fail = fail_msg(msg, conf.errmsg_file, failed_list, err_fmt, args);
   89.54 +    g_list_free(failed_list);
   89.55 +  }
   89.56 +  if(defered_list != NULL){
   89.57 +    ok_warn = warn_msg(msg, conf.warnmsg_file, defered_list, err_fmt, args);
   89.58 +    g_list_free(defered_list);
   89.59 +  }
   89.60 +  va_end(args);
   89.61 +  return ok_fail && ok_warn;
   89.62 +}
   89.63 +
   89.64 +static gint _g_list_strcasecmp(gconstpointer a, gconstpointer b)
   89.65 +{
   89.66 +  return (gint)strcasecmp(a, b);
   89.67 +}
   89.68 +
   89.69 +gboolean deliver_local(msg_out *msgout)
   89.70 +{
   89.71 +  message *msg = msgout->msg;
   89.72 +  GList *rcpt_list = msgout->rcpt_list;
   89.73 +  GList *rcpt_node;
   89.74 +  gboolean ok = TRUE, flag = FALSE, ok_fail = FALSE;
   89.75 +
   89.76 +  DEBUG(5) debugf("deliver_local entered\n");
   89.77 +
   89.78 +  flag = (msg->data_list == NULL);
   89.79 +  if(flag){
   89.80 +    if(!(ok = spool_read_data(msg))){
   89.81 +      logwrite(LOG_ALERT, "could not open data spool file for %s\n",
   89.82 +	       msg->uid);
   89.83 +    }
   89.84 +  }
   89.85 +  if(!ok) return FALSE;
   89.86 +
   89.87 +  ok = FALSE;
   89.88 +  for(rcpt_node = g_list_first(rcpt_list);
   89.89 +      rcpt_node;
   89.90 +      rcpt_node = g_list_next(rcpt_node)){
   89.91 +    GList *hdr_list;
   89.92 +    address *rcpt = (address *)(rcpt_node->data);
   89.93 +    address *env_addr = addr_find_ancestor(rcpt);
   89.94 +    address *ret_path = msg->return_path;
   89.95 +    header *retpath_hdr, *envto_hdr;
   89.96 +
   89.97 +    /* we need a private copy of the hdr list because we add headers here
   89.98 +       that belong to the rcpt only.
   89.99 +       g_list_copy copies only the nodes, so it is safe to
  89.100 +       g_list_free it
  89.101 +    */
  89.102 +    hdr_list = g_list_copy(msg->hdr_list);
  89.103 +    retpath_hdr = create_header(HEAD_ENVELOPE_TO,
  89.104 +				"Envelope-to: %s\n", addr_string(env_addr));
  89.105 +    envto_hdr = create_header(HEAD_RETURN_PATH,
  89.106 +			      "Return-path: %s\n", addr_string(ret_path));
  89.107 +    
  89.108 +    hdr_list = g_list_prepend(hdr_list, envto_hdr);
  89.109 +    hdr_list = g_list_prepend(hdr_list, retpath_hdr);
  89.110 +
  89.111 +    if(rcpt->local_part[0] == '|'){
  89.112 +      DEBUG(1) debugf("attempting to deliver %s with pipe\n", msg->uid);
  89.113 +      if(pipe_out(msg, hdr_list, rcpt, &(rcpt->local_part[1]),
  89.114 +		  (conf.pipe_fromline ? MSGSTR_FROMLINE : 0) |
  89.115 +		  (conf.pipe_fromhack ? MSGSTR_FROMHACK : 0))){
  89.116 +	logwrite(LOG_NOTICE, "%s => %s <%s@%s> with pipe\n",
  89.117 +		 msg->uid, rcpt->local_part,
  89.118 +		 env_addr->local_part, env_addr->domain
  89.119 +		 );
  89.120 +	addr_mark_delivered(rcpt);
  89.121 +	ok = TRUE;
  89.122 +      }else{
  89.123 +	if((errno != (1024 + EX_TEMPFAIL)) && (errno != EAGAIN)){
  89.124 +	  addr_mark_failed(rcpt);
  89.125 +	}else{
  89.126 +	  addr_mark_defered(rcpt); /* has no effect yet,
  89.127 +				      except that mail remains in spool */
  89.128 +	}
  89.129 +      }
  89.130 +    }else{
  89.131 +      /* figure out which mailbox type should be used for this user */
  89.132 +      gchar *user = rcpt->local_part;
  89.133 +      gchar *mbox_type = conf.mbox_default;
  89.134 +      
  89.135 +      if(g_list_find_custom(conf.mbox_users, user, _g_list_strcasecmp) != NULL)
  89.136 +	mbox_type = "mbox";
  89.137 +      else if(g_list_find_custom(conf.mda_users, user, _g_list_strcasecmp) != NULL)
  89.138 +	mbox_type = "mda";
  89.139 +      else if(g_list_find_custom(conf.maildir_users, user, _g_list_strcasecmp) != NULL)
  89.140 +	mbox_type = "maildir";
  89.141 +
  89.142 +      if(strcmp(mbox_type, "mbox") == 0){
  89.143 +	DEBUG(1) debugf("attempting to deliver %s with mbox\n", msg->uid);
  89.144 +	if(append_file(msg, hdr_list, rcpt->local_part)){
  89.145 +	  if(env_addr != rcpt){
  89.146 +	    logwrite(LOG_NOTICE, "%s => %s@%s <%s@%s> with mbox\n",
  89.147 +		     msg->uid, rcpt->local_part, rcpt->domain,
  89.148 +		     env_addr->local_part, env_addr->domain
  89.149 +		     );
  89.150 +	  }else{
  89.151 +	    logwrite(LOG_NOTICE, "%s => <%s@%s> with mbox\n",
  89.152 +		     msg->uid, rcpt->local_part, rcpt->domain);
  89.153 +	  }
  89.154 +	  addr_mark_delivered(rcpt);
  89.155 +	  ok = TRUE;
  89.156 +	}else{
  89.157 +	  if(errno != EAGAIN){ /* prevents 'Resource temporarily unavailable (11)' */
  89.158 +	    addr_mark_failed(rcpt);
  89.159 +	  }else{
  89.160 +	    addr_mark_defered(rcpt);
  89.161 +	  }
  89.162 +	}
  89.163 +
  89.164 +      }else if(strcmp(mbox_type, "mda") == 0){
  89.165 +	if(conf.mda){
  89.166 +	  gchar *cmd = g_malloc(256);
  89.167 +	  GList *var_table = var_table_rcpt(var_table_msg(NULL, msg), rcpt);
  89.168 +	  
  89.169 +	  DEBUG(1) debugf("attempting to deliver %s with mda\n", msg->uid);
  89.170 +	  
  89.171 +	  if(expand(var_table, conf.mda, cmd, 256)){
  89.172 +	  
  89.173 +	    if(pipe_out(msg, hdr_list, rcpt, cmd,
  89.174 +			(conf.mda_fromline ? MSGSTR_FROMLINE : 0) |
  89.175 +			(conf.mda_fromhack ? MSGSTR_FROMHACK : 0))){
  89.176 +	      logwrite(LOG_NOTICE, "%s => %s@%s with mda (cmd = '%s')\n",
  89.177 +		       msg->uid, rcpt->local_part, rcpt->domain, cmd
  89.178 +		       );
  89.179 +	      addr_mark_delivered(rcpt);
  89.180 +	      ok = TRUE;
  89.181 +	    }else{
  89.182 +	      if((errno != (1024 + EX_TEMPFAIL)) && (errno != EAGAIN)){
  89.183 +		addr_mark_failed(rcpt);
  89.184 +	      }else{
  89.185 +		addr_mark_defered(rcpt); /* has no effect yet,
  89.186 +					    except that mail remains in spool */
  89.187 +	      }
  89.188 +	    }
  89.189 +	  }else
  89.190 +	    logwrite(LOG_ALERT, "could not expand string %s\n", conf.mda);
  89.191 +	  
  89.192 +	  destroy_table(var_table);
  89.193 +	}else
  89.194 +	  logwrite(LOG_ALERT, "mbox type is mda, but no mda command given in configuration\n");
  89.195 +
  89.196 +#ifdef ENABLE_MAILDIR
  89.197 +      }else if(strcmp(mbox_type, "maildir") == 0){
  89.198 +	DEBUG(1) debugf("attempting to deliver %s with maildir\n", msg->uid);
  89.199 +	if(maildir_out(msg, hdr_list, rcpt->local_part, 0)){
  89.200 +	  if(env_addr != rcpt){
  89.201 +	    logwrite(LOG_NOTICE, "%s => %s@%s <%s@%s> with local\n",
  89.202 +		     msg->uid, rcpt->local_part, rcpt->domain,
  89.203 +		     env_addr->local_part, env_addr->domain
  89.204 +		     );
  89.205 +	  }else{
  89.206 +	    logwrite(LOG_NOTICE, "%s => <%s@%s> with maildir\n",
  89.207 +		     msg->uid, rcpt->local_part, rcpt->domain);
  89.208 +	  }
  89.209 +	  addr_mark_delivered(rcpt);
  89.210 +	  ok = TRUE;
  89.211 +	}else
  89.212 +	  addr_mark_failed(rcpt);
  89.213 +#endif
  89.214 +      }else
  89.215 +	logwrite(LOG_ALERT, "unknown mbox type '%s'\n", mbox_type);
  89.216 +    }
  89.217 +
  89.218 +    destroy_header(retpath_hdr);
  89.219 +    destroy_header(envto_hdr);
  89.220 +
  89.221 +    g_list_free(hdr_list);
  89.222 +  }
  89.223 +  ok_fail = delivery_failures(msg, rcpt_list, "%s (%d)", ext_strerror(errno), errno);
  89.224 +
  89.225 +  if(flag) msg_free_data(msg);
  89.226 +  if(ok || ok_fail) deliver_finish(msgout);
  89.227 +
  89.228 +  return ok;
  89.229 +}
  89.230 +
  89.231 +/* make a list of rcpt's of a message that are local
  89.232 +   return a new copy of the list
  89.233 +*/
  89.234 +void msg_rcptlist_local(GList *rcpt_list, GList **p_local_list, GList **p_nonlocal_list)
  89.235 +{
  89.236 +  GList *rcpt_node;
  89.237 +
  89.238 +  foreach(rcpt_list, rcpt_node){
  89.239 +    address *rcpt = (address *)(rcpt_node->data);
  89.240 +    GList *dom_node;
  89.241 +
  89.242 +    DEBUG(5) debugf("checking address %s\n", rcpt->address);
  89.243 +
  89.244 +    /* search for local host list: */
  89.245 +    foreach(conf.local_hosts, dom_node){
  89.246 +      if(strcasecmp(dom_node->data, rcpt->domain) == 0){
  89.247 +	*p_local_list = g_list_append(*p_local_list, rcpt);
  89.248 +	DEBUG(5) debugf("<%s@%s> is local\n", rcpt->local_part, rcpt->domain);
  89.249 +	break;
  89.250 +      }else{
  89.251 +	*p_nonlocal_list = g_list_append(*p_nonlocal_list, rcpt);
  89.252 +      }
  89.253 +    }
  89.254 +  }
  89.255 +}
  89.256 +
  89.257 +gboolean deliver_msglist_host_pipe(connect_route *route, GList *msgout_list, gchar *host, GList *res_list)
  89.258 +{
  89.259 +  gboolean ok = TRUE;
  89.260 +  GList *msgout_node;
  89.261 +
  89.262 +  DEBUG(5) debugf("deliver_msglist_host_pipe entered\n");
  89.263 +
  89.264 +  if(route->pipe == NULL){
  89.265 +    logwrite(LOG_ALERT, "no pipe command given for route (protocol is pipe!)\n");
  89.266 +    return FALSE;
  89.267 +  }
  89.268 +
  89.269 +  foreach(msgout_list, msgout_node){
  89.270 +    msg_out *msgout = (msg_out *)(msgout_node->data);
  89.271 +    gboolean flag, ok_msg = TRUE, ok_fail = FALSE;
  89.272 +    message *msg = msgout->msg;
  89.273 +    GList *rcpt_node, *rcpt_list = msgout->rcpt_list;
  89.274 +
  89.275 +    DEBUG(1) debugf("attempting to deliver %s with pipe\n", msg->uid);
  89.276 +
  89.277 +    flag = (msg->data_list == NULL);
  89.278 +    if(flag){
  89.279 +      if(!(ok_msg = spool_read_data(msg))){
  89.280 +	logwrite(LOG_ALERT, "could not open data spool file for %s\n",
  89.281 +		 msg->uid);
  89.282 +      }
  89.283 +    }
  89.284 +    if(!ok_msg) continue;
  89.285 +
  89.286 +    ok = FALSE;
  89.287 +    foreach(rcpt_list, rcpt_node){
  89.288 +      address *rcpt = (address *)(rcpt_node->data);
  89.289 +      gchar *cmd = g_malloc(256);
  89.290 +      GList *var_table = var_table_rcpt(var_table_msg(NULL, msg), rcpt);
  89.291 +      
  89.292 +      DEBUG(1) debugf("attempting to deliver %s to %s@%s with pipe\n",
  89.293 +		      msg->uid, rcpt->local_part, rcpt->domain);
  89.294 +      
  89.295 +      if(expand(var_table, route->pipe, cmd, 256)){
  89.296 +	
  89.297 +	if(pipe_out(msg, msg->hdr_list, rcpt, cmd,
  89.298 +		    (route->pipe_fromline ? MSGSTR_FROMLINE : 0) |
  89.299 +		    (route->pipe_fromhack ? MSGSTR_FROMHACK : 0))){
  89.300 +	  logwrite(LOG_NOTICE, "%s => %s@%s with pipe (cmd = '%s')\n",
  89.301 +		   msg->uid, rcpt->local_part, rcpt->domain, cmd
  89.302 +		   );
  89.303 +	  addr_mark_delivered(rcpt);
  89.304 +	  ok = TRUE;
  89.305 +	}else{
  89.306 +	  logwrite(LOG_ALERT, "pipe_out '%s' failed\n", route->pipe);
  89.307 +
  89.308 +	  if(route->connect_error_fail){
  89.309 +	    addr_mark_failed(rcpt);
  89.310 +	  }else{
  89.311 +	    addr_mark_defered(rcpt);
  89.312 +	  }
  89.313 +	}
  89.314 +      }else
  89.315 +	logwrite(LOG_ALERT, "could not expand string %s\n", route->pipe);
  89.316 +      
  89.317 +      destroy_table(var_table);
  89.318 +    }
  89.319 +    ok_fail = delivery_failures(msg, rcpt_list, "%s", strerror(errno));
  89.320 +
  89.321 +    if(flag) msg_free_data(msg);
  89.322 +
  89.323 +    if(ok || ok_fail) deliver_finish(msgout);
  89.324 +  }
  89.325 +
  89.326 +  return ok;
  89.327 +}
  89.328 +
  89.329 +/* deliver list of messages to one host
  89.330 +   and finishes them if the message was delivered to at least one
  89.331 +   rcpt.
  89.332 +   Returns TRUE if at least one msg was delivered to at least one
  89.333 +   rcpt.
  89.334 +*/
  89.335 +
  89.336 +gboolean deliver_msglist_host_smtp(connect_route *route, GList *msgout_list, gchar *host, GList *res_list)
  89.337 +{
  89.338 +  gboolean ok = FALSE;
  89.339 +  GList *msgout_node;
  89.340 +  smtp_base *psb;
  89.341 +  gint port;
  89.342 +  
  89.343 +  /* paranoid check: */
  89.344 +  if(msgout_list == NULL){
  89.345 +    logwrite(LOG_ALERT,
  89.346 +	     "Ooops: empty list of messages in deliver_msglist_host()\n");
  89.347 +    return FALSE;
  89.348 +  }
  89.349 +
  89.350 +  if(host == NULL){
  89.351 +    host = route->mail_host->address;
  89.352 +    port = route->mail_host->port;
  89.353 +  }else
  89.354 +    port = conf.remote_port;
  89.355 +    
  89.356 +#ifdef ENABLE_POP3
  89.357 +  if(route->pop3_login){
  89.358 +    if(!(pop_before_smtp(route->pop3_login)))
  89.359 +      return FALSE;
  89.360 +  }
  89.361 +#endif
  89.362 +
  89.363 +  if((psb = (route->wrapper ?
  89.364 +	     smtp_out_open_child(route->wrapper) :
  89.365 +	     smtp_out_open(host, port, res_list)))){
  89.366 +
  89.367 +    if(route->wrapper) psb->remote_host = host;
  89.368 +
  89.369 +    set_heloname(psb,
  89.370 +		 route->helo_name ? route->helo_name : conf.host_name,
  89.371 +		 route->do_correct_helo);
  89.372 +
  89.373 +#ifdef ENABLE_AUTH
  89.374 +    if((route->auth_name) && (route->auth_login) && (route->auth_secret))
  89.375 +      set_auth(psb, route->auth_name, route->auth_login, route->auth_secret);
  89.376 +#endif
  89.377 +    if(smtp_out_init(psb)){
  89.378 +
  89.379 +      if(!route->do_pipelining) psb->use_pipelining = FALSE;
  89.380 +
  89.381 +      foreach(msgout_list, msgout_node){
  89.382 +	msg_out *msgout = (msg_out *)(msgout_node->data);
  89.383 +	gboolean flag, ok_msg = FALSE, ok_fail = FALSE;
  89.384 +	message *msg = msgout->msg;
  89.385 +
  89.386 +	/* we may have to read the data at this point
  89.387 +	   and remember if we did */
  89.388 +	flag = (msg->data_list == NULL);
  89.389 +	if(flag){
  89.390 +	  if(!spool_read_data(msg)){
  89.391 +	    logwrite(LOG_ALERT, "could not open data spool file %s\n",
  89.392 +		     msg->uid);
  89.393 +	    break;
  89.394 +	  }
  89.395 +	}
  89.396 +    
  89.397 +	smtp_out_msg(psb, msg,
  89.398 +		     msgout->return_path, msgout->rcpt_list, msgout->hdr_list);
  89.399 +
  89.400 +	ok_fail = delivery_failures(msg, msgout->rcpt_list, 
  89.401 +				    "while connected with %s, the server replied\n\t%s",
  89.402 +				    host, psb->buffer);
  89.403 +
  89.404 +	if((psb->error == smtp_eof) ||
  89.405 +	   (psb->error == smtp_timeout)){
  89.406 +	  /* connection lost */
  89.407 +	  break;
  89.408 +	}
  89.409 +	else if(psb->error != smtp_ok){
  89.410 +	  if(g_list_next(msgout_node) != NULL)
  89.411 +	    if(!smtp_out_rset(psb))
  89.412 +	      break;
  89.413 +	}
  89.414 +	ok_msg = (psb->error == smtp_ok);
  89.415 +
  89.416 +	if(flag) msg_free_data(msg);
  89.417 +	if(ok_msg) ok = TRUE;
  89.418 +	if(ok_msg || ok_fail){
  89.419 +	  deliver_finish(msgout);
  89.420 +	}
  89.421 +      }
  89.422 +      if(psb->error == smtp_ok ||
  89.423 +	 (psb->error == smtp_fail) ||
  89.424 +	 (psb->error == smtp_trylater) ||
  89.425 +	 (psb->error == smtp_syntax)){
  89.426 +
  89.427 +	smtp_out_quit(psb);
  89.428 +      }
  89.429 +    }else{
  89.430 +      /* smtp_out_init() failed */
  89.431 +      if((psb->error == smtp_fail) ||
  89.432 +	 (psb->error == smtp_trylater) ||
  89.433 +	 (psb->error == smtp_syntax)){
  89.434 +	smtp_out_quit(psb);
  89.435 +
  89.436 +	foreach(msgout_list, msgout_node){
  89.437 +	  msg_out *msgout = (msg_out *)(msgout_node->data);
  89.438 +	  smtp_out_mark_rcpts(psb, msgout->rcpt_list);
  89.439 +
  89.440 +	  if(delivery_failures(msgout->msg, msgout->rcpt_list, 
  89.441 +			       "while connected with %s, the server replied\n\t%s",
  89.442 +			       host, psb->buffer))
  89.443 +	    deliver_finish(msgout);
  89.444 +	}
  89.445 +      }
  89.446 +    }
  89.447 +    destroy_smtpbase(psb);
  89.448 +  }else{
  89.449 +    /* smtp_out_open() failed */
  89.450 +    foreach(msgout_list, msgout_node){
  89.451 +      msg_out *msgout = (msg_out *)(msgout_node->data);
  89.452 +      GList *rcpt_node;
  89.453 +
  89.454 +      for(rcpt_node = g_list_first(msgout->rcpt_list);
  89.455 +	  rcpt_node;
  89.456 +	  rcpt_node = g_list_next(rcpt_node)){
  89.457 +	address *rcpt = (address *)(rcpt_node->data);
  89.458 +
  89.459 +	addr_unmark_delivered(rcpt);
  89.460 +	if(route->connect_error_fail){
  89.461 +	  addr_mark_failed(rcpt);
  89.462 +	}else{
  89.463 +	  addr_mark_defered(rcpt);
  89.464 +	}
  89.465 +	if(route->wrapper ?
  89.466 +	   delivery_failures(msgout->msg, msgout->rcpt_list,
  89.467 +			     "could not open wrapper:\n\t%s",
  89.468 +			     strerror(errno)) :
  89.469 +	   delivery_failures(msgout->msg, msgout->rcpt_list, 
  89.470 +			     "could not open connection to %s:%d :\n\t%s",
  89.471 +			     host, port, h_errno != 0 ? hstrerror(h_errno) : strerror(errno)))
  89.472 +	  deliver_finish(msgout);
  89.473 +      }
  89.474 +    }
  89.475 +  }
  89.476 +  return ok;
  89.477 +}
  89.478 +
  89.479 +gboolean deliver_msglist_host(connect_route *route, GList *msgout_list, gchar *host, GList *res_list)
  89.480 +{
  89.481 +  DEBUG(5) debugf("protocol = %s\n", route->protocol);
  89.482 +
  89.483 +  if(strcmp(route->protocol, "pipe") == 0){
  89.484 +    return deliver_msglist_host_pipe(route, msgout_list, host, res_list);
  89.485 +  }else{
  89.486 +    return deliver_msglist_host_smtp(route, msgout_list, host, res_list);
  89.487 +  }
  89.488 +}
  89.489 +
  89.490 +/*
  89.491 +  delivers messages in msgout_list using route
  89.492 +*/
  89.493 +gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list)
  89.494 +{
  89.495 +  gboolean ok = FALSE;
  89.496 +
  89.497 +  DEBUG(5) debugf("deliver_route_msgout_list entered, route->name = %s\n",
  89.498 +		  route->name);
  89.499 +
  89.500 +  if(route->mail_host != NULL){
  89.501 +    /* this is easy... */
  89.502 +    if(deliver_msglist_host(route, msgout_list,
  89.503 +			    NULL, route->resolve_list))
  89.504 +      ok = TRUE;
  89.505 +      
  89.506 +  }else{
  89.507 +    /* this is not easy... */
  89.508 +    GList *mo_ph_list;
  89.509 +
  89.510 +    mo_ph_list = route_msgout_list(route, msgout_list);
  89.511 +    /* okay, now we have ordered our messages by the hosts. */
  89.512 +    if(mo_ph_list != NULL){
  89.513 +      GList *mo_ph_node;
  89.514 +      /* TODO: It would be nice to be able to fork for each host.
  89.515 +	 We cannot do that yet because of complications with finishing the
  89.516 +	 messages. Threads could be a solution because they use the same
  89.517 +	 memory. But we are not thread safe yet...
  89.518 +      */
  89.519 +      foreach(mo_ph_list, mo_ph_node){
  89.520 +	msgout_perhost *mo_ph = (msgout_perhost *)(mo_ph_node->data);
  89.521 +	if(deliver_msglist_host(route, mo_ph->msgout_list,
  89.522 +				mo_ph->host, route->resolve_list))
  89.523 +	  ok = TRUE;
  89.524 +
  89.525 +	destroy_msgout_perhost(mo_ph);
  89.526 +      }
  89.527 +      g_list_free(mo_ph_list);
  89.528 +    }
  89.529 +  }
  89.530 +  return ok;
  89.531 +}
  89.532 +
  89.533 +/*
  89.534 +  calls route_prepare_msg()
  89.535 +  delivers messages in msg_list using route
  89.536 +  by calling deliver_route_msgout_list()
  89.537 +*/
  89.538 +gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list)
  89.539 +{
  89.540 +  GList *msgout_list_deliver = NULL;
  89.541 +  GList *msgout_node;
  89.542 +  gboolean ok = TRUE;
  89.543 +
  89.544 +  DEBUG(6) debugf("deliver_route_msg_list()\n");
  89.545 +
  89.546 +  foreach(msgout_list, msgout_node){
  89.547 +    msg_out *msgout = (msg_out *)(msgout_node->data);
  89.548 +    msg_out *msgout_cloned = clone_msg_out(msgout);
  89.549 +    GList *rcpt_list_non_delivered = NULL;
  89.550 +    GList *rcpt_node;
  89.551 +
  89.552 +    /* we have to delete already delivered rcpt's
  89.553 +       because a previous route may have delivered to it */
  89.554 +    foreach(msgout_cloned->rcpt_list, rcpt_node){
  89.555 +      address *rcpt = (address *)(rcpt_node->data);
  89.556 +      /* failed addresses already have been bounced
  89.557 +	 - there should be a better way to handle those.*/
  89.558 +      if(!addr_is_delivered(rcpt) && !addr_is_failed(rcpt) && !(rcpt->flags & ADDR_FLAG_LAST_ROUTE))
  89.559 +	rcpt_list_non_delivered = g_list_append(rcpt_list_non_delivered, rcpt);
  89.560 +    }
  89.561 +    g_list_free(msgout_cloned->rcpt_list);
  89.562 +    msgout_cloned->rcpt_list = rcpt_list_non_delivered;
  89.563 +
  89.564 +    if(msgout_cloned->rcpt_list){
  89.565 +      if(route_is_allowed_mail_local(route, msgout->msg->return_path) && 
  89.566 +	 route_is_allowed_return_path(route, msgout->msg->return_path)){
  89.567 +	GList *rcpt_list_allowed = NULL, *rcpt_list_notallowed = NULL;
  89.568 +	msg_rcptlist_route(route, msgout_cloned->rcpt_list,
  89.569 +			   &rcpt_list_allowed, &rcpt_list_notallowed);
  89.570 +	
  89.571 +	if(rcpt_list_allowed != NULL){
  89.572 +	  logwrite(LOG_NOTICE, "%s using '%s'\n", msgout->msg->uid, route->name);
  89.573 +
  89.574 +	  g_list_free(msgout_cloned->rcpt_list);
  89.575 +	  msgout_cloned->rcpt_list = rcpt_list_allowed;
  89.576 +	  
  89.577 +	  if(route->last_route){
  89.578 +	    GList *rcpt_node;
  89.579 +	    foreach(msgout_cloned->rcpt_list, rcpt_node){
  89.580 +	      address *rcpt = (address *)(rcpt_node->data);
  89.581 +	      rcpt->flags |= ADDR_FLAG_LAST_ROUTE;
  89.582 +	    }
  89.583 +	  }
  89.584 +
  89.585 +	  route_prepare_msgout(route, msgout_cloned);
  89.586 +	  msgout_list_deliver = g_list_append(msgout_list_deliver, msgout_cloned);
  89.587 +	}else
  89.588 +	  destroy_msg_out(msgout_cloned);
  89.589 +      }
  89.590 +      else
  89.591 +	destroy_msg_out(msgout_cloned);
  89.592 +    }else
  89.593 +      destroy_msg_out(msgout_cloned);
  89.594 +  }
  89.595 +
  89.596 +  if(msgout_list_deliver != NULL){
  89.597 +    if(deliver_route_msgout_list(route, msgout_list_deliver))
  89.598 +      ok = TRUE;
  89.599 +    destroy_msg_out_list(msgout_list_deliver);
  89.600 +  }
  89.601 +  return ok;
  89.602 +}
  89.603 +
  89.604 +/* copy pointers of delivered addresses to the msg's non_rcpt_list,
  89.605 +   to make sure that they will not be delivered again.
  89.606 +*/
  89.607 +void update_non_rcpt_list(msg_out *msgout)
  89.608 +{
  89.609 +  GList *rcpt_node;
  89.610 +  message *msg = msgout->msg;
  89.611 +
  89.612 +  foreach(msgout->rcpt_list, rcpt_node){
  89.613 +    address *rcpt = (address *)(rcpt_node->data);
  89.614 +    if(addr_is_delivered(rcpt) || addr_is_failed(rcpt))
  89.615 +      msg->non_rcpt_list = g_list_append(msg->non_rcpt_list, rcpt);
  89.616 +  }
  89.617 +}
  89.618 +
  89.619 +/* after delivery attempts, we check if there are any
  89.620 +   rcpt addresses left in the message.
  89.621 +   If all addresses have been completed, the spool files will
  89.622 +   be deleted, otherwise the header spool will be written back.
  89.623 +   We never changed the data spool, so there is no need to write that back.
  89.624 +
  89.625 +   returns TRUE if all went well.
  89.626 +*/
  89.627 +gboolean deliver_finish(msg_out *msgout)
  89.628 +{
  89.629 +  GList *rcpt_node;
  89.630 +  gboolean ok = FALSE;
  89.631 +  message *msg = msgout->msg;
  89.632 +  gboolean finished = TRUE;
  89.633 +
  89.634 +  update_non_rcpt_list(msgout);
  89.635 +
  89.636 +  /* we NEVER made copies of the addresses, flags affecting addresses
  89.637 +     were always set on the original address structs */
  89.638 +  foreach(msg->rcpt_list, rcpt_node){
  89.639 +    address *rcpt = (address *)(rcpt_node->data);
  89.640 +    if(!addr_is_finished_children(rcpt))
  89.641 +      finished = FALSE;
  89.642 +    else{
  89.643 +      /* if ALL children have been delivered,
  89.644 +	 mark parent as delivered.
  89.645 +	 if there is one or more not delivered,
  89.646 +	 it must have failed, we mark the parent as failed as well.
  89.647 +      */
  89.648 +      if(addr_is_delivered_children(rcpt)){
  89.649 +	addr_mark_delivered(rcpt);
  89.650 +      }else{
  89.651 +	addr_mark_failed(rcpt);
  89.652 +      }
  89.653 +    }
  89.654 +  }
  89.655 +  
  89.656 +  if(!finished){
  89.657 +    /* one not delivered address was found */
  89.658 +    if(spool_write(msg, FALSE)){
  89.659 +      ok = TRUE;
  89.660 +      DEBUG(2) debugf("spool header for %s written back.\n", msg->uid);
  89.661 +    }else
  89.662 +      logwrite(LOG_ALERT, "could not write back spool header for %s\n",
  89.663 +	       msg->uid);
  89.664 +  }else{
  89.665 +    ok = spool_delete_all(msg);
  89.666 +    if(ok)
  89.667 +      logwrite(LOG_NOTICE, "%s completed.\n", msg->uid);
  89.668 +  }
  89.669 +  return ok;
  89.670 +}
  89.671 +
  89.672 +gboolean deliver_finish_list(GList *msgout_list)
  89.673 +{
  89.674 +  gboolean ok = TRUE;
  89.675 +  GList *msgout_node;
  89.676 +  foreach(msgout_list, msgout_node){
  89.677 +    msg_out *msgout = (msg_out *)(msgout_node->data);
  89.678 +    if(!deliver_finish(msgout))
  89.679 +      ok = FALSE;
  89.680 +  }
  89.681 +  return ok;
  89.682 +}
  89.683 + 
  89.684 +gboolean deliver_msgout_list_online(GList *msgout_list)
  89.685 +{
  89.686 +  GList *rf_list = NULL;
  89.687 +  gchar *connect_name = detect_online();
  89.688 +  gboolean ok = FALSE;
  89.689 +
  89.690 +  if(connect_name != NULL){
  89.691 +    logwrite(LOG_NOTICE, "detected online configuration %s\n", connect_name);
  89.692 +    /* we are online! */
  89.693 +    rf_list = (GList *)table_find(conf.connect_routes, connect_name);
  89.694 +    if(rf_list != NULL){
  89.695 +      GList *route_list = read_route_list(rf_list, FALSE);
  89.696 +      if(route_list){
  89.697 +	GList *route_node;
  89.698 +	foreach(route_list, route_node){
  89.699 +	  connect_route *route = (connect_route *)(route_node->data);
  89.700 +	  ok = deliver_route_msg_list(route, msgout_list);
  89.701 +	}
  89.702 +	destroy_route_list(route_list);
  89.703 +      }
  89.704 +      else
  89.705 +	logwrite(LOG_ALERT,
  89.706 +		 "could not read route list '%s'\n", connect_name);
  89.707 +    }else{
  89.708 +      logwrite(LOG_ALERT, "route list with name '%s' not found.\n", connect_name);
  89.709 +    }
  89.710 +  }
  89.711 +  return ok;
  89.712 +}
  89.713 +
  89.714 +gboolean deliver_msg_list(GList *msg_list, guint flags){
  89.715 +  GList *msgout_list = create_msg_out_list(msg_list);
  89.716 +  GList *local_msgout_list = NULL, *localnet_msgout_list = NULL, *other_msgout_list = NULL;
  89.717 +  GList *msgout_node;
  89.718 +  GList *alias_table = NULL;
  89.719 +  gboolean ok = TRUE;
  89.720 +
  89.721 +  if(conf.alias_file){
  89.722 +    if(!(alias_table = table_read(conf.alias_file, ':')))
  89.723 +      return FALSE;
  89.724 +  }
  89.725 +      
  89.726 +  /* sort messages for different deliveries */
  89.727 +  foreach(msgout_list, msgout_node){
  89.728 +    msg_out *msgout = (msg_out *)(msgout_node->data);
  89.729 +    GList *rcpt_list;
  89.730 +    GList *local_rcpt_list = NULL;
  89.731 +    GList *localnet_rcpt_list = NULL;
  89.732 +    GList *other_rcpt_list;
  89.733 +
  89.734 +    if(!spool_lock(msgout->msg->uid)) continue;
  89.735 +
  89.736 +    rcpt_list = g_list_copy(msgout->msg->rcpt_list);
  89.737 +    if(conf.log_user){
  89.738 +      address *addr = create_address_qualified(conf.log_user, TRUE, conf.host_name);
  89.739 +      if(addr)
  89.740 +	rcpt_list = g_list_prepend(rcpt_list, addr);
  89.741 +    }
  89.742 +    if(alias_table){
  89.743 +      GList *aliased_rcpt_list;
  89.744 +      aliased_rcpt_list = alias_expand(alias_table, rcpt_list,
  89.745 +				       msgout->msg->non_rcpt_list);
  89.746 +      g_list_free(rcpt_list);
  89.747 +      rcpt_list = aliased_rcpt_list;
  89.748 +    }
  89.749 +
  89.750 +    /* local recipients */
  89.751 +    other_rcpt_list = NULL;
  89.752 +    rcptlist_with_addr_is_local(rcpt_list, &local_rcpt_list, &other_rcpt_list);
  89.753 +    
  89.754 +    if(flags & DLVR_LOCAL){
  89.755 +      if(local_rcpt_list != NULL){
  89.756 +	msg_out *local_msgout = clone_msg_out(msgout);
  89.757 +	local_msgout->rcpt_list = local_rcpt_list;
  89.758 +	local_msgout_list = g_list_append(local_msgout_list, local_msgout);
  89.759 +      }
  89.760 +    }
  89.761 +
  89.762 +    g_list_free(rcpt_list);
  89.763 +
  89.764 +    /* local net recipients */
  89.765 +    rcpt_list = other_rcpt_list;
  89.766 +    other_rcpt_list = NULL;
  89.767 +    rcptlist_with_one_of_hostlist(rcpt_list, conf.local_nets,
  89.768 +				  &localnet_rcpt_list, &other_rcpt_list);
  89.769 +
  89.770 +    if(flags & DLVR_LAN){
  89.771 +      if(localnet_rcpt_list != NULL){
  89.772 +	msg_out *localnet_msgout = clone_msg_out(msgout);
  89.773 +	localnet_msgout->rcpt_list = localnet_rcpt_list;
  89.774 +	localnet_msgout_list = g_list_append(localnet_msgout_list, localnet_msgout);
  89.775 +      }
  89.776 +    }
  89.777 +
  89.778 +    if(flags & DLVR_ONLINE){
  89.779 +      /* the rest, this is online delivery */
  89.780 +      if(other_rcpt_list != NULL){
  89.781 +	msg_out *other_msgout = clone_msg_out(msgout);
  89.782 +	other_msgout->rcpt_list = other_rcpt_list;
  89.783 +	other_msgout_list = g_list_append(other_msgout_list, other_msgout);
  89.784 +      }
  89.785 +    }
  89.786 +  }
  89.787 +
  89.788 +  if(alias_table)
  89.789 +    destroy_table(alias_table);
  89.790 +
  89.791 +  /* actual delivery */
  89.792 +  if(local_msgout_list != NULL){
  89.793 +    foreach(local_msgout_list, msgout_node){
  89.794 +      msg_out *msgout = (msg_out *)(msgout_node->data);
  89.795 +      if(!deliver_local(msgout)) ok = FALSE;
  89.796 +    }
  89.797 +    destroy_msg_out_list(local_msgout_list);
  89.798 +  }
  89.799 +
  89.800 +  if(localnet_msgout_list != NULL){
  89.801 +    GList *route_list = NULL;
  89.802 +    GList *route_node;
  89.803 +
  89.804 +    if(conf.local_net_routes)
  89.805 +      route_list = read_route_list(conf.local_net_routes, TRUE);
  89.806 +    else
  89.807 +      route_list = g_list_append(NULL, create_local_route());
  89.808 +
  89.809 +    foreach(route_list, route_node){
  89.810 +      connect_route *route = (connect_route *)(route_node->data);
  89.811 +      if(!deliver_route_msg_list(route, localnet_msgout_list)) ok = FALSE;
  89.812 +    }
  89.813 +    destroy_msg_out_list(localnet_msgout_list);
  89.814 +    destroy_route_list(route_list);
  89.815 +  }
  89.816 +
  89.817 +  if(other_msgout_list != NULL){
  89.818 +    if(!deliver_msgout_list_online(other_msgout_list)) ok = FALSE;
  89.819 +    destroy_msg_out_list(other_msgout_list);
  89.820 +  }
  89.821 +
  89.822 +  foreach(msgout_list, msgout_node){
  89.823 +    msg_out *msgout = (msg_out *)(msgout_node->data);
  89.824 +    spool_unlock(msgout->msg->uid);
  89.825 +  }
  89.826 +
  89.827 +  destroy_msg_out_list(msgout_list);
  89.828 +
  89.829 +  return ok;
  89.830 +}
  89.831 +
  89.832 +/* This function searches in the list of rcpt addresses
  89.833 +   for local and 'local net' addresses. Remote addresses
  89.834 +   which are reachable only when online are treated specially
  89.835 +   in another function.
  89.836 +
  89.837 +   deliver() is called when a message has just been received and should
  89.838 +   be delivered immediately.
  89.839 +*/
  89.840 +gboolean deliver(message *msg)
  89.841 +{
  89.842 +  gboolean ok;
  89.843 +
  89.844 +  GList *msg_list = g_list_append(NULL, msg);
  89.845 +
  89.846 +  ok = deliver_msg_list(msg_list, DLVR_ALL);
  89.847 +  
  89.848 +  g_list_free(msg_list);
  89.849 +
  89.850 +  return ok;
  89.851 +}
  89.852 +
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/src/dotlock.c	Fri Sep 26 17:05:23 2008 +0200
    90.3 @@ -0,0 +1,80 @@
    90.4 +/*  MasqMail
    90.5 +    Copyright (C) 2001 Oliver Kurth
    90.6 +
    90.7 +    This program is free software; you can redistribute it and/or modify
    90.8 +    it under the terms of the GNU General Public License as published by
    90.9 +    the Free Software Foundation; either version 2 of the License, or
   90.10 +    (at your option) any later version.
   90.11 +
   90.12 +    This program is distributed in the hope that it will be useful,
   90.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   90.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   90.15 +    GNU General Public License for more details.
   90.16 +
   90.17 +    You should have received a copy of the GNU General Public License
   90.18 +    along with this program; if not, write to the Free Software
   90.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   90.20 +*/
   90.21 +
   90.22 +#include <glib.h>
   90.23 +#include <unistd.h>
   90.24 +#include <fcntl.h>
   90.25 +#include <sys/stat.h>
   90.26 +#include <sys/types.h>
   90.27 +#include <syslog.h>
   90.28 +#include <errno.h>
   90.29 +#include <string.h>
   90.30 +#include <time.h>
   90.31 +
   90.32 +#include "masqmail.h"
   90.33 +#include "dotlock.h"
   90.34 +
   90.35 +gboolean dot_lock(gchar *lock_name, gchar *hitch_name)
   90.36 +{
   90.37 +  gboolean ok = FALSE;
   90.38 +  int fd;
   90.39 +
   90.40 +  fd = open(hitch_name, O_WRONLY | O_CREAT | O_EXCL, 0);
   90.41 +  if(fd != -1){
   90.42 +    struct stat stat_buf;
   90.43 +
   90.44 +    close(fd);
   90.45 +    link(hitch_name, lock_name);
   90.46 +    if(stat(hitch_name, &stat_buf) == 0){
   90.47 +      if(stat_buf.st_nlink == 2){
   90.48 +        unlink(hitch_name);
   90.49 +        ok = TRUE;
   90.50 +      }
   90.51 +      else{
   90.52 +        if(stat(lock_name, &stat_buf) == 0){
   90.53 +          if((time(NULL) - stat_buf.st_mtime) > MAX_LOCKAGE){
   90.54 +            /* remove lock if uncredibly old */
   90.55 +            unlink(lock_name);
   90.56 +
   90.57 +            link(hitch_name, lock_name);
   90.58 +            if(stat(hitch_name, &stat_buf) == 0){
   90.59 +              if(stat_buf.st_nlink == 2){
   90.60 +                unlink(hitch_name);
   90.61 +                ok = TRUE;
   90.62 +              }
   90.63 +            }
   90.64 +          }
   90.65 +        }
   90.66 +      }
   90.67 +    }
   90.68 +    if(!ok){
   90.69 +      unlink(hitch_name);
   90.70 +    }
   90.71 +  }else
   90.72 +    logwrite(LOG_WARNING, "could not create lock file %s: %s\n",
   90.73 +	     lock_name, strerror(errno));
   90.74 +
   90.75 +  return ok;
   90.76 +}
   90.77 +
   90.78 +gboolean dot_unlock(gchar *lock_name)
   90.79 +{
   90.80 +  unlink(lock_name);
   90.81 +
   90.82 +  return TRUE;
   90.83 +}
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/src/dotlock.h	Fri Sep 26 17:05:23 2008 +0200
    91.3 @@ -0,0 +1,22 @@
    91.4 +/*  MasqMail
    91.5 +    Copyright (C) 2001 Oliver Kurth
    91.6 +
    91.7 +    This program is free software; you can redistribute it and/or modify
    91.8 +    it under the terms of the GNU General Public License as published by
    91.9 +    the Free Software Foundation; either version 2 of the License, or
   91.10 +    (at your option) any later version.
   91.11 +
   91.12 +    This program is distributed in the hope that it will be useful,
   91.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   91.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   91.15 +    GNU General Public License for more details.
   91.16 +
   91.17 +    You should have received a copy of the GNU General Public License
   91.18 +    along with this program; if not, write to the Free Software
   91.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   91.20 +*/
   91.21 +
   91.22 +#define MAX_LOCKAGE 300
   91.23 +
   91.24 +gboolean dot_lock(gchar *lock_name, gchar *hitch_name);
   91.25 +gboolean dot_unlock(gchar *lock_name);
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/src/expand.c	Fri Sep 26 17:05:23 2008 +0200
    92.3 @@ -0,0 +1,125 @@
    92.4 +/*  MasqMail
    92.5 +    Copyright (C) 2000-2001 Oliver Kurth
    92.6 +
    92.7 +    This program is free software; you can redistribute it and/or modify
    92.8 +    it under the terms of the GNU General Public License as published by
    92.9 +    the Free Software Foundation; either version 2 of the License, or
   92.10 +    (at your option) any later version.
   92.11 +
   92.12 +    This program is distributed in the hope that it will be useful,
   92.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   92.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   92.15 +    GNU General Public License for more details.
   92.16 +
   92.17 +    You should have received a copy of the GNU General Public License
   92.18 +    along with this program; if not, write to the Free Software
   92.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   92.20 +*/
   92.21 +
   92.22 +#include "masqmail.h"
   92.23 +
   92.24 +#define MAX_VAR 50
   92.25 +
   92.26 +GList *var_table_rcpt(GList *var_table, address *rcpt)
   92.27 +{
   92.28 +    gchar *tmp_str;
   92.29 +    
   92.30 +    var_table = g_list_prepend(var_table, create_pair_string("rcpt_local", rcpt->local_part));
   92.31 +    var_table = g_list_prepend(var_table, create_pair_string("rcpt_domain", rcpt->domain));
   92.32 +    
   92.33 +    tmp_str = g_strdup_printf("%s@%s", rcpt->local_part, rcpt->domain);
   92.34 +    var_table = g_list_prepend(var_table, create_pair_string("rcpt", tmp_str));
   92.35 +    g_free(tmp_str);
   92.36 +
   92.37 +    return var_table;
   92.38 +}
   92.39 +
   92.40 +GList *var_table_msg(GList *var_table, message *msg)
   92.41 +{
   92.42 +    address *ret_path = msg->return_path;
   92.43 +    gchar *tmp_str;
   92.44 +    
   92.45 +    var_table = g_list_prepend(var_table, create_pair_string("uid", msg->uid));
   92.46 +    var_table = g_list_prepend(var_table, create_pair_string("received_host",
   92.47 +							    msg->received_host ? msg->received_host : ""));
   92.48 +    var_table = g_list_prepend(var_table, create_pair_string("ident", msg->ident ? msg->ident : ""));
   92.49 +    var_table = g_list_prepend(var_table, create_pair_string("return_path_local", ret_path->local_part));
   92.50 +    var_table = g_list_prepend(var_table, create_pair_string("return_path_domain", ret_path->domain));
   92.51 +    
   92.52 +    tmp_str = g_strdup_printf("%s@%s", ret_path->local_part, ret_path->domain);
   92.53 +    var_table = g_list_prepend(var_table, create_pair_string("return_path", tmp_str));
   92.54 +    g_free(tmp_str);
   92.55 +
   92.56 +    return var_table;
   92.57 +}
   92.58 +
   92.59 +GList *var_table_conf(GList *var_table)
   92.60 +{
   92.61 +    var_table = g_list_prepend(var_table, create_pair_string("host_name", conf.host_name));
   92.62 +    var_table = g_list_prepend(var_table, create_pair_string("package", PACKAGE));
   92.63 +    var_table = g_list_prepend(var_table, create_pair_string("version", VERSION));
   92.64 +
   92.65 +    return var_table;
   92.66 +}
   92.67 +
   92.68 +gint expand(GList *var_list, gchar *format, gchar *result, gint result_len)
   92.69 +{
   92.70 +  gchar *p = format, *q = result;
   92.71 +  gchar *vq;
   92.72 +  gint i = 0;
   92.73 +  gboolean escape = FALSE;
   92.74 +
   92.75 +  while(*p && (i < (result_len -1))){
   92.76 +    if((*p == '$') && !escape){
   92.77 +      gchar *value;
   92.78 +      gchar var[MAX_VAR+1];
   92.79 +      int j = 0;
   92.80 +
   92.81 +      p++; /* skip '$' */
   92.82 +      vq = var;
   92.83 +
   92.84 +      if(*p == '{'){
   92.85 +	/* ${var} style */
   92.86 +	p++; /* skip '{' */
   92.87 +	while(*p && (*p != '}') && (j < MAX_VAR)){
   92.88 +	  *(vq++) = *(p++);
   92.89 +	  j++;
   92.90 +	}
   92.91 +	p++;
   92.92 +      }else{
   92.93 +	/* $var style */
   92.94 +	while(*p && (isalnum(*p) || (*p == '_') || (*p == '-')) && (j < MAX_VAR)){
   92.95 +	  *(vq++) = *(p++);
   92.96 +	  j++;
   92.97 +	}
   92.98 +      }
   92.99 +      *vq = 0;
  92.100 +
  92.101 +      if(j < MAX_VAR){
  92.102 +	/* search var */
  92.103 +	value = (gchar *)table_find(var_list, var);
  92.104 +	if(value){
  92.105 +	  gchar *vp = value;
  92.106 +	  while(*vp && (i < (result_len -1))){
  92.107 +	    *(q++) = *(vp++); i++;
  92.108 +	  }
  92.109 +	}
  92.110 +      }
  92.111 +    }else{
  92.112 +      if((*p == '\\') && (!escape)){
  92.113 +	escape = TRUE;
  92.114 +      }else{
  92.115 +	*(q++) = *p; i++;
  92.116 +	escape = FALSE;
  92.117 +      }
  92.118 +      p++;
  92.119 +    }
  92.120 +  }
  92.121 +  *q = 0;
  92.122 +
  92.123 +  if(i >= (result_len -1))
  92.124 +    return -3;
  92.125 +
  92.126 +  return i;
  92.127 +}
  92.128 +
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/src/fail_msg.c	Fri Sep 26 17:05:23 2008 +0200
    93.3 @@ -0,0 +1,177 @@
    93.4 +/*  MasqMail
    93.5 +    Copyright (C) 2000-2001 Oliver Kurth
    93.6 + *
    93.7 + * This program is free software; you can redistribute it and/or modify
    93.8 + * it under the terms of the GNU General Public License as published by
    93.9 + * the Free Software Foundation; either version 2 of the License, or
   93.10 + * (at your option) any later version.
   93.11 + * 
   93.12 + * This program is distributed in the hope that it will be useful,
   93.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   93.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   93.15 + * GNU General Public License for more details.
   93.16 + *
   93.17 + * You should have received a copy of the GNU General Public License
   93.18 + * along with this program; if not, write to the Free Software
   93.19 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   93.20 + */
   93.21 +
   93.22 +#include <sys/wait.h>
   93.23 +
   93.24 +#include "masqmail.h"
   93.25 +#include "peopen.h"
   93.26 +#include "readsock.h"
   93.27 +
   93.28 +gboolean fail_msg(message *msg, gchar *template,
   93.29 +		  GList *failed_rcpts, gchar *err_fmt, va_list args)
   93.30 +{
   93.31 +  gboolean ok = FALSE;
   93.32 +  address *ret_path = NULL;
   93.33 +
   93.34 +  /* do not bounce bounces, send to postmaster instead */
   93.35 +  if(msg->return_path->local_part[0] == 0){
   93.36 +    GList *node;
   93.37 +
   93.38 +    ret_path = create_address_qualified("postmaster", TRUE, conf.host_name);
   93.39 +    foreach(failed_rcpts, node){
   93.40 +      address *addr = (address *)(node->data);
   93.41 +      if(addr_isequal_parent(addr, ret_path)){
   93.42 +	logwrite(LOG_ALERT, "%s == %s: postmaster address failed\n",
   93.43 +		 msg->uid, addr_string(ret_path));
   93.44 +	return FALSE;
   93.45 +      }
   93.46 +    }
   93.47 +  }else
   93.48 +    ret_path = copy_address(msg->return_path);
   93.49 +
   93.50 +  DEBUG(1) debugf("sending failure notice to %s.\n", addr_string(ret_path));
   93.51 +
   93.52 +  if(template){
   93.53 +    FILE *file;
   93.54 +    GList *var_table = var_table_conf(var_table_msg(NULL, msg));
   93.55 +    gchar *err_msg = g_strdup_vprintf(err_fmt, args);
   93.56 +
   93.57 +    var_table = g_list_prepend(var_table, create_pair_string("err_msg", err_msg));
   93.58 +    g_free(err_msg);
   93.59 +
   93.60 +    if((file = fopen(template, "r"))){
   93.61 +      FILE *out;
   93.62 +      gchar *cmd;
   93.63 +      pid_t pid;
   93.64 +
   93.65 +      //      cmd = g_strdup_printf(SBINDIR"/masqmail -oi -f \"<>\" %s@%s",
   93.66 +      //			    ret_path->local_part, ret_path->domain);
   93.67 +      cmd = g_strdup_printf(SBINDIR"/masqmail -oi -f <> %s@%s",
   93.68 +			    ret_path->local_part, ret_path->domain);
   93.69 +      if((out = peidopen(cmd, "w", environ, &pid, conf.mail_uid, conf.mail_gid))){
   93.70 +	gchar fmt[256], line[256];
   93.71 +	int status, ret;
   93.72 +
   93.73 +	while((ret = read_sockline(file, fmt, 256, 0, 0)) > 0){
   93.74 +	  if(fmt[0] == '@'){
   93.75 +	    GList *node;
   93.76 +	    if(strncmp(fmt, "@failed_rcpts", 13) == 0){
   93.77 +	      foreach(failed_rcpts, node){
   93.78 +		address *rcpt = (address *)(node->data);
   93.79 +		fprintf(out, "\t%s\n", addr_string(rcpt));
   93.80 +	      }
   93.81 +	    }else if(strncmp(fmt, "@msg_headers", 12) == 0){
   93.82 +	      foreach(msg->hdr_list, node){
   93.83 +		header *hdr = (header *)(node->data);
   93.84 +		fputs(hdr->header, out);
   93.85 +	      }
   93.86 +	    }else if(strncmp(fmt, "@msg_body", 9) == 0){
   93.87 +	      /* we may have to read the data at this point
   93.88 +		 and remember if we did */
   93.89 +	      gboolean flag = (msg->data_list == NULL);
   93.90 +	      if(flag){
   93.91 +		if(!spool_read_data(msg)){
   93.92 +		  logwrite(LOG_ALERT, "could not open data spool file %s\n",
   93.93 +			   msg->uid);
   93.94 +		}
   93.95 +	      }
   93.96 +	      foreach(msg->data_list, node){
   93.97 +		gchar *line = (gchar *)(node->data);
   93.98 +		fputs(line, out);
   93.99 +	      }
  93.100 +	      if(flag) msg_free_data(msg);
  93.101 +	    }
  93.102 +	  }else{
  93.103 +	    expand(var_table, fmt, line, 256);
  93.104 +	    fputs(line, out);
  93.105 +	  }
  93.106 +	}
  93.107 +
  93.108 +	fclose(out);
  93.109 +	waitpid(pid, &status, 0);
  93.110 +	if((WEXITSTATUS(status) != EXIT_SUCCESS) || WIFSIGNALED(status)){
  93.111 +	  if(WEXITSTATUS(status) != EXIT_SUCCESS)
  93.112 +	    logwrite(LOG_WARNING, "child returned %d\n", WEXITSTATUS(status));
  93.113 +	  if(WIFSIGNALED(status))
  93.114 +	    logwrite(LOG_WARNING, "child got signal: %d\n", WTERMSIG(status));
  93.115 +	}else ok = TRUE;
  93.116 +      }else{
  93.117 +	logwrite(LOG_ERR, "peopen failed: %s\n", strerror(errno));
  93.118 +      }
  93.119 +      g_free(cmd);
  93.120 +      fclose(file);
  93.121 +    }else
  93.122 +      logwrite(LOG_ALERT, "could not open failure message template %s: %s\n",
  93.123 +	       conf.errmsg_file, strerror(errno));
  93.124 +
  93.125 +    destroy_table(var_table);
  93.126 +  }
  93.127 +    
  93.128 +  destroy_address(ret_path);
  93.129 +
  93.130 +  return ok;
  93.131 +}
  93.132 +
  93.133 +/*
  93.134 +ival  : |--|--|----|--------|--------|
  93.135 +warned: |-------W-------------W------
  93.136 +result: |nnnyyyynnnnyyyyyyyyyynnnnnnn
  93.137 +*/
  93.138 +
  93.139 +static
  93.140 +gboolean warn_msg_is_due(message *msg)
  93.141 +{
  93.142 +  time_t now = time(NULL);
  93.143 +  gint dummy;
  93.144 +  
  93.145 +  GList *node;
  93.146 +  for(node = g_list_last(conf.warn_intervals); node; node = g_list_previous(node)){
  93.147 +    gchar *str_ival = (gchar *)(node->data);
  93.148 +    gint ival = time_interval(str_ival, &dummy);
  93.149 +    if(ival >= 0){
  93.150 +      DEBUG(5) debugf("ival = %d\n", ival);
  93.151 +      DEBUG(5) debugf("now - msg->received_time = %d\n", now - msg->received_time);
  93.152 +      if((now - msg->received_time) > ival){
  93.153 +	if(msg->warned_time != 0){
  93.154 +	  if((msg->warned_time - msg->received_time) < ival)
  93.155 +	    return TRUE;
  93.156 +	}else
  93.157 +	  return TRUE;
  93.158 +      }
  93.159 +    }else
  93.160 +      logwrite(LOG_WARNING, "invalid time interval: %s\n", str_ival);
  93.161 +  }
  93.162 +  return FALSE;
  93.163 +}
  93.164 +
  93.165 +gboolean warn_msg(message *msg, gchar *template,
  93.166 +		  GList *defered_rcpts, gchar *err_fmt, va_list args)
  93.167 +{
  93.168 +  time_t now = time(NULL);
  93.169 +
  93.170 +  if(warn_msg_is_due(msg)){
  93.171 +    if(fail_msg(msg, template, defered_rcpts, err_fmt, args)){
  93.172 +      msg->warned_time = now;
  93.173 +      return TRUE;
  93.174 +    }else
  93.175 +      return FALSE;
  93.176 +  }
  93.177 +  return TRUE;
  93.178 +}
  93.179 +
  93.180 +      
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/src/get.c	Fri Sep 26 17:05:23 2008 +0200
    94.3 @@ -0,0 +1,410 @@
    94.4 +/*  MasqMail
    94.5 +    Copyright (C) 2000-2002 Oliver Kurth
    94.6 +
    94.7 +    This program is free software; you can redistribute it and/or modify
    94.8 +    it under the terms of the GNU General Public License as published by
    94.9 +    the Free Software Foundation; either version 2 of the License, or
   94.10 +    (at your option) any later version.
   94.11 +
   94.12 +    This program is distributed in the hope that it will be useful,
   94.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   94.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   94.15 +    GNU General Public License for more details.
   94.16 +
   94.17 +    You should have received a copy of the GNU General Public License
   94.18 +    along with this program; if not, write to the Free Software
   94.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   94.20 +*/
   94.21 +
   94.22 +#include <sys/wait.h>
   94.23 +#include <sys/file.h>
   94.24 +#include <sys/types.h>
   94.25 +
   94.26 +#include "masqmail.h"
   94.27 +#include "pop3_in.h"
   94.28 +
   94.29 +#ifdef ENABLE_POP3
   94.30 +
   94.31 +static int volatile sighup_seen = 0;
   94.32 +
   94.33 +static
   94.34 +void sighup_handler(int sig)
   94.35 +{
   94.36 +  sighup_seen = 1;
   94.37 +  signal(SIGHUP, sighup_handler);
   94.38 +}
   94.39 +
   94.40 +static
   94.41 +void sigchld_handler(int sig)
   94.42 +{
   94.43 +  pid_t pid;
   94.44 +  int status;
   94.45 +  
   94.46 +  pid = waitpid(0, &status, 0);
   94.47 +  if(pid > 0){
   94.48 +    if(WEXITSTATUS(status) != EXIT_SUCCESS)
   94.49 +      logwrite(LOG_WARNING, "process %d exited with %d\n",
   94.50 +	       pid, WEXITSTATUS(status));
   94.51 +    if(WIFSIGNALED(status))
   94.52 +      logwrite(LOG_WARNING,
   94.53 +	       "process with pid %d got signal: %d\n",
   94.54 +	       pid, WTERMSIG(status));
   94.55 +  }
   94.56 +  signal(SIGCHLD, sigchld_handler);
   94.57 +}
   94.58 +
   94.59 +static
   94.60 +int get_lock(get_conf *gc)
   94.61 +{
   94.62 +#ifdef USE_DOTLOCK
   94.63 +  gboolean ok = FALSE;
   94.64 +  gchar *hitch_name;
   94.65 +  gchar *lock_name;
   94.66 +
   94.67 +  /* the name of the lock is constructed from the user
   94.68 +     and the server name, to prevent more than one connection at the same time
   94.69 +     to the same server and the same user. This way concurrent connections
   94.70 +     are possible to different servers or different users */
   94.71 +  hitch_name = g_strdup_printf("%s/masqmail-get-%s@%s-%d.lock",
   94.72 +			       conf.lock_dir, gc->login_user,
   94.73 +			       gc->server_name, getpid());
   94.74 +  lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock",
   94.75 +			      conf.lock_dir, gc->login_user, gc->server_name);
   94.76 +  
   94.77 +  ok = dot_lock(lock_name, hitch_name);
   94.78 +  if(!ok) logwrite(LOG_WARNING,
   94.79 +		   "getting mail for %s@%s is locked\n",
   94.80 +		   gc->login_user, gc->server_name);
   94.81 +
   94.82 +  g_free(lock_name);
   94.83 +  g_free(hitch_name);
   94.84 +
   94.85 +  return ok;
   94.86 +#else
   94.87 +  gchar *lock_name;
   94.88 +  int fd;
   94.89 +
   94.90 +  lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock",
   94.91 +			      conf.lock_dir, gc->login_user, gc->server_name);
   94.92 +
   94.93 +  if((fd = open(lock_name, O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600)) >= 0){
   94.94 +    if(flock(fd, LOCK_EX|LOCK_NB) != 0){
   94.95 +      close(fd);
   94.96 +      logwrite(LOG_WARNING,
   94.97 +	       "getting mail for %s@%s is locked\n",
   94.98 +	       gc->login_user, gc->server_name);
   94.99 +      fd = -1;
  94.100 +    }
  94.101 +  }else
  94.102 +    logwrite(LOG_WARNING,
  94.103 +	     "could not open lock %s: %s\n", lock_name, strerror(errno));
  94.104 +
  94.105 +  g_free(lock_name);
  94.106 +
  94.107 +  return fd;
  94.108 +#endif
  94.109 +}
  94.110 +
  94.111 +#ifdef USE_DOTLOCK
  94.112 +static
  94.113 +gboolean get_unlock(get_conf *gc)
  94.114 +{
  94.115 +  gchar *lock_name lock_name =
  94.116 +    g_strdup_printf("%s/masqmail-get-%s@%s.lock",
  94.117 +		    conf.lock_dir, gc->login_user, gc->server_name);
  94.118 +  
  94.119 +  dot_unlock(lock_name);
  94.120 +
  94.121 +  g_free(lock_name);
  94.122 +
  94.123 +  return TRUE;
  94.124 +}
  94.125 +#else
  94.126 +static void get_unlock(get_conf *gc, int fd)
  94.127 +{
  94.128 +  gchar *lock_name =
  94.129 +    g_strdup_printf("%s/masqmail-get-%s@%s.lock",
  94.130 +		    conf.lock_dir, gc->login_user, gc->server_name);
  94.131 +
  94.132 +  flock(fd, LOCK_UN);
  94.133 +  close(fd);
  94.134 +
  94.135 +  unlink(lock_name);
  94.136 +  g_free(lock_name);
  94.137 +}
  94.138 +#endif
  94.139 +
  94.140 +gboolean get_from_file(gchar *fname)
  94.141 +{
  94.142 +  guint flags = 0;
  94.143 +  get_conf *gc = read_get_conf(fname);
  94.144 +  gboolean ok = TRUE;
  94.145 +  int lock;
  94.146 +
  94.147 +  if(gc){
  94.148 +    if(!gc->do_keep) flags |= POP3_FLAG_DELETE;
  94.149 +    if(gc->do_uidl) flags |= POP3_FLAG_UIDL;
  94.150 +    if(gc->do_uidl_dele) flags |= POP3_FLAG_UIDL_DELE;
  94.151 +    
  94.152 +    if(!(gc->server_name)){
  94.153 +      logwrite(LOG_ALERT, "no server name given in %s\n", fname); return FALSE;
  94.154 +    }
  94.155 +    if(!(gc->address)){
  94.156 +      logwrite(LOG_ALERT, "no address given in %s\n", fname); return FALSE;
  94.157 +    }
  94.158 +    if(!(gc->login_user)){
  94.159 +      logwrite(LOG_ALERT, "no user name given in %s\n", fname); return FALSE;
  94.160 +    }
  94.161 +    if(!(gc->login_pass)){
  94.162 +      logwrite(LOG_ALERT, "no password given in %s\n", fname); return FALSE;
  94.163 +    }
  94.164 +
  94.165 +    DEBUG(3) debugf("flags = %d\n", flags);
  94.166 +    
  94.167 +    if((strcmp(gc->protocol, "pop3") == 0) || (strcmp(gc->protocol, "apop") == 0)){
  94.168 +      pop3_base *popb = NULL;
  94.169 +
  94.170 +      if(strcmp(gc->protocol, "apop") == 0){
  94.171 +	flags |= POP3_FLAG_APOP;
  94.172 +	DEBUG(3) debugf("attempting to get mail for user %s at host %s"
  94.173 +			" for %s@%s with apop\n",
  94.174 +			gc->login_user, gc->server_name,
  94.175 +			gc->address->local_part, gc->address->domain);
  94.176 +      }else{
  94.177 +	DEBUG(3) debugf("attempting to get mail for user %s at host %s"
  94.178 +			" for %s@%s with pop3\n",
  94.179 +			gc->login_user, gc->server_name,
  94.180 +			gc->address->local_part, gc->address->domain);
  94.181 +      }
  94.182 +#ifdef USE_DOTLOCK
  94.183 +      if((lock = get_lock(gc))){
  94.184 +#else
  94.185 +      if((lock = get_lock(gc)) >= 0){
  94.186 +#endif
  94.187 +	if(gc->wrapper){
  94.188 +	  popb = pop3_in_open_child(gc->wrapper, flags);
  94.189 +	  /* quick hack */
  94.190 +	  popb->remote_host = gc->server_name;
  94.191 +	}else{
  94.192 +	  popb = pop3_in_open(gc->server_name, gc->server_port,
  94.193 +			      gc->resolve_list, flags);
  94.194 +	}
  94.195 +	if(popb){
  94.196 +	  ok = pop3_get(popb, gc->login_user, gc->login_pass,
  94.197 +			gc->address, gc->return_path,
  94.198 +			gc->max_count, gc->max_size, gc->max_size_delete);
  94.199 +	  pop3_in_close(popb);
  94.200 +	}else{
  94.201 +	  ok = FALSE;
  94.202 +	  logwrite(LOG_ALERT, "failed to connect to host %s\n", gc->server_name);
  94.203 +	}
  94.204 +#ifdef USE_DOTLOCK
  94.205 +	get_unlock(gc);
  94.206 +#else
  94.207 +	get_unlock(gc, lock);
  94.208 +#endif
  94.209 +      }
  94.210 +    }else{
  94.211 +      logwrite(LOG_ALERT, "get protocol %s unknown\n", gc->protocol);
  94.212 +      ok = FALSE;
  94.213 +    }
  94.214 +
  94.215 +    destroy_get_conf(gc);
  94.216 +  }
  94.217 +  return ok;
  94.218 +}
  94.219 +
  94.220 +gboolean get_from_name(gchar *name)
  94.221 +{
  94.222 +  gchar *fname = (gchar *)table_find(conf.get_names, name);
  94.223 +  if(fname)
  94.224 +    return get_from_file(fname);
  94.225 +  return FALSE;
  94.226 +}
  94.227 +
  94.228 +gboolean get_all()
  94.229 +{
  94.230 +  GList *get_table = conf.get_names;
  94.231 +  GList *get_node;
  94.232 +  void (*old_signal)(int);
  94.233 +
  94.234 +  old_signal = signal(SIGCHLD, SIG_DFL);
  94.235 +
  94.236 +  foreach(get_table, get_node){
  94.237 +    table_pair *pair = (table_pair *)(get_node->data);
  94.238 +    gchar *fname = (gchar *)pair->value;
  94.239 +    pid_t pid;
  94.240 +
  94.241 +    pid = fork();
  94.242 +    if(pid == 0){
  94.243 +      signal(SIGCHLD, old_signal);    
  94.244 +      exit(get_from_file(fname) ? EXIT_SUCCESS : EXIT_FAILURE);
  94.245 +    }else if(pid > 0){
  94.246 +      int status;
  94.247 +      waitpid(pid, &status, 0);
  94.248 +      if(WEXITSTATUS(status) != EXIT_SUCCESS)
  94.249 +	logwrite(LOG_WARNING, "child returned %d\n", WEXITSTATUS(status));
  94.250 +      if(WIFSIGNALED(status))
  94.251 +	logwrite(LOG_WARNING, "child got signal: %d\n", WTERMSIG(status));
  94.252 +    }else
  94.253 +      logwrite(LOG_WARNING, "forking child failed: %s\n", strerror(errno));
  94.254 +  }
  94.255 +    
  94.256 +  signal(SIGCHLD, old_signal);    
  94.257 +
  94.258 +  return TRUE;
  94.259 +}
  94.260 +
  94.261 +void get_online()
  94.262 +{
  94.263 +  GList *gf_list = NULL;
  94.264 +  gchar *connect_name = detect_online();
  94.265 +
  94.266 +  if(connect_name != NULL){
  94.267 +    void (*old_signal)(int);
  94.268 +
  94.269 +    old_signal = signal(SIGCHLD, SIG_DFL);
  94.270 +
  94.271 +    logwrite(LOG_NOTICE, "detected online configuration %s\n", connect_name);
  94.272 +    /* we are online! */
  94.273 +    gf_list = (GList *)table_find(conf.online_gets, connect_name);
  94.274 +    if(gf_list != NULL){
  94.275 +      GList *node;
  94.276 +      foreach(gf_list, node){
  94.277 +	gchar *fname = (gchar *)(node->data);
  94.278 +	pid_t pid;
  94.279 +
  94.280 +	if(fname[0] != '/')
  94.281 +	  fname = (gchar *)table_find(conf.get_names, fname);
  94.282 +
  94.283 +	if(fname != NULL){
  94.284 +	  pid = fork();
  94.285 +	  if(pid == 0){
  94.286 +	    signal(SIGCHLD, old_signal);    
  94.287 +	    exit(get_from_file(fname) ? EXIT_SUCCESS : EXIT_FAILURE);
  94.288 +	  }else if(pid > 0){
  94.289 +	    int status;
  94.290 +	    waitpid(pid, &status, 0);
  94.291 +	    if(WEXITSTATUS(status) != EXIT_SUCCESS)
  94.292 +	      logwrite(LOG_WARNING, "child returned %d\n", WEXITSTATUS(status));
  94.293 +	    if(WIFSIGNALED(status))
  94.294 +	      logwrite(LOG_WARNING, "child got signal: %d\n", WTERMSIG(status));
  94.295 +	  }else
  94.296 +	    logwrite(LOG_WARNING, "forking child failed: %s\n", strerror(errno));
  94.297 +	}
  94.298 +      }
  94.299 +    }
  94.300 +    signal(SIGCHLD, old_signal);    
  94.301 +  }
  94.302 +}
  94.303 +
  94.304 +void get_daemon(gint gival, char *argv[])
  94.305 +{
  94.306 +  struct timeval tm;
  94.307 +  time_t time_before, time_now;
  94.308 +  int sel_ret;
  94.309 +
  94.310 +  /* setup handler for HUP signal: */
  94.311 +  signal(SIGHUP, sighup_handler);
  94.312 +
  94.313 +  /* we can give up root privileges */
  94.314 +  if(!conf.run_as_user){
  94.315 +    if(setegid(conf.mail_gid) != 0){
  94.316 +      logwrite(LOG_ALERT, "could not change gid to %d: %s\n",
  94.317 +	       conf.mail_gid, strerror(errno));
  94.318 +      exit(EXIT_FAILURE);
  94.319 +    }
  94.320 +    if(seteuid(conf.mail_uid) != 0){
  94.321 +      logwrite(LOG_ALERT, "could not change uid to %d: %s\n",
  94.322 +	       conf.mail_uid, strerror(errno));
  94.323 +      exit(EXIT_FAILURE);
  94.324 +    }
  94.325 +  }
  94.326 +
  94.327 +  /*  sel_ret = 0;*/
  94.328 +  time(&time_before);
  94.329 +  time_before -= gival;
  94.330 +  sel_ret = -1;
  94.331 +
  94.332 +  while (1){
  94.333 +    /* see listen_port() in listen.c */
  94.334 +    if(gival > 0){
  94.335 +      time(&time_now);
  94.336 +      if(sel_ret == 0){ /* we are either just starting or did a queue run */
  94.337 +	tm.tv_sec = gival;
  94.338 +	tm.tv_usec = 0;
  94.339 +	time_before = time_now;
  94.340 +      }else{
  94.341 +	tm.tv_sec = gival - (time_now - time_before);
  94.342 +	tm.tv_usec = 0;
  94.343 +
  94.344 +	/* race condition, very unlikely (but possible): */
  94.345 +	if(tm.tv_sec < 0)
  94.346 +	  tm.tv_sec = 0;
  94.347 +      }
  94.348 +    }
  94.349 +
  94.350 +    if ((sel_ret = select(0, NULL, NULL, NULL, &tm)) < 0){
  94.351 +      if(errno != EINTR){
  94.352 +	logwrite(LOG_ALERT, "select: (terminating): %s\n", strerror(errno));
  94.353 +	exit (EXIT_FAILURE);
  94.354 +      }else{
  94.355 +	if(sighup_seen){
  94.356 +	  logwrite(LOG_NOTICE, "HUP signal received. Restarting daemon\n");
  94.357 +
  94.358 +	  if(argv == NULL) exit(EXIT_SUCCESS);
  94.359 +
  94.360 +	  execv(argv[0], &(argv[0]));
  94.361 +	  logwrite(LOG_ALERT, "restarting failed: %s\n", strerror(errno));
  94.362 +	  exit(EXIT_FAILURE);
  94.363 +
  94.364 +	}
  94.365 +      }
  94.366 +    }else{
  94.367 +      /* If select returns 0, the interval time has elapsed.
  94.368 +	 We start a new get process */
  94.369 +      int pid;
  94.370 +      signal(SIGCHLD, sigchld_handler);
  94.371 +      if((pid = fork()) == 0){
  94.372 +	get_online();
  94.373 +
  94.374 +	_exit(EXIT_SUCCESS);
  94.375 +      }
  94.376 +      else if(pid < 0){
  94.377 +	logwrite(LOG_ALERT, "could not fork for get run");
  94.378 +      }
  94.379 +    }
  94.380 +  }
  94.381 +}
  94.382 +
  94.383 +gboolean pop_before_smtp(gchar *fname)
  94.384 +{
  94.385 +  gboolean ok = FALSE;
  94.386 +  GList *resolve_list = NULL;
  94.387 +  get_conf *gc = read_get_conf(fname);
  94.388 +  guint flags = 0;
  94.389 +
  94.390 +#ifdef ENABLE_RESOLVER
  94.391 +  resolve_list = g_list_append(resolve_list, resolve_dns_a);
  94.392 +#endif
  94.393 +  resolve_list = g_list_append(resolve_list, resolve_byname);
  94.394 +
  94.395 +  if(strcmp(gc->protocol, "pop3") == 0){
  94.396 +    DEBUG(3) debugf("attempting to login for user %s, host = %s with pop3\n",
  94.397 +		    gc->login_user, gc->server_name);
  94.398 +    ok = pop3_login(gc->server_name, gc->server_port, resolve_list,
  94.399 +		    gc->login_user, gc->login_pass,
  94.400 +		    flags);
  94.401 +  }else if(strcmp(gc->protocol, "apop") == 0){
  94.402 +    DEBUG(3) debugf("attempting to login for user %s, host = %s with apop\n",
  94.403 +		    gc->login_user, gc->server_name);
  94.404 +    ok = pop3_login(gc->server_name, gc->server_port, resolve_list,
  94.405 +		    gc->login_user, gc->login_pass,
  94.406 +		    flags | POP3_FLAG_APOP);
  94.407 +  }else{
  94.408 +    logwrite(LOG_ALERT, "get protocol %s unknown\n", gc->protocol);
  94.409 +  }
  94.410 +  return ok;
  94.411 +}
  94.412 +
  94.413 +#endif
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/src/header.c	Fri Sep 26 17:05:23 2008 +0200
    95.3 @@ -0,0 +1,259 @@
    95.4 +/*  MasqMail
    95.5 +    Copyright (C) 2000 Oliver Kurth
    95.6 +
    95.7 +    This program is free software; you can redistribute it and/or modify
    95.8 +    it under the terms of the GNU General Public License as published by
    95.9 +    the Free Software Foundation; either version 2 of the License, or
   95.10 +    (at your option) any later version.
   95.11 +
   95.12 +    This program is distributed in the hope that it will be useful,
   95.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   95.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   95.15 +    GNU General Public License for more details.
   95.16 +
   95.17 +    You should have received a copy of the GNU General Public License
   95.18 +    along with this program; if not, write to the Free Software
   95.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   95.20 +*/
   95.21 +#include "masqmail.h"
   95.22 +
   95.23 +header_name header_names[] =
   95.24 +{
   95.25 +  { "From", HEAD_FROM, },
   95.26 +  { "Sender", HEAD_SENDER, },
   95.27 +  { "To", HEAD_TO, },
   95.28 +  { "Cc", HEAD_CC, },
   95.29 +  { "Bcc", HEAD_BCC, },
   95.30 +  { "Date", HEAD_DATE, },
   95.31 +  { "Message-Id", HEAD_MESSAGE_ID, },
   95.32 +  { "Reply-To", HEAD_REPLY_TO, },
   95.33 +  { "Subject", HEAD_SUBJECT, },
   95.34 +  { "Return-Path", HEAD_RETURN_PATH, },
   95.35 +  { "Envelope-To", HEAD_ENVELOPE_TO, },
   95.36 +  { "Received", HEAD_RECEIVED },
   95.37 +};
   95.38 +
   95.39 +/* this was borrowed from exim and slightly changed */
   95.40 +gchar *rec_timestamp()
   95.41 +{
   95.42 +  static gchar buf[64];
   95.43 +  int len;
   95.44 +  
   95.45 +  time_t now = time(NULL);
   95.46 +  struct tm *t = localtime(&now);
   95.47 +
   95.48 +  int diff_hour, diff_min;
   95.49 +  struct tm local;
   95.50 +  struct tm *gmt;
   95.51 +
   95.52 +  memcpy(&local, t, sizeof(struct tm));
   95.53 +  gmt = gmtime(&now);
   95.54 +  diff_min = 60*(local.tm_hour - gmt->tm_hour) + local.tm_min - gmt->tm_min;
   95.55 +  if (local.tm_year != gmt->tm_year)
   95.56 +    diff_min += (local.tm_year > gmt->tm_year)? 1440 : -1440;
   95.57 +  else if (local.tm_yday != gmt->tm_yday)
   95.58 +    diff_min += (local.tm_yday > gmt->tm_yday)? 1440 : -1440;
   95.59 +  diff_hour = diff_min/60;
   95.60 +  diff_min  = abs(diff_min - diff_hour*60);
   95.61 +
   95.62 +  len = strftime(buf, sizeof(buf), "%a, ", &local);
   95.63 +  g_snprintf(buf + len, sizeof(buf) - len, "%02d ", local.tm_mday);
   95.64 +  len += strlen(buf + len);
   95.65 +  len += strftime(buf + len, sizeof(buf) - len, "%b %Y %H:%M:%S", &local);
   95.66 +  g_snprintf(buf + len, sizeof(buf) - len, " %+03d%02d", diff_hour, diff_min);
   95.67 +
   95.68 +  return buf;
   95.69 +}
   95.70 +
   95.71 +/* finds list of headers matching id
   95.72 +   if id == HEAD_UNKNOWN and header == NULL finds all unknown headers
   95.73 +   else finds all headers matching header
   95.74 +*/
   95.75 +GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str)
   95.76 +{
   95.77 +  GList *found_list = NULL;
   95.78 +  GList *node;
   95.79 +
   95.80 +  if((id != HEAD_UNKNOWN) || (hdr_str == NULL)){
   95.81 +    foreach(hdr_list, node){
   95.82 +      header *hdr = (header *)(node->data);
   95.83 +      if(hdr->id == id)
   95.84 +        found_list = g_list_append(found_list, hdr);
   95.85 +    }
   95.86 +  }else{
   95.87 +    foreach(hdr_list, node){
   95.88 +      header *hdr = (header *)(node->data);
   95.89 +      gchar buf[64], *q = buf, *p = hdr->header;
   95.90 +      
   95.91 +      while(*p != ':' && q < buf+63 && *p) *(q++) = *(p++);
   95.92 +      *q = 0;
   95.93 +      
   95.94 +      if(strcasecmp(buf, hdr_str) == 0)
   95.95 +        found_list = g_list_append(found_list, hdr);
   95.96 +    }
   95.97 +  }
   95.98 +  return found_list;
   95.99 +}
  95.100 +
  95.101 +void header_unfold(header *hdr)
  95.102 +{
  95.103 +  gchar *tmp_hdr = g_malloc(strlen(hdr->header));
  95.104 +  gchar *p = hdr->header, *q = tmp_hdr;
  95.105 +  gboolean flag = FALSE;
  95.106 +
  95.107 +  while(*p){
  95.108 +    if(*p != '\n')
  95.109 +      *(q++) = *p;
  95.110 +    else
  95.111 +      flag = TRUE;
  95.112 +    p++;
  95.113 +  }
  95.114 +  *(q++) = '\n';
  95.115 +
  95.116 +  if(flag){
  95.117 +    gchar *new_hdr;
  95.118 +
  95.119 +    g_free(hdr->header);
  95.120 +    new_hdr = g_strdup(tmp_hdr);
  95.121 +    g_free(tmp_hdr);
  95.122 +    hdr->value = new_hdr + (hdr->value - hdr->header);
  95.123 +    hdr->header = new_hdr;
  95.124 +  }
  95.125 +}
  95.126 +
  95.127 +#define MAX_HDR_LEN 72
  95.128 +void header_fold(header *hdr)
  95.129 +{
  95.130 +  gint len = strlen(hdr->header);
  95.131 +  gchar *p, *q;
  95.132 +  /* size is probably overestimated, but so we are on the safe side */
  95.133 +  gchar *tmp_hdr = g_malloc(len + 2*len/MAX_HDR_LEN);
  95.134 +
  95.135 +  p = hdr->header;
  95.136 +  q = tmp_hdr;
  95.137 +
  95.138 +  if(p[len-1] == '\n')
  95.139 +    p[len-1] = 0;
  95.140 +
  95.141 +  while(*p){
  95.142 +    gint i,l;
  95.143 +    gchar *pp;
  95.144 +    
  95.145 +    /* look forward and find potential break points */
  95.146 +    i = 0; l = -1;
  95.147 +    pp = p;
  95.148 +    while(*pp && (i < MAX_HDR_LEN)){
  95.149 +      if((*pp == ' ') || (*pp == '\t'))
  95.150 +	l = i;
  95.151 +      pp++;
  95.152 +      i++;
  95.153 +    }
  95.154 +    if(!*pp) l = pp-p; /* take rest, if EOS found */
  95.155 +
  95.156 +    if(l == -1){
  95.157 +      /* no potential break point was found within MAX_HDR_LEN
  95.158 +       so advance further until the next */
  95.159 +      while(*pp && *pp != ' ' && *pp != '\t'){
  95.160 +	pp++;
  95.161 +	i++;
  95.162 +      }
  95.163 +      l = i;
  95.164 +    }
  95.165 +
  95.166 +    /* copy */
  95.167 +    i = 0;
  95.168 +    while(i < l){
  95.169 +      *(q++) = *(p++);
  95.170 +      i++;
  95.171 +    }
  95.172 +    *(q++) = '\n';
  95.173 +    *(q++) = *(p++); /* this is either space, tab or 0 */
  95.174 +  }
  95.175 +  {
  95.176 +    gchar *new_hdr;
  95.177 +    
  95.178 +    g_free(hdr->header);
  95.179 +    new_hdr = g_strdup(tmp_hdr);
  95.180 +    g_free(tmp_hdr);
  95.181 +    hdr->value = new_hdr + (hdr->value - hdr->header);
  95.182 +    hdr->header = new_hdr;
  95.183 +  }
  95.184 +}
  95.185 +
  95.186 +header *create_header(header_id id, gchar *fmt, ...)
  95.187 +{
  95.188 +  gchar *p;
  95.189 +  header *hdr;
  95.190 +  va_list args;
  95.191 +  va_start(args, fmt);
  95.192 +
  95.193 +  if((hdr = g_malloc(sizeof(header)))){
  95.194 +
  95.195 +    hdr->id = id;
  95.196 +    hdr->header = g_strdup_vprintf(fmt, args);
  95.197 +    hdr->value = NULL;
  95.198 +
  95.199 +    p = hdr->header;
  95.200 +    while(*p && *p != ':') p++;
  95.201 +    if(*p)
  95.202 +      hdr->value = p+1;
  95.203 +  }
  95.204 +
  95.205 +  va_end(args);
  95.206 +  return hdr;
  95.207 +}
  95.208 +
  95.209 +void destroy_header(header *hdr)
  95.210 +{
  95.211 +  if(hdr){
  95.212 +    if(hdr->header) g_free(hdr->header);
  95.213 +    g_free(hdr);
  95.214 +  }
  95.215 +}
  95.216 +
  95.217 +header *copy_header(header *hdr)
  95.218 +{
  95.219 +  header *new_hdr = NULL;
  95.220 +
  95.221 +  if(hdr){
  95.222 +    if((new_hdr = g_malloc(sizeof(header)))){
  95.223 +      new_hdr->id = hdr->id;
  95.224 +      new_hdr->header = g_strdup(hdr->header);
  95.225 +      new_hdr->value = new_hdr->header + (hdr->value - hdr->header);
  95.226 +    }
  95.227 +  }
  95.228 +  return new_hdr;
  95.229 +}
  95.230 +
  95.231 +header *get_header(gchar *line)
  95.232 +{
  95.233 +  gchar *p = line;
  95.234 +  gchar buf[64], *q = buf;
  95.235 +  gint i;
  95.236 +  header *hdr;
  95.237 +  
  95.238 +  while(*p && (*p != ':') && (q < buf+63)) *(q++) = *(p++);
  95.239 +  *q = 0;
  95.240 +  
  95.241 +  if(*p != ':') return NULL;
  95.242 +
  95.243 +  hdr = g_malloc(sizeof(header));
  95.244 +
  95.245 +  hdr->value = NULL;
  95.246 +  p++;
  95.247 +
  95.248 +  while(*p && (*p == ' ' || *p == '\t')) p++;
  95.249 +  hdr->value = p;
  95.250 +
  95.251 +  for(i = 0; i < HEAD_NUM_IDS; i++){
  95.252 +    if(strcasecmp(header_names[i].header, buf) == 0)
  95.253 +      break;
  95.254 +  }
  95.255 +  hdr->id = (header_id)i;
  95.256 +  hdr->header = g_strdup(line);
  95.257 +  hdr->value = hdr->header + (hdr->value - line);
  95.258 +
  95.259 +  DEBUG(4) debugf("header: %d = %s", hdr->id, hdr->header);
  95.260 +
  95.261 +  return hdr;
  95.262 +}
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/src/interface.c	Fri Sep 26 17:05:23 2008 +0200
    96.3 @@ -0,0 +1,99 @@
    96.4 +/*  MasqMail
    96.5 +    Copyright (C) 2000 Oliver Kurth
    96.6 +
    96.7 +    This program is free software; you can redistribute it and/or modify
    96.8 +    it under the terms of the GNU General Public License as published by
    96.9 +    the Free Software Foundation; either version 2 of the License, or
   96.10 +    (at your option) any later version.
   96.11 +
   96.12 +    This program is distributed in the hope that it will be useful,
   96.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   96.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   96.15 +    GNU General Public License for more details.
   96.16 +
   96.17 +    You should have received a copy of the GNU General Public License
   96.18 +    along with this program; if not, write to the Free Software
   96.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   96.20 +*/
   96.21 +
   96.22 +#include "masqmail.h"
   96.23 +
   96.24 +/* define if you get problems... */
   96.25 +/*#define SOCKADDR_OLD 1*/
   96.26 +
   96.27 +gboolean init_sockaddr(struct sockaddr_in *name, interface *iface)
   96.28 +{
   96.29 +  struct hostent *he;
   96.30 +  struct in_addr ia;
   96.31 +  
   96.32 +#ifdef SOCKADDR_OLD
   96.33 +  /* here I tried to be intelligent and failed. */
   96.34 +  if(isalpha(iface->address[0])){
   96.35 +    if ((he = gethostbyname(iface->address)) == NULL) {
   96.36 +      logwrite(LOG_ALERT,
   96.37 +	       "local address '%s' unknown. (deleting)\n",
   96.38 +	       iface->address);
   96.39 +      return FALSE;
   96.40 +    }
   96.41 +    memcpy(&(name->sin_addr), he->h_addr, sizeof(name->sin_addr));
   96.42 +  }else if(isdigit(iface->address[0])){
   96.43 +    if(inet_aton(iface->address, &ia)){
   96.44 +      memcpy(&(name->sin_addr), &ia, sizeof(name->sin_addr));
   96.45 +    }else{
   96.46 +      logwrite(LOG_ALERT,
   96.47 +	       "invalid address '%s': inet_aton() failed (deleting)\n",
   96.48 +	       iface->address);
   96.49 +      return FALSE;
   96.50 +    }
   96.51 +  }else{
   96.52 +    logwrite(LOG_ALERT,
   96.53 +	     "invalid address '%s', should begin with a aphanumeric (deleting)\n",
   96.54 +	     iface->address);
   96.55 +    return FALSE;
   96.56 +  }
   96.57 +#else
   96.58 +  /* this is how others to it. I follow the crowd... */
   96.59 +  if(inet_aton(iface->address, &ia) != 0){
   96.60 +    /* IP address */
   96.61 +    memcpy(&(name->sin_addr), &ia, sizeof(name->sin_addr));
   96.62 +  }else{
   96.63 +    if ((he = gethostbyname(iface->address)) == NULL) {
   96.64 +      logwrite(LOG_ALERT, "local address '%s' unknown. (deleting)\n", iface->address);
   96.65 +      return FALSE;
   96.66 +    }
   96.67 +    memcpy(&(name->sin_addr), he->h_addr, sizeof(name->sin_addr));
   96.68 +  }
   96.69 +#endif
   96.70 +  name->sin_family = AF_INET;
   96.71 +  name->sin_port = htons(iface->port);
   96.72 +
   96.73 +  return TRUE;
   96.74 +}
   96.75 +
   96.76 +int make_server_socket(interface *iface)
   96.77 +{
   96.78 +  int sock = -1;
   96.79 +  struct sockaddr_in server;
   96.80 +        
   96.81 +  memset(&server, 0, sizeof(struct sockaddr_in));
   96.82 +
   96.83 +  /* Create the socket. */
   96.84 +  sock = socket (PF_INET, SOCK_STREAM, 0);
   96.85 +  if (sock < 0){
   96.86 +    logwrite(LOG_ALERT, "socket: %s\n", strerror(errno));
   96.87 +    return -1;
   96.88 +  }
   96.89 +        
   96.90 +  if(init_sockaddr(&server, iface)){
   96.91 +    /* bind the socket */
   96.92 +    if (bind (sock, (struct sockaddr *) &server, sizeof (server)) < 0){
   96.93 +      logwrite(LOG_ALERT, "bind: %s\n", strerror(errno));
   96.94 +      return -1;
   96.95 +    }
   96.96 +  }else{
   96.97 +    close(sock);
   96.98 +    return -1;
   96.99 +  }
  96.100 +        
  96.101 +  return sock;
  96.102 +}
    97.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.2 +++ b/src/libident/INSTALL	Fri Sep 26 17:05:23 2008 +0200
    97.3 @@ -0,0 +1,14 @@
    97.4 +To build the libident library for a supported target, just type:
    97.5 +
    97.6 +	make <target>
    97.7 +
    97.8 +where target can be one of:
    97.9 +
   97.10 +	sunos5, sunos4, svr4, bsd, linux, nextstep3.0 or nextstep3.1
   97.11 +
   97.12 +For other systems you'll need to hack the Makefile (please do send
   97.13 +me any patches you make so I can include them into the next version!)
   97.14 +
   97.15 +			- Peter Eriksson <pen@lysator.liu.se>, 18 Oct 1994
   97.16 +
   97.17 +
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/src/libident/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
    98.3 @@ -0,0 +1,15 @@
    98.4 +EXTRA_DIST=README_MASQMAIL
    98.5 +
    98.6 +AM_CFLAGS=@CFLAGS@ -D_GNU_SOURCE -DHAVE_ANSIHEADERS
    98.7 +
    98.8 +noinst_LIBRARIES=libident.a
    98.9 +
   98.10 +libident_a_SOURCES=\
   98.11 +	ident.h\
   98.12 +	ident.c\
   98.13 +	id_open.c\
   98.14 +	id_close.c\
   98.15 +	id_query.c\
   98.16 +	id_parse.c\
   98.17 +	support.c\
   98.18 +	version.c
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/src/libident/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
    99.3 @@ -0,0 +1,398 @@
    99.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
    99.5 +# @configure_input@
    99.6 +
    99.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    99.8 +# Free Software Foundation, Inc.
    99.9 +# This Makefile.in is free software; the Free Software Foundation
   99.10 +# gives unlimited permission to copy and/or distribute it,
   99.11 +# with or without modifications, as long as this notice is preserved.
   99.12 +
   99.13 +# This program is distributed in the hope that it will be useful,
   99.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   99.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   99.16 +# PARTICULAR PURPOSE.
   99.17 +
   99.18 +@SET_MAKE@
   99.19 +
   99.20 +srcdir = @srcdir@
   99.21 +top_srcdir = @top_srcdir@
   99.22 +VPATH = @srcdir@
   99.23 +pkgdatadir = $(datadir)/@PACKAGE@
   99.24 +pkglibdir = $(libdir)/@PACKAGE@
   99.25 +pkgincludedir = $(includedir)/@PACKAGE@
   99.26 +top_builddir = ../..
   99.27 +
   99.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   99.29 +INSTALL = @INSTALL@
   99.30 +install_sh_DATA = $(install_sh) -c -m 644
   99.31 +install_sh_PROGRAM = $(install_sh) -c
   99.32 +install_sh_SCRIPT = $(install_sh) -c
   99.33 +INSTALL_HEADER = $(INSTALL_DATA)
   99.34 +transform = $(program_transform_name)
   99.35 +NORMAL_INSTALL = :
   99.36 +PRE_INSTALL = :
   99.37 +POST_INSTALL = :
   99.38 +NORMAL_UNINSTALL = :
   99.39 +PRE_UNINSTALL = :
   99.40 +POST_UNINSTALL = :
   99.41 +ACLOCAL = @ACLOCAL@
   99.42 +AMDEP_FALSE = @AMDEP_FALSE@
   99.43 +AMDEP_TRUE = @AMDEP_TRUE@
   99.44 +AMTAR = @AMTAR@
   99.45 +AUTOCONF = @AUTOCONF@
   99.46 +AUTOHEADER = @AUTOHEADER@
   99.47 +AUTOMAKE = @AUTOMAKE@
   99.48 +AWK = @AWK@
   99.49 +BASE64_LIBS = @BASE64_LIBS@
   99.50 +CC = @CC@
   99.51 +CCDEPMODE = @CCDEPMODE@
   99.52 +CFLAGS = @CFLAGS@
   99.53 +CPP = @CPP@
   99.54 +CPPFLAGS = @CPPFLAGS@
   99.55 +CYGPATH_W = @CYGPATH_W@
   99.56 +DEFS = @DEFS@
   99.57 +DEPDIR = @DEPDIR@
   99.58 +ECHO_C = @ECHO_C@
   99.59 +ECHO_N = @ECHO_N@
   99.60 +ECHO_T = @ECHO_T@
   99.61 +EGREP = @EGREP@
   99.62 +EXEEXT = @EXEEXT@
   99.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
   99.64 +GLIB_LIBS = @GLIB_LIBS@
   99.65 +IDENT_LIBS = @IDENT_LIBS@
   99.66 +INSTALL_DATA = @INSTALL_DATA@
   99.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   99.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   99.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   99.70 +LDFLAGS = @LDFLAGS@
   99.71 +LIBOBJS = @LIBOBJS@
   99.72 +LIBS = @LIBS@
   99.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
   99.74 +LTLIBOBJS = @LTLIBOBJS@
   99.75 +MAKEINFO = @MAKEINFO@
   99.76 +MD5_LIBS = @MD5_LIBS@
   99.77 +OBJEXT = @OBJEXT@
   99.78 +PACKAGE = @PACKAGE@
   99.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   99.80 +PACKAGE_NAME = @PACKAGE_NAME@
   99.81 +PACKAGE_STRING = @PACKAGE_STRING@
   99.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   99.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
   99.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
   99.85 +PKG_CONFIG = @PKG_CONFIG@
   99.86 +RANLIB = @RANLIB@
   99.87 +RESOLV_LIBS = @RESOLV_LIBS@
   99.88 +SET_MAKE = @SET_MAKE@
   99.89 +SHELL = @SHELL@
   99.90 +STRIP = @STRIP@
   99.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
   99.92 +VERSION = @VERSION@
   99.93 +ac_ct_CC = @ac_ct_CC@
   99.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
   99.95 +ac_ct_STRIP = @ac_ct_STRIP@
   99.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
   99.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   99.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   99.99 +am__include = @am__include@
  99.100 +am__leading_dot = @am__leading_dot@
  99.101 +am__quote = @am__quote@
  99.102 +bindir = @bindir@
  99.103 +build_alias = @build_alias@
  99.104 +datadir = @datadir@
  99.105 +exec_prefix = @exec_prefix@
  99.106 +has_ident = @has_ident@
  99.107 +host_alias = @host_alias@
  99.108 +includedir = @includedir@
  99.109 +infodir = @infodir@
  99.110 +install_sh = @install_sh@
  99.111 +libdir = @libdir@
  99.112 +libexecdir = @libexecdir@
  99.113 +localstatedir = @localstatedir@
  99.114 +mandir = @mandir@
  99.115 +oldincludedir = @oldincludedir@
  99.116 +prefix = @prefix@
  99.117 +program_transform_name = @program_transform_name@
  99.118 +sbindir = @sbindir@
  99.119 +sharedstatedir = @sharedstatedir@
  99.120 +sysconfdir = @sysconfdir@
  99.121 +target_alias = @target_alias@
  99.122 +with_confdir = @with_confdir@
  99.123 +with_group = @with_group@
  99.124 +with_logdir = @with_logdir@
  99.125 +with_spooldir = @with_spooldir@
  99.126 +with_user = @with_user@
  99.127 +EXTRA_DIST = README_MASQMAIL
  99.128 +
  99.129 +AM_CFLAGS = @CFLAGS@ -D_GNU_SOURCE -DHAVE_ANSIHEADERS
  99.130 +
  99.131 +noinst_LIBRARIES = libident.a
  99.132 +
  99.133 +libident_a_SOURCES = \
  99.134 +	ident.h\
  99.135 +	ident.c\
  99.136 +	id_open.c\
  99.137 +	id_close.c\
  99.138 +	id_query.c\
  99.139 +	id_parse.c\
  99.140 +	support.c\
  99.141 +	version.c
  99.142 +
  99.143 +subdir = src/libident
  99.144 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  99.145 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  99.146 +CONFIG_HEADER = $(top_builddir)/config.h
  99.147 +CONFIG_CLEAN_FILES =
  99.148 +LIBRARIES = $(noinst_LIBRARIES)
  99.149 +
  99.150 +libident_a_AR = $(AR) cru
  99.151 +libident_a_LIBADD =
  99.152 +am_libident_a_OBJECTS = ident.$(OBJEXT) id_open.$(OBJEXT) \
  99.153 +	id_close.$(OBJEXT) id_query.$(OBJEXT) id_parse.$(OBJEXT) \
  99.154 +	support.$(OBJEXT) version.$(OBJEXT)
  99.155 +libident_a_OBJECTS = $(am_libident_a_OBJECTS)
  99.156 +
  99.157 +DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
  99.158 +depcomp = $(SHELL) $(top_srcdir)/depcomp
  99.159 +am__depfiles_maybe = depfiles
  99.160 +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/id_close.Po ./$(DEPDIR)/id_open.Po \
  99.161 +@AMDEP_TRUE@	./$(DEPDIR)/id_parse.Po ./$(DEPDIR)/id_query.Po \
  99.162 +@AMDEP_TRUE@	./$(DEPDIR)/ident.Po ./$(DEPDIR)/support.Po \
  99.163 +@AMDEP_TRUE@	./$(DEPDIR)/version.Po
  99.164 +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  99.165 +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  99.166 +CCLD = $(CC)
  99.167 +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
  99.168 +DIST_SOURCES = $(libident_a_SOURCES)
  99.169 +DIST_COMMON = README $(srcdir)/Makefile.in INSTALL Makefile.am
  99.170 +SOURCES = $(libident_a_SOURCES)
  99.171 +
  99.172 +all: all-am
  99.173 +
  99.174 +.SUFFIXES:
  99.175 +.SUFFIXES: .c .o .obj
  99.176 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
  99.177 +	cd $(top_srcdir) && \
  99.178 +	  $(AUTOMAKE) --gnu  src/libident/Makefile
  99.179 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
  99.180 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
  99.181 +
  99.182 +AR = ar
  99.183 +
  99.184 +clean-noinstLIBRARIES:
  99.185 +	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
  99.186 +libident.a: $(libident_a_OBJECTS) $(libident_a_DEPENDENCIES) 
  99.187 +	-rm -f libident.a
  99.188 +	$(libident_a_AR) libident.a $(libident_a_OBJECTS) $(libident_a_LIBADD)
  99.189 +	$(RANLIB) libident.a
  99.190 +
  99.191 +mostlyclean-compile:
  99.192 +	-rm -f *.$(OBJEXT) core *.core
  99.193 +
  99.194 +distclean-compile:
  99.195 +	-rm -f *.tab.c
  99.196 +
  99.197 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_close.Po@am__quote@
  99.198 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_open.Po@am__quote@
  99.199 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_parse.Po@am__quote@
  99.200 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_query.Po@am__quote@
  99.201 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ident.Po@am__quote@
  99.202 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@
  99.203 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
  99.204 +
  99.205 +.c.o:
  99.206 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
  99.207 +@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
  99.208 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
  99.209 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
  99.210 +@am__fastdepCC_TRUE@	fi
  99.211 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  99.212 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
  99.213 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  99.214 +@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
  99.215 +
  99.216 +.c.obj:
  99.217 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
  99.218 +@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
  99.219 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
  99.220 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
  99.221 +@am__fastdepCC_TRUE@	fi
  99.222 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  99.223 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
  99.224 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  99.225 +@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
  99.226 +uninstall-info-am:
  99.227 +
  99.228 +ETAGS = etags
  99.229 +ETAGSFLAGS =
  99.230 +
  99.231 +CTAGS = ctags
  99.232 +CTAGSFLAGS =
  99.233 +
  99.234 +tags: TAGS
  99.235 +
  99.236 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  99.237 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  99.238 +	unique=`for i in $$list; do \
  99.239 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  99.240 +	  done | \
  99.241 +	  $(AWK) '    { files[$$0] = 1; } \
  99.242 +	       END { for (i in files) print i; }'`; \
  99.243 +	mkid -fID $$unique
  99.244 +
  99.245 +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  99.246 +		$(TAGS_FILES) $(LISP)
  99.247 +	tags=; \
  99.248 +	here=`pwd`; \
  99.249 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  99.250 +	unique=`for i in $$list; do \
  99.251 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  99.252 +	  done | \
  99.253 +	  $(AWK) '    { files[$$0] = 1; } \
  99.254 +	       END { for (i in files) print i; }'`; \
  99.255 +	test -z "$(ETAGS_ARGS)$$tags$$unique" \
  99.256 +	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  99.257 +	     $$tags $$unique
  99.258 +
  99.259 +ctags: CTAGS
  99.260 +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  99.261 +		$(TAGS_FILES) $(LISP)
  99.262 +	tags=; \
  99.263 +	here=`pwd`; \
  99.264 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  99.265 +	unique=`for i in $$list; do \
  99.266 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  99.267 +	  done | \
  99.268 +	  $(AWK) '    { files[$$0] = 1; } \
  99.269 +	       END { for (i in files) print i; }'`; \
  99.270 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
  99.271 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  99.272 +	     $$tags $$unique
  99.273 +
  99.274 +GTAGS:
  99.275 +	here=`$(am__cd) $(top_builddir) && pwd` \
  99.276 +	  && cd $(top_srcdir) \
  99.277 +	  && gtags -i $(GTAGS_ARGS) $$here
  99.278 +
  99.279 +distclean-tags:
  99.280 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  99.281 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  99.282 +
  99.283 +top_distdir = ../..
  99.284 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
  99.285 +
  99.286 +distdir: $(DISTFILES)
  99.287 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  99.288 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  99.289 +	list='$(DISTFILES)'; for file in $$list; do \
  99.290 +	  case $$file in \
  99.291 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  99.292 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  99.293 +	  esac; \
  99.294 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  99.295 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  99.296 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  99.297 +	    dir="/$$dir"; \
  99.298 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
  99.299 +	  else \
  99.300 +	    dir=''; \
  99.301 +	  fi; \
  99.302 +	  if test -d $$d/$$file; then \
  99.303 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  99.304 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  99.305 +	    fi; \
  99.306 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  99.307 +	  else \
  99.308 +	    test -f $(distdir)/$$file \
  99.309 +	    || cp -p $$d/$$file $(distdir)/$$file \
  99.310 +	    || exit 1; \
  99.311 +	  fi; \
  99.312 +	done
  99.313 +check-am: all-am
  99.314 +check: check-am
  99.315 +all-am: Makefile $(LIBRARIES)
  99.316 +
  99.317 +installdirs:
  99.318 +install: install-am
  99.319 +install-exec: install-exec-am
  99.320 +install-data: install-data-am
  99.321 +uninstall: uninstall-am
  99.322 +
  99.323 +install-am: all-am
  99.324 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  99.325 +
  99.326 +installcheck: installcheck-am
  99.327 +install-strip:
  99.328 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  99.329 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  99.330 +	  `test -z '$(STRIP)' || \
  99.331 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  99.332 +mostlyclean-generic:
  99.333 +
  99.334 +clean-generic:
  99.335 +
  99.336 +distclean-generic:
  99.337 +	-rm -f $(CONFIG_CLEAN_FILES)
  99.338 +
  99.339 +maintainer-clean-generic:
  99.340 +	@echo "This command is intended for maintainers to use"
  99.341 +	@echo "it deletes files that may require special tools to rebuild."
  99.342 +clean: clean-am
  99.343 +
  99.344 +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
  99.345 +
  99.346 +distclean: distclean-am
  99.347 +	-rm -rf ./$(DEPDIR)
  99.348 +	-rm -f Makefile
  99.349 +distclean-am: clean-am distclean-compile distclean-generic \
  99.350 +	distclean-tags
  99.351 +
  99.352 +dvi: dvi-am
  99.353 +
  99.354 +dvi-am:
  99.355 +
  99.356 +info: info-am
  99.357 +
  99.358 +info-am:
  99.359 +
  99.360 +install-data-am:
  99.361 +
  99.362 +install-exec-am:
  99.363 +
  99.364 +install-info: install-info-am
  99.365 +
  99.366 +install-man:
  99.367 +
  99.368 +installcheck-am:
  99.369 +
  99.370 +maintainer-clean: maintainer-clean-am
  99.371 +	-rm -rf ./$(DEPDIR)
  99.372 +	-rm -f Makefile
  99.373 +maintainer-clean-am: distclean-am maintainer-clean-generic
  99.374 +
  99.375 +mostlyclean: mostlyclean-am
  99.376 +
  99.377 +mostlyclean-am: mostlyclean-compile mostlyclean-generic
  99.378 +
  99.379 +pdf: pdf-am
  99.380 +
  99.381 +pdf-am:
  99.382 +
  99.383 +ps: ps-am
  99.384 +
  99.385 +ps-am:
  99.386 +
  99.387 +uninstall-am: uninstall-info-am
  99.388 +
  99.389 +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
  99.390 +	clean-noinstLIBRARIES ctags distclean distclean-compile \
  99.391 +	distclean-generic distclean-tags distdir dvi dvi-am info \
  99.392 +	info-am install install-am install-data install-data-am \
  99.393 +	install-exec install-exec-am install-info install-info-am \
  99.394 +	install-man install-strip installcheck installcheck-am \
  99.395 +	installdirs maintainer-clean maintainer-clean-generic \
  99.396 +	mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
  99.397 +	ps ps-am tags uninstall uninstall-am uninstall-info-am
  99.398 +
  99.399 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  99.400 +# Otherwise a system limit (for SysV at least) may be exceeded.
  99.401 +.NOEXPORT:
   100.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.2 +++ b/src/libident/README	Fri Sep 26 17:05:23 2008 +0200
   100.3 @@ -0,0 +1,77 @@
   100.4 +COPYRIGHT ISSUES:
   100.5 +
   100.6 +	This version of 'libident' is hereby released into the
   100.7 +	Public Domain. It may be distributed for a fee or without
   100.8 +	a fee. We only ask you not to pretend you wrote it.
   100.9 +
  100.10 +If you make any changes, please send sources or a diff of it to
  100.11 +us (pen@lysator.liu.se or pell@lysator.liu.se), so we can keep
  100.12 +_one_ unified version of libident available...
  100.13 +
  100.14 +
  100.15 +FTP SITE:
  100.16 +
  100.17 +The official FTP site and location for libident is:
  100.18 +
  100.19 +	ftp://ftp.lysator.liu.se/pub/ident/libs
  100.20 +
  100.21 +
  100.22 +COMMENTS:
  100.23 +
  100.24 +This is the second stab at a small library to interface to the Ident
  100.25 +protocol server. Maybe this will work correctly on some machines.. :-)
  100.26 + 
  100.27 +The ident-tester.c file is a small daemon (to be started from Inetd)
  100.28 +that does an ident lookup on you if you telnet into it. Can be used
  100.29 +to verify that your Ident server is working correctly.
  100.30 + 
  100.31 +I'm currently running this "ident-tester" on port 114 at lysator.liu.se
  100.32 +(130.236.254.1) if you wish to test your server.
  100.33 + 
  100.34 +/Peter Eriksson <pen@lysator.liu.se>, 1 Aug 1992
  100.35 +
  100.36 +
  100.37 +This library now contains some higher-level routines, as well as a
  100.38 +similar test program to test these (lookup-tester).
  100.39 +
  100.40 +/Pär Emanuelsson <pell@lysator.liu.se>, 4 April 1993
  100.41 +
  100.42 +
  100.43 +Support for NextStep 3.1 added.
  100.44 +
  100.45 +/Michael Kuch <kuch@mailserv.zdv.uni-tuebingen.de>, 13 Aug 1993
  100.46 +
  100.47 +
  100.48 +Updated the ident.h header file to work with Linux, and reorganized the
  100.49 +Makefile for easier compilation...
  100.50 +
  100.51 +/Peter Eriksson, 18 Oct 1994
  100.52 +
  100.53 +
  100.54 +Added the copyright notice at the top.
  100.55 +
  100.56 +/Peter Eriksson, 29 Nov 1994
  100.57 +
  100.58 +
  100.59 +For release 0.18:
  100.60 +
  100.61 +Added some bug fixes and improvements from Jean-Philippe Martin-Flatin
  100.62 +(syj@ecmwf.int).
  100.63 +
  100.64 +/Peter Eriksson, 5 Oct 1995
  100.65 +
  100.66 +
  100.67 +For release 0.20:
  100.68 +
  100.69 +Some cleanup of the distribution, and some bug fixes in the
  100.70 +ident-tester.c source. Perhaps it should be called 1.0? (Perhaps
  100.71 +it should use GNU Autoconf...)
  100.72 +
  100.73 +/Peter Eriksson, 13 Nov 1996
  100.74 +
  100.75 +
  100.76 +For release 0.21:
  100.77 +
  100.78 +A couple of minor fixes (mainly support for 2.11BSD).
  100.79 +
  100.80 +/Peter Eriksson, 17 Jan 1997
   101.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.2 +++ b/src/libident/README_MASQMAIL	Fri Sep 26 17:05:23 2008 +0200
   101.3 @@ -0,0 +1,10 @@
   101.4 +This is from libident 0.22 (though the version string says 0.21?). I
   101.5 +have not changed it, except that I replaced the Makefile with a
   101.6 +Makefile.am.
   101.7 +
   101.8 +I also did not include the example programs and the man page in the
   101.9 +masqmail source tarball.
  101.10 +
  101.11 +Oliver Kurth, Fri Oct  6 15:11:07 CEST 2000
  101.12 +kurth@innominate.de
  101.13 +
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/src/libident/id_close.c	Fri Sep 26 17:05:23 2008 +0200
   102.3 @@ -0,0 +1,29 @@
   102.4 +/*
   102.5 +** id_close.c                            Close a connection to an IDENT server
   102.6 +**
   102.7 +** Author: Peter Eriksson <pen@lysator.liu.se>
   102.8 +*/
   102.9 +
  102.10 +#ifdef NeXT3
  102.11 +#  include <libc.h>
  102.12 +#endif
  102.13 +
  102.14 +#ifdef HAVE_ANSIHEADERS
  102.15 +#  include <stdlib.h>
  102.16 +#  include <unistd.h>
  102.17 +#endif
  102.18 +
  102.19 +#define IN_LIBIDENT_SRC
  102.20 +#include "ident.h"
  102.21 +
  102.22 +int id_close __P1(ident_t *, id)
  102.23 +{
  102.24 +    int res;
  102.25 +  
  102.26 +    res = close(id->fd);
  102.27 +    free(id);
  102.28 +    
  102.29 +    return res;
  102.30 +}
  102.31 +
  102.32 +
   103.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.2 +++ b/src/libident/id_open.c	Fri Sep 26 17:05:23 2008 +0200
   103.3 @@ -0,0 +1,167 @@
   103.4 +/*
   103.5 +** id_open.c                 Establish/initiate a connection to an IDENT server
   103.6 +**
   103.7 +** Author: Peter Eriksson <pen@lysator.liu.se>
   103.8 +** Fixes: Pär Emanuelsson <pell@lysator.liu.se>
   103.9 +*/
  103.10 +
  103.11 +#ifdef NeXT3
  103.12 +#  include <libc.h>
  103.13 +#endif
  103.14 +
  103.15 +#include <stdio.h>
  103.16 +#include <errno.h>
  103.17 +#include <fcntl.h>
  103.18 +
  103.19 +#ifdef HAVE_ANSIHEADERS
  103.20 +#  include <stdlib.h>
  103.21 +#  include <string.h>
  103.22 +#  include <unistd.h>
  103.23 +#  if !defined(__sgi) && !defined(VMS)
  103.24 +#    define bzero(p,l)     memset(p, 0, l)
  103.25 +#  endif
  103.26 +#endif
  103.27 +
  103.28 +#include <sys/types.h>
  103.29 +#include <sys/socket.h>
  103.30 +#include <sys/wait.h>
  103.31 +#include <sys/time.h>
  103.32 +#include <sys/file.h>
  103.33 +
  103.34 +#define IN_LIBIDENT_SRC
  103.35 +#include "ident.h"
  103.36 +
  103.37 +#include <arpa/inet.h>
  103.38 +
  103.39 +#ifdef _AIX
  103.40 +#  include <sys/select.h>
  103.41 +#endif
  103.42 +
  103.43 +
  103.44 +/*
  103.45 +ident_t *id_open __P3(struct in_addr *, laddr,
  103.46 +		      struct in_addr *, faddr,
  103.47 +		      struct timeval *, timeout)
  103.48 +*/
  103.49 +
  103.50 +ident_t *id_open __P((	__STRUCT_IN_ADDR_P laddr,
  103.51 +			__STRUCT_IN_ADDR_P faddr,
  103.52 +			__STRUCT_TIMEVAL_P timeout))
  103.53 +{
  103.54 +    ident_t *id;
  103.55 +    int res, tmperrno;
  103.56 +    struct sockaddr_in sin_laddr, sin_faddr;
  103.57 +    fd_set rs, ws, es;
  103.58 +#ifndef OLD_SETSOCKOPT
  103.59 +    int on = 1;
  103.60 +    struct linger linger;
  103.61 +#endif
  103.62 +    
  103.63 +    if ((id = (ident_t *) malloc(sizeof(*id))) == 0)
  103.64 +	return 0;
  103.65 +    
  103.66 +    if ((id->fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
  103.67 +    {
  103.68 +	free(id);
  103.69 +	return 0;
  103.70 +    }
  103.71 +    
  103.72 +    if (timeout)
  103.73 +    {
  103.74 +	if ((res = fcntl(id->fd, F_GETFL, 0)) < 0)
  103.75 +	    goto ERROR;
  103.76 +
  103.77 +#ifndef VMS
  103.78 +	if (fcntl(id->fd, F_SETFL, res | FNDELAY) < 0)
  103.79 +	    goto ERROR;
  103.80 +#endif
  103.81 +    }
  103.82 +
  103.83 +    /* We silently ignore errors if we can't change LINGER */
  103.84 +#ifdef OLD_SETSOCKOPT
  103.85 +    /* Old style setsockopt() */
  103.86 +    (void) setsockopt(id->fd, SOL_SOCKET, SO_DONTLINGER);
  103.87 +    (void) setsockopt(id->fd, SOL_SOCKET, SO_REUSEADDR);
  103.88 +#else
  103.89 +    /* New style setsockopt() */
  103.90 +    linger.l_onoff = 0;
  103.91 +    linger.l_linger = 0;
  103.92 +    
  103.93 +    (void) setsockopt(id->fd, SOL_SOCKET, SO_LINGER, (void *) &linger, sizeof(linger));
  103.94 +    (void) setsockopt(id->fd, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on));
  103.95 +#endif
  103.96 +    
  103.97 +    id->buf[0] = '\0';
  103.98 +    
  103.99 +    bzero((char *)&sin_laddr, sizeof(sin_laddr));
 103.100 +    sin_laddr.sin_family = AF_INET;
 103.101 +    sin_laddr.sin_addr = *laddr;
 103.102 +    sin_laddr.sin_port = 0;
 103.103 +    
 103.104 +    if (bind(id->fd, (struct sockaddr *) &sin_laddr, sizeof(sin_laddr)) < 0)
 103.105 +    {
 103.106 +#ifdef DEBUG
 103.107 +	perror("libident: bind");
 103.108 +#endif
 103.109 +	goto ERROR;
 103.110 +    }
 103.111 +    
 103.112 +    bzero((char *)&sin_faddr, sizeof(sin_faddr));
 103.113 +    sin_faddr.sin_family = AF_INET;
 103.114 +    sin_faddr.sin_addr = *faddr;
 103.115 +    sin_faddr.sin_port = htons(IDPORT);
 103.116 +
 103.117 +    errno = 0;
 103.118 +    res = connect(id->fd, (struct sockaddr *) &sin_faddr, sizeof(sin_faddr));
 103.119 +    if (res < 0 && errno != EINPROGRESS)
 103.120 +    {
 103.121 +#ifdef DEBUG
 103.122 +	perror("libident: connect");
 103.123 +#endif
 103.124 +	goto ERROR;
 103.125 +    }
 103.126 +
 103.127 +    if (timeout)
 103.128 +    {
 103.129 +	FD_ZERO(&rs);
 103.130 +	FD_ZERO(&ws);
 103.131 +	FD_ZERO(&es);
 103.132 +	
 103.133 +	FD_SET(id->fd, &rs);
 103.134 +	FD_SET(id->fd, &ws);
 103.135 +	FD_SET(id->fd, &es);
 103.136 +
 103.137 +#ifdef __hpux
 103.138 +	if ((res = select(FD_SETSIZE, (int *) &rs, (int *) &ws, (int *) &es, timeout)) < 0)
 103.139 +#else
 103.140 +	if ((res = select(FD_SETSIZE, &rs, &ws, &es, timeout)) < 0)
 103.141 +#endif
 103.142 +	{
 103.143 +#ifdef DEBUG
 103.144 +	    perror("libident: select");
 103.145 +#endif
 103.146 +	    goto ERROR;
 103.147 +	}
 103.148 +	
 103.149 +	if (res == 0)
 103.150 +	{
 103.151 +	    errno = ETIMEDOUT;
 103.152 +	    goto ERROR;
 103.153 +	}
 103.154 +	
 103.155 +	if (FD_ISSET(id->fd, &es))
 103.156 +	    goto ERROR;
 103.157 +	
 103.158 +	if (!FD_ISSET(id->fd, &rs) && !FD_ISSET(id->fd, &ws))
 103.159 +	    goto ERROR;
 103.160 +    }
 103.161 +    
 103.162 +    return id;
 103.163 +    
 103.164 +  ERROR:
 103.165 +    tmperrno = errno;		/* Save, so close() won't erase it */
 103.166 +    close(id->fd);
 103.167 +    free(id);
 103.168 +    errno = tmperrno;
 103.169 +    return 0;
 103.170 +}
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/src/libident/id_parse.c	Fri Sep 26 17:05:23 2008 +0200
   104.3 @@ -0,0 +1,229 @@
   104.4 +/*
   104.5 +** id_parse.c                    Receive and parse a reply from an IDENT server
   104.6 +**
   104.7 +** Author: Peter Eriksson <pen@lysator.liu.se>
   104.8 +** Fiddling: Pär Emanuelsson <pell@lysator.liu.se>
   104.9 +*/
  104.10 +
  104.11 +#ifdef NeXT3
  104.12 +#  include <libc.h>
  104.13 +#endif
  104.14 +
  104.15 +#include <stdio.h>
  104.16 +#include <string.h>
  104.17 +#include <errno.h>
  104.18 +#include <ctype.h>
  104.19 +
  104.20 +#ifdef HAVE_ANSIHEADERS
  104.21 +#  include <stdlib.h>
  104.22 +#  include <string.h>
  104.23 +#  include <unistd.h>
  104.24 +#endif
  104.25 +
  104.26 +#include <sys/types.h>
  104.27 +#include <sys/wait.h>
  104.28 +#include <sys/time.h>
  104.29 +
  104.30 +#ifdef _AIX
  104.31 +#  include <sys/select.h>
  104.32 +#endif
  104.33 +
  104.34 +#ifdef _AIX
  104.35 +#  include <sys/select.h>
  104.36 +#endif
  104.37 +#ifdef VMS
  104.38 +#  include <sys/socket.h>     /* for fd_set */
  104.39 +#endif
  104.40 +#define IN_LIBIDENT_SRC
  104.41 +#include "ident.h"
  104.42 +
  104.43 +
  104.44 +/*
  104.45 +int id_parse __P7(ident_t *, id,
  104.46 +		  struct timeval *, timeout,
  104.47 +		  int *, lport,
  104.48 +		  int *, fport,
  104.49 +		  char **, identifier,
  104.50 +		  char **, opsys,
  104.51 +		  char **, charset)
  104.52 +*/
  104.53 +
  104.54 +int id_parse __P((  ident_t *id,               
  104.55 +                    __STRUCT_TIMEVAL_P timeout,
  104.56 +                    int *lport,                
  104.57 +                    int *fport,                
  104.58 +                    char **identifier,         
  104.59 +                    char **opsys,              
  104.60 +                    char **charset))           
  104.61 +{
  104.62 +    char c, *cp, *tmp_charset;
  104.63 +    fd_set rs;
  104.64 +    int pos, res=0, lp, fp;
  104.65 +    
  104.66 +    errno = 0;
  104.67 +    
  104.68 +    tmp_charset = 0;
  104.69 +    
  104.70 +    if (!id)
  104.71 +	return -1;
  104.72 +    if (lport)
  104.73 +	*lport = 0;
  104.74 +    if (fport)
  104.75 +	*fport = 0;
  104.76 +    if (identifier)
  104.77 +	*identifier = 0;
  104.78 +    if (opsys)
  104.79 +	*opsys = 0;
  104.80 +    if (charset)
  104.81 +	*charset = 0;
  104.82 +    
  104.83 +    pos = strlen(id->buf);
  104.84 +    
  104.85 +    if (timeout)
  104.86 +    {
  104.87 +	FD_ZERO(&rs);
  104.88 +	FD_SET(id->fd, &rs);
  104.89 +
  104.90 +#ifdef __hpux
  104.91 +	if ((res = select(FD_SETSIZE, (int *) &rs, (int *)0, (int *)0, timeout)) < 0)
  104.92 +#else
  104.93 +	if ((res = select(FD_SETSIZE, &rs, (fd_set *)0, (fd_set *)0, timeout)) < 0)
  104.94 +#endif
  104.95 +	    return -1;
  104.96 +	
  104.97 +	if (res == 0)
  104.98 +	{
  104.99 +	    errno = ETIMEDOUT;
 104.100 +	    return -1;
 104.101 +	}
 104.102 +    }
 104.103 +    
 104.104 +    /* Every octal value is allowed except 0, \n and \r */
 104.105 +    while (pos < sizeof(id->buf) &&
 104.106 +	   (res = read(id->fd, id->buf + pos, 1)) == 1 &&
 104.107 +	   id->buf[pos] != '\n' && id->buf[pos] != '\r')
 104.108 +	pos++;
 104.109 +    
 104.110 +    if (res < 0)
 104.111 +	return -1;
 104.112 +    
 104.113 +    if (res == 0)
 104.114 +    {
 104.115 +	errno = ENOTCONN;
 104.116 +	return -1;
 104.117 +    }
 104.118 +    
 104.119 +    if (id->buf[pos] != '\n' && id->buf[pos] != '\r')
 104.120 +	return 0;		/* Not properly terminated string */
 104.121 +    
 104.122 +    id->buf[pos++] = '\0';
 104.123 +    
 104.124 +    /*
 104.125 +    ** Get first field (<lport> , <fport>)
 104.126 +    */
 104.127 +    cp = id_strtok(id->buf, ":", &c);
 104.128 +    if (!cp)
 104.129 +	return -2;
 104.130 +    
 104.131 +    if (sscanf(cp, " %d , %d", &lp, &fp) != 2)
 104.132 +    {
 104.133 +	if (identifier)
 104.134 +	{
 104.135 +	    *identifier = id_strdup(cp);
 104.136 +	    if (*identifier == NULL)
 104.137 +	        return -4;
 104.138 +	}
 104.139 +	return -2;
 104.140 +    }
 104.141 +    
 104.142 +    if (lport)
 104.143 +	*lport = lp;
 104.144 +    if (fport)
 104.145 +	*fport = fp;
 104.146 +    
 104.147 +    /*
 104.148 +    ** Get second field (USERID or ERROR)
 104.149 +    */
 104.150 +    cp = id_strtok((char *)0, ":", &c);
 104.151 +    if (!cp)
 104.152 +	return -2;
 104.153 +    
 104.154 +    if (strcmp(cp, "ERROR") == 0)
 104.155 +    {
 104.156 +	cp = id_strtok((char *)0, "\n\r", &c);
 104.157 +	if (!cp)
 104.158 +	    return -2;
 104.159 +	
 104.160 +	if (identifier)
 104.161 +	{
 104.162 +	    *identifier = id_strdup(cp);
 104.163 +	    if (*identifier == NULL)
 104.164 +	        return -4;
 104.165 +	}
 104.166 +	
 104.167 +	return 2;
 104.168 +    }
 104.169 +    else if (strcmp(cp, "USERID") == 0)
 104.170 +    {
 104.171 +	/*
 104.172 +	** Get first subfield of third field <opsys>
 104.173 +	*/
 104.174 +	cp = id_strtok((char *) 0, ",:", &c);
 104.175 +	if (!cp)
 104.176 +	    return -2;
 104.177 +	
 104.178 +	if (opsys)
 104.179 +	{
 104.180 +	    *opsys = id_strdup(cp);
 104.181 +	    if (*opsys == NULL)
 104.182 +	        return -4;
 104.183 +	}
 104.184 +	
 104.185 +	/*
 104.186 +	** We have a second subfield (<charset>)
 104.187 +	*/
 104.188 +	if (c == ',')
 104.189 +	{
 104.190 +	    cp = id_strtok((char *)0, ":", &c);
 104.191 +	    if (!cp)
 104.192 +		return -2;
 104.193 +	    
 104.194 +	    tmp_charset = cp;
 104.195 +	    if (charset)
 104.196 +	    {
 104.197 +		*charset = id_strdup(cp);
 104.198 +		if (*charset == NULL)
 104.199 +		    return -4;
 104.200 +	    }
 104.201 +	    
 104.202 +	    /*
 104.203 +	    ** We have even more subfields - ignore them
 104.204 +	    */
 104.205 +	    if (c == ',')
 104.206 +		id_strtok((char *)0, ":", &c);
 104.207 +	}
 104.208 +	
 104.209 +	if (tmp_charset && strcmp(tmp_charset, "OCTET") == 0)
 104.210 +	    cp = id_strtok((char *)0, (char *)0, &c);
 104.211 +	else
 104.212 +	    cp = id_strtok((char *)0, "\n\r", &c);
 104.213 +	
 104.214 +	if (identifier)
 104.215 +	{
 104.216 +	    *identifier = id_strdup(cp);
 104.217 +	    if (*identifier == NULL)
 104.218 +	        return -4;
 104.219 +	}
 104.220 +	return 1;
 104.221 +    }
 104.222 +    else
 104.223 +    {
 104.224 +	if (identifier)
 104.225 +	{
 104.226 +	    *identifier = id_strdup(cp);
 104.227 +	    if (*identifier == NULL)
 104.228 +	        return -4;
 104.229 +	}
 104.230 +	return -3;
 104.231 +    }
 104.232 +}
   105.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.2 +++ b/src/libident/id_query.c	Fri Sep 26 17:05:23 2008 +0200
   105.3 @@ -0,0 +1,88 @@
   105.4 +/*
   105.5 +** id_query.c                             Transmit a query to an IDENT server
   105.6 +**
   105.7 +** Author: Peter Eriksson <pen@lysator.liu.se>
   105.8 +*/
   105.9 +
  105.10 +#ifdef NeXT3
  105.11 +#  include <libc.h>
  105.12 +#endif
  105.13 +
  105.14 +#include <stdio.h>
  105.15 +#include <errno.h>
  105.16 +#include <signal.h>
  105.17 +
  105.18 +#ifdef HAVE_ANSIHEADERS
  105.19 +#  include <stdlib.h>
  105.20 +#  include <string.h>
  105.21 +#  include <unistd.h>
  105.22 +#endif
  105.23 +
  105.24 +#include <sys/types.h>
  105.25 +#include <sys/wait.h>
  105.26 +#include <sys/time.h>
  105.27 +
  105.28 +#ifdef _AIX
  105.29 +#  include <sys/select.h>
  105.30 +#endif
  105.31 +
  105.32 +#ifdef _AIX
  105.33 +#  include <sys/select.h>
  105.34 +#endif
  105.35 +#ifdef VMS
  105.36 +#  include <sys/socket.h>     /* for fd_set */
  105.37 +#endif
  105.38 +#define IN_LIBIDENT_SRC
  105.39 +#include "ident.h"
  105.40 +
  105.41 +
  105.42 +/*
  105.43 +int id_query __P4(ident_t *, id,
  105.44 +		  int, lport,
  105.45 +		  int, fport,
  105.46 +		  struct timeval *, timeout)
  105.47 +*/
  105.48 +
  105.49 +int    id_query __P((	ident_t *id,                 
  105.50 +			int lport,                   
  105.51 +			int fport,                   
  105.52 +			__STRUCT_TIMEVAL_P timeout))
  105.53 +{
  105.54 +#ifdef SIGRETURNTYPE
  105.55 +    SIGRETURNTYPE (*old_sig)();
  105.56 +#else
  105.57 +    void (*old_sig) __P((int));
  105.58 +#endif
  105.59 +    int res;
  105.60 +    char buf[80];
  105.61 +    fd_set ws;
  105.62 +    
  105.63 +    sprintf(buf, "%d , %d\r\n", lport, fport);
  105.64 +    
  105.65 +    if (timeout)
  105.66 +    {
  105.67 +	FD_ZERO(&ws);
  105.68 +	FD_SET(id->fd, &ws);
  105.69 +
  105.70 +#ifdef __hpux
  105.71 +	if ((res = select(FD_SETSIZE, (int *)0, (int *)&ws, (int *)0, timeout)) < 0)
  105.72 +#else
  105.73 +	if ((res = select(FD_SETSIZE, (fd_set *)0, &ws, (fd_set *)0, timeout)) < 0)
  105.74 +#endif
  105.75 +	    return -1;
  105.76 +	
  105.77 +	if (res == 0)
  105.78 +	{
  105.79 +	    errno = ETIMEDOUT;
  105.80 +	    return -1;
  105.81 +	}
  105.82 +    }
  105.83 +
  105.84 +    old_sig = signal(SIGPIPE, SIG_IGN);
  105.85 +    
  105.86 +    res = write(id->fd, buf, strlen(buf));
  105.87 +    
  105.88 +    signal(SIGPIPE, old_sig);
  105.89 +    
  105.90 +    return res;
  105.91 +}
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/src/libident/ident.c	Fri Sep 26 17:05:23 2008 +0200
   106.3 @@ -0,0 +1,155 @@
   106.4 +/*
   106.5 +** ident.c	High-level calls to the ident lib
   106.6 +**
   106.7 +** Author: Pär Emanuelsson <pell@lysator.liu.se>
   106.8 +** Hacked by: Peter Eriksson <pen@lysator.liu.se>
   106.9 +*/
  106.10 +
  106.11 +#ifdef NeXT3
  106.12 +#  include <libc.h>
  106.13 +#endif
  106.14 +
  106.15 +#include <stdio.h>
  106.16 +
  106.17 +#ifdef HAVE_ANSIHEADERS
  106.18 +#  include <stdlib.h>
  106.19 +#  include <string.h>
  106.20 +#endif
  106.21 +
  106.22 +#include <errno.h>
  106.23 +
  106.24 +#include <sys/types.h>
  106.25 +#include <sys/socket.h>
  106.26 +
  106.27 +#define IN_LIBIDENT_SRC
  106.28 +#include "ident.h"
  106.29 +
  106.30 +#include <arpa/inet.h>
  106.31 +
  106.32 +
  106.33 +
  106.34 +
  106.35 +/* Do a complete ident query and return result */
  106.36 +
  106.37 +IDENT *ident_lookup __P2(int, fd,
  106.38 +			 int, timeout)
  106.39 +{
  106.40 +    struct sockaddr_in localaddr, remoteaddr;
  106.41 +    int len;
  106.42 +    
  106.43 +    len = sizeof(remoteaddr);
  106.44 +    if (getpeername(fd, (struct sockaddr*) &remoteaddr, &len) < 0)
  106.45 +	return 0;
  106.46 +    
  106.47 +    len = sizeof(localaddr);
  106.48 +    if (getsockname(fd, (struct sockaddr *) &localaddr, &len) < 0)
  106.49 +	return 0;
  106.50 +
  106.51 +    return ident_query( &localaddr.sin_addr, &remoteaddr.sin_addr,
  106.52 +		       ntohs(localaddr.sin_port), ntohs(remoteaddr.sin_port),
  106.53 +		       timeout);
  106.54 +}
  106.55 +
  106.56 +
  106.57 +IDENT *ident_query __P5(struct in_addr *, laddr,
  106.58 +			struct in_addr *, raddr,
  106.59 +			int, lport,
  106.60 +			int, rport,
  106.61 +			int, timeout)
  106.62 +{
  106.63 +    int res;
  106.64 +    ident_t *id;
  106.65 +    struct timeval timout;
  106.66 +    IDENT *ident=0;
  106.67 +
  106.68 +    
  106.69 +    timout.tv_sec = timeout;
  106.70 +    timout.tv_usec = 0;
  106.71 +    
  106.72 +    if (timeout)
  106.73 +	id = id_open( laddr, raddr, &timout);
  106.74 +    else
  106.75 +	id = id_open( laddr, raddr, (struct timeval *)0);
  106.76 +    
  106.77 +    if (!id)
  106.78 +    {
  106.79 +	errno = EINVAL;
  106.80 +	return 0;
  106.81 +    }
  106.82 +  
  106.83 +    if (timeout)
  106.84 +	res = id_query(id, rport, lport, &timout);
  106.85 +    else
  106.86 +	res = id_query(id, rport, lport, (struct timeval *) 0);
  106.87 +    
  106.88 +    if (res < 0)
  106.89 +    {
  106.90 +	id_close(id);
  106.91 +	return 0;
  106.92 +    }
  106.93 +    
  106.94 +    ident = (IDENT *) malloc(sizeof(IDENT));
  106.95 +    if (!ident) {
  106.96 +	id_close(id);
  106.97 +	return 0;
  106.98 +    }
  106.99 +    
 106.100 +    if (timeout)
 106.101 +	res = id_parse(id, &timout,
 106.102 +		       &ident->lport,
 106.103 +		       &ident->fport,
 106.104 +		       &ident->identifier,
 106.105 +		       &ident->opsys,
 106.106 +		       &ident->charset);
 106.107 +    else
 106.108 +	res = id_parse(id, (struct timeval *) 0,
 106.109 +		       &ident->lport,
 106.110 +		       &ident->fport,
 106.111 +		       &ident->identifier,
 106.112 +		       &ident->opsys,
 106.113 +		       &ident->charset);
 106.114 +    
 106.115 +    if (res != 1)
 106.116 +    {
 106.117 +	free(ident);
 106.118 +	id_close(id);
 106.119 +	return 0;
 106.120 +    }
 106.121 +    
 106.122 +    id_close(id);
 106.123 +    return ident;			/* At last! */
 106.124 +}
 106.125 +
 106.126 +
 106.127 +char *ident_id __P2(int, fd,
 106.128 +		    int, timeout)
 106.129 +{
 106.130 +    IDENT *ident;
 106.131 +    char *id=0;
 106.132 +    
 106.133 +    ident = ident_lookup(fd, timeout);
 106.134 +    if (ident && ident->identifier && *ident->identifier)
 106.135 +    {
 106.136 +	id = id_strdup(ident->identifier);
 106.137 +	if (id == NULL)
 106.138 +	    return NULL;
 106.139 +    }
 106.140 +
 106.141 +    ident_free(ident);
 106.142 +    return id;
 106.143 +}
 106.144 +
 106.145 +
 106.146 +void ident_free __P1(IDENT *, id)
 106.147 +{
 106.148 +    if (!id)
 106.149 +	return;
 106.150 +    if (id->identifier)
 106.151 +	free(id->identifier);
 106.152 +    if (id->opsys)
 106.153 +	free(id->opsys);
 106.154 +    if (id->charset)
 106.155 +	free(id->charset);
 106.156 +    free(id);
 106.157 +}
 106.158 +
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/src/libident/ident.h	Fri Sep 26 17:05:23 2008 +0200
   107.3 @@ -0,0 +1,194 @@
   107.4 +/*
   107.5 +** ident.h
   107.6 +**
   107.7 +** Author: Peter Eriksson <pen@lysator.liu.se>
   107.8 +** Intruder: Pär Emanuelsson <pell@lysator.liu.se>
   107.9 +*/
  107.10 +
  107.11 +#ifndef __IDENT_H__
  107.12 +#define __IDENT_H__
  107.13 +
  107.14 +#ifdef	__cplusplus
  107.15 +extern "C" {
  107.16 +#endif
  107.17 +
  107.18 +/* Sigh */
  107.19 +#ifdef __STDC__
  107.20 +#  if __STDC__ == 1
  107.21 +#    define IS_STDC 1
  107.22 +#  endif
  107.23 +#endif
  107.24 +
  107.25 +#ifdef __P
  107.26 +#  undef __P
  107.27 +#endif
  107.28 +    
  107.29 +#ifdef IS_STDC
  107.30 +#  define __P(AL)	                  AL
  107.31 +
  107.32 +#ifdef IN_LIBIDENT_SRC
  107.33 +    
  107.34 +#  define __P1(t1,a1) \
  107.35 +    (t1 a1)
  107.36 +    
  107.37 +#  define __P2(t1,a1,t2,a2) \
  107.38 +    (t1 a1, t2 a2)
  107.39 +	
  107.40 +#  define __P3(t1,a1,t2,a2,t3,a3) \
  107.41 +    (t1 a1, t2 a2, t3 a3)
  107.42 +	    
  107.43 +#  define __P4(t1,a1,t2,a2,t3,a3,t4,a4) \
  107.44 +    (t1 a1, t2 a2, t3 a3, t4 a4)
  107.45 +
  107.46 +#  define __P5(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) \
  107.47 +    (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)
  107.48 +
  107.49 +#  define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
  107.50 +    (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7)
  107.51 +#endif
  107.52 +    
  107.53 +#else
  107.54 +
  107.55 +#  define __P(AL)	                  ()
  107.56 +
  107.57 +#ifdef IN_LIBIDENT_SRC
  107.58 +    
  107.59 +#  define __P1(t1,a1)                     (a1) \
  107.60 +    t1 a1;
  107.61 +#  define __P2(t1,a1,t2,a2)               (a1, a2) \
  107.62 +    t1 a1; \
  107.63 +    t2 a2;
  107.64 +#  define __P3(t1,a1,t2,a2,t3,a3)         (a1, a2, a3) \
  107.65 +    t1 a1; \
  107.66 +    t2 a2; \
  107.67 +    t3 a3;
  107.68 +#  define __P4(t1,a1,t2,a2,t3,a3,t4,a4)   (a1, a2, a3, a4) \
  107.69 +    t1 a1; \
  107.70 +    t2 a2; \
  107.71 +    t3 a3; \
  107.72 +    t4 a4;
  107.73 +#  define __P5(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5)   (a1, a2, a3, a4, a5) \
  107.74 +    t1 a1; \
  107.75 +    t2 a2; \
  107.76 +    t3 a3; \
  107.77 +    t4 a4; \
  107.78 +    t5 a5;
  107.79 +#  define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
  107.80 +    (a1, a2, a3, a4, a5, a6, a7) \
  107.81 +    t1 a1; \
  107.82 +    t2 a2; \
  107.83 +    t3 a3; \
  107.84 +    t4 a4; \
  107.85 +    t5 a5; \
  107.86 +    t6 a6; \
  107.87 +    t7 a7;
  107.88 +#endif
  107.89 +#endif
  107.90 +
  107.91 +#ifdef IS_STDC
  107.92 +#  undef IS_STDC
  107.93 +#endif
  107.94 +
  107.95 +#ifdef _AIX
  107.96 +#  include <sys/select.h>
  107.97 +#endif
  107.98 +#ifdef __sgi
  107.99 +#  include <bstring.h>
 107.100 +#endif
 107.101 +#include <sys/types.h>
 107.102 +#include <netinet/in.h>
 107.103 +#include <sys/time.h>
 107.104 +
 107.105 +#if defined(VMS) && !defined(FD_SETSIZE)
 107.106 +#  define FD_SETSIZE 64
 107.107 +#endif
 107.108 +
 107.109 +/*
 107.110 + * Sigh, GCC v2 complains when using undefined struct tags
 107.111 + * in function prototypes...
 107.112 + */
 107.113 +#if defined(__GNUC__) && !defined(INADDR_ANY)
 107.114 +#  define __STRUCT_IN_ADDR_P	void *
 107.115 +#else
 107.116 +#  define __STRUCT_IN_ADDR_P	struct in_addr *
 107.117 +#endif
 107.118 +
 107.119 +#if defined(__GNUC__) && !defined(DST_NONE)
 107.120 +#  define __STRUCT_TIMEVAL_P	void *
 107.121 +#else
 107.122 +#  define __STRUCT_TIMEVAL_P	struct timeval *
 107.123 +#endif
 107.124 +
 107.125 +#if defined(__sgi) && defined(_POSIX_SOURCE)
 107.126 +#  undef  __STRUCT_TIMEVAL_P
 107.127 +#  define __STRUCT_TIMEVAL_P	void *
 107.128 +#endif
 107.129 +	
 107.130 +#ifndef IDBUFSIZE
 107.131 +#  define IDBUFSIZE 2048
 107.132 +#endif
 107.133 +
 107.134 +#ifndef IDPORT
 107.135 +#  define IDPORT	113
 107.136 +#endif
 107.137 +
 107.138 +typedef struct
 107.139 +{
 107.140 +  int fd;
 107.141 +  char buf[IDBUFSIZE];
 107.142 +} ident_t;
 107.143 +
 107.144 +typedef struct {
 107.145 +  int lport;                    /* Local port */
 107.146 +  int fport;                    /* Far (remote) port */
 107.147 +  char *identifier;             /* Normally user name */
 107.148 +  char *opsys;                  /* OS */
 107.149 +  char *charset;                /* Charset (what did you expect?) */
 107.150 +} IDENT;                        /* For higher-level routines */
 107.151 +
 107.152 +/* Low-level calls and macros */
 107.153 +#define id_fileno(ID)	((ID)->fd)
 107.154 +
 107.155 +extern ident_t * id_open __P((__STRUCT_IN_ADDR_P laddr,
 107.156 +			   __STRUCT_IN_ADDR_P faddr,
 107.157 +			   __STRUCT_TIMEVAL_P timeout));
 107.158 +  
 107.159 +extern int    id_close __P((ident_t *id));
 107.160 +  
 107.161 +extern int    id_query __P((ident_t *id,
 107.162 +			    int lport,
 107.163 +			    int fport,
 107.164 +			    __STRUCT_TIMEVAL_P timeout));
 107.165 +  
 107.166 +extern int    id_parse __P((ident_t *id,
 107.167 +			    __STRUCT_TIMEVAL_P timeout,
 107.168 +			    int *lport,
 107.169 +			    int *fport,
 107.170 +			    char **identifier,
 107.171 +			    char **opsys,
 107.172 +			    char **charset));
 107.173 +  
 107.174 +/* High-level calls */
 107.175 +
 107.176 +extern IDENT *ident_lookup __P((int fd, int timeout));
 107.177 +
 107.178 +extern char  *ident_id __P((int fd, int timeout));
 107.179 +
 107.180 +extern IDENT *ident_query __P(( __STRUCT_IN_ADDR_P laddr, __STRUCT_IN_ADDR_P raddr, int lport, int rport, int timeout));
 107.181 +
 107.182 +extern void   ident_free __P((IDENT *id));
 107.183 +
 107.184 +extern char  id_version[];
 107.185 +
 107.186 +#ifdef IN_LIBIDENT_SRC
 107.187 +
 107.188 +extern char *id_strdup __P((char *str));
 107.189 +extern char *id_strtok __P((char *cp, char *cs, char *dc));
 107.190 +
 107.191 +#endif
 107.192 +
 107.193 +#ifdef	__cplusplus
 107.194 +}
 107.195 +#endif
 107.196 +
 107.197 +#endif
   108.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.2 +++ b/src/libident/support.c	Fri Sep 26 17:05:23 2008 +0200
   108.3 @@ -0,0 +1,86 @@
   108.4 +/*
   108.5 +** support.c
   108.6 +**
   108.7 +** Author: Pr Emanuelsson <pell@lysator.liu.se>
   108.8 +** Hacked by: Peter Eriksson <pen@lysator.liu.se>
   108.9 +*/
  108.10 +#include <stdio.h>
  108.11 +#include <ctype.h>
  108.12 +
  108.13 +#ifdef HAVE_ANSIHEADERS
  108.14 +#  include <stdlib.h>
  108.15 +#  include <string.h>
  108.16 +#else
  108.17 +#  define strchr(str, c) index(str, c)
  108.18 +#endif
  108.19 +
  108.20 +#define IN_LIBIDENT_SRC
  108.21 +#include "ident.h"
  108.22 +
  108.23 +
  108.24 +char *id_strdup __P1(char *, str)
  108.25 +{
  108.26 +    char *cp;
  108.27 +
  108.28 +    cp = (char *) malloc(strlen(str)+1);
  108.29 +    if (cp == NULL)
  108.30 +    {
  108.31 +#ifdef DEBUG
  108.32 +	perror("libident: malloc");
  108.33 +#endif
  108.34 +        return NULL;
  108.35 +    }
  108.36 +
  108.37 +    strcpy(cp, str);
  108.38 +
  108.39 +    return cp;
  108.40 +}
  108.41 +
  108.42 +
  108.43 +char *id_strtok __P3(char *, cp,
  108.44 +		      char *, cs,
  108.45 +		      char *, dc)
  108.46 +{
  108.47 +    static char *bp = 0;
  108.48 +    
  108.49 +    if (cp)
  108.50 +	bp = cp;
  108.51 +    
  108.52 +    /*
  108.53 +    ** No delimitor cs - return whole buffer and point at end
  108.54 +    */
  108.55 +    if (!cs)
  108.56 +    {
  108.57 +	while (*bp)
  108.58 +	    bp++;
  108.59 +	return cs;
  108.60 +    }
  108.61 +    
  108.62 +    /*
  108.63 +    ** Skip leading spaces
  108.64 +    */
  108.65 +    while (isspace(*bp))
  108.66 +	bp++;
  108.67 +    
  108.68 +    /*
  108.69 +    ** No token found?
  108.70 +    */
  108.71 +    if (!*bp)
  108.72 +	return 0;
  108.73 +    
  108.74 +    cp = bp;
  108.75 +    while (*bp && !strchr(cs, *bp))
  108.76 +	bp++;
  108.77 +    
  108.78 +    /*
  108.79 +    ** Remove trailing spaces
  108.80 +    */
  108.81 +    *dc = *bp;
  108.82 +    for (dc = bp-1; dc > cp && isspace(*dc); dc--)
  108.83 +	;
  108.84 +    *++dc = '\0';
  108.85 +    
  108.86 +    bp++;
  108.87 +    
  108.88 +    return cp;
  108.89 +}
   109.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.2 +++ b/src/libident/version.c	Fri Sep 26 17:05:23 2008 +0200
   109.3 @@ -0,0 +1,1 @@
   109.4 +char id_version[] = "0.21";
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/src/listen.c	Fri Sep 26 17:05:23 2008 +0200
   110.3 @@ -0,0 +1,243 @@
   110.4 +/*  MasqMail
   110.5 +    Copyright (C) 1999/2000 Oliver Kurth
   110.6 +
   110.7 +    This program is free software; you can redistribute it and/or modify
   110.8 +    it under the terms of the GNU General Public License as published by
   110.9 +    the Free Software Foundation; either version 2 of the License, or
  110.10 +    (at your option) any later version.
  110.11 +
  110.12 +    This program is distributed in the hope that it will be useful,
  110.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  110.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  110.15 +    GNU General Public License for more details.
  110.16 +
  110.17 +    You should have received a copy of the GNU General Public License
  110.18 +    along with this program; if not, write to the Free Software
  110.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  110.20 +*/
  110.21 +
  110.22 +#include "masqmail.h"
  110.23 +#include <sys/wait.h>
  110.24 +#include <sys/types.h>
  110.25 +
  110.26 +static int volatile sighup_seen = 0;
  110.27 +
  110.28 +static
  110.29 +void sighup_handler(int sig)
  110.30 +{
  110.31 +  sighup_seen = 1;
  110.32 +  signal(SIGHUP, sighup_handler);
  110.33 +}
  110.34 +
  110.35 +static
  110.36 +void sigchld_handler(int sig)
  110.37 +{
  110.38 +  pid_t pid;
  110.39 +  int status;
  110.40 +  
  110.41 +  pid = waitpid(0, &status, 0);
  110.42 +  if(pid > 0){
  110.43 +    if(WEXITSTATUS(status) != EXIT_SUCCESS)
  110.44 +      logwrite(LOG_WARNING, "process %d exited with %d\n",
  110.45 +	       pid, WEXITSTATUS(status));
  110.46 +    if(WIFSIGNALED(status))
  110.47 +      logwrite(LOG_WARNING,
  110.48 +	       "process with pid %d got signal: %d\n",
  110.49 +	       pid, WTERMSIG(status));
  110.50 +  }
  110.51 +  signal(SIGCHLD, sigchld_handler);
  110.52 +}
  110.53 +
  110.54 +#ifdef ENABLE_SMTP_SERVER
  110.55 +void accept_connect(int listen_sock, int sock, struct sockaddr_in* sock_addr)
  110.56 +{
  110.57 +  pid_t pid;
  110.58 +  int dup_sock = dup(sock);
  110.59 +  FILE *out, *in;
  110.60 +  gchar *rem_host;
  110.61 +  gchar *ident = NULL;
  110.62 +
  110.63 +  rem_host = g_strdup(inet_ntoa(sock_addr->sin_addr));
  110.64 +#ifdef ENABLE_IDENT
  110.65 +  {
  110.66 +    gchar *id = NULL;
  110.67 +    if((id = (gchar *)ident_id(sock, 60))){
  110.68 +      ident = g_strdup(id);
  110.69 +    }
  110.70 +    logwrite(LOG_NOTICE, "connect from host %s, port %hd ident=%s\n",
  110.71 +	     rem_host,
  110.72 +	     ntohs (sock_addr->sin_port),
  110.73 +	     ident ? ident : "(unknown)");
  110.74 +  }
  110.75 +#else
  110.76 +  logwrite(LOG_NOTICE, "connect from host %s, port %hd\n",
  110.77 +	 rem_host,
  110.78 +	 ntohs (sock_addr->sin_port));
  110.79 +#endif
  110.80 +
  110.81 +  // start child for connection:
  110.82 +  signal(SIGCHLD, sigchld_handler);
  110.83 +  pid = fork();
  110.84 +  if(pid == 0){
  110.85 +    close(listen_sock);
  110.86 +    out = fdopen(sock, "w");
  110.87 +    in = fdopen(dup_sock, "r");
  110.88 +    
  110.89 +    smtp_in(in, out, rem_host, ident);
  110.90 +
  110.91 +    _exit(EXIT_SUCCESS);
  110.92 +  }else if(pid < 0){
  110.93 +    logwrite(LOG_WARNING, "could not fork for incoming smtp connection: %s\n",
  110.94 +	     strerror(errno));
  110.95 +  }
  110.96 +
  110.97 +#ifdef ENABLE_IDENT
  110.98 +  if(ident != NULL) g_free(ident);
  110.99 +#endif
 110.100 +
 110.101 +  close(sock);
 110.102 +  close(dup_sock);
 110.103 +}
 110.104 +#endif /*ifdef ENABLE_SMTP_SERVER*/
 110.105 +
 110.106 +void listen_port(GList *iface_list, gint qival, char *argv[])
 110.107 +{
 110.108 +  int i;
 110.109 +  fd_set active_fd_set, read_fd_set;
 110.110 +  struct timeval tm;
 110.111 +  time_t time_before, time_now;
 110.112 +  struct sockaddr_in clientname;
 110.113 +  size_t size;
 110.114 +  GList *node, *node_next;
 110.115 +  int sel_ret;
 110.116 +
 110.117 +  /* Create the sockets and set them up to accept connections. */
 110.118 +  FD_ZERO (&active_fd_set);
 110.119 +#ifdef ENABLE_SMTP_SERVER
 110.120 +  for(node = g_list_first(iface_list);
 110.121 +      node;
 110.122 +      node = node_next){
 110.123 +    interface *iface = (interface *)(node->data);
 110.124 +    int sock;
 110.125 +
 110.126 +    node_next=g_list_next(node);
 110.127 +    if ((sock = make_server_socket (iface))<0){
 110.128 +      iface_list= g_list_remove_link(iface_list, node);
 110.129 +      g_list_free_1(node);
 110.130 +      continue;
 110.131 +    }
 110.132 +    if (listen (sock, 1) < 0){
 110.133 +      logwrite(LOG_ALERT, "listen: (terminating): %s\n", strerror(errno));
 110.134 +      exit (EXIT_FAILURE);
 110.135 +    }
 110.136 +    logwrite(LOG_NOTICE, "listening on interface %s:%d\n",
 110.137 +	     iface->address, iface->port);
 110.138 +    DEBUG(5) debugf("sock = %d\n", sock);
 110.139 +    FD_SET (sock, &active_fd_set);
 110.140 +  }
 110.141 +#endif
 110.142 +
 110.143 +  /* setup handler for HUP signal: */
 110.144 +  signal(SIGHUP, sighup_handler);
 110.145 +  signal(SIGCHLD, sigchld_handler);
 110.146 +
 110.147 +  /* now that we have our socket(s),
 110.148 +     we can give up root privileges */
 110.149 +  if(!conf.run_as_user){
 110.150 +    if(setegid(conf.mail_gid) != 0){
 110.151 +      logwrite(LOG_ALERT, "could not change gid to %d: %s\n",
 110.152 +	       conf.mail_gid, strerror(errno));
 110.153 +      exit(EXIT_FAILURE);
 110.154 +    }
 110.155 +    if(seteuid(conf.mail_uid) != 0){
 110.156 +      logwrite(LOG_ALERT, "could not change uid to %d: %s\n",
 110.157 +	       conf.mail_uid, strerror(errno));
 110.158 +      exit(EXIT_FAILURE);
 110.159 +    }
 110.160 +  }
 110.161 +
 110.162 +  /*  sel_ret = 0;*/
 110.163 +  time(&time_before);
 110.164 +  time_before -= qival;
 110.165 +  sel_ret = -1;
 110.166 +
 110.167 +  while (1){
 110.168 +
 110.169 +    /* if we were interrupted by an incoming connection (or a signal)
 110.170 +       we have to recalculate the time until the next queue run should
 110.171 +       occur. select may put a value into tm, but doc for select() says
 110.172 +       we should not use it.*/
 110.173 +    if(qival > 0){
 110.174 +      time(&time_now);
 110.175 +      if(sel_ret == 0){ /* we are either just starting or did a queue run */
 110.176 +	tm.tv_sec = qival;
 110.177 +	tm.tv_usec = 0;
 110.178 +	time_before = time_now;
 110.179 +      }else{
 110.180 +	tm.tv_sec = qival - (time_now - time_before);
 110.181 +	tm.tv_usec = 0;
 110.182 +
 110.183 +	/* race condition, very unlikely (but possible): */
 110.184 +	if(tm.tv_sec < 0)
 110.185 +	  tm.tv_sec = 0;
 110.186 +      }
 110.187 +    }
 110.188 +    /* Block until input arrives on one or more active sockets,
 110.189 +       or signal arrives,
 110.190 +       or queuing interval time elapsed (if qival > 0) */
 110.191 +    read_fd_set = active_fd_set;
 110.192 +    if ((sel_ret = select(FD_SETSIZE, &read_fd_set, NULL, NULL,
 110.193 +			  qival > 0 ? &tm : NULL)) < 0){
 110.194 +      if(errno != EINTR){
 110.195 +	logwrite(LOG_ALERT, "select: (terminating): %s\n", strerror(errno));
 110.196 +	exit (EXIT_FAILURE);
 110.197 +      }else{
 110.198 +	if(sighup_seen){
 110.199 +	  logwrite(LOG_NOTICE, "HUP signal received. Restarting daemon\n");
 110.200 +
 110.201 +	  for(i = 0; i < FD_SETSIZE; i++)
 110.202 +	    if(FD_ISSET(i, &active_fd_set))
 110.203 +	      close(i);
 110.204 +
 110.205 +	  execv(argv[0], &(argv[0]));
 110.206 +	  logwrite(LOG_ALERT, "restarting failed: %s\n", strerror(errno));
 110.207 +	  exit(EXIT_FAILURE);
 110.208 +	}
 110.209 +      }
 110.210 +    }
 110.211 +    else if(sel_ret > 0){
 110.212 +#ifdef ENABLE_SMTP_SERVER
 110.213 +      for(i = 0; i < FD_SETSIZE; i++){
 110.214 +	if (FD_ISSET (i, &read_fd_set)){
 110.215 +	  int sock = i;
 110.216 +	  int new;
 110.217 +	  size = sizeof (clientname);
 110.218 +	  new = accept (sock,
 110.219 +			(struct sockaddr *) &clientname,
 110.220 +			&size);
 110.221 +	  if (new < 0){
 110.222 +	    logwrite(LOG_ALERT, "accept: (ignoring): %s\n",
 110.223 +		     strerror(errno));
 110.224 +	  }else
 110.225 +	    accept_connect(sock, new, &clientname);
 110.226 +	}
 110.227 +      }
 110.228 +#else
 110.229 +      ;
 110.230 +#endif
 110.231 +    }else{
 110.232 +      /* If select returns 0, the interval time has elapsed.
 110.233 +	 We start a new queue runner process */
 110.234 +      int pid;
 110.235 +      signal(SIGCHLD, sigchld_handler);
 110.236 +      if((pid = fork()) == 0){
 110.237 +	queue_run();
 110.238 +
 110.239 +	_exit(EXIT_SUCCESS);
 110.240 +      }
 110.241 +      else if(pid < 0){
 110.242 +	logwrite(LOG_ALERT, "could not fork for queue run");
 110.243 +      }
 110.244 +    }
 110.245 +  }
 110.246 +}
   111.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.2 +++ b/src/local.c	Fri Sep 26 17:05:23 2008 +0200
   111.3 @@ -0,0 +1,366 @@
   111.4 +/*  MasqMail
   111.5 +    Copyright (C) 1999-2001 Oliver Kurth
   111.6 +
   111.7 +    This program is free software; you can redistribute it and/or modify
   111.8 +    it under the terms of the GNU General Public License as published by
   111.9 +    the Free Software Foundation; either version 2 of the License, or
  111.10 +    (at your option) any later version.
  111.11 +
  111.12 +    This program is distributed in the hope that it will be useful,
  111.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  111.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  111.15 +    GNU General Public License for more details.
  111.16 +
  111.17 +    You should have received a copy of the GNU General Public License
  111.18 +    along with this program; if not, write to the Free Software
  111.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  111.20 +*/
  111.21 +
  111.22 +#include "masqmail.h"
  111.23 +#include "peopen.h"
  111.24 +#include <sys/wait.h>
  111.25 +
  111.26 +static
  111.27 +void message_stream(FILE *out, message *msg, GList *hdr_list, guint flags)
  111.28 +{
  111.29 +  time_t now = time(NULL);
  111.30 +  GList *node;
  111.31 +  
  111.32 +  if(flags & MSGSTR_FROMLINE){
  111.33 +    fprintf(out, "From <%s@%s> %s", msg->return_path->local_part,
  111.34 +	    msg->return_path->domain, ctime(&now));
  111.35 +  }
  111.36 +	  
  111.37 +  foreach(hdr_list, node){
  111.38 +    header *hdr = (header *)(node->data);
  111.39 +    fputs(hdr->header, out);
  111.40 +  }
  111.41 +  putc('\n', out);
  111.42 +  foreach(msg->data_list, node){
  111.43 +    /* From hack: */
  111.44 +    if(flags & MSGSTR_FROMHACK){
  111.45 +      if(strncmp(node->data, "From ", 5) == 0)
  111.46 +	putc('>', out);
  111.47 +    }
  111.48 +    fputs(node->data, out);
  111.49 +  }
  111.50 +  putc('\n', out);
  111.51 +}
  111.52 +
  111.53 +gboolean append_file(message *msg, GList *hdr_list, gchar *user)
  111.54 +{
  111.55 +  struct passwd *pw;
  111.56 +  gboolean ok = FALSE;
  111.57 +  
  111.58 +  /* headers may be special for a local delivery */
  111.59 +  if(hdr_list == NULL)
  111.60 +    hdr_list = msg->hdr_list;
  111.61 +
  111.62 +  if((pw = getpwnam(user))){
  111.63 +    uid_t saved_uid = geteuid();
  111.64 +    gid_t saved_gid = getegid();
  111.65 +    gboolean uid_ok = TRUE, gid_ok = TRUE;
  111.66 +
  111.67 +    if(!conf.run_as_user){
  111.68 +      uid_ok = (seteuid(0) == 0);
  111.69 +      if(uid_ok){
  111.70 +	gid_ok = (setegid(conf.mail_gid) == 0);
  111.71 +	uid_ok = (seteuid(pw->pw_uid) == 0);
  111.72 +      }
  111.73 +    }
  111.74 +
  111.75 +    DEBUG(5) debugf("running as euid %d\n", geteuid());
  111.76 +    DEBUG(5) debugf("running as egid %d\n", getegid());
  111.77 +
  111.78 +    if(uid_ok && gid_ok){
  111.79 +      gchar *filename;
  111.80 +      FILE *out;
  111.81 +
  111.82 +      filename = g_strdup_printf("%s/%s", conf.mail_dir, user);
  111.83 +      if((out = fopen(filename, "a"))){
  111.84 +#ifdef USE_LIBLOCKFILE
  111.85 +        gint err;
  111.86 +        /* lock file using liblockfile */
  111.87 +        err = maillock(user,3);
  111.88 +	if(err == 0){
  111.89 +#else
  111.90 +	/* lock file: */
  111.91 +	struct flock lock;
  111.92 +	lock.l_type = F_WRLCK;
  111.93 +	lock.l_whence = SEEK_END;
  111.94 +	lock.l_start = lock.l_len = 0;
  111.95 +	if(fcntl(fileno(out), F_SETLK, &lock) != -1){
  111.96 +#endif
  111.97 +	  fchmod(fileno(out), 0600);
  111.98 +	  
  111.99 +	  message_stream(out, msg, hdr_list, MSGSTR_FROMLINE|MSGSTR_FROMHACK);
 111.100 +
 111.101 +	  ok = TRUE;
 111.102 +	  
 111.103 +	  /* close when still user */
 111.104 +	  fclose(out);
 111.105 +#ifdef USE_LIBLOCKFILE
 111.106 +          mailunlock();
 111.107 +#endif
 111.108 +	}else{
 111.109 +	  fclose(out);
 111.110 +#ifdef USE_LIBLOCKFILE
 111.111 +	  DEBUG(3) debugf("could not lock file %s: error %d\n",
 111.112 +			  filename, err);
 111.113 +	} /* XEmacs indenting convenience... */
 111.114 +#else
 111.115 +	  DEBUG(3) debugf("could not lock file %s: %s\n",
 111.116 +			  filename, strerror(errno));
 111.117 +	}
 111.118 +#endif
 111.119 +      }else{
 111.120 +	logwrite(LOG_ALERT, "could not open file %s: %s\n",
 111.121 +		 filename, strerror(errno));
 111.122 +      }
 111.123 +      g_free(filename);
 111.124 +
 111.125 +      if(!conf.run_as_user){
 111.126 +	uid_ok = (seteuid(0) == 0);
 111.127 +	if(uid_ok){
 111.128 +	  gid_ok = (setegid(saved_gid) == 0);
 111.129 +	  uid_ok = (seteuid(saved_uid) == 0);
 111.130 +	}
 111.131 +      }
 111.132 +      
 111.133 +      if(!uid_ok || !gid_ok){
 111.134 +	/* FIXME: if this fails we HAVE to exit, because we shall not run
 111.135 +	   with some users id. But we do not return, and so this message
 111.136 +	   will not be finished, so the user will get the message again
 111.137 +	   next time a delivery is attempted... */
 111.138 +	logwrite(LOG_ALERT,
 111.139 +		 "could not set back uid or gid after local delivery: %s\n",
 111.140 +		 strerror(errno));
 111.141 +	logwrite(LOG_ALERT,
 111.142 +		 "uid=%d, gid=%d, euid=%d, egid=%d, want = %d, %d\n",
 111.143 +		 getuid(), getgid(), geteuid(), getegid(), saved_uid, saved_gid);
 111.144 +	exit(EXIT_FAILURE);
 111.145 +      }
 111.146 +    }else{
 111.147 +      logwrite(LOG_ALERT,
 111.148 +	       "could not set uid or gid for local delivery, uid = %d: %s\n",
 111.149 +	       pw->pw_uid, strerror(errno));
 111.150 +    }
 111.151 +  }else{
 111.152 +    logwrite(LOG_ALERT, "could not find password entry for user %s\n", user);
 111.153 +    errno = ENOENT; /* getpwnam does not set errno correctly */
 111.154 +  }
 111.155 +
 111.156 +  return ok;
 111.157 +}
 111.158 +
 111.159 +#ifdef ENABLE_MAILDIR
 111.160 +gboolean maildir_out(message *msg, GList *hdr_list, gchar *user, guint flags)
 111.161 +{
 111.162 +  struct passwd *pw;
 111.163 +  gboolean ok = FALSE;
 111.164 +  
 111.165 +  /* headers may be special for a local delivery */
 111.166 +  if(hdr_list == NULL)
 111.167 +    hdr_list = msg->hdr_list;
 111.168 +
 111.169 +  if((pw = getpwnam(user))){
 111.170 +    uid_t saved_uid = geteuid();
 111.171 +    gid_t saved_gid = getegid();
 111.172 +    gboolean uid_ok = TRUE, gid_ok = TRUE;
 111.173 +
 111.174 +    if(!conf.run_as_user){
 111.175 +      uid_ok = (seteuid(0) == 0);
 111.176 +      if(uid_ok){
 111.177 +	gid_ok = (setegid(conf.mail_gid) == 0);
 111.178 +	uid_ok = (seteuid(pw->pw_uid) == 0);
 111.179 +      }
 111.180 +    }
 111.181 +
 111.182 +    DEBUG(5) debugf("running as euid %d\n", geteuid());
 111.183 +    DEBUG(5) debugf("running as egid %d\n", getegid());
 111.184 +    
 111.185 +    if(uid_ok && gid_ok){
 111.186 +      char *path = g_strdup_printf("%s/Maildir", pw->pw_dir);
 111.187 +      struct stat statbuf;
 111.188 +      int ret;
 111.189 +
 111.190 +      DEBUG(5) debugf("path = %s\n", path);
 111.191 +
 111.192 +      ok = TRUE;
 111.193 +      ret = stat(path, &statbuf);
 111.194 +      if(ret != 0){
 111.195 +	ok = FALSE;
 111.196 +	if(errno == ENOENT){
 111.197 +	  logwrite(LOG_NOTICE, "directory %s does not exist, creating\n", path);
 111.198 +	  if(mkdir(path, 0700) == 0)
 111.199 +	    ok = TRUE;
 111.200 +	}else
 111.201 +	  logwrite(LOG_ALERT, "stat of %s failed: %s\n", path, strerror(errno));
 111.202 +      }
 111.203 +      if(ok){
 111.204 +	ok = FALSE;
 111.205 +	ret = stat(path, &statbuf);
 111.206 +	if(S_ISDIR(statbuf.st_mode)){
 111.207 +	  gchar *subdirs[] = {"tmp", "new", "cur"};
 111.208 +	  int i;
 111.209 +	  for(i = 0; i < 3; i++){
 111.210 +	    char *path1 = g_strdup_printf("%s/%s", path, subdirs[i]);
 111.211 +	    ret = stat(path1, &statbuf);
 111.212 +	    if(ret != 0){
 111.213 +	      if(errno == ENOENT){
 111.214 +		logwrite(LOG_NOTICE, "directory %s does not exist, creating\n", path1);
 111.215 +		if(mkdir(path1, 0700) != 0) break;
 111.216 +	      }
 111.217 +	    }
 111.218 +	    g_free(path1);
 111.219 +	  }
 111.220 +	  if(i == 3){
 111.221 +	    FILE *out;
 111.222 +	    mode_t saved_mode = umask(066);
 111.223 +	    /* the qmail style unique works only if delivering
 111.224 +	       with different process. We do not fork for each delivery,
 111.225 +	       so our uid is more unique. Hope it is compatible with all
 111.226 +	       MUAs.
 111.227 +	    */
 111.228 +	    gchar *filename = g_strdup_printf("%s/tmp/%s.%s", path, msg->uid, conf.host_name);
 111.229 +
 111.230 +	    DEBUG(5) debugf("filename = %s\n", filename);
 111.231 +	    
 111.232 +	    if((out = fopen(filename, "w"))){
 111.233 +	      gchar *newname =
 111.234 +		g_strdup_printf("%s/new/%s.%s", path, msg->uid, conf.host_name);
 111.235 +	      message_stream(out, msg, hdr_list, flags);
 111.236 +	      ok = TRUE;
 111.237 +	      if(fflush(out) == EOF) ok = FALSE;
 111.238 +	      else if(fdatasync(fileno(out)) != 0){
 111.239 +		if(errno != EINVAL) /* some fs do not support this..
 111.240 +				       I hope this also means that it is not necessary */
 111.241 +		  ok = FALSE;
 111.242 +	      }
 111.243 +	      fclose(out);
 111.244 +	      if(rename(filename, newname) != 0){
 111.245 +		ok = FALSE;
 111.246 +		logwrite(LOG_ALERT, "moving %s to %s failed: %s",
 111.247 +			 filename, newname, strerror(errno));
 111.248 +	      }
 111.249 +	      g_free(newname);
 111.250 +	    }
 111.251 +	    umask(saved_mode);
 111.252 +	    g_free(filename);
 111.253 +	  }
 111.254 +	}else{
 111.255 +	  logwrite(LOG_ALERT, "%s is not a directory\n", path);
 111.256 +	  errno = ENOTDIR;
 111.257 +	}
 111.258 +      }
 111.259 +      if(!conf.run_as_user){
 111.260 +	uid_ok = (seteuid(0) == 0);
 111.261 +	if(uid_ok){
 111.262 +	  gid_ok = (setegid(saved_gid) == 0);
 111.263 +	  uid_ok = (seteuid(saved_uid) == 0);
 111.264 +	}
 111.265 +      }
 111.266 +      if(!uid_ok || !gid_ok){
 111.267 +	/* FIXME: if this fails we HAVE to exit, because we shall not run
 111.268 +	   with some users id. But we do not return, and so this message
 111.269 +	   will not be finished, so the user will get the message again
 111.270 +	   next time a delivery is attempted... */
 111.271 +	logwrite(LOG_ALERT,
 111.272 +		 "could not set back uid or gid after local delivery: %s\n",
 111.273 +		 strerror(errno));
 111.274 +	exit(EXIT_FAILURE);
 111.275 +      }
 111.276 +      g_free(path);
 111.277 +    }else{
 111.278 +      logwrite(LOG_ALERT,
 111.279 +	       "could not set uid or gid for local delivery, uid = %d: %s\n",
 111.280 +	       pw->pw_uid, strerror(errno));
 111.281 +    }
 111.282 +  }else{
 111.283 +    logwrite(LOG_ALERT, "could not find password entry for user %s\n", user);
 111.284 +    errno = ENOENT; /* getpwnam does not set errno correctly */
 111.285 +  }
 111.286 +  return ok;
 111.287 +}
 111.288 +#endif
 111.289 +
 111.290 +gboolean
 111.291 +pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags)
 111.292 +{
 111.293 +  gchar *envp[40];
 111.294 +  FILE *out;
 111.295 +  uid_t saved_uid = geteuid();
 111.296 +  gid_t saved_gid = getegid();
 111.297 +  gboolean ok = FALSE;
 111.298 +  gint i, n;
 111.299 +  pid_t pid;
 111.300 +  void (*old_signal)(int);
 111.301 +  int status;
 111.302 +
 111.303 +  /* set uid and gid to the mail ids */
 111.304 +  if(!conf.run_as_user){
 111.305 +    set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid);
 111.306 +  }
 111.307 +
 111.308 +  /* set environment */
 111.309 +  {
 111.310 +    gint i = 0;
 111.311 +    address *ancestor = addr_find_ancestor(rcpt);
 111.312 +
 111.313 +    envp[i++] = g_strdup_printf("SENDER=%s@%s", msg->return_path->local_part, msg->return_path->domain);
 111.314 +    envp[i++] = g_strdup_printf("SENDER_DOMAIN=%s", msg->return_path->domain);
 111.315 +    envp[i++] = g_strdup_printf("SENDER_LOCAL=%s", msg->return_path->local_part);
 111.316 +    envp[i++] = g_strdup_printf("RECEIVED_HOST=%s", msg->received_host ? msg->received_host : "");
 111.317 +
 111.318 +    envp[i++] = g_strdup_printf("RETURN_PATH=%s@%s",
 111.319 +				msg->return_path->local_part, msg->return_path->domain);
 111.320 +    envp[i++] = g_strdup_printf("DOMAIN=%s", ancestor->domain);
 111.321 +
 111.322 +    envp[i++] = g_strdup_printf("LOCAL_PART=%s", ancestor->local_part);
 111.323 +    envp[i++] = g_strdup_printf("USER=%s", ancestor->local_part);
 111.324 +    envp[i++] = g_strdup_printf("LOGNAME=%s", ancestor->local_part);
 111.325 +
 111.326 +    envp[i++] = g_strdup_printf("MESSAGE_ID=%s", msg->uid);
 111.327 +    envp[i++] = g_strdup_printf("QUALIFY_DOMAIN=%s", conf.host_name);
 111.328 +
 111.329 +    envp[i] = NULL;
 111.330 +    n = i;
 111.331 +  }
 111.332 +
 111.333 +  old_signal = signal(SIGCHLD, SIG_DFL);
 111.334 +
 111.335 +  out = peidopen(cmd, "w", envp, &pid, conf.mail_uid, conf.mail_gid);
 111.336 +  if(out != NULL){
 111.337 +    message_stream(out, msg, hdr_list, flags);
 111.338 +
 111.339 +    fclose(out);
 111.340 +
 111.341 +    waitpid(pid, &status, 0);
 111.342 +
 111.343 +    if(WEXITSTATUS(status) != 0){
 111.344 +      int exstat = WEXITSTATUS(status);
 111.345 +      logwrite(LOG_ALERT, "process returned %d (%s)\n", exstat, ext_strerror(1024 + exstat));
 111.346 +      errno = 1024 + exstat;
 111.347 +    }else if(WIFSIGNALED(status)){
 111.348 +      logwrite(LOG_ALERT, "process got signal %d\n", WTERMSIG(status));
 111.349 +    }else
 111.350 +      ok = TRUE;
 111.351 +
 111.352 +  }else
 111.353 +    logwrite(LOG_ALERT, "could not open pipe '%s': %s\n", cmd, strerror(errno));
 111.354 +
 111.355 +  signal(SIGCHLD, old_signal);
 111.356 +
 111.357 +  /* free environment */
 111.358 +  for(i = 0; i < n; i++){
 111.359 +    g_free(envp[i]);
 111.360 +  }
 111.361 +
 111.362 +  /* set uid and gid back */
 111.363 +  if(!conf.run_as_user){
 111.364 +    set_euidgid(saved_uid, saved_gid, NULL, NULL);
 111.365 +  }
 111.366 +
 111.367 +  return ok;
 111.368 +}
 111.369 +    
   112.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.2 +++ b/src/log.c	Fri Sep 26 17:05:23 2008 +0200
   112.3 @@ -0,0 +1,211 @@
   112.4 +/*  MasqMail
   112.5 +    Copyright (C) 1999-2001 Oliver Kurth
   112.6 +
   112.7 +    This program is free software; you can redistribute it and/or modify
   112.8 +    it under the terms of the GNU General Public License as published by
   112.9 +    the Free Software Foundation; either version 2 of the License, or
  112.10 +    (at your option) any later version.
  112.11 +
  112.12 +    This program is distributed in the hope that it will be useful,
  112.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  112.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  112.15 +    GNU General Public License for more details.
  112.16 +
  112.17 +    You should have received a copy of the GNU General Public License
  112.18 +    along with this program; if not, write to the Free Software
  112.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  112.20 +*/
  112.21 +
  112.22 +#include "masqmail.h"
  112.23 +
  112.24 +#include "sysexits.h"
  112.25 +
  112.26 +static char *_sysexit_strings[] = {
  112.27 +  "command line usage error",
  112.28 +  "data format error",
  112.29 +  "cannot open input",
  112.30 +  "addressee unknown",
  112.31 +  "host name unknown",
  112.32 +  "service unavailable",
  112.33 +  "internal software error",
  112.34 +  "system error (e.g., can't fork)",
  112.35 +  "critical OS file missing",
  112.36 +  "can't create (user) output file",
  112.37 +  "input/output error",
  112.38 +  "temp failure; user is invited to retry",
  112.39 +  "remote error in protocol",
  112.40 +  "permission denied",
  112.41 +  "configuration error"
  112.42 +};
  112.43 +
  112.44 +gchar *ext_strerror(int err)
  112.45 +{
  112.46 +  if(err < 1024)
  112.47 +    return strerror(err);
  112.48 +  else
  112.49 +    if(err > 1024 + EX__BASE &&
  112.50 +       (err - 1024 - EX__BASE < sizeof(_sysexit_strings)/sizeof(_sysexit_strings[0])))
  112.51 +      return _sysexit_strings[err - 1024 - EX__BASE];
  112.52 +
  112.53 +  return "unknown error";
  112.54 +}
  112.55 +
  112.56 +static FILE *logfile = NULL;
  112.57 +static FILE *debugfile = NULL;
  112.58 +
  112.59 +gboolean logopen()
  112.60 +{
  112.61 +  gchar *filename;
  112.62 +  mode_t saved_mode = umask(066);
  112.63 +
  112.64 +  if(conf.use_syslog){
  112.65 +    openlog(PACKAGE, LOG_PID, LOG_MAIL);
  112.66 +  }else{
  112.67 +    uid_t saved_uid;
  112.68 +    gid_t saved_gid;
  112.69 +    
  112.70 +    saved_gid = setegid(conf.mail_gid);
  112.71 +    saved_uid = seteuid(conf.mail_uid);
  112.72 +
  112.73 +    filename = g_strdup_printf("%s/masqmail.log", conf.log_dir);
  112.74 +    logfile = fopen(filename, "a");
  112.75 +    if(!logfile){
  112.76 +      fprintf(stderr, "could not open log '%s': %s\n", filename, strerror(errno));
  112.77 +      return FALSE;
  112.78 +    }
  112.79 +    g_free(filename);
  112.80 +
  112.81 +    seteuid(saved_uid);
  112.82 +    setegid(saved_gid);
  112.83 +  }
  112.84 +
  112.85 +#ifdef ENABLE_DEBUG
  112.86 +  if(conf.debug_level > 0){
  112.87 +    filename = g_strdup_printf("%s/debug.log", conf.log_dir);
  112.88 +    debugfile = fopen(filename, "a");
  112.89 +    if(!debugfile){
  112.90 +      fprintf(stderr, "could not open debug log '%s'\n", filename);
  112.91 +      return FALSE;
  112.92 +    }
  112.93 +    g_free(filename);
  112.94 +  }
  112.95 +#endif
  112.96 +  umask(saved_mode);
  112.97 +  return TRUE;
  112.98 +}
  112.99 +
 112.100 +void logclose()
 112.101 +{
 112.102 +  if(conf.use_syslog)
 112.103 +    closelog();
 112.104 +  else
 112.105 +    if(logfile) fclose(logfile);
 112.106 +  if(debugfile) fclose(debugfile);
 112.107 +}
 112.108 +
 112.109 +void vlogwrite(int pri, const char *fmt, va_list args)
 112.110 +{
 112.111 +  if((conf.do_verbose && (pri & LOG_VERBOSE)) || (pri == LOG_ALERT) || (pri == LOG_WARNING)){
 112.112 +    va_list args_copy;
 112.113 +    va_copy(args_copy, args);
 112.114 +    vfprintf(stdout, fmt, args_copy);
 112.115 +    va_end(args_copy);
 112.116 +    fflush(stdout); /* is this necessary? */
 112.117 +  }
 112.118 +
 112.119 +  pri &= ~LOG_VERBOSE;
 112.120 +  if(pri){
 112.121 +
 112.122 +    if(conf.use_syslog)
 112.123 +      vsyslog(pri, fmt, args);
 112.124 +    else{
 112.125 +      if(pri <= conf.log_max_pri){
 112.126 +	FILE *file = logfile ? logfile : stderr;
 112.127 +	time_t now = time(NULL);
 112.128 +	struct tm *t = localtime(&now);
 112.129 +	gchar buf[24];
 112.130 +	uid_t saved_uid;
 112.131 +	gid_t saved_gid;
 112.132 +
 112.133 +	saved_gid = setegid(conf.mail_gid);
 112.134 +	saved_uid = seteuid(conf.mail_uid);
 112.135 +
 112.136 +	strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t);
 112.137 +	fprintf(file, "%s [%d] ", buf, getpid());
 112.138 +	
 112.139 +	vfprintf(file, fmt, args);
 112.140 +	fflush(file);
 112.141 +
 112.142 +	seteuid(saved_uid);
 112.143 +	setegid(saved_gid);
 112.144 +      }
 112.145 +    }
 112.146 +  }
 112.147 +}  
 112.148 +
 112.149 +#ifdef ENABLE_DEBUG
 112.150 +void vdebugwrite(int pri, const char *fmt, va_list args)
 112.151 +{
 112.152 +  time_t now = time(NULL);
 112.153 +  struct tm *t = localtime(&now);
 112.154 +  gchar buf[24];
 112.155 +  strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t);
 112.156 +
 112.157 +  if(debugfile){
 112.158 +    fprintf(debugfile, "%s [%d] ", buf, getpid());
 112.159 +  
 112.160 +    vfprintf(debugfile, fmt, args);
 112.161 +    fflush(debugfile);
 112.162 +  }else{
 112.163 +    fprintf(stderr, "no debug file, msg was:\n");
 112.164 +    vfprintf(stderr, fmt, args);
 112.165 +  }
 112.166 +}
 112.167 +#endif
 112.168 +
 112.169 +void logwrite(int pri, const char *fmt, ...)
 112.170 +{
 112.171 +  va_list args, args_copy;
 112.172 +  int saved_errno = errno; /* somewhere this is changed to EBADF */
 112.173 +
 112.174 +  va_start(args, fmt);
 112.175 +#ifdef ENABLE_DEBUG
 112.176 +  va_copy(args_copy, args);
 112.177 +#endif
 112.178 +  vlogwrite(pri, fmt, args);
 112.179 +#ifdef ENABLE_DEBUG
 112.180 +  if(debugfile)
 112.181 +    vdebugwrite(pri, fmt, args_copy);
 112.182 +  va_end(args_copy);
 112.183 +#endif
 112.184 +  va_end(args);
 112.185 +
 112.186 +  errno = saved_errno;
 112.187 +}
 112.188 +
 112.189 +#ifdef ENABLE_DEBUG
 112.190 +void debugf(const char *fmt, ...)
 112.191 +{
 112.192 +  va_list args;
 112.193 +  va_start(args, fmt);
 112.194 +
 112.195 +  vdebugwrite(LOG_DEBUG, fmt, args);
 112.196 +
 112.197 +  va_end(args);
 112.198 +}
 112.199 +
 112.200 +void vdebugf(const char *fmt, va_list args)
 112.201 +{
 112.202 +  vdebugwrite(LOG_DEBUG, fmt, args);
 112.203 +}
 112.204 +#endif
 112.205 +
 112.206 +void maillog(const char *fmt, ...)
 112.207 +{
 112.208 +  va_list args;
 112.209 +  va_start(args, fmt);
 112.210 +
 112.211 +  vlogwrite(LOG_NOTICE, fmt, args);
 112.212 +
 112.213 +  va_end(args);
 112.214 +}
   113.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.2 +++ b/src/lookup.c	Fri Sep 26 17:05:23 2008 +0200
   113.3 @@ -0,0 +1,376 @@
   113.4 +/* MasqMail Copyright (C) Oliver Kurth,
   113.5 + *
   113.6 + * This program is free software; you can redistribute it and/or modify
   113.7 + * it under the terms of the GNU General Public License as published by
   113.8 + * the Free Software Foundation; either version 2 of the License, or
   113.9 + * (at your option) any later version.
  113.10 + * 
  113.11 + * This program is distributed in the hope that it will be useful,
  113.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  113.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  113.14 + * GNU General Public License for more details.
  113.15 + *
  113.16 + * You should have received a copy of the GNU General Public License
  113.17 + * along with this program; if not, write to the Free Software
  113.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  113.19 + */
  113.20 +
  113.21 +#include <sys/types.h>
  113.22 +#include <netinet/in.h>
  113.23 +#include <arpa/nameser.h>
  113.24 +#include <resolv.h>
  113.25 +
  113.26 +#include "masqmail.h"
  113.27 +
  113.28 +#ifdef RESOLV_TEST
  113.29 +
  113.30 +#undef DEBUG
  113.31 +#define DEBUG(x) if(x > 0)
  113.32 +
  113.33 +#define debugf g_print
  113.34 +#endif
  113.35 +
  113.36 +#ifdef ENABLE_RESOLVER
  113.37 +
  113.38 +static union {
  113.39 +  HEADER hdr;
  113.40 +  unsigned char buf[PACKETSZ];
  113.41 +} response;
  113.42 +static unsigned char *resp_end;
  113.43 +static unsigned char *resp_pos;
  113.44 +
  113.45 +static int num_answers;
  113.46 +static char name[MAX_DNSNAME];
  113.47 +
  113.48 +unsigned short rr_type;
  113.49 +unsigned short rr_dlen;
  113.50 +
  113.51 +static
  113.52 +unsigned short getshort(unsigned char *c)
  113.53 +{
  113.54 +  unsigned short u;
  113.55 +  u = c[0];
  113.56 +  return (u << 8) + c[1];
  113.57 +}
  113.58 +
  113.59 +static
  113.60 +int dns_resolve(char *domain, int type, gboolean do_search)
  113.61 +{
  113.62 +  int n;
  113.63 +  int i;
  113.64 +
  113.65 +  int resp_len;
  113.66 +  /*errno = 0;*/
  113.67 +
  113.68 +  /*
  113.69 +  if (!stralloc_copy(&glue,domain)) return DNS_MEM;
  113.70 +  if (!stralloc_0(&glue)) return DNS_MEM;
  113.71 +  */
  113.72 +
  113.73 +  //  resp_len = res_query(domain, C_IN, type, response.buf, sizeof(response));
  113.74 +  DEBUG(5) debugf("DNS: before res_search()\n");
  113.75 +  if(do_search)
  113.76 +    resp_len = res_search(domain, C_IN, type, response.buf, sizeof(response));
  113.77 +  else
  113.78 +    resp_len = res_query(domain, C_IN, type, response.buf, sizeof(response));
  113.79 +  DEBUG(5) debugf("DBG: after res_search()\n");
  113.80 +
  113.81 +  if (resp_len <= 0){
  113.82 +    /*
  113.83 +    if (errno == ECONNREFUSED) return DNS_SOFT;
  113.84 +    if (h_errno == TRY_AGAIN) return DNS_SOFT;
  113.85 +    return DNS_HARD;
  113.86 +    */
  113.87 +    return -1;
  113.88 +  }
  113.89 +  if (resp_len >= sizeof(response))
  113.90 +    resp_len = sizeof(response);
  113.91 +
  113.92 +  resp_end = response.buf + resp_len;
  113.93 +  resp_pos = response.buf + sizeof(HEADER);
  113.94 +  n = ntohs(response.hdr.qdcount);
  113.95 +
  113.96 +  while (n-- > 0){
  113.97 +    i = dn_expand(response.buf, resp_end, resp_pos, name, MAX_DNSNAME);
  113.98 +    if (i < 0)
  113.99 +      return -1;
 113.100 +    DEBUG(5) debugf("DBG: resolve name = %s\n", name);
 113.101 +    resp_pos += i;
 113.102 +    i = resp_end - resp_pos;
 113.103 +    if (i < QFIXEDSZ)
 113.104 +      return -1;
 113.105 +    resp_pos += QFIXEDSZ;
 113.106 +  }
 113.107 +  num_answers = ntohs(response.hdr.ancount);
 113.108 +
 113.109 +  return 0;
 113.110 +}
 113.111 +
 113.112 +static int dns_next()
 113.113 +{
 113.114 +  int i;
 113.115 +
 113.116 +  if (num_answers <= 0) return 2;
 113.117 +  num_answers--;
 113.118 +
 113.119 +  if (resp_pos == resp_end)
 113.120 +    return -1 /* soft */;
 113.121 +
 113.122 +  i = dn_expand(response.buf, resp_end, resp_pos, name, 256);
 113.123 +  if (i < 0)
 113.124 +    return -1; /* soft */
 113.125 +  resp_pos += i;
 113.126 +
 113.127 +  i = resp_end - resp_pos;
 113.128 +  if (i < 4 + 3 * 2)
 113.129 +    return -1; /* soft */
 113.130 +   
 113.131 +  rr_type = getshort(resp_pos);
 113.132 +  rr_dlen = getshort(resp_pos + 8);
 113.133 +  resp_pos += 10;
 113.134 +
 113.135 +  return 0;
 113.136 +}
 113.137 +
 113.138 +static
 113.139 +int dns_getip(guint32 *ip)
 113.140 +{
 113.141 +  int ret;
 113.142 +
 113.143 +  if((ret = dns_next())) return ret;
 113.144 +
 113.145 +  if (rr_type == T_A){
 113.146 +    if (rr_dlen < 4)
 113.147 +      return -1; /* soft */
 113.148 +    *ip = *(guint32 *)(resp_pos);
 113.149 +    DEBUG(5) debugf("DNS: dns_getip(): ip = %s\n", inet_ntoa(*(struct in_addr*)ip));
 113.150 +    resp_pos += rr_dlen;
 113.151 +
 113.152 +    return 1;
 113.153 +  }
 113.154 +  resp_pos += rr_dlen;
 113.155 +  return 0;
 113.156 +}
 113.157 +
 113.158 +static
 113.159 +int dns_getmx(int *pref)
 113.160 +{
 113.161 +  int ret;
 113.162 +
 113.163 +  if((ret = dns_next())) return ret;
 113.164 +
 113.165 +  if (rr_type == T_MX){
 113.166 +    if (rr_dlen < 3)
 113.167 +      return -1; /* soft */
 113.168 +
 113.169 +    *pref = (resp_pos[0] << 8) + resp_pos[1];
 113.170 +    if (dn_expand(response.buf, resp_end, resp_pos + 2, name, MAX_DNSNAME) < 0)
 113.171 +      return -1;
 113.172 +   
 113.173 +    resp_pos += rr_dlen;
 113.174 +
 113.175 +    return 1;
 113.176 +  }
 113.177 +  resp_pos += rr_dlen;
 113.178 +  return 0;
 113.179 +}
 113.180 +
 113.181 +/*
 113.182 +static
 113.183 +int dns_getname(int type)
 113.184 +{
 113.185 +  int ret;
 113.186 +
 113.187 +  if((ret = dns_next())) return ret;
 113.188 +
 113.189 +  if (rr_type == type){
 113.190 +    if (dn_expand(response.buf, resp_end, resp_pos, name, MAX_DNSNAME) < 0)
 113.191 +      return -1;
 113.192 +   
 113.193 +    resp_pos += rr_dlen;
 113.194 +
 113.195 +    return 1;
 113.196 +  }
 113.197 +  resp_pos += rr_dlen;
 113.198 +  return 0;
 113.199 +}
 113.200 +*/
 113.201 +
 113.202 +static
 113.203 +int dns_look_ip(gchar *domain, guint32 *ip)
 113.204 +{
 113.205 +  gchar *n = domain;
 113.206 +
 113.207 +  while(TRUE){
 113.208 +    if(dns_resolve(n, T_A, FALSE) == 0){
 113.209 +      dns_next();
 113.210 +      if(rr_type == T_A){
 113.211 +	if (rr_dlen < 4)
 113.212 +	  return -1; /* soft */
 113.213 +	*ip = *(guint32 *)(resp_pos);
 113.214 +	
 113.215 +	DEBUG(5) debugf("DNS: dns_look_ip(): ip = %s\n",
 113.216 +			inet_ntoa(*(struct in_addr*)ip));
 113.217 +	
 113.218 +	resp_pos += rr_dlen;
 113.219 +	return 0;
 113.220 +      }else if(rr_type == T_CNAME){
 113.221 +	if (dn_expand(response.buf, resp_end, resp_pos, name, MAX_DNSNAME) < 0)
 113.222 +	  return -1;
 113.223 +
 113.224 +	DEBUG(5) debugf("DNS: (CNAME) dns_look_ip(): name = %s\n", name);
 113.225 +	
 113.226 +	resp_pos += rr_dlen;
 113.227 +	n = name;
 113.228 +      }else
 113.229 +	return -1;
 113.230 +    }else
 113.231 +      return -1;
 113.232 +  }
 113.233 +}
 113.234 +
 113.235 +GList *resolve_dns_a(GList *list, gchar *domain)
 113.236 +{
 113.237 +  int ret;
 113.238 +
 113.239 +  DEBUG(5) debugf("DNS: resolve_dns_a entered\n");
 113.240 +
 113.241 +  if(dns_resolve(domain, T_A, TRUE) == 0){
 113.242 +    mxip_addr mxip;
 113.243 +    while((ret = dns_getip(&(mxip.ip))) != 2){
 113.244 +      if(ret == 1){
 113.245 +	mxip.name = g_strdup(name);
 113.246 +	mxip.pref = 0;
 113.247 +	list = g_list_append(list, g_memdup(&mxip, sizeof(mxip)));
 113.248 +      }
 113.249 +    }
 113.250 +  }
 113.251 +  return list;
 113.252 +}
 113.253 +
 113.254 +static
 113.255 +gint _mx_sort_func(gconstpointer aa, gconstpointer bb)
 113.256 +{
 113.257 +  const mxip_addr *a = (mxip_addr *)aa;
 113.258 +  const mxip_addr *b = (mxip_addr *)bb;
 113.259 +
 113.260 +  if(a->pref == b->pref)
 113.261 +    return a->ip - b->ip;
 113.262 +  else
 113.263 +    return a->pref - b->pref;
 113.264 +}
 113.265 +
 113.266 +GList *resolve_dns_mx(GList *list, gchar *domain)
 113.267 +{
 113.268 +  GList *node;
 113.269 +  int ret;
 113.270 +  int cnt = 0;
 113.271 +
 113.272 +  DEBUG(5) debugf("DNS: resolve_dns_mx entered\n");
 113.273 +
 113.274 +  if(dns_resolve(domain, T_MX, TRUE) == 0){
 113.275 +    GList *node_next;
 113.276 +    mxip_addr mxip;
 113.277 +    while((ret = dns_getmx(&(mxip.pref))) != 2){
 113.278 +      if(ret == 1){
 113.279 +	mxip.name = g_strdup(name);
 113.280 +	mxip.ip = rand();
 113.281 +	list = g_list_append(list, g_memdup(&mxip, sizeof(mxip)));
 113.282 +	cnt++;
 113.283 +      }
 113.284 +    }
 113.285 +
 113.286 +    DEBUG(5) debugf("DNS: found %d mx records\n", cnt);
 113.287 +
 113.288 +    /* to randomize sequences with equal pref values,
 113.289 +       we temporarily 'misused' the ip field and
 113.290 +       put a random number in it as a secondary sort key.
 113.291 +    */
 113.292 +    list = g_list_sort(list, _mx_sort_func);
 113.293 +
 113.294 +    /* CNAME resolving has to be added as well. */
 113.295 +
 113.296 +    for(node = g_list_first(list);
 113.297 +	node != NULL;
 113.298 +	node = node_next){
 113.299 +
 113.300 +      mxip_addr *p_mxip = (mxip_addr *)(node->data);
 113.301 +      node_next = g_list_next(node);
 113.302 +
 113.303 +      if(dns_look_ip(p_mxip->name, &(p_mxip->ip)) != 0){
 113.304 +	DEBUG(1) debugf("DNS: could not resolve target of mx %s\n", p_mxip->name);
 113.305 +	list = g_list_remove_link(list, node);
 113.306 +	g_free(node->data);
 113.307 +	g_list_free_1(node);
 113.308 +      }
 113.309 +    }
 113.310 +  }
 113.311 +  return list;
 113.312 +}
 113.313 +
 113.314 +#endif
 113.315 +
 113.316 +/* now something completely different... */
 113.317 +
 113.318 +GList *resolve_byname(GList *list, gchar *domain)
 113.319 +{
 113.320 +  struct hostent *hent;
 113.321 +
 113.322 +  DEBUG(5) debugf("DNS: resolve_byname entered\n");
 113.323 +
 113.324 +  if((hent = gethostbyname(domain))){
 113.325 +    char *haddr;
 113.326 +    int i = 0;
 113.327 +    while((haddr = hent->h_addr_list[i++])){
 113.328 +      mxip_addr mxip;
 113.329 +      mxip.ip = *(guint32 *)(haddr);
 113.330 +      mxip.pref = 0;
 113.331 +      mxip.name = g_strdup(hent->h_name);
 113.332 +      list = g_list_append(list, g_memdup(&mxip, sizeof(mxip)));
 113.333 +    }
 113.334 +  }
 113.335 +  return list;
 113.336 +}
 113.337 +
 113.338 +#ifdef RESOLV_TEST
 113.339 +int main(int argc, char *argv[])
 113.340 +{
 113.341 +  GList *addr_list = NULL, *node;
 113.342 +
 113.343 +  g_print("starting res_init()\n");
 113.344 +
 113.345 +  g_print("retrans = %d, retry = %d\n", _res.retrans, _res.retry);
 113.346 +
 113.347 +  if(res_init() == 0){
 113.348 +    
 113.349 +    addr_list = resolve_dns_a(NULL, argv[1]);
 113.350 +    g_print("A:\n");
 113.351 +
 113.352 +    foreach(addr_list, node){
 113.353 +      mxip_addr *p_mxip = (mxip_addr *)(node->data);
 113.354 +    
 113.355 +      printf("name = %s\n IP = %s\n",
 113.356 +	     p_mxip->name,
 113.357 +	     inet_ntoa(*(struct in_addr *)&(p_mxip->ip)));
 113.358 +    }
 113.359 +    addr_list = resolve_dns_mx(NULL, argv[1]);
 113.360 +    g_print("MX:\n");
 113.361 +
 113.362 +    foreach(addr_list, node){
 113.363 +      mxip_addr *p_mxip = (mxip_addr *)(node->data);
 113.364 +    
 113.365 +      printf("name = %s\n IP = %s pref = %d\n",
 113.366 +	     p_mxip->name,
 113.367 +	     inet_ntoa(*(struct in_addr *)&(p_mxip->ip)),
 113.368 +	     p_mxip->pref);
 113.369 +    }
 113.370 +    {
 113.371 +      guint32 ip;
 113.372 +      dns_look_ip(argv[1], &ip);
 113.373 +      printf("dns_look_ip: %s\n", inet_ntoa(*((struct in_addr *)(&ip))));
 113.374 +    }
 113.375 +  }else
 113.376 +    printf("res_init() failed.\n");
 113.377 +  
 113.378 +}
 113.379 +#endif
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/src/lookup.h	Fri Sep 26 17:05:23 2008 +0200
   114.3 @@ -0,0 +1,33 @@
   114.4 +/* MasqMail
   114.5 + * Copyright (C) Oliver Kurth,
   114.6 + *
   114.7 + * This program is free software; you can redistribute it and/or modify
   114.8 + * it under the terms of the GNU General Public License as published by
   114.9 + * the Free Software Foundation; either version 2 of the License, or
  114.10 + * (at your option) any later version.
  114.11 + * 
  114.12 + * This program is distributed in the hope that it will be useful,
  114.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  114.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  114.15 + * GNU General Public License for more details.
  114.16 + *
  114.17 + * You should have received a copy of the GNU General Public License
  114.18 + * along with this program; if not, write to the Free Software
  114.19 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  114.20 + */
  114.21 +
  114.22 +#define MAX_DNSNAME MAXDNAME
  114.23 +
  114.24 +typedef
  114.25 +struct{
  114.26 +  guint32 ip;
  114.27 +  int pref;
  114.28 +  guchar *name;
  114.29 +} mxip_addr;
  114.30 +
  114.31 +
  114.32 +typedef GList *(*resolve_func)(GList *, gchar *);
  114.33 +
  114.34 +GList *resolve_dns_a(GList *list, gchar *domain);
  114.35 +GList *resolve_dns_mx(GList *list, gchar *domain);
  114.36 +GList *resolve_byname(GList *list, gchar *domain);
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/src/masqmail.c	Fri Sep 26 17:05:23 2008 +0200
   115.3 @@ -0,0 +1,828 @@
   115.4 +/*  MasqMail
   115.5 +    Copyright (C) 1999-2001 Oliver Kurth
   115.6 +
   115.7 +    This program is free software; you can redistribute it and/or modify
   115.8 +    it under the terms of the GNU General Public License as published by
   115.9 +    the Free Software Foundation; either version 2 of the License, or
  115.10 +    (at your option) any later version.
  115.11 +
  115.12 +    This program is distributed in the hope that it will be useful,
  115.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  115.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  115.15 +    GNU General Public License for more details.
  115.16 +
  115.17 +    You should have received a copy of the GNU General Public License
  115.18 +    along with this program; if not, write to the Free Software
  115.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  115.20 +*/
  115.21 +
  115.22 +#include <stdio.h>
  115.23 +#include <errno.h>
  115.24 +#include <stdlib.h>
  115.25 +#include <string.h>
  115.26 +#include <unistd.h>
  115.27 +#include <sys/types.h>
  115.28 +#include <sys/socket.h>
  115.29 +#include <sys/time.h>
  115.30 +#include <netinet/in.h>
  115.31 +#include <netdb.h>
  115.32 +#include <syslog.h>
  115.33 +#include <signal.h>
  115.34 +
  115.35 +#include <glib.h>
  115.36 +
  115.37 +#include "masqmail.h"
  115.38 +
  115.39 +/* mutually exclusive modes. Note that there is neither a 'get' mode
  115.40 +   nor a 'queue daemon' mode. These, as well as the distinction beween
  115.41 +   the two (non exclusive) daemon (queue and listen) modes are handled
  115.42 +   by flags.*/
  115.43 +typedef enum _mta_mode
  115.44 +{
  115.45 +  MODE_ACCEPT = 0, /* accept message on stdin */
  115.46 +  MODE_DAEMON,     /* run as daemon */
  115.47 +  MODE_RUNQUEUE,   /* single queue run, online or offline */
  115.48 +  MODE_GET_DAEMON, /* run as get (retrieve) daemon */
  115.49 +  MODE_SMTP,       /* accept SMTP on stdin */
  115.50 +  MODE_LIST,       /* list queue */
  115.51 +  MODE_MCMD,       /* do queue manipulation */
  115.52 +  MODE_VERSION,    /* show version */
  115.53 +  MODE_BI,         /* fake ;-) */
  115.54 +  MODE_NONE        /* to prevent default MODE_ACCEPT */    
  115.55 +}mta_mode;
  115.56 +
  115.57 +char *pidfile = NULL;
  115.58 +volatile int sigterm_in_progress = 0;
  115.59 +
  115.60 +static
  115.61 +void sigterm_handler(int sig)
  115.62 +{
  115.63 +  if(sigterm_in_progress)
  115.64 +    raise(sig);
  115.65 +  sigterm_in_progress = 1;
  115.66 +
  115.67 +  if(pidfile){
  115.68 +    uid_t uid;
  115.69 +    uid = seteuid(0);
  115.70 +    if(unlink(pidfile) != 0)
  115.71 +      logwrite(LOG_WARNING, "could not delete pid file %s: %s\n",
  115.72 +	       pidfile, strerror(errno));
  115.73 +    seteuid(uid); /* we exit anyway after this, just to be sure */
  115.74 +  }
  115.75 +
  115.76 +  signal(sig, SIG_DFL);
  115.77 +  raise(sig);
  115.78 +}
  115.79 +
  115.80 +#ifdef ENABLE_IDENT /* so far used for that only */
  115.81 +static
  115.82 +gboolean is_in_netlist(gchar *host, GList *netlist)
  115.83 +{
  115.84 +  guint hostip = inet_addr(host);
  115.85 +  struct in_addr addr;
  115.86 +
  115.87 +  addr.s_addr = hostip;
  115.88 +  if(addr.s_addr != INADDR_NONE){
  115.89 +    GList *node;
  115.90 +    foreach(netlist, node){
  115.91 +      struct in_addr *net = (struct in_addr *)(node->data);
  115.92 +      if((addr.s_addr & net->s_addr) == net->s_addr)
  115.93 +	return TRUE;
  115.94 +    }
  115.95 +  }
  115.96 +  return FALSE;
  115.97 +}
  115.98 +#endif
  115.99 +
 115.100 +gchar *get_optarg(char *argv[], gint argc, gint *argp, gint *pos)
 115.101 +{
 115.102 +  if(argv[*argp][*pos])
 115.103 +    return &(argv[*argp][*pos]);
 115.104 +  else{
 115.105 +    if(*argp+1 < argc){
 115.106 +      if(argv[(*argp)+1][0] != '-'){
 115.107 +	(*argp)++;
 115.108 +	*pos = 0;
 115.109 +	return &(argv[*argp][*pos]);
 115.110 +      }
 115.111 +    }
 115.112 +  }
 115.113 +  return NULL;
 115.114 +}  
 115.115 +
 115.116 +gchar *get_progname(gchar *arg0)
 115.117 +{
 115.118 +  gchar *p = arg0 + strlen(arg0) - 1;
 115.119 +  while(p > arg0){
 115.120 +    if(*p == '/')
 115.121 +      return p+1;
 115.122 +    p--;
 115.123 +  }
 115.124 +  return p;
 115.125 +}
 115.126 +
 115.127 +gboolean write_pidfile(gchar *name)
 115.128 +{
 115.129 +  FILE *fptr;
 115.130 +
 115.131 +  if((fptr = fopen(name, "wt"))){
 115.132 +    fprintf(fptr, "%d\n", getpid());
 115.133 +    fclose(fptr);
 115.134 +    pidfile = strdup(name);
 115.135 +    return TRUE;
 115.136 +  }
 115.137 +  logwrite(LOG_WARNING, "could not write pid file: %s\n", strerror(errno));
 115.138 +  return FALSE;
 115.139 +}
 115.140 +
 115.141 +static
 115.142 +void mode_daemon(gboolean do_listen, gint queue_interval, char *argv[])
 115.143 +{
 115.144 +  guint pid;
 115.145 +
 115.146 +  /* daemon */
 115.147 +  if(!conf.run_as_user){
 115.148 +    if((conf.orig_uid != 0) && (conf.orig_uid != conf.mail_uid)){
 115.149 +      fprintf(stderr, "must be root or %s for daemon.\n", DEF_MAIL_USER);
 115.150 +      exit(EXIT_FAILURE);
 115.151 +    }
 115.152 +  }
 115.153 +
 115.154 +  if((pid = fork()) > 0){
 115.155 +    exit(EXIT_SUCCESS);
 115.156 +  }else if(pid < 0){
 115.157 +    logwrite(LOG_ALERT, "could not fork!");
 115.158 +    exit(EXIT_FAILURE);
 115.159 +  }
 115.160 +
 115.161 +  signal(SIGTERM, sigterm_handler);
 115.162 +  write_pidfile(PIDFILEDIR"/masqmail.pid");
 115.163 +
 115.164 +  conf.do_verbose = FALSE;
 115.165 +
 115.166 +  fclose(stdin);
 115.167 +  fclose(stdout);
 115.168 +  fclose(stderr);
 115.169 +
 115.170 +  listen_port(do_listen ? conf.listen_addresses : NULL,
 115.171 +	      queue_interval, argv);
 115.172 +}
 115.173 +
 115.174 +#ifdef ENABLE_POP3
 115.175 +static
 115.176 +void mode_get_daemon(gint get_interval, char *argv[])
 115.177 +{
 115.178 +  guint pid;
 115.179 +
 115.180 +  /* daemon */
 115.181 +  if(!conf.run_as_user){
 115.182 +    if((conf.orig_uid != 0) && (conf.orig_uid != conf.mail_uid)){
 115.183 +      fprintf(stderr, "must be root or %s for daemon.\n", DEF_MAIL_USER);
 115.184 +      exit(EXIT_FAILURE);
 115.185 +    }
 115.186 +  }
 115.187 +
 115.188 +  if((pid = fork()) > 0){
 115.189 +    exit(EXIT_SUCCESS);
 115.190 +  }else if(pid < 0){
 115.191 +    logwrite(LOG_ALERT, "could not fork!");
 115.192 +    exit(EXIT_FAILURE);
 115.193 +  }
 115.194 +
 115.195 +  signal(SIGTERM, sigterm_handler);
 115.196 +  write_pidfile(PIDFILEDIR"/masqmail-get.pid");
 115.197 +
 115.198 +  conf.do_verbose = FALSE;
 115.199 +
 115.200 +  fclose(stdin);
 115.201 +  fclose(stdout);
 115.202 +  fclose(stderr);
 115.203 +
 115.204 +  get_daemon(get_interval, argv);
 115.205 +}
 115.206 +#endif
 115.207 +
 115.208 +#ifdef ENABLE_SMTP_SERVER
 115.209 +static void mode_smtp()
 115.210 +{
 115.211 +  /* accept smtp message on stdin */
 115.212 +  /* write responses to stderr. */
 115.213 +
 115.214 +  struct sockaddr_in saddr;
 115.215 +  gchar *peername = NULL;
 115.216 +  int dummy = sizeof(saddr);
 115.217 +#ifdef ENABLE_IDENT
 115.218 +  gchar *ident = NULL;
 115.219 +#endif
 115.220 +
 115.221 +  conf.do_verbose = FALSE;
 115.222 +
 115.223 +  if(!conf.run_as_user){
 115.224 +    seteuid(conf.orig_uid);
 115.225 +    setegid(conf.orig_gid);
 115.226 +  }
 115.227 +
 115.228 +  DEBUG(5) debugf("accepting smtp message on stdin\n");
 115.229 +
 115.230 +  if(getpeername(0, (struct sockaddr *)(&saddr), &dummy) == 0){
 115.231 +    peername = g_strdup(inet_ntoa(saddr.sin_addr));
 115.232 +#ifdef ENABLE_IDENT
 115.233 +    {
 115.234 +      gchar *id = NULL;
 115.235 +      if((id = (gchar *)ident_id(0, 60))){
 115.236 +	ident = g_strdup(id);
 115.237 +      }
 115.238 +    }
 115.239 +#endif
 115.240 +  }else if(errno != ENOTSOCK)
 115.241 +    exit(EXIT_FAILURE);
 115.242 +
 115.243 +  //smtp_in(stdin, stdout, peername);
 115.244 +  smtp_in(stdin, stderr, peername, NULL);
 115.245 +
 115.246 +#ifdef ENABLE_IDENT
 115.247 +  if(ident) g_free(ident);
 115.248 +#endif
 115.249 +}
 115.250 +#endif
 115.251 +
 115.252 +static void mode_accept(address *return_path, gchar *full_sender_name,
 115.253 +			guint accept_flags, char **addresses, int addr_cnt)
 115.254 +{
 115.255 +  /* accept message on stdin */
 115.256 +  accept_error err;
 115.257 +  message *msg = create_message();
 115.258 +  gint i;
 115.259 +
 115.260 +  if(return_path != NULL){
 115.261 +    if((conf.orig_uid != 0) &&
 115.262 +       (conf.orig_uid != conf.mail_uid) &&
 115.263 +       (!is_ingroup(conf.orig_uid, conf.mail_gid))){
 115.264 +      fprintf(stderr,
 115.265 +	      "must be in root, %s or in group %s for setting return path.\n",
 115.266 +	      DEF_MAIL_USER, DEF_MAIL_GROUP);
 115.267 +      exit(EXIT_FAILURE);
 115.268 +    }
 115.269 +  }
 115.270 +
 115.271 +  if(!conf.run_as_user){
 115.272 +    seteuid(conf.orig_uid);
 115.273 +    setegid(conf.orig_gid);
 115.274 +  }
 115.275 +
 115.276 +  DEBUG(5) debugf("accepting message on stdin\n");
 115.277 +
 115.278 +  msg->received_prot = PROT_LOCAL;
 115.279 +  for(i = 0; i < addr_cnt; i++){
 115.280 +    if(addresses[i][0] != '|')
 115.281 +      msg->rcpt_list =
 115.282 +	g_list_append(msg->rcpt_list,
 115.283 +		      create_address_qualified(addresses[i], TRUE, conf.host_name));
 115.284 +    else{
 115.285 +      logwrite(LOG_ALERT, "no pipe allowed as recipient address: %s\n", addresses[i]);
 115.286 +      exit(EXIT_FAILURE);
 115.287 +    }
 115.288 +  }
 115.289 +
 115.290 +  /* -f option */
 115.291 +  msg->return_path = return_path;
 115.292 +
 115.293 +  /* -F option */
 115.294 +  msg->full_sender_name = full_sender_name;
 115.295 +    
 115.296 +  if((err = accept_message(stdin, msg, accept_flags)) == AERR_OK){
 115.297 +    if(spool_write(msg, TRUE)){
 115.298 +      pid_t pid;
 115.299 +      logwrite(LOG_NOTICE, "%s <= %s with %s\n",
 115.300 +	       msg->uid, addr_string(msg->return_path),
 115.301 +	       prot_names[PROT_LOCAL]);
 115.302 +
 115.303 +      if(!conf.do_queue){
 115.304 +
 115.305 +	if((pid = fork()) == 0){
 115.306 +
 115.307 +	  conf.do_verbose = FALSE;
 115.308 +
 115.309 +	  fclose(stdin);
 115.310 +	  fclose(stdout);
 115.311 +	  fclose(stderr);
 115.312 +
 115.313 +	  if(deliver(msg)){
 115.314 +	    exit(EXIT_SUCCESS);
 115.315 +	  }else
 115.316 +	    exit(EXIT_FAILURE);
 115.317 +	}else if(pid < 0){
 115.318 +	  logwrite(LOG_ALERT, "could not fork for delivery, id = %s",
 115.319 +		   msg->uid);
 115.320 +	}
 115.321 +      }
 115.322 +    }else{
 115.323 +      fprintf(stderr, "Could not write spool file\n");
 115.324 +      exit(EXIT_FAILURE);
 115.325 +    }
 115.326 +  }else{
 115.327 +    switch(err){
 115.328 +    case AERR_EOF:
 115.329 +      fprintf(stderr, "unexpected EOF.\n");
 115.330 +      exit(EXIT_FAILURE);
 115.331 +    case AERR_NORCPT:
 115.332 +      fprintf(stderr, "no recipients.\n");
 115.333 +      exit(EXIT_FAILURE);
 115.334 +    default:
 115.335 +      /* should never happen: */
 115.336 +      fprintf(stderr, "Unknown error (%d)\r\n", err);
 115.337 +      exit(EXIT_FAILURE);
 115.338 +    }
 115.339 +    exit(EXIT_FAILURE);
 115.340 +  }
 115.341 +}
 115.342 +
 115.343 +int
 115.344 +main(int argc, char *argv[])
 115.345 +{
 115.346 +  /* cmd line flags */
 115.347 +  gchar *conf_file = CONF_FILE;
 115.348 +  gint arg = 1;
 115.349 +  gboolean do_get = FALSE;
 115.350 +  gboolean do_get_online = FALSE;
 115.351 +
 115.352 +  gboolean do_listen = FALSE;
 115.353 +  gboolean do_runq = FALSE;
 115.354 +  gboolean do_runq_online = FALSE;
 115.355 +
 115.356 +  gboolean do_queue = FALSE;
 115.357 +
 115.358 +  gboolean do_verbose = FALSE;
 115.359 +  gint debug_level = -1;
 115.360 +
 115.361 +  mta_mode mta_mode = MODE_ACCEPT;
 115.362 +
 115.363 +  gint queue_interval = 0;
 115.364 +  gint get_interval = 0;
 115.365 +  gboolean opt_t = FALSE;
 115.366 +  gboolean opt_i = FALSE;
 115.367 +  gboolean opt_odb = FALSE;
 115.368 +  gboolean opt_oem = FALSE;
 115.369 +  gboolean exit_failure = FALSE;
 115.370 +
 115.371 +  gchar *M_cmd = NULL;
 115.372 +
 115.373 +  gint exit_code = EXIT_SUCCESS;
 115.374 +  gchar *route_name = NULL;
 115.375 +  gchar *get_name = NULL;
 115.376 +  gchar *progname;
 115.377 +  gchar *f_address = NULL;
 115.378 +  gchar *full_sender_name = NULL;
 115.379 +  address *return_path = NULL; /* may be changed by -f option */
 115.380 +
 115.381 +  progname = get_progname(argv[0]);
 115.382 +
 115.383 +  if(strcmp(progname, "mailq") == 0)
 115.384 +    { mta_mode = MODE_LIST; }
 115.385 +  else if(strcmp(progname, "mailrm") == 0)
 115.386 +    { mta_mode = MODE_MCMD; M_cmd = "rm"; }
 115.387 +  else if(strcmp(progname, "runq") == 0)
 115.388 +    { mta_mode = MODE_RUNQUEUE; do_runq = TRUE; }
 115.389 +  else if(strcmp(progname, "rmail") == 0)
 115.390 +    { mta_mode = MODE_ACCEPT; opt_i = TRUE; }
 115.391 +  else if(strcmp(progname, "smtpd") == 0 || strcmp(progname, "in.smtpd") == 0)
 115.392 +    { mta_mode = MODE_SMTP; }
 115.393 +
 115.394 +  /* parse cmd line */
 115.395 +  while(arg < argc){
 115.396 +    gint pos = 0;
 115.397 +    if((argv[arg][pos] == '-') && (argv[arg][pos+1] != '-')){
 115.398 +      pos++;
 115.399 +      switch(argv[arg][pos++]){
 115.400 +      case 'b':
 115.401 +	switch(argv[arg][pos++]){
 115.402 +	case 'd':
 115.403 +	  do_listen = TRUE;
 115.404 +	  mta_mode = MODE_DAEMON;
 115.405 +	  break;
 115.406 +	case 'i':
 115.407 +	  /* ignored */
 115.408 +	  mta_mode = MODE_BI;
 115.409 +	  break;
 115.410 +	case 's':
 115.411 +	  mta_mode = MODE_SMTP;
 115.412 +	  break;
 115.413 +	case 'p':
 115.414 +	  mta_mode = MODE_LIST;
 115.415 +	  break;
 115.416 +	case 'V':
 115.417 +	  mta_mode = MODE_VERSION;
 115.418 +	  break;
 115.419 +	default:
 115.420 +	  fprintf(stderr, "unrecognized option '%s'\n", argv[arg]);
 115.421 +	  exit(EXIT_FAILURE);
 115.422 +	}
 115.423 +	break;
 115.424 +      case 'B':
 115.425 +	/* we ignore this and throw the argument away */
 115.426 +	get_optarg(argv, argc, &arg, &pos);
 115.427 +	break;
 115.428 +      case 'C':
 115.429 +	if(!(conf_file = get_optarg(argv, argc, &arg, &pos))){
 115.430 +	  fprintf(stderr, "-C requires a filename as argument.\n");
 115.431 +	  exit(EXIT_FAILURE);
 115.432 +	}
 115.433 +	break;
 115.434 +      case 'F':
 115.435 +	{
 115.436 +	  full_sender_name = get_optarg(argv, argc, &arg, &pos);
 115.437 +	  if(!full_sender_name){
 115.438 +	    fprintf(stderr, "-F requires a name as an argument\n");
 115.439 +	    exit(EXIT_FAILURE);
 115.440 +	  }
 115.441 +	}
 115.442 +	break;
 115.443 +      case 'd':
 115.444 +	if(getuid() == 0){
 115.445 +	  char *lvl = get_optarg(argv, argc, &arg, &pos);
 115.446 +	  if(lvl)
 115.447 +	    debug_level = atoi(lvl);
 115.448 +	  else{
 115.449 +	    fprintf(stderr, "-d requires a number as an argument.\n");
 115.450 +	    exit(EXIT_FAILURE);
 115.451 +	  }
 115.452 +	}else{
 115.453 +	  fprintf(stderr, "only root may set the debug level.\n");
 115.454 +	  exit(EXIT_FAILURE);
 115.455 +	}
 115.456 +	break;
 115.457 +      case 'f':
 115.458 +	/* set return path */
 115.459 +	{
 115.460 +	  gchar *address;
 115.461 +	  address = get_optarg(argv, argc, &arg, &pos);
 115.462 +	  if(address){
 115.463 +	    f_address = g_strdup(address);
 115.464 +	  }else{
 115.465 +	    fprintf(stderr, "-f requires an address as an argument\n");
 115.466 +	    exit(EXIT_FAILURE);
 115.467 +	  }
 115.468 +	}
 115.469 +	break;
 115.470 +      case 'g':
 115.471 +	do_get = TRUE;
 115.472 +	if(!mta_mode) mta_mode = MODE_NONE; /* to prevent default MODE_ACCEPT */
 115.473 +	if(argv[arg][pos] == 'o'){
 115.474 +	  pos++;
 115.475 +	  do_get_online = TRUE;
 115.476 +	  /* can be NULL, then we use online detection method */
 115.477 +	  route_name = get_optarg(argv, argc, &arg, &pos);
 115.478 +
 115.479 +	  if(route_name != NULL){
 115.480 +	    if(isdigit(route_name[0])){
 115.481 +	      get_interval = time_interval(route_name, &pos);
 115.482 +	      route_name = get_optarg(argv, argc, &arg, &pos);
 115.483 +	      mta_mode = MODE_GET_DAEMON;
 115.484 +	      do_get = FALSE;
 115.485 +	    }
 115.486 +	  }
 115.487 +	}else{
 115.488 +	  if((optarg = get_optarg(argv, argc, &arg, &pos))){
 115.489 +	    get_name = get_optarg(argv, argc, &arg, &pos);
 115.490 +	  }
 115.491 +	}
 115.492 +	break;
 115.493 +      case 'i':
 115.494 +	if(argv[arg][pos] == 0){
 115.495 +	  opt_i = TRUE;
 115.496 +	  exit_failure = FALSE; /* may override -oem */
 115.497 +	}else{
 115.498 +	  fprintf(stderr, "unrecognized option '%s'\n", argv[arg]);
 115.499 +	  exit(EXIT_FAILURE);
 115.500 +	}
 115.501 +	break;
 115.502 +      case 'M':
 115.503 +	{
 115.504 +	  mta_mode = MODE_MCMD;
 115.505 +	  M_cmd = g_strdup(&(argv[arg][pos]));
 115.506 +	}
 115.507 +	break;
 115.508 +      case 'o':
 115.509 +	switch(argv[arg][pos++]){
 115.510 +	case 'e':
 115.511 +	  if(argv[arg][pos++] == 'm') /* -oem */
 115.512 +	    if(!opt_i) exit_failure = TRUE;
 115.513 +	    opt_oem = TRUE;
 115.514 +	  break;
 115.515 +	case 'd':
 115.516 +	  if(argv[arg][pos] == 'b') /* -odb */
 115.517 +	    opt_odb = TRUE;
 115.518 +	  else if(argv[arg][pos] == 'q') /* -odq */
 115.519 +	    do_queue = TRUE;
 115.520 +	  break;
 115.521 +	case 'i':
 115.522 +	  opt_i = TRUE;
 115.523 +	  exit_failure = FALSE; /* may override -oem */
 115.524 +	  break;
 115.525 +	}
 115.526 +	break;
 115.527 +
 115.528 +      case 'q':
 115.529 +	{
 115.530 +	  gchar *optarg;
 115.531 +
 115.532 +	  do_runq = TRUE;
 115.533 +	  mta_mode = MODE_RUNQUEUE;
 115.534 +	  if(argv[arg][pos] == 'o'){
 115.535 +	    pos++;
 115.536 +	    do_runq = FALSE;
 115.537 +	    do_runq_online = TRUE;
 115.538 +	    /* can be NULL, then we use online detection method */
 115.539 +	    route_name = get_optarg(argv, argc, &arg, &pos);
 115.540 +	  }else if((optarg = get_optarg(argv, argc, &arg, &pos))){
 115.541 +	    mta_mode = MODE_DAEMON;
 115.542 +	    queue_interval = time_interval(optarg, &pos);
 115.543 +	  }
 115.544 +	}
 115.545 +	break;
 115.546 +      case 't':
 115.547 +	if(argv[arg][pos] == 0){
 115.548 +	  opt_t = TRUE;
 115.549 +	}else{
 115.550 +	  fprintf(stderr, "unrecognized option '%s'\n", argv[arg]);
 115.551 +	  exit(EXIT_FAILURE);
 115.552 +	}
 115.553 +	break;
 115.554 +      case 'v':
 115.555 +	do_verbose = TRUE;
 115.556 +	break;
 115.557 +      default:
 115.558 +	fprintf(stderr, "unrecognized option '%s'\n", argv[arg]);
 115.559 +	exit(EXIT_FAILURE);
 115.560 +      }
 115.561 +    }else{
 115.562 +      if(argv[arg][pos+1] == '-'){
 115.563 +        if(argv[arg][pos+2] != '\0'){
 115.564 +	  fprintf(stderr, "unrecognized option '%s'\n", argv[arg]);
 115.565 +	  exit(EXIT_FAILURE);
 115.566 +        }
 115.567 +	arg++;
 115.568 +      }
 115.569 +      break;
 115.570 +    }
 115.571 +    arg++;
 115.572 +  }
 115.573 +
 115.574 +  if(mta_mode == MODE_VERSION){
 115.575 +    gchar *with_resolver = "", *with_smtp_server = "", *with_pop3 = "", *with_auth = "", 
 115.576 +      *with_maildir = "", *with_ident = "", *with_mserver = "";
 115.577 +    
 115.578 +#ifdef ENABLE_RESOLVER
 115.579 +    with_resolver = " +resolver";
 115.580 +#endif
 115.581 +#ifdef ENABLE_SMTP_SERVER
 115.582 +    with_smtp_server = " +smtp-server";
 115.583 +#endif
 115.584 +#ifdef ENABLE_POP3
 115.585 +    with_pop3 = " +pop3";
 115.586 +#endif
 115.587 +#ifdef ENABLE_AUTH
 115.588 +    with_auth = " +auth";
 115.589 +#endif
 115.590 +#ifdef ENABLE_MAILDIR
 115.591 +    with_maildir = " +maildir";
 115.592 +#endif
 115.593 +#ifdef ENABLE_IDENT
 115.594 +    with_ident = " +ident";
 115.595 +#endif
 115.596 +#ifdef ENABLE_MSERVER
 115.597 +    with_mserver = " +mserver";
 115.598 +#endif
 115.599 +
 115.600 +    printf("%s %s%s%s%s%s%s%s%s\n", PACKAGE, VERSION,
 115.601 +	   with_resolver, with_smtp_server, with_pop3, with_auth,
 115.602 +	   with_maildir, with_ident, with_mserver);
 115.603 +      
 115.604 +    exit(EXIT_SUCCESS);
 115.605 +  }
 115.606 +
 115.607 +  /* initialize random generator */
 115.608 +  srand(time(NULL));
 115.609 +  /* ignore SIGPIPE signal */
 115.610 +  signal(SIGPIPE, SIG_IGN);
 115.611 +
 115.612 +  /* close all possibly open file descriptors */
 115.613 +  {
 115.614 +    int i, max_fd = sysconf(_SC_OPEN_MAX);
 115.615 +
 115.616 +    if(max_fd <= 0) max_fd = 64;
 115.617 +    for(i = 3; i < max_fd; i++)
 115.618 +      close(i);
 115.619 +  }
 115.620 +
 115.621 +  init_conf();
 115.622 +
 115.623 +  /* if we are not privileged, and the config file was changed we
 115.624 +     implicetely set the the run_as_user flag and give up all
 115.625 +     privileges.
 115.626 +
 115.627 +     So it is possible for a user to run his own daemon without
 115.628 +     breaking security.
 115.629 +  */
 115.630 +  if(strcmp(conf_file, CONF_FILE) != 0){
 115.631 +    if(conf.orig_uid != 0){
 115.632 +      conf.run_as_user = TRUE;
 115.633 +      seteuid(conf.orig_uid);
 115.634 +      setegid(conf.orig_gid);
 115.635 +      setuid(conf.orig_uid);
 115.636 +      setgid(conf.orig_gid);
 115.637 +    }
 115.638 +  }
 115.639 +
 115.640 +  read_conf(conf_file);
 115.641 +
 115.642 +  if(do_queue) conf.do_queue = TRUE;
 115.643 +  if(do_verbose) conf.do_verbose = TRUE;
 115.644 +  if(debug_level >= 0) /* if >= 0, it was given by argument */
 115.645 +    conf.debug_level = debug_level;
 115.646 +
 115.647 +  chdir("/");
 115.648 +
 115.649 +  if(!conf.run_as_user){
 115.650 +    if(setgid(0) != 0){
 115.651 +      fprintf(stderr,
 115.652 +	      "could not set gid to 0. Is the setuid bit set? : %s\n",
 115.653 +	      strerror(errno));
 115.654 +      exit(EXIT_FAILURE);
 115.655 +    }
 115.656 +    if(setuid(0) != 0){
 115.657 +      fprintf(stderr,
 115.658 +	      "could not gain root privileges. Is the setuid bit set? : %s\n",
 115.659 +	      strerror(errno));
 115.660 +      exit(EXIT_FAILURE);
 115.661 +    }
 115.662 +  }
 115.663 +
 115.664 +  if(!logopen()){
 115.665 +    fprintf(stderr, "could not open log file\n");
 115.666 +    exit(EXIT_FAILURE);
 115.667 +  }
 115.668 +
 115.669 +  DEBUG(1) debugf("masqmail %s starting\n", VERSION);
 115.670 +
 115.671 +  DEBUG(5){
 115.672 +    gchar **str = argv;
 115.673 +    debugf("args: \n");
 115.674 +    while(*str){
 115.675 +      debugf("%s \n", *str);
 115.676 +      str++;
 115.677 +    }
 115.678 +  }
 115.679 +  DEBUG(5) debugf("queue_interval = %d\n", queue_interval);
 115.680 +
 115.681 +  if(f_address){
 115.682 +    return_path = create_address_qualified(f_address, TRUE, conf.host_name);
 115.683 +    g_free(f_address);
 115.684 +    if(!return_path){
 115.685 +      fprintf(stderr, "invalid RFC821 address: %s\n", f_address);
 115.686 +      exit(EXIT_FAILURE);
 115.687 +    }
 115.688 +  }
 115.689 +
 115.690 +  if(do_get){
 115.691 +#ifdef ENABLE_POP3
 115.692 +    if((mta_mode == MODE_NONE) || (mta_mode == MODE_RUNQUEUE)){
 115.693 +
 115.694 +      set_identity(conf.orig_uid, "getting mail");
 115.695 +
 115.696 +      if(do_get_online){
 115.697 +	if(route_name != NULL){
 115.698 +	  conf.online_detect = g_strdup("argument");
 115.699 +	  set_online_name(route_name);
 115.700 +	}
 115.701 +	get_online();
 115.702 +      }else{
 115.703 +	if(get_name)
 115.704 +	  get_from_name(get_name);
 115.705 +	else
 115.706 +	  get_all();
 115.707 +      }
 115.708 +    }else{
 115.709 +      logwrite(LOG_ALERT, "get (-g) only allowed alone or together with queue run (-q)\n");
 115.710 +    }
 115.711 +#else
 115.712 +    fprintf(stderr, "get (pop) support not compiled in\n");
 115.713 +#endif
 115.714 +  }
 115.715 +
 115.716 +  switch(mta_mode){
 115.717 +  case MODE_DAEMON:
 115.718 +    mode_daemon(do_listen, queue_interval, argv);
 115.719 +    break;
 115.720 +  case MODE_RUNQUEUE:
 115.721 +    {
 115.722 +      /* queue runs */
 115.723 +      set_identity(conf.orig_uid, "queue run");
 115.724 +
 115.725 +      if(do_runq)
 115.726 +	exit_code = queue_run() ? EXIT_SUCCESS : EXIT_FAILURE;
 115.727 +
 115.728 +      if(do_runq_online){
 115.729 +	if(route_name != NULL){
 115.730 +	  conf.online_detect = g_strdup("argument");
 115.731 +	  set_online_name(route_name);
 115.732 +	}
 115.733 +	exit_code = queue_run_online() ? EXIT_SUCCESS : EXIT_FAILURE;
 115.734 +      }
 115.735 +    }
 115.736 +    break;
 115.737 +  case MODE_GET_DAEMON:
 115.738 +#ifdef ENABLE_POP3
 115.739 +    if(route_name != NULL){
 115.740 +      conf.online_detect = g_strdup("argument");
 115.741 +      set_online_name(route_name);
 115.742 +    }
 115.743 +    mode_get_daemon(get_interval, argv);
 115.744 +#endif
 115.745 +    break;
 115.746 +
 115.747 +  case MODE_SMTP:
 115.748 +#ifdef ENABLE_SMTP_SERVER
 115.749 +    mode_smtp();
 115.750 +#else
 115.751 +    fprintf(stderr, "smtp server support not compiled in\n");
 115.752 +#endif
 115.753 +    break;
 115.754 +  case MODE_LIST:
 115.755 +
 115.756 +    queue_list();
 115.757 +    break;
 115.758 +
 115.759 +  case MODE_BI:
 115.760 +    
 115.761 +    exit(EXIT_SUCCESS);
 115.762 +    break; /* well... */
 115.763 +    
 115.764 +  case MODE_MCMD:
 115.765 +    if(strcmp(M_cmd, "rm") == 0){
 115.766 +      gboolean ok = FALSE;
 115.767 +
 115.768 +      set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL);
 115.769 +
 115.770 +      if(is_privileged_user(conf.orig_uid)){
 115.771 +	for(; arg < argc; arg++){
 115.772 +	  if(queue_delete(argv[arg]))
 115.773 +	    ok = TRUE;
 115.774 +	}
 115.775 +      }else{
 115.776 +	struct passwd *pw = getpwuid(conf.orig_uid);
 115.777 +	if(pw){
 115.778 +	  for(; arg < argc; arg++){
 115.779 +	    message *msg = msg_spool_read(argv[arg], FALSE);
 115.780 +#ifdef ENABLE_IDENT
 115.781 +	    if(((msg->received_host == NULL) && (msg->received_prot == PROT_LOCAL)) ||
 115.782 +	       is_in_netlist(msg->received_host, conf.ident_trusted_nets)){
 115.783 +#else
 115.784 +	      if((msg->received_host == NULL) && (msg->received_prot == PROT_LOCAL)){
 115.785 +#endif
 115.786 +	      if(msg->ident){
 115.787 +		if(strcmp(pw->pw_name, msg->ident) == 0){
 115.788 +		  if(queue_delete(argv[arg]))
 115.789 +		    ok = TRUE;
 115.790 +		}else{
 115.791 +		  fprintf(stderr, "you do not own message id %s\n", argv[arg]);
 115.792 +		}
 115.793 +	      }else
 115.794 +		fprintf(stderr, "message %s does not have an ident.\n", argv[arg]);
 115.795 +	    }else{
 115.796 +	      fprintf(stderr, "message %s was not received locally or from a trusted network.\n", argv[arg]);
 115.797 +	    }
 115.798 +	  }
 115.799 +	}else{
 115.800 +	  fprintf(stderr, "could not find a passwd entry for uid %d: %s\n", conf.orig_uid, strerror(errno));
 115.801 +	}
 115.802 +      }
 115.803 +      exit(ok ? EXIT_SUCCESS : EXIT_FAILURE);
 115.804 +    }else{
 115.805 +      fprintf(stderr, "unknown command %s\n", M_cmd);
 115.806 +      exit(EXIT_FAILURE);
 115.807 +    }
 115.808 +    break;
 115.809 +
 115.810 +    case MODE_ACCEPT:
 115.811 +    {
 115.812 +      guint accept_flags =
 115.813 +	(opt_t ? ACC_DEL_RCPTS|ACC_DEL_BCC|ACC_RCPT_FROM_HEAD : ACC_HEAD_FROM_RCPT) |
 115.814 +	(opt_i ? ACC_NODOT_TERM : ACC_NODOT_RELAX);
 115.815 +    
 115.816 +      mode_accept(return_path, full_sender_name, accept_flags, &(argv[arg]), argc - arg);
 115.817 +
 115.818 +      exit(exit_failure ? EXIT_FAILURE : EXIT_SUCCESS);
 115.819 +    }
 115.820 +    break;
 115.821 +  case MODE_NONE:
 115.822 +      break;
 115.823 +  default:
 115.824 +      fprintf(stderr, "unknown mode: %d\n", mta_mode);
 115.825 +      break;
 115.826 +    }
 115.827 +    
 115.828 +  logclose();
 115.829 +
 115.830 +  exit(exit_code);
 115.831 +}
   116.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.2 +++ b/src/masqmail.h	Fri Sep 26 17:05:23 2008 +0200
   116.3 @@ -0,0 +1,656 @@
   116.4 +/*  MasqMail
   116.5 +    Copyright (C) 1999-2001 Oliver Kurth
   116.6 +
   116.7 +    This program is free software; you can redistribute it and/or modify
   116.8 +    it under the terms of the GNU General Public License as published by
   116.9 +    the Free Software Foundation; either version 2 of the License, or
  116.10 +    (at your option) any later version.
  116.11 +
  116.12 +    This program is distributed in the hope that it will be useful,
  116.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  116.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  116.15 +    GNU General Public License for more details.
  116.16 +
  116.17 +    You should have received a copy of the GNU General Public License
  116.18 +    along with this program; if not, write to the Free Software
  116.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  116.20 +*/
  116.21 +#include <config.h>
  116.22 +
  116.23 +#include <stdio.h>
  116.24 +#include <stdarg.h>
  116.25 +#include <errno.h>
  116.26 +#include <stdlib.h>
  116.27 +#include <string.h>
  116.28 +#include <ctype.h>
  116.29 +#include <unistd.h>
  116.30 +#include <pwd.h>
  116.31 +#include <sys/types.h>
  116.32 +#include <sys/socket.h>
  116.33 +#include <netinet/in.h>
  116.34 +#include <time.h>
  116.35 +#include <sys/time.h>
  116.36 +#include <netinet/in.h>
  116.37 +#include <arpa/inet.h>
  116.38 +#include <netdb.h>
  116.39 +#include <syslog.h>
  116.40 +#include <signal.h>
  116.41 +#include <fcntl.h>
  116.42 +
  116.43 +#include <glib.h>
  116.44 +
  116.45 +#ifdef ENABLE_IDENT
  116.46 +#include "libident/ident.h"
  116.47 +#endif
  116.48 +
  116.49 +#include "lookup.h"
  116.50 +
  116.51 +typedef
  116.52 +struct _interface
  116.53 +{
  116.54 +  gchar *address;
  116.55 +  gint port;
  116.56 +} interface;
  116.57 +
  116.58 +#define ADDR_FLAG_DELIVERED 0x01
  116.59 +#define ADDR_FLAG_DEFERED 0x02
  116.60 +#define ADDR_FLAG_FAILED 0x04
  116.61 +#define ADDR_FLAG_LAST_ROUTE 0x40
  116.62 +#define ADDR_FLAG_NOEXPAND 0x80
  116.63 +
  116.64 +typedef struct _address
  116.65 +{
  116.66 +  gchar *address;
  116.67 +  gchar *local_part;
  116.68 +  gchar *domain;
  116.69 +  gint flags;
  116.70 +  GList *children;
  116.71 +  struct _address *parent;
  116.72 +} address;
  116.73 +
  116.74 +#define addr_mark_delivered(addr) { addr->flags |= ADDR_FLAG_DELIVERED; }
  116.75 +#define addr_unmark_delivered(addr) { addr->flags &= ~ADDR_FLAG_DELIVERED; }
  116.76 +#define addr_is_delivered(addr) ((addr->flags & ADDR_FLAG_DELIVERED) != 0 )
  116.77 +
  116.78 +#define addr_mark_defered(addr) { addr->flags |= ADDR_FLAG_DEFERED; }
  116.79 +#define addr_unmark_defered(addr) { addr->flags &= ~ADDR_FLAG_DEFERED; }
  116.80 +#define addr_is_defered(addr) ((addr->flags & ADDR_FLAG_DEFERED) != 0 )
  116.81 +
  116.82 +#define addr_mark_failed(addr) { addr->flags |= ADDR_FLAG_FAILED; }
  116.83 +#define addr_unmark_failed(addr) { addr->flags &= ~ADDR_FLAG_FAILED; }
  116.84 +#define addr_is_failed(addr) ((addr->flags & ADDR_FLAG_FAILED) != 0 )
  116.85 +
  116.86 +typedef
  116.87 +struct _connect_route
  116.88 +{
  116.89 +  gchar *name;
  116.90 +  gchar *filename;
  116.91 +
  116.92 +  gchar *protocol;
  116.93 +
  116.94 +  gboolean is_local_net;
  116.95 +  gboolean last_route;
  116.96 +
  116.97 +  GList *allowed_return_paths;
  116.98 +  GList *not_allowed_return_paths;
  116.99 +  GList *allowed_mail_locals;
 116.100 +  GList *not_allowed_mail_locals;
 116.101 +  GList *allowed_rcpt_domains;
 116.102 +  GList *not_allowed_rcpt_domains;
 116.103 +
 116.104 +  interface *mail_host;
 116.105 +  gchar *wrapper;
 116.106 +  gboolean connect_error_fail;
 116.107 +
 116.108 +  gchar *helo_name;
 116.109 +  gboolean do_correct_helo;
 116.110 +  gboolean do_pipelining;
 116.111 +
 116.112 +  gchar *set_h_from_domain;
 116.113 +  gchar *set_h_reply_to_domain;
 116.114 +  gchar *set_return_path_domain;
 116.115 +
 116.116 +  GList *map_h_from_addresses;
 116.117 +  GList *map_h_reply_to_addresses;
 116.118 +  GList *map_h_mail_followup_to_addresses;
 116.119 +  GList *map_return_path_addresses;
 116.120 +
 116.121 +  gboolean expand_h_sender_domain;
 116.122 +  gboolean expand_h_sender_address;
 116.123 +
 116.124 +  GList *resolve_list;
 116.125 +
 116.126 +  gchar *auth_name;
 116.127 +  gchar *auth_login;
 116.128 +  gchar *auth_secret;
 116.129 +
 116.130 +  gchar *pop3_login;
 116.131 +
 116.132 +  gchar *pipe;
 116.133 +  
 116.134 +  gboolean pipe_fromline;
 116.135 +  gboolean pipe_fromhack;
 116.136 +} connect_route;
 116.137 +
 116.138 +typedef struct _get_conf
 116.139 +{
 116.140 +  gchar *protocol;
 116.141 +  gchar *server_name;
 116.142 +  guint server_port;
 116.143 +  gchar *wrapper;
 116.144 +  gchar *login_user;
 116.145 +  gchar *login_pass;
 116.146 +  address *address;
 116.147 +  address *return_path;
 116.148 +  gboolean do_keep;
 116.149 +  gboolean do_uidl;
 116.150 +  gboolean do_uidl_dele;
 116.151 +  gint max_size;
 116.152 +  gboolean max_size_delete;
 116.153 +  gint max_count;
 116.154 +
 116.155 +  GList *resolve_list;
 116.156 +
 116.157 +} get_conf;
 116.158 +
 116.159 +typedef
 116.160 +struct _masqmail_conf
 116.161 +{
 116.162 +  gint mail_uid;
 116.163 +  gint mail_gid;
 116.164 +
 116.165 +  gint orig_uid;
 116.166 +  gint orig_gid;
 116.167 +
 116.168 +  gboolean run_as_user;
 116.169 +
 116.170 +  gchar *mail_dir;
 116.171 +  gchar *lock_dir;
 116.172 +  gchar *spool_dir;
 116.173 +  gchar *log_dir;
 116.174 +
 116.175 +  gint debug_level;
 116.176 +  gboolean use_syslog;
 116.177 +  guint log_max_pri;
 116.178 +
 116.179 +  gchar *host_name;
 116.180 +  GList *local_hosts;
 116.181 +  GList *local_addresses;
 116.182 +  GList *not_local_addresses;
 116.183 +  GList *local_nets;
 116.184 +  GList *listen_addresses;
 116.185 +
 116.186 +  guint remote_port;
 116.187 +
 116.188 +  gboolean do_save_envelope_to;
 116.189 +
 116.190 +  gboolean defer_all;
 116.191 +  gboolean do_relay;
 116.192 +
 116.193 +  GList *ident_trusted_nets;
 116.194 +
 116.195 +  gboolean do_queue;
 116.196 +
 116.197 +  gboolean do_verbose;
 116.198 +
 116.199 +  gchar *mbox_default;
 116.200 +  GList *mbox_users;
 116.201 +  GList *mda_users;
 116.202 +  GList *maildir_users;
 116.203 +
 116.204 +  gchar *mda;
 116.205 +  gboolean mda_fromline;
 116.206 +  gboolean mda_fromhack;
 116.207 +
 116.208 +  gboolean pipe_fromline;
 116.209 +  gboolean pipe_fromhack;
 116.210 +
 116.211 +  gchar *alias_file;
 116.212 +  int (*alias_local_cmp)(const char *, const char *);
 116.213 +
 116.214 +  GList *local_net_routes;
 116.215 +  GList *connect_routes; /* list of pairs which point to lists */
 116.216 +
 116.217 +  gchar *online_detect;
 116.218 +  gchar *online_file;
 116.219 +  gchar *online_pipe;
 116.220 +  interface *mserver_iface;
 116.221 +
 116.222 +  GList *get_names;
 116.223 +  GList *online_gets; /* list of pairs which point to lists */
 116.224 +
 116.225 +  gchar *errmsg_file;
 116.226 +  gchar *warnmsg_file;
 116.227 +  GList *warn_intervals;
 116.228 +  gint max_defer_time;
 116.229 +
 116.230 +  gchar *log_user;
 116.231 +} masqmail_conf;
 116.232 +
 116.233 +extern masqmail_conf conf;
 116.234 +
 116.235 +typedef
 116.236 +struct _table_pair
 116.237 +{
 116.238 +  gchar *key;
 116.239 +  gpointer *value;
 116.240 +} table_pair;
 116.241 +
 116.242 +
 116.243 +typedef
 116.244 +enum _prot_id
 116.245 +{
 116.246 +  PROT_LOCAL = 0,
 116.247 +  PROT_BSMTP,
 116.248 +  PROT_SMTP,
 116.249 +  PROT_ESMTP,
 116.250 +  PROT_POP3,
 116.251 +  PROT_APOP,
 116.252 +  PROT_NUM
 116.253 +}prot_id;
 116.254 +
 116.255 +extern gchar *prot_names[];
 116.256 +
 116.257 +typedef
 116.258 +enum _header_id
 116.259 +{
 116.260 +  HEAD_FROM = 0,
 116.261 +  HEAD_SENDER,
 116.262 +  HEAD_TO,
 116.263 +  HEAD_CC,
 116.264 +  HEAD_BCC,
 116.265 +  HEAD_DATE,
 116.266 +  HEAD_MESSAGE_ID,
 116.267 +  HEAD_REPLY_TO,
 116.268 +  HEAD_SUBJECT,
 116.269 +  HEAD_RETURN_PATH,
 116.270 +  HEAD_ENVELOPE_TO,
 116.271 +  HEAD_RECEIVED,
 116.272 +  HEAD_NUM_IDS,
 116.273 +  HEAD_STATUS,
 116.274 +  HEAD_UNKNOWN = HEAD_NUM_IDS,
 116.275 +  HEAD_NONE = -1,
 116.276 +}header_id;
 116.277 +
 116.278 +typedef
 116.279 +struct _header_name
 116.280 +{
 116.281 +  gchar *header;
 116.282 +  header_id id;
 116.283 +}header_name;
 116.284 +
 116.285 +typedef
 116.286 +struct _header
 116.287 +{
 116.288 +  header_id id;
 116.289 +  gchar *header;
 116.290 +  gchar *value;
 116.291 +}header;
 116.292 +
 116.293 +
 116.294 +typedef
 116.295 +struct _message
 116.296 +{
 116.297 +  gchar *uid;
 116.298 +
 116.299 +  gchar *received_host;
 116.300 +  prot_id received_prot;
 116.301 +  gchar *ident;
 116.302 +  gint transfer_id; /* for multiple messages per transfer */
 116.303 +
 116.304 +  address *return_path;
 116.305 +  GList *rcpt_list;
 116.306 +  GList *non_rcpt_list;
 116.307 +
 116.308 +  GList *hdr_list;
 116.309 +  GList *data_list;
 116.310 +
 116.311 +  gint data_size;
 116.312 +  time_t received_time;
 116.313 +  time_t warned_time;
 116.314 +
 116.315 +  gchar *full_sender_name;
 116.316 +}message;
 116.317 +
 116.318 +typedef
 116.319 +struct _msg_out
 116.320 +{
 116.321 +  message *msg;
 116.322 +  
 116.323 +  address *return_path;
 116.324 +  GList *rcpt_list;
 116.325 +
 116.326 +  GList *hdr_list;
 116.327 +  GList *xtra_hdr_list;
 116.328 +}msg_out;
 116.329 +
 116.330 +typedef
 116.331 +struct _msgout_perhost
 116.332 +{
 116.333 +  gchar *host;
 116.334 +  GList *msgout_list;
 116.335 +} msgout_perhost;
 116.336 +
 116.337 +/* flags for accept() */
 116.338 +/*#define ACC_LOCAL      0x01 (we better use received_host == NULL) */
 116.339 +#define ACC_HEAD_FROM_RCPT 0x01 /* create To: Header from rcpt_list (cmd line) */
 116.340 +#define ACC_DEL_RCPTS      0x02 /* -t option, delete rcpts */
 116.341 +#define ACC_DEL_BCC        0x04 /* -t option, delete Bcc header */
 116.342 +#define ACC_RCPT_FROM_HEAD 0x08 /* -t option, get rcpts from headers */
 116.343 +#define ACC_NODOT_TERM     0x10 /* a dot on a line itself does not end
 116.344 +				   the message (-oi option) */
 116.345 +#define ACC_NO_RECVD_HDR   0x20 /* do not create a Received: header */
 116.346 +#define ACC_MAIL_FROM_HEAD 0x40 /* get return path from header */
 116.347 +#define ACC_NODOT_RELAX    0x80 /* do not be picky if message ist not terminated by a dot on a line */
 116.348 +#define ACC_SAVE_ENVELOPE_TO 0x0100 /* save an existent Envelope-to header as X-Orig-Envelope-to */
 116.349 +
 116.350 +#define DLVR_LOCAL 0x01
 116.351 +#define DLVR_LAN 0x02
 116.352 +#define DLVR_ONLINE 0x04
 116.353 +#define DLVR_ALL (DLVR_LOCAL|DLVR_LAN|DLVR_ONLINE)
 116.354 +
 116.355 +/* transport flags */
 116.356 +#define MSGSTR_FROMLINE 0x01
 116.357 +#define MSGSTR_FROMHACK 0x02
 116.358 +
 116.359 +typedef
 116.360 +enum _accept_error
 116.361 +{
 116.362 +  AERR_OK = 0,
 116.363 +  AERR_TIMEOUT,
 116.364 +  AERR_EOF,
 116.365 +  AERR_OVERFLOW,
 116.366 +  AERR_SYNTAX,
 116.367 +  AERR_NOSPOOL,
 116.368 +  AERR_NORCPT,
 116.369 +  AERR_UNKNOWN
 116.370 +}accept_error;
 116.371 +
 116.372 +#define BUF_LEN 1024
 116.373 +#define MAX_ADDRESS 256
 116.374 +#define MAX_DATALINE 4096
 116.375 +
 116.376 +typedef
 116.377 +enum _smtp_cmd_id
 116.378 +{
 116.379 +  SMTP_HELO = 0,
 116.380 +  SMTP_EHLO,
 116.381 +  SMTP_MAIL_FROM,
 116.382 +  SMTP_RCPT_TO,
 116.383 +  SMTP_DATA,
 116.384 +  SMTP_QUIT,
 116.385 +  SMTP_RSET,
 116.386 +  SMTP_NOOP,
 116.387 +  SMTP_HELP,
 116.388 +  SMTP_NUM_IDS,
 116.389 +  SMTP_EOF = -1,
 116.390 +  SMTP_ERROR = -2,
 116.391 +} smtp_cmd_id;
 116.392 +
 116.393 +typedef
 116.394 +struct _smtp_cmd
 116.395 +{
 116.396 +  smtp_cmd_id id;
 116.397 +  gchar *cmd;
 116.398 +} smtp_cmd;
 116.399 +
 116.400 +typedef
 116.401 +struct _smtp_connection
 116.402 +{
 116.403 +  gchar *remote_host;
 116.404 +
 116.405 +  prot_id prot;
 116.406 +  gint next_id;
 116.407 +  
 116.408 +  gboolean helo_seen;
 116.409 +  gboolean from_seen;
 116.410 +  gboolean rcpt_seen;
 116.411 +
 116.412 +  message *msg;
 116.413 +}smtp_connection;
 116.414 +
 116.415 +/* alias.c*/
 116.416 +gboolean addr_is_local(address *addr);
 116.417 +GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list);
 116.418 +
 116.419 +/* child.c */
 116.420 +int child(const char *command);
 116.421 +
 116.422 +/* conf.c */
 116.423 +void init_conf();
 116.424 +gboolean read_conf(gchar *filename);
 116.425 +connect_route *read_route(gchar *filename, gboolean is_local_net);
 116.426 +GList *read_route_list(GList *rf_list, gboolean is_local_net);
 116.427 +void destroy_route(connect_route *r);
 116.428 +void destroy_route_list(GList *list);
 116.429 +get_conf *read_get_conf(gchar *filename);
 116.430 +void destroy_get_conf(get_conf *gc);
 116.431 +connect_route *create_local_route();
 116.432 +
 116.433 +/* expand.c */
 116.434 +GList *var_table_rcpt(GList *var_table, address *rcpt);
 116.435 +GList *var_table_msg(GList *var_table, message *msg);
 116.436 +GList *var_table_conf(GList *var_table);
 116.437 +gint expand(GList *var_list, gchar *format, gchar *result, gint result_len);
 116.438 +
 116.439 +/* message.c */
 116.440 +message *create_message(void);
 116.441 +void destroy_message(message *msg);
 116.442 +void destroy_msg_list(GList *msg_list);
 116.443 +void msg_free_data(message *msg);
 116.444 +gint msg_calc_size(message *msg, gboolean is_smtp);
 116.445 +
 116.446 +msg_out *create_msg_out(message *msg);
 116.447 +msg_out *clone_msg_out(msg_out *msgout_orig);
 116.448 +GList *create_msg_out_list(GList *msg_list);
 116.449 +void destroy_msg_out(msg_out *msgout);
 116.450 +void destroy_msg_out_list(GList *msgout_list);
 116.451 +
 116.452 +/* address.c */
 116.453 +address *create_address(gchar *path, gboolean is_rfc821);
 116.454 +address *create_address_qualified(gchar *path, gboolean is_rfc821,
 116.455 +				  gchar *domain);
 116.456 +address *create_address_pipe(gchar *path);
 116.457 +void destroy_address(address *addr);
 116.458 +address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom);
 116.459 +#define copy_address(addr) copy_modify_address(addr, NULL, NULL)
 116.460 +gboolean addr_isequal(address *addr1, address *addr2);
 116.461 +gboolean addr_isequal_parent(address *addr1, address *addr2);
 116.462 +address *addr_find_ancestor(address *addr);
 116.463 +gboolean addr_is_delivered_children(address *addr);
 116.464 +gboolean addr_is_finished_children(address *addr);
 116.465 +gchar *addr_string(address *addr);
 116.466 +gint addr_match(address *addr1, address *addr2);
 116.467 +
 116.468 +/* accept.c */
 116.469 +accept_error accept_message(FILE *in, message *msg,
 116.470 +			    guint flags);
 116.471 +accept_error accept_message_prepare(message *msg, guint flags);
 116.472 +
 116.473 +/* header.c */
 116.474 +gchar *rec_timestamp();
 116.475 +GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str);
 116.476 +void header_unfold(header *hdr);
 116.477 +void header_fold(header *hdr);
 116.478 +header *create_header(header_id id, gchar *fmt, ...);
 116.479 +void destroy_header(header *hdr);
 116.480 +header *copy_header(header *hdr);
 116.481 +header *get_header(gchar *line);
 116.482 +
 116.483 +/* smtp_in.c */
 116.484 +void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident);
 116.485 +
 116.486 +/* listen.c */
 116.487 +void listen_port(GList *addr_list, gint qival, char *argv[]);
 116.488 +
 116.489 +/* parse.c */
 116.490 +gboolean split_address(const gchar *path, gchar **local_part, gchar **domain,
 116.491 +		       gboolean is_rfc821);
 116.492 +gboolean parse_address_rfc822(gchar *string,
 116.493 +		       gchar **local_begin, gchar **local_end,
 116.494 +		       gchar **domain_begin, gchar **domain_end,
 116.495 +			      gchar **address_end);
 116.496 +gboolean parse_address_rfc821(gchar *string,
 116.497 +			      gchar **local_begin, gchar **local_end,
 116.498 +			      gchar **domain_begin, gchar **domain_end,
 116.499 +			      gchar **address_end);
 116.500 +address *_create_address(gchar *string, gchar **end, gboolean is_rfc821);
 116.501 +address *create_address_rfc821(gchar *string, gchar **end);
 116.502 +address *create_address_rfc822(gchar *string, gchar **end);
 116.503 +GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain);
 116.504 +gboolean addr_isequal(address *addr1, address *addr2);
 116.505 +
 116.506 +/* connect.c */
 116.507 +mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port,
 116.508 +			  GList *addr_list);
 116.509 +mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port,
 116.510 +			     GList *res_funcs);
 116.511 +
 116.512 +/* deliver.c */
 116.513 +void msg_rcptlist_local(GList *rcpt_list, GList **, GList **);
 116.514 +gboolean deliver_local(msg_out *msgout);
 116.515 +gboolean deliver_msglist_host(connect_route *route, GList *msg_list, gchar *host, GList *res_list);
 116.516 +gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list);
 116.517 +gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list);
 116.518 +gboolean deliver_finish(msg_out *msgout);
 116.519 +gboolean deliver_finish_list(GList *msgout_list);
 116.520 +gboolean deliver_msg_list(GList *msg_list, guint flags);
 116.521 +gboolean deliver(message *msg);
 116.522 +
 116.523 +/* fail_msg.c */
 116.524 +gboolean fail_msg(message *msg, gchar *template,
 116.525 +		  GList *failed_rcpts, gchar *err_fmt, va_list args);
 116.526 +gboolean warn_msg(message *msg, gchar *template,
 116.527 +		  GList *failed_rcpts, gchar *err_fmt, va_list args);
 116.528 +
 116.529 +/* get.c */
 116.530 +gboolean get_from_file(gchar *fname);
 116.531 +gboolean get_from_name(gchar *name);
 116.532 +gboolean get_all(void);
 116.533 +void get_online(void);
 116.534 +void get_daemon(gint gival, char *argv[]);
 116.535 +gboolean pop_before_smtp(gchar *fname);
 116.536 +
 116.537 +/* interface.c */
 116.538 +gboolean init_sockaddr(struct sockaddr_in *name, interface *iface);
 116.539 +int make_server_socket(interface *iface);
 116.540 +
 116.541 +/* local.c */
 116.542 +gboolean append_file(message *msg, GList *hdr_list, gchar *user);
 116.543 +gboolean maildir_out(message *msg, GList *hdr_list, gchar *user, guint flags);
 116.544 +gboolean pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags);
 116.545 +
 116.546 +/* log.c */
 116.547 +gchar *ext_strerror(int err);
 116.548 +gboolean logopen(void);
 116.549 +void logclose(void);
 116.550 +void vlogwrite(int pri, const char *fmt, va_list args);
 116.551 +void logwrite(int pri, const char *fmt, ...);
 116.552 +void debugf(const char *fmt, ...);
 116.553 +void vdebugf(const char *fmt, va_list args);
 116.554 +void maillog(const char *fmt, ...);
 116.555 +
 116.556 +/* spool.c */
 116.557 +gboolean spool_read_data(message *msg);
 116.558 +gboolean spool_read_data(message *msg);
 116.559 +message *msg_spool_read(gchar *uid, gboolean do_readdata);
 116.560 +gboolean spool_write(message *msg, gboolean do_writedata);
 116.561 +gboolean spool_lock(gchar *uid);
 116.562 +gboolean spool_unlock(gchar *uid);
 116.563 +gboolean spool_delete_all(message *msg);
 116.564 +
 116.565 +/* queue.c */
 116.566 +GList *read_queue(gboolean do_readdata);
 116.567 +gboolean queue_run(void);
 116.568 +gboolean queue_run_online(void);
 116.569 +void queue_list(void);
 116.570 +gboolean queue_delete(gchar *uid);
 116.571 +
 116.572 +/* online.c */
 116.573 +gchar *detect_online();
 116.574 +void set_online_name(gchar *name);
 116.575 +
 116.576 +/* permissions.c */
 116.577 +gboolean is_ingroup(uid_t uid, gid_t gid);
 116.578 +void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid);
 116.579 +void set_identity(uid_t old_uid, gchar *task_name);
 116.580 +
 116.581 +/* rewrite.c */
 116.582 +gboolean set_address_header_domain(header *hdr, gchar *domain);
 116.583 +gboolean map_address_header(header *hdr, GList *table);
 116.584 +
 116.585 +/* route.c */
 116.586 +msgout_perhost *create_msgout_perhost(gchar *host);
 116.587 +void destroy_msgout_perhost(msgout_perhost *mo_ph);
 116.588 +void rewrite_headers(msg_out *msgout, connect_route *route);
 116.589 +void rcptlist_with_one_of_hostlist(GList *rcpt_list, GList *host_list,
 116.590 +				     GList **, GList **);
 116.591 +void rcptlist_with_addr_is_local(GList *rcpt_list,
 116.592 +				   GList **p_rcpt_list, GList **p_non_rcpt_list);
 116.593 +gboolean route_strip_msgout(connect_route *route, msg_out *msgout);
 116.594 +msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout);
 116.595 +GList *route_msgout_list(connect_route *route, GList *msgout_list);
 116.596 +gboolean route_is_allowed_return_path(connect_route *route, address *ret_path);
 116.597 +gboolean route_is_allowed_mail_local(connect_route *route, address *ret_path);
 116.598 +void msg_rcptlist_route(connect_route *route, GList *rcpt_list,
 116.599 +			GList **p_rcpt_list, GList **p_non_rcpt_list);
 116.600 +
 116.601 +/* tables.c */
 116.602 +table_pair *create_pair(gchar *key, gpointer value);
 116.603 +table_pair *create_pair_string(gchar *key, gpointer value);
 116.604 +table_pair *parse_table_pair(gchar *line, char delim);
 116.605 +gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func)(const char *, const char *));
 116.606 +gpointer *table_find(GList *table_list, gchar *key);
 116.607 +gpointer *table_find_case(GList *table_list, gchar *key);
 116.608 +gpointer *table_find_fnmatch(GList *table_list, gchar *key);
 116.609 +GList *table_read(gchar *fname, gchar delim);
 116.610 +void destroy_table(GList *table);
 116.611 +
 116.612 +/* timeival.c */
 116.613 +gint time_interval(gchar *str, gint *pos);
 116.614 +
 116.615 +/* permissions.c */
 116.616 +gboolean is_privileged_user(uid_t uid);
 116.617 +
 116.618 +/* other things */
 116.619 +
 116.620 +#define foreach(list, node)\
 116.621 +for((node) = g_list_first(list);\
 116.622 +    (node);\
 116.623 +    (node) = g_list_next(node))
 116.624 +
 116.625 +#ifdef ENABLE_DEBUG
 116.626 +#define DEBUG(level) if(level <= conf.debug_level)
 116.627 +#else
 116.628 +/* hopefully the compiler optmizes this away... */
 116.629 +#define DEBUG(level) if(0)
 116.630 +#endif
 116.631 +
 116.632 +#define LOG_VERBOSE 0x100
 116.633 +
 116.634 +#ifndef HAVE_GETLINE
 116.635 +#define getline(buf, size, file) getdelim(buf, size, '\n', file)
 116.636 +#endif
 116.637 +
 116.638 +#ifndef HAVE_FDATASYNC
 116.639 +#define fdatasync(fd) fsync(fd)
 116.640 +#endif
 116.641 +
 116.642 +#ifndef CONF_DIR
 116.643 +#define CONF_DIR "/etc/masqmail"
 116.644 +#endif
 116.645 +
 116.646 +#define CONF_FILE CONF_DIR"/masqmail.conf"
 116.647 +
 116.648 +#define PIDFILEDIR "/var/run/masqmail/"
 116.649 +
 116.650 +#ifndef va_copy
 116.651 +#ifdef __va_copy
 116.652 +#define va_copy(ap1, ap2) __va_copy(ap1, ap2)
 116.653 +#else
 116.654 +#define va_copy(ap1, ap2) G_VA_COPY(ap1, ap2)
 116.655 +#endif
 116.656 +#endif
 116.657 +
 116.658 +/* *BSD needs this: */
 116.659 +extern char **environ;
   117.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.2 +++ b/src/md5/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
   117.3 @@ -0,0 +1,19 @@
   117.4 +AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE
   117.5 +
   117.6 +noinst_LIBRARIES=libmd5c.a
   117.7 +noinst_PROGRAMS=hmactest
   117.8 +
   117.9 +hmactest_SOURCES=\
  117.10 +	md5.h\
  117.11 +	global.h\
  117.12 +	md5c.c\
  117.13 +	hmac_md5.h\
  117.14 +	hmac_md5.c\
  117.15 +	hmactest.c
  117.16 +
  117.17 +libmd5c_a_SOURCES=\
  117.18 +	md5.h\
  117.19 +	global.h\
  117.20 +	md5c.c\
  117.21 +	hmac_md5.h\
  117.22 +	hmac_md5.c
  117.23 \ No newline at end of file
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/src/md5/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
   118.3 @@ -0,0 +1,412 @@
   118.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
   118.5 +# @configure_input@
   118.6 +
   118.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
   118.8 +# Free Software Foundation, Inc.
   118.9 +# This Makefile.in is free software; the Free Software Foundation
  118.10 +# gives unlimited permission to copy and/or distribute it,
  118.11 +# with or without modifications, as long as this notice is preserved.
  118.12 +
  118.13 +# This program is distributed in the hope that it will be useful,
  118.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  118.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  118.16 +# PARTICULAR PURPOSE.
  118.17 +
  118.18 +@SET_MAKE@
  118.19 +
  118.20 +srcdir = @srcdir@
  118.21 +top_srcdir = @top_srcdir@
  118.22 +VPATH = @srcdir@
  118.23 +pkgdatadir = $(datadir)/@PACKAGE@
  118.24 +pkglibdir = $(libdir)/@PACKAGE@
  118.25 +pkgincludedir = $(includedir)/@PACKAGE@
  118.26 +top_builddir = ../..
  118.27 +
  118.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
  118.29 +INSTALL = @INSTALL@
  118.30 +install_sh_DATA = $(install_sh) -c -m 644
  118.31 +install_sh_PROGRAM = $(install_sh) -c
  118.32 +install_sh_SCRIPT = $(install_sh) -c
  118.33 +INSTALL_HEADER = $(INSTALL_DATA)
  118.34 +transform = $(program_transform_name)
  118.35 +NORMAL_INSTALL = :
  118.36 +PRE_INSTALL = :
  118.37 +POST_INSTALL = :
  118.38 +NORMAL_UNINSTALL = :
  118.39 +PRE_UNINSTALL = :
  118.40 +POST_UNINSTALL = :
  118.41 +ACLOCAL = @ACLOCAL@
  118.42 +AMDEP_FALSE = @AMDEP_FALSE@
  118.43 +AMDEP_TRUE = @AMDEP_TRUE@
  118.44 +AMTAR = @AMTAR@
  118.45 +AUTOCONF = @AUTOCONF@
  118.46 +AUTOHEADER = @AUTOHEADER@
  118.47 +AUTOMAKE = @AUTOMAKE@
  118.48 +AWK = @AWK@
  118.49 +BASE64_LIBS = @BASE64_LIBS@
  118.50 +CC = @CC@
  118.51 +CCDEPMODE = @CCDEPMODE@
  118.52 +CFLAGS = @CFLAGS@
  118.53 +CPP = @CPP@
  118.54 +CPPFLAGS = @CPPFLAGS@
  118.55 +CYGPATH_W = @CYGPATH_W@
  118.56 +DEFS = @DEFS@
  118.57 +DEPDIR = @DEPDIR@
  118.58 +ECHO_C = @ECHO_C@
  118.59 +ECHO_N = @ECHO_N@
  118.60 +ECHO_T = @ECHO_T@
  118.61 +EGREP = @EGREP@
  118.62 +EXEEXT = @EXEEXT@
  118.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
  118.64 +GLIB_LIBS = @GLIB_LIBS@
  118.65 +IDENT_LIBS = @IDENT_LIBS@
  118.66 +INSTALL_DATA = @INSTALL_DATA@
  118.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
  118.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
  118.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  118.70 +LDFLAGS = @LDFLAGS@
  118.71 +LIBOBJS = @LIBOBJS@
  118.72 +LIBS = @LIBS@
  118.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
  118.74 +LTLIBOBJS = @LTLIBOBJS@
  118.75 +MAKEINFO = @MAKEINFO@
  118.76 +MD5_LIBS = @MD5_LIBS@
  118.77 +OBJEXT = @OBJEXT@
  118.78 +PACKAGE = @PACKAGE@
  118.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  118.80 +PACKAGE_NAME = @PACKAGE_NAME@
  118.81 +PACKAGE_STRING = @PACKAGE_STRING@
  118.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
  118.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
  118.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
  118.85 +PKG_CONFIG = @PKG_CONFIG@
  118.86 +RANLIB = @RANLIB@
  118.87 +RESOLV_LIBS = @RESOLV_LIBS@
  118.88 +SET_MAKE = @SET_MAKE@
  118.89 +SHELL = @SHELL@
  118.90 +STRIP = @STRIP@
  118.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
  118.92 +VERSION = @VERSION@
  118.93 +ac_ct_CC = @ac_ct_CC@
  118.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
  118.95 +ac_ct_STRIP = @ac_ct_STRIP@
  118.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
  118.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  118.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
  118.99 +am__include = @am__include@
 118.100 +am__leading_dot = @am__leading_dot@
 118.101 +am__quote = @am__quote@
 118.102 +bindir = @bindir@
 118.103 +build_alias = @build_alias@
 118.104 +datadir = @datadir@
 118.105 +exec_prefix = @exec_prefix@
 118.106 +has_ident = @has_ident@
 118.107 +host_alias = @host_alias@
 118.108 +includedir = @includedir@
 118.109 +infodir = @infodir@
 118.110 +install_sh = @install_sh@
 118.111 +libdir = @libdir@
 118.112 +libexecdir = @libexecdir@
 118.113 +localstatedir = @localstatedir@
 118.114 +mandir = @mandir@
 118.115 +oldincludedir = @oldincludedir@
 118.116 +prefix = @prefix@
 118.117 +program_transform_name = @program_transform_name@
 118.118 +sbindir = @sbindir@
 118.119 +sharedstatedir = @sharedstatedir@
 118.120 +sysconfdir = @sysconfdir@
 118.121 +target_alias = @target_alias@
 118.122 +with_confdir = @with_confdir@
 118.123 +with_group = @with_group@
 118.124 +with_logdir = @with_logdir@
 118.125 +with_spooldir = @with_spooldir@
 118.126 +with_user = @with_user@
 118.127 +AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE
 118.128 +
 118.129 +noinst_LIBRARIES = libmd5c.a
 118.130 +noinst_PROGRAMS = hmactest
 118.131 +
 118.132 +hmactest_SOURCES = \
 118.133 +	md5.h\
 118.134 +	global.h\
 118.135 +	md5c.c\
 118.136 +	hmac_md5.h\
 118.137 +	hmac_md5.c\
 118.138 +	hmactest.c
 118.139 +
 118.140 +
 118.141 +libmd5c_a_SOURCES = \
 118.142 +	md5.h\
 118.143 +	global.h\
 118.144 +	md5c.c\
 118.145 +	hmac_md5.h\
 118.146 +	hmac_md5.c
 118.147 +
 118.148 +subdir = src/md5
 118.149 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 118.150 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 118.151 +CONFIG_HEADER = $(top_builddir)/config.h
 118.152 +CONFIG_CLEAN_FILES =
 118.153 +LIBRARIES = $(noinst_LIBRARIES)
 118.154 +
 118.155 +libmd5c_a_AR = $(AR) cru
 118.156 +libmd5c_a_LIBADD =
 118.157 +am_libmd5c_a_OBJECTS = md5c.$(OBJEXT) hmac_md5.$(OBJEXT)
 118.158 +libmd5c_a_OBJECTS = $(am_libmd5c_a_OBJECTS)
 118.159 +noinst_PROGRAMS = hmactest$(EXEEXT)
 118.160 +PROGRAMS = $(noinst_PROGRAMS)
 118.161 +
 118.162 +am_hmactest_OBJECTS = md5c.$(OBJEXT) hmac_md5.$(OBJEXT) \
 118.163 +	hmactest.$(OBJEXT)
 118.164 +hmactest_OBJECTS = $(am_hmactest_OBJECTS)
 118.165 +hmactest_LDADD = $(LDADD)
 118.166 +hmactest_DEPENDENCIES =
 118.167 +hmactest_LDFLAGS =
 118.168 +
 118.169 +DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
 118.170 +depcomp = $(SHELL) $(top_srcdir)/depcomp
 118.171 +am__depfiles_maybe = depfiles
 118.172 +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/hmac_md5.Po ./$(DEPDIR)/hmactest.Po \
 118.173 +@AMDEP_TRUE@	./$(DEPDIR)/md5c.Po
 118.174 +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 118.175 +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 118.176 +CCLD = $(CC)
 118.177 +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 118.178 +DIST_SOURCES = $(libmd5c_a_SOURCES) $(hmactest_SOURCES)
 118.179 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
 118.180 +SOURCES = $(libmd5c_a_SOURCES) $(hmactest_SOURCES)
 118.181 +
 118.182 +all: all-am
 118.183 +
 118.184 +.SUFFIXES:
 118.185 +.SUFFIXES: .c .o .obj
 118.186 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
 118.187 +	cd $(top_srcdir) && \
 118.188 +	  $(AUTOMAKE) --gnu  src/md5/Makefile
 118.189 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
 118.190 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
 118.191 +
 118.192 +AR = ar
 118.193 +
 118.194 +clean-noinstLIBRARIES:
 118.195 +	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
 118.196 +libmd5c.a: $(libmd5c_a_OBJECTS) $(libmd5c_a_DEPENDENCIES) 
 118.197 +	-rm -f libmd5c.a
 118.198 +	$(libmd5c_a_AR) libmd5c.a $(libmd5c_a_OBJECTS) $(libmd5c_a_LIBADD)
 118.199 +	$(RANLIB) libmd5c.a
 118.200 +
 118.201 +clean-noinstPROGRAMS:
 118.202 +	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
 118.203 +hmactest$(EXEEXT): $(hmactest_OBJECTS) $(hmactest_DEPENDENCIES) 
 118.204 +	@rm -f hmactest$(EXEEXT)
 118.205 +	$(LINK) $(hmactest_LDFLAGS) $(hmactest_OBJECTS) $(hmactest_LDADD) $(LIBS)
 118.206 +
 118.207 +mostlyclean-compile:
 118.208 +	-rm -f *.$(OBJEXT) core *.core
 118.209 +
 118.210 +distclean-compile:
 118.211 +	-rm -f *.tab.c
 118.212 +
 118.213 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmac_md5.Po@am__quote@
 118.214 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmactest.Po@am__quote@
 118.215 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5c.Po@am__quote@
 118.216 +
 118.217 +.c.o:
 118.218 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
 118.219 +@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
 118.220 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
 118.221 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
 118.222 +@am__fastdepCC_TRUE@	fi
 118.223 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 118.224 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
 118.225 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 118.226 +@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
 118.227 +
 118.228 +.c.obj:
 118.229 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
 118.230 +@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
 118.231 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
 118.232 +@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
 118.233 +@am__fastdepCC_TRUE@	fi
 118.234 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 118.235 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
 118.236 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 118.237 +@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
 118.238 +uninstall-info-am:
 118.239 +
 118.240 +ETAGS = etags
 118.241 +ETAGSFLAGS =
 118.242 +
 118.243 +CTAGS = ctags
 118.244 +CTAGSFLAGS =
 118.245 +
 118.246 +tags: TAGS
 118.247 +
 118.248 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 118.249 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 118.250 +	unique=`for i in $$list; do \
 118.251 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 118.252 +	  done | \
 118.253 +	  $(AWK) '    { files[$$0] = 1; } \
 118.254 +	       END { for (i in files) print i; }'`; \
 118.255 +	mkid -fID $$unique
 118.256 +
 118.257 +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 118.258 +		$(TAGS_FILES) $(LISP)
 118.259 +	tags=; \
 118.260 +	here=`pwd`; \
 118.261 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 118.262 +	unique=`for i in $$list; do \
 118.263 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 118.264 +	  done | \
 118.265 +	  $(AWK) '    { files[$$0] = 1; } \
 118.266 +	       END { for (i in files) print i; }'`; \
 118.267 +	test -z "$(ETAGS_ARGS)$$tags$$unique" \
 118.268 +	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
 118.269 +	     $$tags $$unique
 118.270 +
 118.271 +ctags: CTAGS
 118.272 +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 118.273 +		$(TAGS_FILES) $(LISP)
 118.274 +	tags=; \
 118.275 +	here=`pwd`; \
 118.276 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 118.277 +	unique=`for i in $$list; do \
 118.278 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 118.279 +	  done | \
 118.280 +	  $(AWK) '    { files[$$0] = 1; } \
 118.281 +	       END { for (i in files) print i; }'`; \
 118.282 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
 118.283 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 118.284 +	     $$tags $$unique
 118.285 +
 118.286 +GTAGS:
 118.287 +	here=`$(am__cd) $(top_builddir) && pwd` \
 118.288 +	  && cd $(top_srcdir) \
 118.289 +	  && gtags -i $(GTAGS_ARGS) $$here
 118.290 +
 118.291 +distclean-tags:
 118.292 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 118.293 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 118.294 +
 118.295 +top_distdir = ../..
 118.296 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 118.297 +
 118.298 +distdir: $(DISTFILES)
 118.299 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 118.300 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 118.301 +	list='$(DISTFILES)'; for file in $$list; do \
 118.302 +	  case $$file in \
 118.303 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
 118.304 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
 118.305 +	  esac; \
 118.306 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 118.307 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
 118.308 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
 118.309 +	    dir="/$$dir"; \
 118.310 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
 118.311 +	  else \
 118.312 +	    dir=''; \
 118.313 +	  fi; \
 118.314 +	  if test -d $$d/$$file; then \
 118.315 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
 118.316 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
 118.317 +	    fi; \
 118.318 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
 118.319 +	  else \
 118.320 +	    test -f $(distdir)/$$file \
 118.321 +	    || cp -p $$d/$$file $(distdir)/$$file \
 118.322 +	    || exit 1; \
 118.323 +	  fi; \
 118.324 +	done
 118.325 +check-am: all-am
 118.326 +check: check-am
 118.327 +all-am: Makefile $(LIBRARIES) $(PROGRAMS)
 118.328 +
 118.329 +installdirs:
 118.330 +install: install-am
 118.331 +install-exec: install-exec-am
 118.332 +install-data: install-data-am
 118.333 +uninstall: uninstall-am
 118.334 +
 118.335 +install-am: all-am
 118.336 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 118.337 +
 118.338 +installcheck: installcheck-am
 118.339 +install-strip:
 118.340 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
 118.341 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
 118.342 +	  `test -z '$(STRIP)' || \
 118.343 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 118.344 +mostlyclean-generic:
 118.345 +
 118.346 +clean-generic:
 118.347 +
 118.348 +distclean-generic:
 118.349 +	-rm -f $(CONFIG_CLEAN_FILES)
 118.350 +
 118.351 +maintainer-clean-generic:
 118.352 +	@echo "This command is intended for maintainers to use"
 118.353 +	@echo "it deletes files that may require special tools to rebuild."
 118.354 +clean: clean-am
 118.355 +
 118.356 +clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
 118.357 +	mostlyclean-am
 118.358 +
 118.359 +distclean: distclean-am
 118.360 +	-rm -rf ./$(DEPDIR)
 118.361 +	-rm -f Makefile
 118.362 +distclean-am: clean-am distclean-compile distclean-generic \
 118.363 +	distclean-tags
 118.364 +
 118.365 +dvi: dvi-am
 118.366 +
 118.367 +dvi-am:
 118.368 +
 118.369 +info: info-am
 118.370 +
 118.371 +info-am:
 118.372 +
 118.373 +install-data-am:
 118.374 +
 118.375 +install-exec-am:
 118.376 +
 118.377 +install-info: install-info-am
 118.378 +
 118.379 +install-man:
 118.380 +
 118.381 +installcheck-am:
 118.382 +
 118.383 +maintainer-clean: maintainer-clean-am
 118.384 +	-rm -rf ./$(DEPDIR)
 118.385 +	-rm -f Makefile
 118.386 +maintainer-clean-am: distclean-am maintainer-clean-generic
 118.387 +
 118.388 +mostlyclean: mostlyclean-am
 118.389 +
 118.390 +mostlyclean-am: mostlyclean-compile mostlyclean-generic
 118.391 +
 118.392 +pdf: pdf-am
 118.393 +
 118.394 +pdf-am:
 118.395 +
 118.396 +ps: ps-am
 118.397 +
 118.398 +ps-am:
 118.399 +
 118.400 +uninstall-am: uninstall-info-am
 118.401 +
 118.402 +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 118.403 +	clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \
 118.404 +	distclean-compile distclean-generic distclean-tags distdir dvi \
 118.405 +	dvi-am info info-am install install-am install-data \
 118.406 +	install-data-am install-exec install-exec-am install-info \
 118.407 +	install-info-am install-man install-strip installcheck \
 118.408 +	installcheck-am installdirs maintainer-clean \
 118.409 +	maintainer-clean-generic mostlyclean mostlyclean-compile \
 118.410 +	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
 118.411 +	uninstall-am uninstall-info-am
 118.412 +
 118.413 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
 118.414 +# Otherwise a system limit (for SysV at least) may be exceeded.
 118.415 +.NOEXPORT:
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/src/md5/global.h	Fri Sep 26 17:05:23 2008 +0200
   119.3 @@ -0,0 +1,30 @@
   119.4 +/* GLOBAL.H - RSAREF types and constants
   119.5 + */
   119.6 +
   119.7 +/* PROTOTYPES should be set to one if and only if the compiler supports
   119.8 +   function argument prototyping.
   119.9 +   The following makes PROTOTYPES default to 0 if it has not already
  119.10 +   been defined with C compiler flags.
  119.11 + */
  119.12 +#ifndef PROTOTYPES
  119.13 +#define PROTOTYPES 0
  119.14 +#endif
  119.15 +
  119.16 +/* POINTER defines a generic pointer type */
  119.17 +typedef unsigned char *POINTER;
  119.18 +
  119.19 +/* UINT2 defines a two byte word */
  119.20 +typedef unsigned short int UINT2;
  119.21 +
  119.22 +/* UINT4 defines a four byte word */
  119.23 +typedef unsigned long int UINT4;
  119.24 +
  119.25 +/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
  119.26 +If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
  119.27 +  returns an empty list.
  119.28 + */
  119.29 +#if PROTOTYPES
  119.30 +#define PROTO_LIST(list) list
  119.31 +#else
  119.32 +#define PROTO_LIST(list) ()
  119.33 +#endif
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/src/md5/hmac_md5.c	Fri Sep 26 17:05:23 2008 +0200
   120.3 @@ -0,0 +1,80 @@
   120.4 +/*
   120.5 +** Function: hmac_md5
   120.6 +*/
   120.7 +
   120.8 +#include <string.h>
   120.9 +#include "global.h"
  120.10 +#include "md5.h"
  120.11 +#include "hmac_md5.h"
  120.12 +
  120.13 +void hmac_md5(unsigned char *text, int text_len,
  120.14 +	      unsigned char* key, int key_len, unsigned char *digest)
  120.15 +     /* text;     pointer to data stream */
  120.16 +     /* text_len; length of data stream */
  120.17 +     /* key;      pointer to authentication key */
  120.18 +     /* key_len;  length of authentication key */
  120.19 +     /* digest;   caller digest to be filled in */
  120.20 +
  120.21 +{
  120.22 +  MD5_CTX context;
  120.23 +  unsigned char k_ipad[65];    /* inner padding -
  120.24 +				* key XORd with ipad
  120.25 +				*/
  120.26 +  unsigned char k_opad[65];    /* outer padding -
  120.27 +				* key XORd with opad
  120.28 +				*/
  120.29 +  unsigned char tk[16];
  120.30 +  int i;
  120.31 +  /* if key is longer than 64 bytes reset it to key=MD5(key) */
  120.32 +  if (key_len > 64) {
  120.33 +
  120.34 +    MD5_CTX      tctx;
  120.35 +
  120.36 +    MD5Init(&tctx);
  120.37 +    MD5Update(&tctx, key, key_len);
  120.38 +    MD5Final(tk, &tctx);
  120.39 +
  120.40 +    key = tk;
  120.41 +    key_len = 16;
  120.42 +  }
  120.43 +
  120.44 +  /*
  120.45 +   * the HMAC_MD5 transform looks like:
  120.46 +   *
  120.47 +   * MD5(K XOR opad, MD5(K XOR ipad, text))
  120.48 +   *
  120.49 +   * where K is an n byte key
  120.50 +   * ipad is the byte 0x36 repeated 64 times
  120.51 +   * opad is the byte 0x5c repeated 64 times
  120.52 +   * and text is the data being protected
  120.53 +   */
  120.54 +
  120.55 +  /* start out by storing key in pads */
  120.56 +  bzero( k_ipad, sizeof k_ipad);
  120.57 +  bzero( k_opad, sizeof k_opad);
  120.58 +  bcopy( key, k_ipad, key_len);
  120.59 +  bcopy( key, k_opad, key_len);
  120.60 +
  120.61 +  /* XOR key with ipad and opad values */
  120.62 +  for (i=0; i<64; i++) {
  120.63 +    k_ipad[i] ^= 0x36;
  120.64 +    k_opad[i] ^= 0x5c;
  120.65 +  }
  120.66 +  /*
  120.67 +   * perform inner MD5
  120.68 +   */
  120.69 +  MD5Init(&context);                   /* init context for 1st
  120.70 +					* pass */
  120.71 +  MD5Update(&context, k_ipad, 64);      /* start with inner pad */
  120.72 +  MD5Update(&context, text, text_len); /* then text of datagram */
  120.73 +  MD5Final(digest, &context);          /* finish up 1st pass */
  120.74 +  /*
  120.75 +   * perform outer MD5
  120.76 +   */
  120.77 +  MD5Init(&context);                   /* init context for 2nd
  120.78 +					* pass */
  120.79 +  MD5Update(&context, k_opad, 64);     /* start with outer pad */
  120.80 +  MD5Update(&context, digest, 16);     /* then results of 1st
  120.81 +					* hash */
  120.82 +  MD5Final(digest, &context);          /* finish up 2nd pass */
  120.83 +}
   121.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.2 +++ b/src/md5/hmac_md5.h	Fri Sep 26 17:05:23 2008 +0200
   121.3 @@ -0,0 +1,7 @@
   121.4 +void hmac_md5(unsigned char *text, int text_len,
   121.5 +	      unsigned char* key, int key_len, unsigned char *digest);
   121.6 +     /* text;     pointer to data stream */
   121.7 +     /* text_len; length of data stream */
   121.8 +     /* key;      pointer to authentication key */
   121.9 +     /* key_len;  length of authentication key */
  121.10 +     /* digest;   caller digest to be filled in */
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/src/md5/hmactest.c	Fri Sep 26 17:05:23 2008 +0200
   122.3 @@ -0,0 +1,46 @@
   122.4 +#include <stdio.h>
   122.5 +#include <stdlib.h>
   122.6 +#include <sys/time.h>
   122.7 +#include <string.h>
   122.8 +#include "global.h"
   122.9 +#include "md5.h"
  122.10 +#include "hmac_md5.h"
  122.11 +
  122.12 +static
  122.13 +void pad0_copy(char *d, char *s, int sz)
  122.14 +{
  122.15 +  int i = 0;
  122.16 +  while(*s && (i < sz)) { *(d++) = *(s++); i++; }
  122.17 +  while(i <= sz) { *(d++) = 0; i++; }
  122.18 +}
  122.19 +
  122.20 +int main()
  122.21 +{
  122.22 +  int i;
  122.23 +  //  unsigned char digest[16];
  122.24 +  char digest[16];
  122.25 +  char *msgid = "<1896.697170952@postoffice.reston.mci.net>";
  122.26 +  char secret[65];
  122.27 +
  122.28 +  hmac_md5("<48157.953508124@mail.class-c.net>", 34,
  122.29 +	   "no!SpamAtAll", 12, digest);
  122.30 +  for(i = 0; i < 16; i++)
  122.31 +    printf("%x", (unsigned int)digest[i]);
  122.32 +  printf("\n");
  122.33 +
  122.34 +  hmac_md5(msgid, strlen(msgid),
  122.35 +	    "tanstaaftanstaaf", 16, digest);
  122.36 +  for(i = 0; i < 16; i++)
  122.37 +    printf("%x", (unsigned int)digest[i]);
  122.38 +  printf("\n");
  122.39 +
  122.40 +  pad0_copy(secret, "tanstaaftanstaaf", 64);
  122.41 +  hmac_md5(msgid, strlen(msgid),
  122.42 +	    secret, 64, digest);
  122.43 +  for(i = 0; i < 16; i++)
  122.44 +    printf("%x", (unsigned int)digest[i]);
  122.45 +  printf("\n");
  122.46 +
  122.47 +  exit(0);
  122.48 +}
  122.49 +
   123.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.2 +++ b/src/md5/md5.h	Fri Sep 26 17:05:23 2008 +0200
   123.3 @@ -0,0 +1,36 @@
   123.4 +/* MD5.H - header file for MD5C.C
   123.5 + */
   123.6 +
   123.7 +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
   123.8 +rights reserved.
   123.9 +
  123.10 +License to copy and use this software is granted provided that it
  123.11 +is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  123.12 +Algorithm" in all material mentioning or referencing this software
  123.13 +or this function.
  123.14 +
  123.15 +License is also granted to make and use derivative works provided
  123.16 +that such works are identified as "derived from the RSA Data
  123.17 +Security, Inc. MD5 Message-Digest Algorithm" in all material
  123.18 +mentioning or referencing the derived work.
  123.19 +
  123.20 +RSA Data Security, Inc. makes no representations concerning either
  123.21 +the merchantability of this software or the suitability of this
  123.22 +software for any particular purpose. It is provided "as is"
  123.23 +without express or implied warranty of any kind.
  123.24 +
  123.25 +These notices must be retained in any copies of any part of this
  123.26 +documentation and/or software.
  123.27 + */
  123.28 +
  123.29 +/* MD5 context. */
  123.30 +typedef struct {
  123.31 +  UINT4 state[4];                                   /* state (ABCD) */
  123.32 +  UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
  123.33 +  unsigned char buffer[64];                         /* input buffer */
  123.34 +} MD5_CTX;
  123.35 +
  123.36 +void MD5Init PROTO_LIST ((MD5_CTX *));
  123.37 +void MD5Update PROTO_LIST
  123.38 +  ((MD5_CTX *, unsigned char *, unsigned int));
  123.39 +void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
   124.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.2 +++ b/src/md5/md5c.c	Fri Sep 26 17:05:23 2008 +0200
   124.3 @@ -0,0 +1,334 @@
   124.4 +/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
   124.5 + */
   124.6 +
   124.7 +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
   124.8 +rights reserved.
   124.9 +
  124.10 +License to copy and use this software is granted provided that it
  124.11 +is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  124.12 +Algorithm" in all material mentioning or referencing this software
  124.13 +or this function.
  124.14 +
  124.15 +License is also granted to make and use derivative works provided
  124.16 +that such works are identified as "derived from the RSA Data
  124.17 +Security, Inc. MD5 Message-Digest Algorithm" in all material
  124.18 +mentioning or referencing the derived work.
  124.19 +
  124.20 +RSA Data Security, Inc. makes no representations concerning either
  124.21 +the merchantability of this software or the suitability of this
  124.22 +software for any particular purpose. It is provided "as is"
  124.23 +without express or implied warranty of any kind.
  124.24 +
  124.25 +These notices must be retained in any copies of any part of this
  124.26 +documentation and/or software.
  124.27 + */
  124.28 +
  124.29 +#include "global.h"
  124.30 +#include "md5.h"
  124.31 +
  124.32 +/* Constants for MD5Transform routine.
  124.33 + */
  124.34 +#define S11 7
  124.35 +#define S12 12
  124.36 +#define S13 17
  124.37 +#define S14 22
  124.38 +#define S21 5
  124.39 +#define S22 9
  124.40 +#define S23 14
  124.41 +#define S24 20
  124.42 +#define S31 4
  124.43 +#define S32 11
  124.44 +#define S33 16
  124.45 +#define S34 23
  124.46 +#define S41 6
  124.47 +#define S42 10
  124.48 +#define S43 15
  124.49 +#define S44 21
  124.50 +
  124.51 +static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
  124.52 +static void Encode PROTO_LIST
  124.53 +  ((unsigned char *, UINT4 *, unsigned int));
  124.54 +static void Decode PROTO_LIST
  124.55 +  ((UINT4 *, unsigned char *, unsigned int));
  124.56 +static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
  124.57 +static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));
  124.58 +
  124.59 +static unsigned char PADDING[64] = {
  124.60 +  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  124.61 +  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  124.62 +  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  124.63 +};
  124.64 +
  124.65 +/* F, G, H and I are basic MD5 functions.
  124.66 + */
  124.67 +#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
  124.68 +#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
  124.69 +#define H(x, y, z) ((x) ^ (y) ^ (z))
  124.70 +#define I(x, y, z) ((y) ^ ((x) | (~z)))
  124.71 +
  124.72 +/* ROTATE_LEFT rotates x left n bits.
  124.73 + */
  124.74 +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
  124.75 +
  124.76 +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
  124.77 +Rotation is separate from addition to prevent recomputation.
  124.78 + */
  124.79 +#define FF(a, b, c, d, x, s, ac) { \
  124.80 + (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
  124.81 + (a) = ROTATE_LEFT ((a), (s)); \
  124.82 + (a) += (b); \
  124.83 +  }
  124.84 +#define GG(a, b, c, d, x, s, ac) { \
  124.85 + (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
  124.86 + (a) = ROTATE_LEFT ((a), (s)); \
  124.87 + (a) += (b); \
  124.88 +  }
  124.89 +#define HH(a, b, c, d, x, s, ac) { \
  124.90 + (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
  124.91 + (a) = ROTATE_LEFT ((a), (s)); \
  124.92 + (a) += (b); \
  124.93 +  }
  124.94 +#define II(a, b, c, d, x, s, ac) { \
  124.95 + (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
  124.96 + (a) = ROTATE_LEFT ((a), (s)); \
  124.97 + (a) += (b); \
  124.98 +  }
  124.99 +
 124.100 +/* MD5 initialization. Begins an MD5 operation, writing a new context.
 124.101 + */
 124.102 +void MD5Init (context)
 124.103 +MD5_CTX *context;                                        /* context */
 124.104 +{
 124.105 +  context->count[0] = context->count[1] = 0;
 124.106 +  /* Load magic initialization constants.
 124.107 +*/
 124.108 +  context->state[0] = 0x67452301;
 124.109 +  context->state[1] = 0xefcdab89;
 124.110 +  context->state[2] = 0x98badcfe;
 124.111 +  context->state[3] = 0x10325476;
 124.112 +}
 124.113 +
 124.114 +/* MD5 block update operation. Continues an MD5 message-digest
 124.115 +  operation, processing another message block, and updating the
 124.116 +  context.
 124.117 + */
 124.118 +void MD5Update (context, input, inputLen)
 124.119 +MD5_CTX *context;                                        /* context */
 124.120 +unsigned char *input;                                /* input block */
 124.121 +unsigned int inputLen;                     /* length of input block */
 124.122 +{
 124.123 +  unsigned int i, index, partLen;
 124.124 +
 124.125 +  /* Compute number of bytes mod 64 */
 124.126 +  index = (unsigned int)((context->count[0] >> 3) & 0x3F);
 124.127 +
 124.128 +  /* Update number of bits */
 124.129 +  if ((context->count[0] += ((UINT4)inputLen << 3))
 124.130 +   < ((UINT4)inputLen << 3))
 124.131 + context->count[1]++;
 124.132 +  context->count[1] += ((UINT4)inputLen >> 29);
 124.133 +
 124.134 +  partLen = 64 - index;
 124.135 +
 124.136 +  /* Transform as many times as possible.
 124.137 +*/
 124.138 +  if (inputLen >= partLen) {
 124.139 + MD5_memcpy
 124.140 +   ((POINTER)&context->buffer[index], (POINTER)input, partLen);
 124.141 + MD5Transform (context->state, context->buffer);
 124.142 +
 124.143 + for (i = partLen; i + 63 < inputLen; i += 64)
 124.144 +   MD5Transform (context->state, &input[i]);
 124.145 +
 124.146 + index = 0;
 124.147 +  }
 124.148 +  else
 124.149 + i = 0;
 124.150 +
 124.151 +  /* Buffer remaining input */
 124.152 +  MD5_memcpy
 124.153 + ((POINTER)&context->buffer[index], (POINTER)&input[i],
 124.154 +  inputLen-i);
 124.155 +}
 124.156 +
 124.157 +/* MD5 finalization. Ends an MD5 message-digest operation, writing the
 124.158 +  the message digest and zeroizing the context.
 124.159 + */
 124.160 +void MD5Final (digest, context)
 124.161 +unsigned char digest[16];                         /* message digest */
 124.162 +MD5_CTX *context;                                       /* context */
 124.163 +{
 124.164 +  unsigned char bits[8];
 124.165 +  unsigned int index, padLen;
 124.166 +
 124.167 +  /* Save number of bits */
 124.168 +  Encode (bits, context->count, 8);
 124.169 +
 124.170 +  /* Pad out to 56 mod 64.
 124.171 +*/
 124.172 +  index = (unsigned int)((context->count[0] >> 3) & 0x3f);
 124.173 +  padLen = (index < 56) ? (56 - index) : (120 - index);
 124.174 +  MD5Update (context, PADDING, padLen);
 124.175 +
 124.176 +  /* Append length (before padding) */
 124.177 +  MD5Update (context, bits, 8);
 124.178 +
 124.179 +  /* Store state in digest */
 124.180 +  Encode (digest, context->state, 16);
 124.181 +
 124.182 +  /* Zeroize sensitive information.
 124.183 +*/
 124.184 +  MD5_memset ((POINTER)context, 0, sizeof (*context));
 124.185 +}
 124.186 +
 124.187 +/* MD5 basic transformation. Transforms state based on block.
 124.188 + */
 124.189 +static void MD5Transform (state, block)
 124.190 +UINT4 state[4];
 124.191 +unsigned char block[64];
 124.192 +{
 124.193 +  UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
 124.194 +
 124.195 +  Decode (x, block, 64);
 124.196 +
 124.197 +  /* Round 1 */
 124.198 +  FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
 124.199 +  FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
 124.200 +  FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
 124.201 +  FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
 124.202 +  FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
 124.203 +  FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
 124.204 +  FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
 124.205 +  FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
 124.206 +  FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
 124.207 +  FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
 124.208 +  FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
 124.209 +  FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
 124.210 +  FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
 124.211 +  FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
 124.212 +  FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
 124.213 +  FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
 124.214 +
 124.215 + /* Round 2 */
 124.216 +  GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
 124.217 +  GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
 124.218 +  GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
 124.219 +  GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
 124.220 +  GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
 124.221 +  GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */
 124.222 +  GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
 124.223 +  GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
 124.224 +  GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
 124.225 +  GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
 124.226 +  GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
 124.227 +  GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
 124.228 +  GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
 124.229 +  GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
 124.230 +  GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
 124.231 +  GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
 124.232 +
 124.233 +  /* Round 3 */
 124.234 +  HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
 124.235 +  HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
 124.236 +  HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
 124.237 +  HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
 124.238 +  HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
 124.239 +  HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
 124.240 +  HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
 124.241 +  HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
 124.242 +  HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
 124.243 +  HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
 124.244 +  HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
 124.245 +  HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
 124.246 +  HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
 124.247 +  HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
 124.248 +  HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
 124.249 +  HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
 124.250 +
 124.251 +  /* Round 4 */
 124.252 +  II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
 124.253 +  II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
 124.254 +  II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
 124.255 +  II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
 124.256 +  II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
 124.257 +  II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
 124.258 +  II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
 124.259 +  II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
 124.260 +  II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
 124.261 +  II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
 124.262 +  II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
 124.263 +  II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
 124.264 +  II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
 124.265 +  II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
 124.266 +  II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
 124.267 +  II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
 124.268 +
 124.269 +  state[0] += a;
 124.270 +  state[1] += b;
 124.271 +  state[2] += c;
 124.272 +  state[3] += d;
 124.273 +
 124.274 +  /* Zeroize sensitive information.
 124.275 +*/
 124.276 +  MD5_memset ((POINTER)x, 0, sizeof (x));
 124.277 +}
 124.278 +
 124.279 +/* Encodes input (UINT4) into output (unsigned char). Assumes len is
 124.280 +  a multiple of 4.
 124.281 + */
 124.282 +static void Encode (output, input, len)
 124.283 +unsigned char *output;
 124.284 +UINT4 *input;
 124.285 +unsigned int len;
 124.286 +{
 124.287 +  unsigned int i, j;
 124.288 +
 124.289 +  for (i = 0, j = 0; j < len; i++, j += 4) {
 124.290 + output[j] = (unsigned char)(input[i] & 0xff);
 124.291 + output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
 124.292 + output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
 124.293 + output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
 124.294 +  }
 124.295 +}
 124.296 +
 124.297 +/* Decodes input (unsigned char) into output (UINT4). Assumes len is
 124.298 +  a multiple of 4.
 124.299 + */
 124.300 +static void Decode (output, input, len)
 124.301 +UINT4 *output;
 124.302 +unsigned char *input;
 124.303 +unsigned int len;
 124.304 +{
 124.305 +  unsigned int i, j;
 124.306 +
 124.307 +  for (i = 0, j = 0; j < len; i++, j += 4)
 124.308 + output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
 124.309 +   (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
 124.310 +}
 124.311 +
 124.312 +/* Note: Replace "for loop" with standard memcpy if possible.
 124.313 + */
 124.314 +
 124.315 +static void MD5_memcpy (output, input, len)
 124.316 +POINTER output;
 124.317 +POINTER input;
 124.318 +unsigned int len;
 124.319 +{
 124.320 +  unsigned int i;
 124.321 +
 124.322 +  for (i = 0; i < len; i++)
 124.323 +    output[i] = input[i];
 124.324 +}
 124.325 +
 124.326 +/* Note: Replace "for loop" with standard memset if possible.
 124.327 + */
 124.328 +static void MD5_memset (output, value, len)
 124.329 +POINTER output;
 124.330 +int value;
 124.331 +unsigned int len;
 124.332 +{
 124.333 +  unsigned int i;
 124.334 +
 124.335 +  for (i = 0; i < len; i++)
 124.336 + ((char *)output)[i] = (char)value;
 124.337 +}
   125.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.2 +++ b/src/message.c	Fri Sep 26 17:05:23 2008 +0200
   125.3 @@ -0,0 +1,210 @@
   125.4 +/*  MasqMail
   125.5 +    Copyright (C) 1999-2001 Oliver Kurth
   125.6 +
   125.7 +    This program is free software; you can redistribute it and/or modify
   125.8 +    it under the terms of the GNU General Public License as published by
   125.9 +    the Free Software Foundation; either version 2 of the License, or
  125.10 +    (at your option) any later version.
  125.11 +
  125.12 +    This program is distributed in the hope that it will be useful,
  125.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  125.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  125.15 +    GNU General Public License for more details.
  125.16 +
  125.17 +    You should have received a copy of the GNU General Public License
  125.18 +    along with this program; if not, write to the Free Software
  125.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  125.20 +*/
  125.21 +
  125.22 +#include "masqmail.h"
  125.23 +
  125.24 +message *create_message()
  125.25 +{
  125.26 +  message *msg = (message *)g_malloc(sizeof(message));
  125.27 +  if(msg){
  125.28 +    memset(msg, 0, sizeof(message));
  125.29 +    msg->data_size = -1;
  125.30 +  }
  125.31 +  return msg;
  125.32 +}
  125.33 +
  125.34 +gint msg_calc_size(message *msg, gboolean is_smtp)
  125.35 +{
  125.36 +  GList *node;
  125.37 +  gint l_cnt = 0, c_cnt = 0;
  125.38 +
  125.39 +  /* header size */
  125.40 +  if(msg->hdr_list){
  125.41 +    for(node = g_list_first(msg->hdr_list); node; node = g_list_next(node)){
  125.42 +      if(node->data){
  125.43 +	header *hdr = (header *)(node->data);
  125.44 +	if(hdr->header){
  125.45 +	  char *p = hdr->header;
  125.46 +	  while(*p){
  125.47 +	    if(*p++ == '\n') l_cnt++;
  125.48 +	    c_cnt++;
  125.49 +	  }
  125.50 +	}
  125.51 +      }
  125.52 +    }
  125.53 +  }
  125.54 +
  125.55 +  /* empty line separating headers from data: */
  125.56 +  c_cnt++;
  125.57 +  l_cnt++;
  125.58 +
  125.59 +  /* data size */
  125.60 +  if(msg->data_list){
  125.61 +    for(node = g_list_first(msg->data_list); node; node = g_list_next(node)){
  125.62 +      if(node->data){
  125.63 +	char *p = node->data;
  125.64 +	while(*p){
  125.65 +	  if(*p++ == '\n') l_cnt++;
  125.66 +	  c_cnt++;
  125.67 +	}
  125.68 +      }
  125.69 +    }
  125.70 +  }
  125.71 +
  125.72 +  return is_smtp ? c_cnt + l_cnt : c_cnt;
  125.73 +}
  125.74 +
  125.75 +void msg_free_data(message *msg)
  125.76 +{
  125.77 +  GList *node;
  125.78 +
  125.79 +  if(msg->data_list){
  125.80 +    for(node = g_list_first(msg->data_list); node; node = g_list_next(node)){
  125.81 +      if(node->data)
  125.82 +	g_free(node->data);
  125.83 +    }
  125.84 +    g_list_free(msg->data_list);
  125.85 +    msg->data_list = NULL;
  125.86 +  }
  125.87 +}
  125.88 +
  125.89 +void destroy_message(message *msg)
  125.90 +{
  125.91 +  GList *node;
  125.92 +
  125.93 +  if(msg->uid) g_free(msg->uid);
  125.94 +  if(msg->ident) g_free(msg->ident);
  125.95 +  if(msg->return_path) g_free(msg->return_path);
  125.96 +
  125.97 +  if(msg->rcpt_list){
  125.98 +    for(node = g_list_first(msg->rcpt_list); node; node = g_list_next(node)){
  125.99 +      if(node->data)
 125.100 +	g_free(node->data);
 125.101 +    }
 125.102 +    g_list_free(msg->rcpt_list);
 125.103 +  }
 125.104 +  if(msg->hdr_list){
 125.105 +    for(node = g_list_first(msg->hdr_list); node; node = g_list_next(node)){
 125.106 +      if(node->data){
 125.107 +	header *hdr = (header *)(node->data);
 125.108 +	if(hdr->header)
 125.109 +	  g_free(hdr->header);
 125.110 +	g_free(node->data);
 125.111 +      }
 125.112 +    }
 125.113 +    g_list_free(msg->hdr_list);
 125.114 +  }
 125.115 +
 125.116 +  if(msg->full_sender_name)
 125.117 +    g_free(msg->full_sender_name);
 125.118 +
 125.119 +  msg_free_data(msg);
 125.120 +
 125.121 +  g_free(msg);
 125.122 +}
 125.123 +
 125.124 +void destroy_msg_list(GList *msg_list)
 125.125 +{
 125.126 +  GList *msg_node;
 125.127 +
 125.128 +  foreach(msg_list, msg_node){
 125.129 +    message *msg = (message *)(msg_node->data);
 125.130 +    destroy_message(msg);
 125.131 +  }
 125.132 +  g_list_free(msg_list);
 125.133 +}
 125.134 +
 125.135 +msg_out *create_msg_out(message *msg)
 125.136 +{
 125.137 +  msg_out *msgout = NULL;
 125.138 +
 125.139 +  msgout = g_malloc(sizeof(msg_out));
 125.140 +  if(msgout){
 125.141 +    msgout->msg = msg;
 125.142 +    msgout->return_path = NULL;
 125.143 +    msgout->rcpt_list = NULL;
 125.144 +    
 125.145 +    msgout->hdr_list = NULL;
 125.146 +    msgout->xtra_hdr_list = NULL;
 125.147 +  }
 125.148 +  return msgout;
 125.149 +}
 125.150 +
 125.151 +msg_out *clone_msg_out(msg_out *msgout_orig)
 125.152 +{
 125.153 +  if(msgout_orig){
 125.154 +    msg_out *msgout = create_msg_out(msgout_orig->msg);
 125.155 +    if(msgout){
 125.156 +      msgout->msg = msgout_orig->msg;
 125.157 +      if(msgout_orig->return_path)
 125.158 +	msgout->return_path = copy_address(msgout_orig->return_path);
 125.159 +      if(msgout_orig->hdr_list)
 125.160 +	msgout->hdr_list = g_list_copy(msgout_orig->hdr_list);
 125.161 +      /* FIXME: if this lives longer than the original
 125.162 +	 and we access one of the xtra hdrs, we will segfault
 125.163 +	 or cause some weird bugs: */
 125.164 +      msgout->xtra_hdr_list = NULL;
 125.165 +      if(msgout_orig->rcpt_list)
 125.166 +	msgout->rcpt_list = g_list_copy(msgout_orig->rcpt_list);
 125.167 +    }
 125.168 +    return msgout;
 125.169 +  }
 125.170 +  return NULL;
 125.171 +}
 125.172 +
 125.173 +GList *create_msg_out_list(GList *msg_list)
 125.174 +{
 125.175 +  GList *msgout_list = NULL;
 125.176 +  GList *msg_node;
 125.177 +
 125.178 +  foreach(msg_list, msg_node){
 125.179 +    message *msg = (message *)(msg_node->data);
 125.180 +    msgout_list = g_list_append(msgout_list, create_msg_out(msg));
 125.181 +  }
 125.182 +  return msgout_list;
 125.183 +}
 125.184 +
 125.185 +void destroy_msg_out(msg_out *msgout)
 125.186 +{
 125.187 +  if(msgout){
 125.188 +    if(msgout->return_path)
 125.189 +      destroy_address(msgout->return_path);
 125.190 +    if(msgout->hdr_list)
 125.191 +      g_list_free(msgout->hdr_list);
 125.192 +    if(msgout->xtra_hdr_list){
 125.193 +      GList *hdr_node;
 125.194 +      foreach(msgout->xtra_hdr_list, hdr_node){
 125.195 +	header *hdr = (header *)(hdr_node->data);
 125.196 +	destroy_header(hdr);
 125.197 +      }
 125.198 +      g_list_free(msgout->xtra_hdr_list);
 125.199 +    }
 125.200 +    g_free(msgout);
 125.201 +  }
 125.202 +}
 125.203 +
 125.204 +void destroy_msg_out_list(GList *msgout_list)
 125.205 +{
 125.206 +  GList *msgout_node;
 125.207 +
 125.208 +  foreach(msgout_list, msgout_node){
 125.209 +    msg_out *msgout = (msg_out *)(msgout_node->data);
 125.210 +    destroy_msg_out(msgout);
 125.211 +  }
 125.212 +  g_list_free(msgout_list);
 125.213 +}
   126.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.2 +++ b/src/mservdetect.c	Fri Sep 26 17:05:23 2008 +0200
   126.3 @@ -0,0 +1,76 @@
   126.4 +/*  MasqMail
   126.5 +    Copyright (C) 1999-2001 Oliver Kurth
   126.6 +
   126.7 +    This program is free software; you can redistribute it and/or modify
   126.8 +    it under the terms of the GNU General Public License as published by
   126.9 +    the Free Software Foundation; either version 2 of the License, or
  126.10 +    (at your option) any later version.
  126.11 +
  126.12 +    This program is distributed in the hope that it will be useful,
  126.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  126.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  126.15 +    GNU General Public License for more details.
  126.16 +
  126.17 +    You should have received a copy of the GNU General Public License
  126.18 +    along with this program; if not, write to the Free Software
  126.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  126.20 +*/
  126.21 +
  126.22 +/*
  126.23 +#include "masqmail.h"
  126.24 +#include "readsock.h"
  126.25 +#include "mserver.h"
  126.26 +*/
  126.27 +
  126.28 +#include "config.h"
  126.29 +
  126.30 +/* ugly hack */
  126.31 +#ifndef ENABLE_MSERVER
  126.32 +#define ENABLE_MSERVER 1
  126.33 +#include "mserver.c"
  126.34 +#else
  126.35 +#include "masqmail.h"
  126.36 +#include "readsock.h"
  126.37 +#include "mserver.h"
  126.38 +#endif /* ENABLE_MSERVER */
  126.39 +
  126.40 +void logwrite(int pri, const char *fmt, ...)
  126.41 +{
  126.42 +  va_list args;
  126.43 +  va_start(args, fmt);
  126.44 +
  126.45 +  vfprintf(stdout, fmt, args);
  126.46 +
  126.47 +  va_end(args);
  126.48 +}
  126.49 +
  126.50 +void debugf(const char *fmt, ...)
  126.51 +{
  126.52 +  va_list args;
  126.53 +  va_start(args, fmt);
  126.54 +
  126.55 +  vfprintf(stdout, fmt, args);
  126.56 +
  126.57 +  va_end(args);
  126.58 +}
  126.59 +
  126.60 +int main(int argc, char *argv[])
  126.61 +{
  126.62 +  if(argc == 3){
  126.63 +    interface iface;
  126.64 +    gchar *name;
  126.65 +
  126.66 +    iface.address = g_strdup(argv[1]);
  126.67 +    iface.port = atoi(argv[2]);
  126.68 +
  126.69 +    name = mserver_detect_online(&iface);
  126.70 +
  126.71 +    printf("%s\n", name);
  126.72 +
  126.73 +    exit(EXIT_SUCCESS);
  126.74 +  }else{
  126.75 +    fprintf(stderr, "usage %s <host> <port>\n", argv[0]);
  126.76 +    exit(EXIT_FAILURE);
  126.77 +  }
  126.78 +}
  126.79 +
   127.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.2 +++ b/src/mserver.c	Fri Sep 26 17:05:23 2008 +0200
   127.3 @@ -0,0 +1,78 @@
   127.4 +/*  MasqMail
   127.5 +    Copyright (C) 1999/2000/2001 Oliver Kurth
   127.6 +
   127.7 +    This program is free software; you can redistribute it and/or modify
   127.8 +    it under the terms of the GNU General Public License as published by
   127.9 +    the Free Software Foundation; either version 2 of the License, or
  127.10 +    (at your option) any later version.
  127.11 +
  127.12 +    This program is distributed in the hope that it will be useful,
  127.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  127.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  127.15 +    GNU General Public License for more details.
  127.16 +
  127.17 +    You should have received a copy of the GNU General Public License
  127.18 +    along with this program; if not, write to the Free Software
  127.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  127.20 +*/
  127.21 +
  127.22 +#include "masqmail.h"
  127.23 +#include "readsock.h"
  127.24 +#include "mserver.h"
  127.25 +
  127.26 +#ifdef ENABLE_MSERVER
  127.27 +
  127.28 +gchar *mserver_detect_online(interface *iface)
  127.29 +{
  127.30 +  struct sockaddr_in saddr;
  127.31 +  gchar *ret = NULL;
  127.32 +
  127.33 +  if(init_sockaddr(&saddr, iface)){
  127.34 +    int sock = socket(PF_INET, SOCK_STREAM, 0);
  127.35 +    int dup_sock;
  127.36 +    if(connect(sock, (struct sockaddr *)(&saddr), sizeof(saddr)) == 0){
  127.37 +      FILE *in, *out;
  127.38 +      char buf[256];
  127.39 +
  127.40 +      dup_sock = dup(sock);
  127.41 +      out = fdopen(sock, "w");
  127.42 +      in = fdopen(dup_sock, "r");
  127.43 +
  127.44 +      if(read_sockline(in, buf, 256, 15, READSOCKL_CHUG)){
  127.45 +	if(strncmp(buf, "READY", 5) == 0){
  127.46 +	  fprintf(out, "STAT\n"); fflush(out);
  127.47 +	  if(read_sockline(in, buf, 256, 15, READSOCKL_CHUG)){
  127.48 +	    if(strncmp(buf, "DOWN", 4) == 0){
  127.49 +	      ret = NULL;
  127.50 +	    }else if(strncmp(buf, "UP", 2) == 0){
  127.51 +	      gchar *p = buf+3;
  127.52 +	      while((*p != ':') && *p) p++;
  127.53 +	      if(*p){
  127.54 +		*p = 0;
  127.55 +		p++;
  127.56 +		if((atoi(p) >= 0) && *p)
  127.57 +		  ret = g_strdup(buf+3);
  127.58 +	      }else
  127.59 +		logwrite(LOG_ALERT,
  127.60 +			 "unexpected response from mserver after STAT cmd: %s",
  127.61 +			 buf);
  127.62 +	    }else{
  127.63 +	      logwrite(LOG_ALERT,
  127.64 +		       "unexpected response from mserver after STAT cmd: %s",
  127.65 +		       buf);
  127.66 +	    }
  127.67 +	  }
  127.68 +	}
  127.69 +	fprintf(out, "QUIT"); fflush(out);
  127.70 +
  127.71 +	close(sock);
  127.72 +	close(dup_sock);
  127.73 +	fclose(in);
  127.74 +	fclose(out);
  127.75 +      }
  127.76 +    }
  127.77 +  }
  127.78 +  return ret;
  127.79 +}
  127.80 +
  127.81 +#endif
   128.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.2 +++ b/src/mserver.h	Fri Sep 26 17:05:23 2008 +0200
   128.3 @@ -0,0 +1,19 @@
   128.4 +/*  MasqMail
   128.5 +    Copyright (C) 2001 Oliver Kurth
   128.6 +
   128.7 +    This program is free software; you can redistribute it and/or modify
   128.8 +    it under the terms of the GNU General Public License as published by
   128.9 +    the Free Software Foundation; either version 2 of the License, or
  128.10 +    (at your option) any later version.
  128.11 +
  128.12 +    This program is distributed in the hope that it will be useful,
  128.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  128.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  128.15 +    GNU General Public License for more details.
  128.16 +
  128.17 +    You should have received a copy of the GNU General Public License
  128.18 +    along with this program; if not, write to the Free Software
  128.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  128.20 +*/
  128.21 +
  128.22 +gchar *mserver_detect_online(interface *iface);
   129.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.2 +++ b/src/online.c	Fri Sep 26 17:05:23 2008 +0200
   129.3 @@ -0,0 +1,119 @@
   129.4 +/*  MasqMail
   129.5 +    Copyright (C) 1999-2001 Oliver Kurth
   129.6 +
   129.7 +    This program is free software; you can redistribute it and/or modify
   129.8 +    it under the terms of the GNU General Public License as published by
   129.9 +    the Free Software Foundation; either version 2 of the License, or
  129.10 +    (at your option) any later version.
  129.11 +
  129.12 +    This program is distributed in the hope that it will be useful,
  129.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  129.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  129.15 +    GNU General Public License for more details.
  129.16 +
  129.17 +    You should have received a copy of the GNU General Public License
  129.18 +    along with this program; if not, write to the Free Software
  129.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  129.20 +*/
  129.21 +
  129.22 +#include <sys/stat.h>
  129.23 +#include <sys/wait.h>
  129.24 +#include "masqmail.h"
  129.25 +#include "mserver.h"
  129.26 +#include "peopen.h"
  129.27 +
  129.28 +gchar *connection_name;
  129.29 +
  129.30 +void set_online_name(gchar *name)
  129.31 +{
  129.32 +  connection_name = g_strdup(name);
  129.33 +}
  129.34 +
  129.35 +static
  129.36 +gchar *detect_online_pipe(const gchar *pipe)
  129.37 +{
  129.38 +  pid_t pid;
  129.39 +  void (*old_signal)(int);
  129.40 +  int status;
  129.41 +  FILE *in;
  129.42 +  gchar *name = NULL;
  129.43 +
  129.44 +  old_signal = signal(SIGCHLD, SIG_DFL);
  129.45 +
  129.46 +  in = peopen(pipe, "r", environ, &pid);
  129.47 +  if(in != NULL){
  129.48 +    gchar output[256];
  129.49 +    if(fgets(output, 255, in)){
  129.50 +      g_strchomp(output);
  129.51 +      name = g_strdup(output);
  129.52 +    }
  129.53 +    fclose(in);
  129.54 +    waitpid(pid, &status, 0);
  129.55 +    if(WEXITSTATUS(status) != EXIT_SUCCESS){
  129.56 +      g_free(name);
  129.57 +      name = NULL;
  129.58 +    }
  129.59 +  }else
  129.60 +    logwrite(LOG_ALERT, "could not open pipe '%s': %s\n", pipe, strerror(errno));
  129.61 +
  129.62 +  signal(SIGCHLD, old_signal);
  129.63 +
  129.64 +  return name;
  129.65 +}
  129.66 +
  129.67 +gchar *detect_online()
  129.68 +{
  129.69 +  if(conf.online_detect != NULL){
  129.70 +    if(strcmp(conf.online_detect, "file") == 0){
  129.71 +      DEBUG(3) debugf("online detection method 'file'\n");
  129.72 +      if(conf.online_file != NULL){
  129.73 +	struct stat st;
  129.74 +	if(stat(conf.online_file, &st) == 0){
  129.75 +	  FILE *fptr = fopen(conf.online_file, "r");
  129.76 +	  if(fptr){
  129.77 +	    char buf[256];
  129.78 +	    fgets(buf, 256, fptr);
  129.79 +	    g_strchomp(buf);
  129.80 +	    fclose(fptr);
  129.81 +	    return g_strdup(buf);
  129.82 +	  }else{
  129.83 +	    logwrite(LOG_ALERT, "opening of %s failed: %s\n",
  129.84 +		     conf.online_file, strerror(errno));
  129.85 +	    return NULL;
  129.86 +	  }
  129.87 +	}
  129.88 +	else if(errno == ENOENT){
  129.89 +	  logwrite(LOG_NOTICE, "not online.\n");
  129.90 +	  return NULL;
  129.91 +	}else{
  129.92 +	  logwrite(LOG_ALERT, "stat of %s failed: %s",
  129.93 +		   conf.online_file, strerror(errno));
  129.94 +	  return NULL;
  129.95 +	}
  129.96 +      }else
  129.97 +	logwrite(LOG_ALERT,
  129.98 +		 "online detection mode is 'file', "
  129.99 +		 "but online_file is undefined\n");
 129.100 +#ifdef ENABLE_MSERVER
 129.101 +    }else if(strcmp(conf.online_detect, "mserver") == 0){
 129.102 +      DEBUG(3) debugf("connection method 'mserver'\n");
 129.103 +      return mserver_detect_online(conf.mserver_iface);
 129.104 +#endif
 129.105 +    }else if(strcmp(conf.online_detect, "pipe") == 0){
 129.106 +      DEBUG(3) debugf("connection method 'pipe'\n");
 129.107 +      if(conf.online_pipe)
 129.108 +	return detect_online_pipe(conf.online_pipe);
 129.109 +      else{
 129.110 +	logwrite(LOG_ALERT,
 129.111 +		 "online detection mode is 'pipe', "
 129.112 +		 "but online_pipe is undefined\n");
 129.113 +	return NULL;
 129.114 +      }
 129.115 +    }else if(strcmp(conf.online_detect, "argument") == 0){
 129.116 +      return connection_name;
 129.117 +    }else{
 129.118 +      DEBUG(3) debugf("no connection method selected\n");
 129.119 +    }
 129.120 +  }
 129.121 +  return NULL;
 129.122 +}
   130.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.2 +++ b/src/parse.c	Fri Sep 26 17:05:23 2008 +0200
   130.3 @@ -0,0 +1,450 @@
   130.4 +/*  MasqMail
   130.5 +    Copyright (C) 1999-2001 Oliver Kurth
   130.6 +
   130.7 +    This program is free software; you can redistribute it and/or modify
   130.8 +    it under the terms of the GNU General Public License as published by
   130.9 +    the Free Software Foundation; either version 2 of the License, or
  130.10 +    (at your option) any later version.
  130.11 +
  130.12 +    This program is distributed in the hope that it will be useful,
  130.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  130.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  130.15 +    GNU General Public License for more details.
  130.16 +
  130.17 +    You should have received a copy of the GNU General Public License
  130.18 +    along with this program; if not, write to the Free Software
  130.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  130.20 +*/
  130.21 +
  130.22 +#ifndef PARSE_TEST
  130.23 +#include "masqmail.h"
  130.24 +#endif
  130.25 +
  130.26 +/* This is really dangerous. I hope that I was careful enough,
  130.27 +   but maybe there is some malformed address possible that causes
  130.28 +   this to segfault or be caught in endless loops.
  130.29 +
  130.30 +   If you find something like that, PLEASE mail the string to me
  130.31 +   (no matter how idiotic it is), so that I can debug that.
  130.32 +   Those things really should not happen.
  130.33 +*/
  130.34 +
  130.35 +static gchar *specials = "()<>@,;:\\\".[]`";
  130.36 +
  130.37 +char *parse_error = NULL;
  130.38 +
  130.39 +static
  130.40 +gchar *skip_comment(gchar *p)
  130.41 +{
  130.42 +
  130.43 +#ifdef PARSE_TEST
  130.44 +  g_print("skip_comment: %s\n", p);
  130.45 +#endif
  130.46 +
  130.47 +  p++;
  130.48 +  while(*p && *p != ')'){
  130.49 +    p++;
  130.50 +    if(*p == '(')
  130.51 +      p = skip_comment(p);
  130.52 +  }
  130.53 +  p++;
  130.54 +
  130.55 +  return p;
  130.56 +}
  130.57 +
  130.58 +static
  130.59 +gboolean read_word(gchar *p, gchar **b, gchar **e)
  130.60 +{
  130.61 +#ifdef PARSE_TEST
  130.62 +  g_print("read_word: %s\n", p);
  130.63 +#endif
  130.64 +  /* eat leading spaces */
  130.65 +  while(*p && isspace(*p)) p++;
  130.66 +  
  130.67 +  *b = p;
  130.68 +  /*  b = &p;*/
  130.69 +  if(*p == '\"'){
  130.70 +    /* quoted-string */
  130.71 +    p++;
  130.72 +    while(*p && (*p != '\"')) p++;
  130.73 +    p++;
  130.74 +  }else{
  130.75 +    /* atom */
  130.76 +    while(*p && !strchr(specials, *p) && !iscntrl(*p) && !isspace(*p))
  130.77 +      p++;
  130.78 +  }
  130.79 +  *e = p;
  130.80 +  return TRUE;
  130.81 +}
  130.82 +
  130.83 +static
  130.84 +gboolean read_word_with_dots(gchar *p, gchar **b, gchar **e)
  130.85 +{
  130.86 +  gchar *b0 = p;
  130.87 +
  130.88 +#ifdef PARSE_TEST
  130.89 +  g_print("read_word_with_dots: %s\n", p);
  130.90 +#endif
  130.91 +  while(TRUE){
  130.92 +    if(!read_word(p, b, e))
  130.93 +      return FALSE;
  130.94 +    p = *e;
  130.95 +    if(*p != '.') break;
  130.96 +    p++;
  130.97 +  }
  130.98 +  *b = b0;
  130.99 +  *e = p;
 130.100 +  return TRUE;
 130.101 +}
 130.102 +
 130.103 +static
 130.104 +gboolean read_domain(gchar *p, gchar **b, gchar **e)
 130.105 +{
 130.106 +#ifdef PARSE_TEST
 130.107 +  g_print("read_domain: %s\n", p);
 130.108 +#endif
 130.109 +  *b = p;
 130.110 +  if(*p != '['){
 130.111 +    while(isalnum(*p) || (*p == '-') || (*p == '.'))
 130.112 +      p++;
 130.113 +  }else{
 130.114 +    p++;
 130.115 +    while(isalpha(*p) || (*p == '.'))
 130.116 +      p++;
 130.117 +    if(*p != ']'){
 130.118 +      parse_error =
 130.119 +	g_strdup_printf("']' expected at end of literal address %s", *b);
 130.120 +      return FALSE;
 130.121 +    }
 130.122 +    p++;
 130.123 +  }
 130.124 +  *e = p;
 130.125 +  return TRUE;
 130.126 +}
 130.127 +
 130.128 +gboolean parse_address_rfc822(gchar *string,
 130.129 +		       gchar **local_begin, gchar **local_end,
 130.130 +		       gchar **domain_begin, gchar **domain_end,
 130.131 +		       gchar **address_end)
 130.132 +{
 130.133 +  gint angle_brackets = 0;
 130.134 +
 130.135 +  gchar *p = string;
 130.136 +  gchar *b, *e;
 130.137 +
 130.138 +  *local_begin = *local_end = NULL;
 130.139 +  *domain_begin = *domain_end = NULL;
 130.140 +
 130.141 +  /* might be some memory left from previous call: */
 130.142 +  if(parse_error != NULL){
 130.143 +    g_free(parse_error);
 130.144 +    parse_error = NULL;
 130.145 +  }
 130.146 +
 130.147 +  /* leading spaces and angle brackets */
 130.148 +  while(*p && (isspace(*p) || (*p == '<'))){
 130.149 +    if(*p == '<')
 130.150 +      angle_brackets++;
 130.151 +    p++;
 130.152 +  }
 130.153 + 
 130.154 +  if(*p){
 130.155 +    while(TRUE){
 130.156 +      if(read_word_with_dots(p, &b, &e)){
 130.157 +	p = e;
 130.158 +#ifdef PARSE_TEST
 130.159 +	g_print("after read_word_with_dots: %s\n", p);
 130.160 +#endif
 130.161 +	/* eat white spaces and comments */
 130.162 +	while((*p && (isspace(*p))) || (*p == '(')){
 130.163 +	  if(*p == '('){
 130.164 +	    if(!(p = skip_comment(p))){
 130.165 +	      parse_error =
 130.166 +		g_strdup("missing right bracket ')'");
 130.167 +	      return FALSE;
 130.168 +	    }
 130.169 +	  }else
 130.170 +	    p++;
 130.171 +	}
 130.172 +	/* we now have a non-space char that is not
 130.173 +	   the beginning of a comment */
 130.174 +
 130.175 +	if(*p == '@'){
 130.176 +	  /* the last word was the local_part
 130.177 +	     of an addr-spec */
 130.178 +	  *local_begin = b;
 130.179 +	  *local_end = e;
 130.180 +#ifdef PARSE_TEST
 130.181 +	  g_print("found local part: %s\n", *local_begin);
 130.182 +#endif
 130.183 +	  if(*p == '@'){
 130.184 +	    p++; /* skip @ */
 130.185 +	    /* now the domain */
 130.186 +	    if(read_domain(p, &b, &e)){
 130.187 +	      p = e;
 130.188 +	      *domain_begin = b;
 130.189 +	      *domain_end = e;
 130.190 +	    }
 130.191 +	    else
 130.192 +	      return FALSE;
 130.193 +	  }else{
 130.194 +	    /* unqualified? */
 130.195 +	    *domain_begin = *domain_end = NULL;
 130.196 +	  }
 130.197 +	  break;
 130.198 +	}else if(*p == '<'){
 130.199 +	  /* addr-spec follows */
 130.200 +	  while(isspace(*p) || (*p == '<')){
 130.201 +	    if(*p == '<')
 130.202 +	      angle_brackets++;
 130.203 +	    p++;
 130.204 +	  }
 130.205 +	  if(read_word_with_dots(p, &b, &e)){
 130.206 +	    p = e;
 130.207 +	    *local_begin = b;
 130.208 +	    *local_end = e;
 130.209 +#ifdef PARSE_TEST
 130.210 +	  g_print("found local part: %s\n", *local_begin);
 130.211 +#endif
 130.212 +	  }else
 130.213 +	    return FALSE;
 130.214 +	  if(*p == '@'){
 130.215 +	    p++;
 130.216 +	    if(read_domain(p, &b, &e)){
 130.217 +	      p = e;
 130.218 +	      *domain_begin = b;
 130.219 +	      *domain_end = e;
 130.220 +	    }else
 130.221 +	      return FALSE;
 130.222 +	  }else{
 130.223 +	    /* may be unqualified address */
 130.224 +	    *domain_begin = *domain_end = NULL;
 130.225 +	  }
 130.226 +	  break;
 130.227 +	}else if(!*p || *p == '>'){
 130.228 +	  *local_begin = b;
 130.229 +	  *local_end = e;
 130.230 +#ifdef PARSE_TEST
 130.231 +	  g_print("found local part: %s\n", *local_begin);
 130.232 +#endif
 130.233 +	  *domain_begin = *domain_end = NULL;
 130.234 +	  break;
 130.235 +	}else if(strchr(specials, *p) || iscntrl(*p) || isspace(*p)){
 130.236 +	  parse_error = g_strdup_printf("unexpected character: %c", *p);
 130.237 +	  return FALSE;
 130.238 +	}
 130.239 +      }else
 130.240 +	return FALSE;
 130.241 +    }
 130.242 +   /* trailing spaces and angle brackets */
 130.243 +#ifdef PARSE_TEST
 130.244 +    g_print("down counting trailing '>'\n");
 130.245 +#endif
 130.246 +    while(*p && (isspace(*p) || (*p == '>'))){
 130.247 +      if(*p == '>')
 130.248 +	angle_brackets--;
 130.249 +      p++;
 130.250 +    }
 130.251 +
 130.252 +    *address_end = p;
 130.253 +
 130.254 +    if(angle_brackets != 0){
 130.255 +      if(angle_brackets > 0)
 130.256 +	parse_error = g_strdup("missing '>' at end of string");
 130.257 +      else
 130.258 +	parse_error = g_strdup("superfluous '>' at end of string");
 130.259 +      return FALSE;
 130.260 +    }else{
 130.261 +      /* we successfully parsed the address */
 130.262 +      return TRUE;
 130.263 +    }
 130.264 +    /* we never get here */
 130.265 +  }
 130.266 +  return FALSE;
 130.267 +}
 130.268 +
 130.269 +gboolean parse_address_rfc821(gchar *string,
 130.270 +			      gchar **local_begin, gchar **local_end,
 130.271 +			      gchar **domain_begin, gchar **domain_end,
 130.272 +			      gchar **address_end)
 130.273 +{
 130.274 +  gint angle_brackets = 0;
 130.275 +
 130.276 +  gchar *p = string;
 130.277 +  gchar *b, *e;
 130.278 +
 130.279 +  *local_begin = *local_end = NULL;
 130.280 +  *domain_begin = *domain_end = NULL;
 130.281 +
 130.282 +  /* might be some memory left from previous call: */
 130.283 +  if(parse_error != NULL){
 130.284 +    g_free(parse_error);
 130.285 +    parse_error = NULL;
 130.286 +  }
 130.287 +
 130.288 +  /* leading spaces and angle brackets */
 130.289 +  while(*p && (isspace(*p) || (*p == '<'))){
 130.290 +    if(*p == '<')
 130.291 +      angle_brackets++;
 130.292 +    p++;
 130.293 +  }
 130.294 + 
 130.295 +  if(*p){
 130.296 +    while(TRUE){
 130.297 +      if(read_word_with_dots(p, &b, &e)){
 130.298 +	p = e;
 130.299 +#ifdef PARSE_TEST
 130.300 +	g_print("after read_word_with_dots: %s\n", p);
 130.301 +#endif
 130.302 +	*local_begin = b;
 130.303 +	*local_end = e;
 130.304 +#ifdef PARSE_TEST
 130.305 +	  g_print("found local part: %s\n", *local_begin);
 130.306 +	  g_print("local_end = %s\n", *local_end);
 130.307 +#endif
 130.308 +	if(!(*p) || isspace(*p) || (*p == '>')){
 130.309 +	  /* unqualified ?*/
 130.310 +	  domain_begin = domain_end = NULL;
 130.311 +	  break;
 130.312 +	}else if(*p == '@'){
 130.313 +	  p++;
 130.314 +	  if(read_domain(p, &b, &e)){
 130.315 +	    p = e;
 130.316 +	    *domain_begin = b;
 130.317 +	    *domain_end = e;
 130.318 +	  }
 130.319 +	  break;
 130.320 +	}else{
 130.321 +	  parse_error =
 130.322 +	      g_strdup_printf("unexpected character after local part '%c'",*p);
 130.323 +	  return FALSE;
 130.324 +	}
 130.325 +      } else
 130.326 +         return FALSE;
 130.327 +    }
 130.328 +
 130.329 +    /* trailing spaces and angle brackets */
 130.330 +#ifdef PARSE_TEST
 130.331 +    g_print("down counting trailing '>'\n");
 130.332 +#endif
 130.333 +    while(*p && (isspace(*p) || (*p == '>'))){
 130.334 +      if(*p == '>')
 130.335 +	angle_brackets--;
 130.336 +      p++;
 130.337 +    }
 130.338 +    *address_end = p;
 130.339 +
 130.340 +    if(angle_brackets != 0){
 130.341 +      if(angle_brackets > 0)
 130.342 +	parse_error = g_strdup("missing '>' at end of string");
 130.343 +      else
 130.344 +	parse_error = g_strdup("superfluous '>' at end of string");
 130.345 +      return FALSE;
 130.346 +    }else{
 130.347 +      /* we successfully parsed the address */
 130.348 +      return TRUE;
 130.349 +    }
 130.350 +    /* we never get here */
 130.351 +  }
 130.352 +  return FALSE;
 130.353 +}
 130.354 +
 130.355 +/*
 130.356 +  allocate address, reading from string.
 130.357 +  On failure, returns NULL.
 130.358 +  after call, end contatins a pointer to the end of the parsed string
 130.359 +  end may be NULL, if we are not interested.
 130.360 +
 130.361 +  parses both rfc 821 and rfc 822 addresses, depending on flag is_rfc821
 130.362 +*/
 130.363 +
 130.364 +address *_create_address(gchar *string, gchar **end, gboolean is_rfc821)
 130.365 +{
 130.366 +  gchar *loc_beg, *loc_end;
 130.367 +  gchar *dom_beg, *dom_end;
 130.368 +  gchar *addr_end;
 130.369 +
 130.370 +  if (string && (string[0] == 0)) {
 130.371 +    address *addr = g_malloc(sizeof(address));
 130.372 +    addr->address = g_strdup("");
 130.373 +    addr->local_part = g_strdup("");
 130.374 +    addr->domain = g_strdup(""); /* 'NULL' address (failure notice),
 130.375 +        "" makes sure it will not be qualified with a hostname */
 130.376 +    return addr;
 130.377 +  }
 130.378 +
 130.379 +  if(is_rfc821 ?
 130.380 +     parse_address_rfc821(string,
 130.381 +			  &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end) :
 130.382 +     parse_address_rfc822(string,
 130.383 +			  &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end)){
 130.384 +    address *addr = g_malloc(sizeof(address));
 130.385 +    gchar *p = addr_end;
 130.386 +    
 130.387 +
 130.388 +    memset(addr, 0, sizeof(address));
 130.389 +
 130.390 +    if(loc_beg[0] == '|'){
 130.391 +      parse_error = g_strdup("no pipe allowed for RFC 822/821 address");
 130.392 +      return NULL;
 130.393 +    }
 130.394 +
 130.395 +    while(*p && (*p != ',')) p++;
 130.396 +    addr->address = g_strndup(string, p - string);
 130.397 +
 130.398 +    addr->local_part = g_strndup(loc_beg, loc_end - loc_beg);
 130.399 +
 130.400 +#ifdef PARSE_TEST
 130.401 +    g_print("addr->local_part = %s\n", addr->local_part);
 130.402 +#endif
 130.403 +
 130.404 +    if(dom_beg != NULL){
 130.405 +      addr->domain = g_strndup(dom_beg, dom_end - dom_beg);
 130.406 +    }else{
 130.407 +      if(addr->local_part[0] == 0)
 130.408 +	addr->domain = g_strdup(""); /* 'NULL' address (failure notice),
 130.409 +		      "" makes sure it will not be qualified with a hostname */
 130.410 +      else
 130.411 +	addr->domain = NULL;
 130.412 +    }
 130.413 +
 130.414 +    if(end != NULL)
 130.415 +      *end = p;
 130.416 +
 130.417 +#ifndef PARSE_TEST
 130.418 +    addr_unmark_delivered(addr);
 130.419 +#endif
 130.420 +
 130.421 +    return addr;
 130.422 +  }
 130.423 +  return NULL;
 130.424 +}
 130.425 +
 130.426 +address *create_address_rfc822(gchar *string, gchar **end){
 130.427 +  return _create_address(string, end, FALSE);
 130.428 +}
 130.429 +
 130.430 +address *create_address_rfc821(gchar *string, gchar **end){
 130.431 +  return _create_address(string, end, TRUE);
 130.432 +}
 130.433 +
 130.434 +GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain)
 130.435 +{
 130.436 +  gchar *p = string;
 130.437 +  gchar *end;
 130.438 +
 130.439 +  while(*p){
 130.440 +    address *addr = _create_address(p, &end, FALSE);
 130.441 +    if(addr){
 130.442 +      if(domain)
 130.443 +	if(addr->domain == NULL)
 130.444 +	  addr->domain = g_strdup(domain);
 130.445 +
 130.446 +      addr_list = g_list_append(addr_list, addr);
 130.447 +      p = end;
 130.448 +    }else
 130.449 +      break;
 130.450 +    while(*p == ',' || isspace(*p)) p++;
 130.451 +  }
 130.452 +  return addr_list;
 130.453 +}
   131.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.2 +++ b/src/peopen.c	Fri Sep 26 17:05:23 2008 +0200
   131.3 @@ -0,0 +1,136 @@
   131.4 +/* This a snippet I found in sourceforge. I just changed the identing
   131.5 +   style to my own and deleted the main function.  */
   131.6 +
   131.7 +#include <errno.h>
   131.8 +#include <stdio.h>
   131.9 +#include <stdlib.h>
  131.10 +#include <unistd.h>
  131.11 +#include <string.h>
  131.12 +#include <sys/types.h>
  131.13 +
  131.14 +#include "peopen.h"
  131.15 +#include "sysexits.h"
  131.16 +
  131.17 +#include "masqmail.h"
  131.18 +
  131.19 +static
  131.20 +void destroy_argv(char **arr)
  131.21 +{
  131.22 +  char *p = arr[0];
  131.23 +  int i = 0;
  131.24 +
  131.25 +  while(p){
  131.26 +    free(p);
  131.27 +    p = arr[i++];
  131.28 +  }
  131.29 +  free(arr);
  131.30 +}
  131.31 +
  131.32 +static
  131.33 +char **create_argv(const char *cmd, int count)
  131.34 +{
  131.35 +  char buf[strlen(cmd)+1];
  131.36 +  char **arr, *q;
  131.37 +  const char *p;
  131.38 +  int i = 0;
  131.39 +
  131.40 +  arr = (char **)malloc(sizeof(char *) * count);
  131.41 +  
  131.42 +  p = cmd;
  131.43 +  while(*p && i < (count-1)){
  131.44 +    while(*p && isspace(*p)) p++;
  131.45 +    q = buf;
  131.46 +    while(*p && !isspace(*p)) *q++ = *p++;
  131.47 +    *q = 0;
  131.48 +    arr[i++] = strdup(buf);
  131.49 +    while(*p && isspace(*p)) p++;
  131.50 +  }
  131.51 +  arr[i] = NULL;
  131.52 +
  131.53 +  return arr;
  131.54 +}
  131.55 +
  131.56 +FILE* peidopen(const char	*command,
  131.57 +	       const char	*type,
  131.58 +	       char *const envp [],
  131.59 +	       int *ret_pid,
  131.60 +	       uid_t uid, gid_t gid
  131.61 +	     )
  131.62 +{
  131.63 +  enum { Read, Write } mode;
  131.64 +  int pipe_fd [2];
  131.65 +  pid_t pid;
  131.66 +    
  131.67 +  if (command == NULL || type == NULL) {
  131.68 +    errno = EINVAL;
  131.69 +    return NULL;
  131.70 +  }
  131.71 +
  131.72 +  if (strcmp (type, "r")) {
  131.73 +    if (strcmp (type, "w")) {
  131.74 +      errno = EINVAL;
  131.75 +      return NULL;
  131.76 +    } else
  131.77 +      mode = Write;
  131.78 +  } else
  131.79 +    mode = Read;
  131.80 +
  131.81 +  if (pipe (pipe_fd) == -1)
  131.82 +    return NULL;
  131.83 +
  131.84 +  switch (pid = fork ()) {
  131.85 +  case 0: /* child thread */
  131.86 +
  131.87 +    {
  131.88 +      int i, max_fd = sysconf(_SC_OPEN_MAX);
  131.89 +      
  131.90 +      if(max_fd <= 0) max_fd = 64;
  131.91 +      for(i = 0; i < max_fd; i++)
  131.92 +	if((i != pipe_fd[0]) && (i != pipe_fd[1])) close(i);
  131.93 +    }
  131.94 +    if (close (pipe_fd [mode == Read ? 0 : 1]) != -1 &&
  131.95 +	dup2 (pipe_fd [mode == Read ? 1 : 0], mode == Read ? STDOUT_FILENO : STDIN_FILENO) != -1) {
  131.96 +      //      char *argv [] = { "/bin/sh", "-c", (char*) command, NULL };
  131.97 +      char **argv = create_argv(command, 10);
  131.98 +      int ret;
  131.99 +
 131.100 +      if(uid != (uid_t)-1){
 131.101 +	if((ret = seteuid(0)) != 0){
 131.102 +	  exit(EX_NOPERM);
 131.103 +	}
 131.104 +      }
 131.105 +      if(gid != (gid_t)-1){
 131.106 +	if((ret = setgid(gid)) != 0){
 131.107 +	  exit(EX_NOPERM);
 131.108 +	}
 131.109 +      }
 131.110 +      if(uid != (uid_t)-1){
 131.111 +	if((ret = setuid(uid)) != 0){
 131.112 +	  exit(EX_NOPERM);
 131.113 +	}
 131.114 +      }
 131.115 +      execve (*argv, argv, envp);
 131.116 +    }
 131.117 +	    
 131.118 +    _exit (errno);
 131.119 +	    
 131.120 +  default: /* parent thread */
 131.121 +    *ret_pid = pid;
 131.122 +    close (pipe_fd [mode == Read ? 1 : 0]);
 131.123 +    return fdopen (pipe_fd [mode == Read ? 0 : 1], type);
 131.124 +	    
 131.125 +  case -1:
 131.126 +    close (pipe_fd [0]);
 131.127 +    close (pipe_fd [1]);
 131.128 +    return NULL;
 131.129 +  }
 131.130 +}
 131.131 +
 131.132 +FILE* peopen(const char	*command,
 131.133 +	     const char	*type,
 131.134 +	     char *const envp [],
 131.135 +	     int *ret_pid
 131.136 +	     )
 131.137 +{
 131.138 +  return peidopen(command, type, envp, ret_pid, -1 ,-1);
 131.139 +}
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/src/peopen.h	Fri Sep 26 17:05:23 2008 +0200
   132.3 @@ -0,0 +1,13 @@
   132.4 +FILE* peopen(const char	*command,
   132.5 +	     const char	*type,
   132.6 +	     char *const envp [],
   132.7 +	     int *ret_pid
   132.8 +);
   132.9 +
  132.10 +FILE* peidopen(const char	*command,
  132.11 +	       const char	*type,
  132.12 +	       char *const envp [],
  132.13 +	       int *ret_pid,
  132.14 +	       uid_t uid, gid_t gid
  132.15 +);
  132.16 +
   133.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.2 +++ b/src/permissions.c	Fri Sep 26 17:05:23 2008 +0200
   133.3 @@ -0,0 +1,78 @@
   133.4 +/*  MasqMail
   133.5 +    Copyright (C) 2000 Oliver Kurth
   133.6 +
   133.7 +    This program is free software; you can redistribute it and/or modify
   133.8 +    it under the terms of the GNU General Public License as published by
   133.9 +    the Free Software Foundation; either version 2 of the License, or
  133.10 +    (at your option) any later version.
  133.11 +
  133.12 +    This program is distributed in the hope that it will be useful,
  133.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  133.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  133.15 +    GNU General Public License for more details.
  133.16 +
  133.17 +    You should have received a copy of the GNU General Public License
  133.18 +    along with this program; if not, write to the Free Software
  133.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  133.20 +*/
  133.21 +
  133.22 +#include "masqmail.h"
  133.23 +#include <pwd.h>
  133.24 +#include <grp.h>
  133.25 +
  133.26 +/* is there really no function in libc for this? */
  133.27 +gboolean is_ingroup(uid_t uid, gid_t gid)
  133.28 +{
  133.29 +  struct group *grent = getgrgid(gid);
  133.30 +
  133.31 +  if(grent){
  133.32 +    struct passwd *pwent = getpwuid(uid);
  133.33 +    if(pwent){
  133.34 +      char *entry;
  133.35 +      int i = 0;
  133.36 +      while((entry = grent->gr_mem[i++])){
  133.37 +	if(strcmp(pwent->pw_name, entry) == 0)
  133.38 +	  return TRUE;
  133.39 +      }
  133.40 +    }
  133.41 +  }
  133.42 +  return FALSE;
  133.43 +}
  133.44 +
  133.45 +gboolean is_privileged_user(uid_t uid)
  133.46 +{
  133.47 +  return (uid == 0) || (uid == conf.mail_uid) || (is_ingroup(uid, conf.mail_gid));
  133.48 +}
  133.49 +
  133.50 +void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid)
  133.51 +{
  133.52 +  if(old_uid) *old_uid = geteuid();
  133.53 +  if(old_gid) *old_gid = getegid();
  133.54 +
  133.55 +  seteuid(0);
  133.56 +
  133.57 +  if(setegid(gid) != 0){
  133.58 +    logwrite(LOG_ALERT, "could not change gid to %d: %s\n",
  133.59 +	     gid, strerror(errno));
  133.60 +    exit(EXIT_FAILURE);
  133.61 +  }
  133.62 +  if(seteuid(uid) != 0){
  133.63 +    logwrite(LOG_ALERT, "could not change uid to %d: %s\n",
  133.64 +	     uid, strerror(errno));
  133.65 +    exit(EXIT_FAILURE);
  133.66 +  }
  133.67 +}
  133.68 +
  133.69 +void set_identity(uid_t old_uid, gchar *task_name)
  133.70 +{
  133.71 +  if(!conf.run_as_user){
  133.72 +    if(!is_privileged_user(old_uid)){
  133.73 +      fprintf(stderr,
  133.74 +	      "must be root, %s or in group %s for %s.\n",
  133.75 +	      DEF_MAIL_USER, DEF_MAIL_GROUP, task_name);
  133.76 +      exit(EXIT_FAILURE);
  133.77 +    }
  133.78 +
  133.79 +    set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL);
  133.80 +  }
  133.81 +}
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/src/pop3_in.c	Fri Sep 26 17:05:23 2008 +0200
   134.3 @@ -0,0 +1,820 @@
   134.4 +/* pop3_in.c, Copyright (C) 2000 by Oliver Kurth,
   134.5 + *
   134.6 + * This program is free software; you can redistribute it and/or modify
   134.7 + * it under the terms of the GNU General Public License as published by
   134.8 + * the Free Software Foundation; either version 2 of the License, or
   134.9 + * (at your option) any later version.
  134.10 + * 
  134.11 + * This program is distributed in the hope that it will be useful,
  134.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  134.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  134.14 + * GNU General Public License for more details.
  134.15 + *
  134.16 + * You should have received a copy of the GNU General Public License
  134.17 + * along with this program; if not, write to the Free Software
  134.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  134.19 + */
  134.20 +
  134.21 +/* see RFC 1725 */
  134.22 +
  134.23 +#include "masqmail.h"
  134.24 +#include "pop3_in.h"
  134.25 +#include "readsock.h"
  134.26 +
  134.27 +#include <sys/wait.h>
  134.28 +#include <sys/stat.h>
  134.29 +
  134.30 +#ifdef USE_LIB_CRYPTO
  134.31 +#include <openssl/md5.h>
  134.32 +#else
  134.33 +#include "md5/global.h"
  134.34 +#include "md5/md5.h"
  134.35 +#endif
  134.36 +
  134.37 +#ifdef ENABLE_POP3
  134.38 +
  134.39 +/* experimental feature */
  134.40 +#define DO_WRITE_UIDL_EARLY 1
  134.41 +
  134.42 +static
  134.43 +gchar *MD5String (char *string)
  134.44 +{
  134.45 +  MD5_CTX context;
  134.46 +  unsigned char digest[16];
  134.47 +  char str_digest[33];
  134.48 +  int i;
  134.49 +
  134.50 +#ifdef USE_LIB_CRYPTO
  134.51 +  MD5(string, strlen(string), digest);
  134.52 +#else
  134.53 +  MD5Init(&context);
  134.54 +  MD5Update(&context, string, strlen(string));
  134.55 +  MD5Final(digest, &context);
  134.56 +#endif
  134.57 +  for (i = 0;  i < 16;  i++) 
  134.58 +    sprintf(str_digest+2*i, "%02x", digest[i]);
  134.59 +
  134.60 +  return g_strdup(str_digest);
  134.61 +}
  134.62 +
  134.63 +static
  134.64 +pop3_base *create_pop3base(gint sock, guint flags)
  134.65 +{
  134.66 +  gint dup_sock;
  134.67 +
  134.68 +  pop3_base *popb = (pop3_base *)g_malloc(sizeof(pop3_base));
  134.69 +  if(popb){
  134.70 +    memset(popb, 0, sizeof(pop3_base));
  134.71 +
  134.72 +    popb->error = pop3_ok;
  134.73 +
  134.74 +    popb->buffer = (gchar *)g_malloc(POP3_BUF_LEN);
  134.75 +
  134.76 +    dup_sock = dup(sock);
  134.77 +    popb->out = fdopen(sock, "w");
  134.78 +    popb->in = fdopen(dup_sock, "r");
  134.79 +    
  134.80 +    popb->flags = flags;
  134.81 +  }
  134.82 +  return popb;
  134.83 +}
  134.84 +
  134.85 +static
  134.86 +void pop3_printf(FILE *out, gchar *fmt, ...)
  134.87 +{
  134.88 +  va_list args;
  134.89 +  va_start(args, fmt);
  134.90 +
  134.91 +  DEBUG(4){
  134.92 +    gchar buf[256];
  134.93 +    va_list args_copy;
  134.94 +
  134.95 +    va_copy(args_copy, args);
  134.96 +    vsnprintf(buf, 255, fmt, args_copy);
  134.97 +    va_end(args_copy);
  134.98 +
  134.99 +    debugf(">>>%s", buf);
 134.100 +  }
 134.101 +
 134.102 +  vfprintf(out, fmt, args);  fflush(out);
 134.103 +
 134.104 +  va_end(args);
 134.105 +}
 134.106 +
 134.107 +static
 134.108 +gboolean find_uid(pop3_base *popb, gchar *str)
 134.109 +{
 134.110 +  GList *node, *node_next;
 134.111 +
 134.112 +  for(node = popb->list_uid_old; node; node=node_next){
 134.113 +    gchar *uid = (gchar *)(node->data);
 134.114 +    node_next = node->next;
 134.115 +    if(strcmp(uid, str) == 0){
 134.116 +#if 1
 134.117 +      popb->list_uid_old = g_list_remove_link(popb->list_uid_old, node);
 134.118 +      g_list_free_1(node);
 134.119 +      g_free(uid);
 134.120 +#endif
 134.121 +      return TRUE;
 134.122 +    }
 134.123 +  }
 134.124 +  return FALSE;
 134.125 +}
 134.126 +
 134.127 +static
 134.128 +gboolean write_uidl(pop3_base *popb, gchar *user)
 134.129 +{
 134.130 +  gboolean ok = FALSE;
 134.131 +  GList *node;
 134.132 +  gchar *filename = g_strdup_printf("%s/popuidl/%s@%s",
 134.133 +				    conf.spool_dir,
 134.134 +				    user, popb->remote_host);
 134.135 +  gchar *tmpname = g_strdup_printf("%s.tmp", filename);
 134.136 +  FILE *fptr = fopen(tmpname, "wt");
 134.137 +
 134.138 +  if(fptr){
 134.139 +    foreach(popb->drop_list, node){
 134.140 +      msg_info *info = (msg_info *)(node->data);
 134.141 +      if(info->is_fetched || info->is_in_uidl)
 134.142 +	fprintf(fptr, "%s\n", info->uid);
 134.143 +    }
 134.144 +    fclose(fptr);
 134.145 +    ok = (rename(tmpname, filename) != -1);
 134.146 +  }
 134.147 +  
 134.148 +  g_free(tmpname);
 134.149 +  g_free(filename);
 134.150 +  return ok;
 134.151 +}
 134.152 +
 134.153 +static
 134.154 +gboolean read_uidl_fname(pop3_base *popb, gchar *filename)
 134.155 +{
 134.156 +  gboolean ok = FALSE;
 134.157 +  FILE *fptr = fopen(filename, "rt");
 134.158 +  gchar buf[256];
 134.159 +
 134.160 +  if(fptr){
 134.161 +    popb->list_uid_old = NULL;
 134.162 +    while(fgets(buf, 255, fptr)){
 134.163 +      if(buf[strlen(buf)-1] == '\n'){
 134.164 +	g_strchomp(buf);
 134.165 +	popb->list_uid_old =
 134.166 +	  g_list_append(popb->list_uid_old, g_strdup(buf));
 134.167 +      }else{
 134.168 +	logwrite(LOG_ALERT, "broken uid: %s\n", buf);
 134.169 +	break;
 134.170 +      }
 134.171 +    }
 134.172 +    fclose(fptr);
 134.173 +    ok = TRUE;
 134.174 +  }else
 134.175 +    logwrite(LOG_ALERT, "opening of %s failed: %s", filename, strerror(errno));
 134.176 +  return ok;
 134.177 +}
 134.178 +
 134.179 +static
 134.180 +gboolean read_uidl(pop3_base *popb, gchar *user)
 134.181 +{
 134.182 +  gboolean ok = FALSE;
 134.183 +  struct stat statbuf;
 134.184 +  gchar *filename = g_strdup_printf("%s/popuidl/%s@%s",
 134.185 +				    conf.spool_dir,
 134.186 +				    user, popb->remote_host);
 134.187 +
 134.188 +  if(stat(filename, &statbuf) == 0){
 134.189 +    ok = read_uidl_fname(popb, filename);
 134.190 +    if(ok){
 134.191 +      GList *drop_node;
 134.192 +      foreach(popb->drop_list, drop_node){
 134.193 +	msg_info *info = (msg_info *)(drop_node->data);
 134.194 +	if(find_uid(popb, info->uid)){
 134.195 +	  DEBUG(5) debugf("msg with uid '%s' already known\n", info->uid);
 134.196 +	  info->is_in_uidl = TRUE;
 134.197 +	  popb->uidl_known_cnt++;
 134.198 +	}else
 134.199 +	  DEBUG(5) debugf("msg with uid '%s' not known\n", info->uid);
 134.200 +      }
 134.201 +    }
 134.202 +  }else{
 134.203 +    logwrite(LOG_DEBUG, "no uidl file '%s' found\n", filename);
 134.204 +    ok = TRUE;
 134.205 +  }
 134.206 +
 134.207 +  g_free(filename);
 134.208 +  return ok; /* return code is irrelevant, do not check... */
 134.209 +}
 134.210 +
 134.211 +static
 134.212 +gboolean read_response(pop3_base *popb, int timeout)
 134.213 +{
 134.214 +  gint len;
 134.215 +
 134.216 +  len = read_sockline(popb->in, popb->buffer, POP3_BUF_LEN, timeout, READSOCKL_CHUG);
 134.217 +
 134.218 +  if(len == -3){
 134.219 +    popb->error = pop3_timeout;
 134.220 +    return FALSE;
 134.221 +  }
 134.222 +  else if(len == -2){
 134.223 +    popb->error = pop3_syntax;
 134.224 +    return FALSE;
 134.225 +  }
 134.226 +  else if(len == -1){
 134.227 +    popb->error = pop3_eof;
 134.228 +    return FALSE;
 134.229 +  }
 134.230 +  
 134.231 +  return TRUE;
 134.232 +}
 134.233 +
 134.234 +static
 134.235 +gboolean check_response(pop3_base *popb)
 134.236 +{
 134.237 +  char c = popb->buffer[0];
 134.238 +
 134.239 +  if(c == '+'){
 134.240 +    popb->error = pop3_ok;
 134.241 +    return TRUE;
 134.242 +  }else if(c == '-')
 134.243 +    popb->error = pop3_fail;
 134.244 +  else
 134.245 +    popb->error = pop3_syntax;
 134.246 +  return FALSE;
 134.247 +}
 134.248 +
 134.249 +static
 134.250 +gboolean strtoi(gchar *p, gchar **pend, gint *val)
 134.251 +{
 134.252 +  gchar buf[12];
 134.253 +  gint i = 0;
 134.254 +
 134.255 +  while(*p && isspace(*p)) p++;
 134.256 +  if(*p){
 134.257 +    while((i < 11) && isdigit(*p))
 134.258 +      buf[i++] = *(p++);
 134.259 +    buf[i] = 0;
 134.260 +    *val = atoi(buf);
 134.261 +    *pend = p;
 134.262 +    return TRUE;
 134.263 +  }
 134.264 +  return FALSE;
 134.265 +}
 134.266 +
 134.267 +static
 134.268 +gboolean check_response_int_int(pop3_base *popb, gint *arg0, gint *arg1)
 134.269 +{
 134.270 +  if(check_response(popb)){
 134.271 +    gchar *p = &(popb->buffer[3]);
 134.272 +    gchar *pe;
 134.273 +
 134.274 +    if(strtoi(p, &pe, arg0)){
 134.275 +      DEBUG(5) debugf("arg0 = %d\n", *arg0);
 134.276 +      p = pe;
 134.277 +      if(strtoi(p, &pe, arg1))
 134.278 +	DEBUG(5) debugf("arg1 = %d\n", *arg1);
 134.279 +	return TRUE;
 134.280 +    }
 134.281 +    popb->error = pop3_syntax;
 134.282 +  }
 134.283 +  return FALSE;
 134.284 +}
 134.285 +
 134.286 +static
 134.287 +gboolean get_drop_listing(pop3_base *popb)
 134.288 +{
 134.289 +  gchar buf[64];
 134.290 +
 134.291 +  DEBUG(5) debugf("get_drop_listing() entered\n");
 134.292 +
 134.293 +  while(1){
 134.294 +    gint len = read_sockline(popb->in, buf, 64, POP3_CMD_TIMEOUT, READSOCKL_CHUG);
 134.295 +    if(len > 0){
 134.296 +      if(buf[0] == '.')
 134.297 +	return TRUE;
 134.298 +      else{
 134.299 +	gint number, msg_size;
 134.300 +	gchar *p = buf, *pe;
 134.301 +	if(strtoi(p, &pe, &number)){
 134.302 +	  p = pe;
 134.303 +	  if(strtoi(p, &pe, &msg_size)){
 134.304 +	    msg_info *info = g_malloc(sizeof(msg_info));
 134.305 +	    info->number = number;
 134.306 +	    info->size = msg_size;
 134.307 +
 134.308 +	    DEBUG(5) debugf("get_drop_listing(), number = %d, msg_size = %d\n", number, msg_size);
 134.309 +
 134.310 +	    info->uid = NULL;
 134.311 +	    info->is_fetched = FALSE;
 134.312 +	    info->is_in_uidl = FALSE;
 134.313 +	    popb->drop_list = g_list_append(popb->drop_list, info);
 134.314 +	  }else{
 134.315 +	    popb->error = pop3_syntax;
 134.316 +	    break;
 134.317 +	  }
 134.318 +	}else{
 134.319 +	  popb->error = pop3_syntax;
 134.320 +	  break;
 134.321 +	}
 134.322 +      }
 134.323 +    }else{
 134.324 +      popb->error = (len == -1) ? pop3_eof : pop3_timeout;
 134.325 +      return FALSE;
 134.326 +    }
 134.327 +  }
 134.328 +  return FALSE;
 134.329 +}
 134.330 +
 134.331 +static
 134.332 +gboolean get_uid_listing(pop3_base *popb)
 134.333 +{
 134.334 +  gchar buf[64];
 134.335 +
 134.336 +  while(1){
 134.337 +    gint len = read_sockline(popb->in, buf, 64, POP3_CMD_TIMEOUT, READSOCKL_CHUG);
 134.338 +    if(len > 0){
 134.339 +      if(buf[0] == '.')
 134.340 +	return TRUE;
 134.341 +      else{
 134.342 +	gint number;
 134.343 +	gchar *p = buf, *pe;
 134.344 +	if(strtoi(p, &pe, &number)){
 134.345 +	  msg_info *info = NULL;
 134.346 +	  GList *drop_node;
 134.347 +
 134.348 +	  p = pe;
 134.349 +	  while(*p && isspace(*p)) p++;
 134.350 +
 134.351 +	  foreach(popb->drop_list, drop_node){
 134.352 +	    msg_info *curr_info = (msg_info *)(drop_node->data);
 134.353 +	    if(curr_info->number == number){
 134.354 +	      info = curr_info;
 134.355 +	      break;
 134.356 +	    }
 134.357 +	  }
 134.358 +	  if(info){
 134.359 +	    info->uid = g_strdup(p);
 134.360 +	    g_strchomp(info->uid);
 134.361 +	  }
 134.362 +
 134.363 +	}else{
 134.364 +	  popb->error = pop3_syntax;
 134.365 +	  break;
 134.366 +	}
 134.367 +      }
 134.368 +    }
 134.369 +  }
 134.370 +  return FALSE;
 134.371 +}
 134.372 +
 134.373 +static
 134.374 +gboolean check_init_response(pop3_base *popb)
 134.375 +{
 134.376 +  if(check_response(popb)){
 134.377 +    gchar buf[256];
 134.378 +    gchar *p = popb->buffer;
 134.379 +    gint i = 0;
 134.380 +    if(*p){
 134.381 +      while(*p && (*p != '<')) p++;
 134.382 +      while(*p && (*p != '>') && (i < 254))
 134.383 +	buf[i++] = *(p++);
 134.384 +      buf[i++] = '>';
 134.385 +      buf[i] = 0;
 134.386 +
 134.387 +      popb->timestamp = g_strdup(buf);
 134.388 +
 134.389 +      return TRUE;
 134.390 +    }
 134.391 +  }
 134.392 +  return FALSE;
 134.393 +}
 134.394 +
 134.395 +void pop3_in_close(pop3_base *popb)
 134.396 +{
 134.397 +  GList *node;
 134.398 +
 134.399 +  fclose(popb->in);
 134.400 +  fclose(popb->out);
 134.401 +
 134.402 +  close(popb->sock);
 134.403 +
 134.404 +  foreach(popb->list_uid_old, node){
 134.405 +    gchar *uid = (gchar *)(node->data);
 134.406 +    g_free(uid);
 134.407 +  }
 134.408 +  g_list_free(popb->list_uid_old);
 134.409 +
 134.410 +  foreach(popb->drop_list, node){
 134.411 +    msg_info *info = (msg_info *)(node->data);
 134.412 +    if(info->uid) g_free(info->uid);
 134.413 +    g_free(info);
 134.414 +  }
 134.415 +  g_list_free(popb->drop_list);
 134.416 +
 134.417 +  if(popb->buffer) g_free(popb->buffer);
 134.418 +  if(popb->timestamp) g_free(popb->timestamp);
 134.419 +}
 134.420 +
 134.421 +pop3_base *pop3_in_open(gchar *host, gint port, GList *resolve_list, guint flags)
 134.422 +{
 134.423 +  pop3_base *popb;
 134.424 +  gint sock;
 134.425 +  mxip_addr *addr;
 134.426 +
 134.427 +  DEBUG(5) debugf("pop3_in_open entered, host = %s\n", host);
 134.428 +
 134.429 +  if((addr = connect_resolvelist(&sock, host, port, resolve_list))){
 134.430 +    /* create structure to hold status data: */
 134.431 +    popb = create_pop3base(sock, flags);
 134.432 +    popb->remote_host = addr->name;
 134.433 +
 134.434 +    DEBUG(5){
 134.435 +      struct sockaddr_in name;
 134.436 +      int len;
 134.437 +      getsockname(sock, (struct sockaddr *)(&name), &len);
 134.438 +      debugf("socket: name.sin_addr = %s\n", inet_ntoa(name.sin_addr));
 134.439 +    }
 134.440 +    return popb;
 134.441 +  }
 134.442 +  return NULL;
 134.443 +}
 134.444 +
 134.445 +pop3_base *pop3_in_open_child(gchar *cmd, guint flags)
 134.446 +{
 134.447 +  pop3_base *popb;
 134.448 +  gint sock;
 134.449 +
 134.450 +  DEBUG(5) debugf("pop3_in_open_child entered, cmd = %s\n", cmd);
 134.451 +
 134.452 +  sock = child(cmd);
 134.453 +
 134.454 +  if(sock > 0){
 134.455 +
 134.456 +    popb = create_pop3base(sock, flags);
 134.457 +    popb->remote_host = NULL;
 134.458 +
 134.459 +    return popb;
 134.460 +  }
 134.461 +  logwrite(LOG_ALERT, "child failed (sock = %d): %s\n", sock, strerror(errno));
 134.462 +
 134.463 +  return NULL;
 134.464 +}
 134.465 +
 134.466 +gboolean pop3_in_init(pop3_base *popb)
 134.467 +{
 134.468 +  gboolean ok;
 134.469 +
 134.470 +  if((ok = read_response(popb, POP3_INITIAL_TIMEOUT))){
 134.471 +    ok = check_init_response(popb);
 134.472 +  }
 134.473 +  if(!ok)
 134.474 +    /*    pop3_in_log_failure(popb, NULL);*/
 134.475 +    logwrite(LOG_ALERT, "pop3 failed\n");
 134.476 +  return ok;
 134.477 +}
 134.478 +
 134.479 +gboolean pop3_in_login(pop3_base *popb, gchar *user, gchar *pass)
 134.480 +{
 134.481 +  if(popb->flags & POP3_FLAG_APOP){
 134.482 +
 134.483 +    gchar *string = g_strdup_printf("%s%s", popb->timestamp, pass);
 134.484 +    gchar *digest = MD5String(string);
 134.485 +    pop3_printf(popb->out, "APOP %s %s\r\n", user, digest);
 134.486 +    g_free(string);
 134.487 +    g_free(digest);
 134.488 +    if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.489 +      if(check_response(popb))
 134.490 +	return TRUE;
 134.491 +      else
 134.492 +	popb->error = pop3_login_failure;
 134.493 +    }
 134.494 +
 134.495 +  }else{
 134.496 +
 134.497 +    pop3_printf(popb->out, "USER %s\r\n", user);
 134.498 +    if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.499 +      if(check_response(popb)){
 134.500 +	pop3_printf(popb->out, "PASS %s\r\n", pass);
 134.501 +	if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.502 +	  if(check_response(popb))
 134.503 +	    return TRUE;
 134.504 +	  else
 134.505 +	    popb->error = pop3_login_failure;
 134.506 +	}
 134.507 +      }else{
 134.508 +	popb->error = pop3_login_failure;
 134.509 +      }
 134.510 +    }
 134.511 +  }
 134.512 +  return FALSE;
 134.513 +}
 134.514 +
 134.515 +gboolean pop3_in_stat(pop3_base *popb)
 134.516 +{
 134.517 +  pop3_printf(popb->out, "STAT\r\n");
 134.518 +  if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.519 +    gint msg_cnt, mbox_size;
 134.520 +    if(check_response_int_int(popb, &msg_cnt, &mbox_size)){
 134.521 +      popb->msg_cnt = msg_cnt;
 134.522 +      popb->mbox_size = mbox_size;
 134.523 +
 134.524 +      return TRUE;
 134.525 +    }
 134.526 +  }
 134.527 +  return FALSE;
 134.528 +}
 134.529 +
 134.530 +gboolean pop3_in_list(pop3_base *popb)
 134.531 +{
 134.532 +  pop3_printf(popb->out, "LIST\r\n");
 134.533 +  if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.534 +    if(get_drop_listing(popb)){
 134.535 +      return TRUE;
 134.536 +    }
 134.537 +  }
 134.538 +  return FALSE;
 134.539 +}
 134.540 +
 134.541 +gboolean pop3_in_dele(pop3_base *popb, gint number)
 134.542 +{
 134.543 +  pop3_printf(popb->out, "DELE %d\r\n", number);
 134.544 +  if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.545 +    return TRUE;
 134.546 +  }
 134.547 +  return FALSE;
 134.548 +}
 134.549 +
 134.550 +message *pop3_in_retr(pop3_base *popb, gint number, address *rcpt)
 134.551 +{
 134.552 +  accept_error err;
 134.553 +
 134.554 +  pop3_printf(popb->out, "RETR %d\r\n", number);
 134.555 +  if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.556 +    message *msg = create_message();
 134.557 +    msg->received_host = popb->remote_host;
 134.558 +    msg->received_prot = (popb->flags & POP3_FLAG_APOP) ? PROT_APOP : PROT_POP3;
 134.559 +    msg->transfer_id = (popb->next_id)++;
 134.560 +    msg->rcpt_list = g_list_append(NULL, copy_address(rcpt));
 134.561 +
 134.562 +    if((err = accept_message(popb->in, msg,
 134.563 +			     ACC_MAIL_FROM_HEAD|(conf.do_save_envelope_to ? ACC_SAVE_ENVELOPE_TO : 0)))
 134.564 +       == AERR_OK)
 134.565 +      return msg;
 134.566 +
 134.567 +    destroy_message(msg);
 134.568 +  }
 134.569 +  return NULL;
 134.570 +}  
 134.571 +
 134.572 +gboolean pop3_in_uidl(pop3_base *popb)
 134.573 +{
 134.574 +  pop3_printf(popb->out, "UIDL\r\n");
 134.575 +  if(read_response(popb, POP3_CMD_TIMEOUT)){
 134.576 +    if(get_uid_listing(popb)){
 134.577 +      return TRUE;
 134.578 +    }
 134.579 +  }
 134.580 +  return FALSE;
 134.581 +}
 134.582 +
 134.583 +gboolean pop3_in_quit(pop3_base *popb)
 134.584 +{
 134.585 +  pop3_printf(popb->out, "QUIT\r\n");
 134.586 +  
 134.587 +  DEBUG(4) debugf("QUIT\n");
 134.588 +
 134.589 +  signal(SIGALRM, SIG_DFL);
 134.590 +
 134.591 +  return TRUE;
 134.592 +}
 134.593 +
 134.594 +/* Send a DELE command for each message in (the old) uid listing.
 134.595 +   This is to prevent mail from to be kept on server, if a previous
 134.596 +   transaction was interupted. */
 134.597 +gboolean pop3_in_uidl_dele(pop3_base *popb)
 134.598 +{
 134.599 +  GList *drop_node;
 134.600 +
 134.601 +  foreach(popb->drop_list, drop_node){
 134.602 +    msg_info *info = (msg_info *)(drop_node->data);
 134.603 +    /*    if(find_uid(popb, info->uid)){*/
 134.604 +    if(info->is_in_uidl){
 134.605 +      if(!pop3_in_dele(popb, info->number))
 134.606 +	return FALSE;
 134.607 +      /* TODO: it probably makes sense to also
 134.608 +	 delete this uid from the listing */
 134.609 +    }
 134.610 +  }
 134.611 +  return TRUE;
 134.612 +}
 134.613 +
 134.614 +gboolean pop3_get(pop3_base *popb,
 134.615 +		  gchar *user, gchar *pass, address *rcpt, address *return_path,
 134.616 +		  gint max_count, gint max_size, gboolean max_size_delete)
 134.617 +{
 134.618 +  gboolean ok = FALSE;
 134.619 +  gint num_children = 0;
 134.620 +  
 134.621 +  DEBUG(5) debugf("rcpt = %s@%s\n", rcpt->local_part, rcpt->domain);
 134.622 +
 134.623 +  signal(SIGCHLD, SIG_DFL);
 134.624 +
 134.625 +  if(pop3_in_init(popb)){
 134.626 +    if(pop3_in_login(popb, user, pass)){
 134.627 +      if(pop3_in_stat(popb)){
 134.628 +	if(popb->msg_cnt > 0){
 134.629 +
 134.630 +	  logwrite(LOG_NOTICE|LOG_VERBOSE, "%d message(s) for user %s at %s\n",
 134.631 +		   popb->msg_cnt, user, popb->remote_host);
 134.632 +
 134.633 +	  if(pop3_in_list(popb)){
 134.634 +	    gboolean do_get = !(popb->flags & POP3_FLAG_UIDL);
 134.635 +	    if(!do_get) do_get = pop3_in_uidl(popb);
 134.636 +	    if(do_get){
 134.637 +	      gint count = 0;
 134.638 +	      GList *drop_node;
 134.639 +
 134.640 +	      if(popb->flags & POP3_FLAG_UIDL){
 134.641 +		read_uidl(popb, user);
 134.642 +		logwrite(LOG_VERBOSE|LOG_NOTICE, "%d message(s) already in uidl.\n",
 134.643 +			 popb->uidl_known_cnt);
 134.644 +	      }
 134.645 +	      if((popb->flags & POP3_FLAG_UIDL) && (popb->flags & POP3_FLAG_UIDL_DELE))
 134.646 +		pop3_in_uidl_dele(popb);
 134.647 +
 134.648 +	      foreach(popb->drop_list, drop_node){
 134.649 +
 134.650 +		msg_info *info = (msg_info *)(drop_node->data);
 134.651 +		gboolean do_get_this = !(popb->flags & POP3_FLAG_UIDL);
 134.652 +		/*		if(!do_get_this) do_get_this = !find_uid(popb, info->uid);*/
 134.653 +		if(!do_get_this) do_get_this = !(info->is_in_uidl);
 134.654 +		if(do_get_this){
 134.655 +
 134.656 +		  if((info->size < max_size) || (max_size == 0)){
 134.657 +		    message *msg;
 134.658 +
 134.659 +		    logwrite(LOG_VERBOSE|LOG_NOTICE, "receiving message %d\n", info->number);
 134.660 +		    msg = pop3_in_retr(popb, info->number, rcpt);
 134.661 +
 134.662 +		    if(msg){
 134.663 +		      if(return_path)
 134.664 +			msg->return_path = copy_address(return_path);
 134.665 +		      if(spool_write(msg, TRUE)){
 134.666 +			pid_t pid;
 134.667 +			logwrite(LOG_NOTICE, "%s <= %s host=%s with %s\n",
 134.668 +				 msg->uid,
 134.669 +				 addr_string(msg->return_path),
 134.670 +				 popb->remote_host,
 134.671 +				 (popb->flags & POP3_FLAG_APOP) ?
 134.672 +				 prot_names[PROT_APOP] : prot_names[PROT_POP3]
 134.673 +				 );
 134.674 +			info->is_fetched = TRUE;
 134.675 +			count++;
 134.676 +#if DO_WRITE_UIDL_EARLY
 134.677 +			if(popb->flags & POP3_FLAG_UIDL) write_uidl(popb, user);
 134.678 +#endif
 134.679 +			if(!conf.do_queue){
 134.680 +
 134.681 +			  /* wait for child processes. If there are too many,
 134.682 +			     we wait blocking, before we fork another one */
 134.683 +			  while(num_children > 0){
 134.684 +			    int status, options = WNOHANG;
 134.685 +			    pid_t pid;
 134.686 +
 134.687 +			    if(num_children >= POP3_MAX_CHILDREN){
 134.688 +			      logwrite(LOG_NOTICE, "too many children - waiting\n");
 134.689 +			      options = 0;
 134.690 +			    }
 134.691 +			    if((pid = waitpid(0, &status, options)) > 0){
 134.692 +			      num_children--;
 134.693 +			      if(WEXITSTATUS(status) != EXIT_SUCCESS)
 134.694 +				logwrite(LOG_WARNING,
 134.695 +					 "delivery process with pid %d returned %d\n",
 134.696 +					 pid, WEXITSTATUS(status));
 134.697 +			      if(WIFSIGNALED(status))
 134.698 +				logwrite(LOG_WARNING,
 134.699 +					 "delivery process with pid %d got signal: %d\n",
 134.700 +					 pid, WTERMSIG(status));
 134.701 +			    }else if(pid < 0){
 134.702 +			      logwrite(LOG_WARNING, "wait got error: %s\n", strerror(errno));
 134.703 +			    }
 134.704 +			  }
 134.705 +
 134.706 +			  if((pid = fork()) == 0){
 134.707 +			    deliver(msg);
 134.708 +			    _exit(EXIT_SUCCESS);
 134.709 +			  }else if(pid < 0){
 134.710 +			    logwrite(LOG_ALERT|LOG_VERBOSE,
 134.711 +				     "could not fork for delivery, id = %s: %s\n",
 134.712 +				     msg->uid, strerror(errno));
 134.713 +			  }else
 134.714 +			    num_children++;
 134.715 +			}else{
 134.716 +			  DEBUG(1) debugf("queuing forced by configuration or option.\n");
 134.717 +			}
 134.718 +			if(popb->flags & POP3_FLAG_DELETE)
 134.719 +			  pop3_in_dele(popb, info->number);
 134.720 +
 134.721 +			destroy_message(msg);
 134.722 +		      }/* if(spool_write(msg, TRUE)) */
 134.723 +		    }else{
 134.724 +		      logwrite(LOG_ALERT,
 134.725 +			       "retrieving of message %d failed: %d\n",
 134.726 +			       info->number, popb->error);
 134.727 +		    }
 134.728 +		  }/* if((info->size > max_size) ... */
 134.729 +		  else{
 134.730 +		    logwrite(LOG_NOTICE|LOG_VERBOSE, "size of message #%d (%d) > max_size (%d)\n",
 134.731 +			     info->number, info->size, max_size);
 134.732 +		    if(max_size_delete)
 134.733 +			if(popb->flags & POP3_FLAG_DELETE)
 134.734 +			  pop3_in_dele(popb, info->number);
 134.735 +		  }
 134.736 +		}/* if(do_get_this) ... */
 134.737 +		else{
 134.738 +		  if(popb->flags & POP3_FLAG_UIDL){
 134.739 +		    info->is_fetched = TRUE; /* obsolete? */
 134.740 +		    logwrite(LOG_VERBOSE, "message %d already known\n",
 134.741 +			     info->number);
 134.742 +		    DEBUG(1) debugf("message %d (uid = %s) not fetched\n",
 134.743 +				    info->number, info->uid);
 134.744 +#if 0
 134.745 +#if DO_WRITE_UIDL_EARLY
 134.746 +		    write_uidl(popb, user); /* obsolete? */
 134.747 +#endif
 134.748 +#endif
 134.749 +		  }
 134.750 +		}
 134.751 +		if((max_count != 0) && (count >= max_count))
 134.752 +		  break;
 134.753 +	      }/* foreach() */
 134.754 +#if DO_WRITE_UIDL_EARLY
 134.755 +#else
 134.756 +	      if(popb->flags & POP3_FLAG_UIDL) write_uidl(popb, user);
 134.757 +#endif
 134.758 +	    }/* if(pop3_in_uidl(popb) ... */
 134.759 +	  }/* if(pop3_in_list(popb)) */
 134.760 +	}/* if(popb->msg_cnt > 0) */
 134.761 +	else{
 134.762 +	  logwrite(LOG_NOTICE|LOG_VERBOSE,
 134.763 +		   "no messages for user %s at %s\n", user, popb->remote_host);
 134.764 +	}
 134.765 +	ok = TRUE;
 134.766 +      }
 134.767 +      pop3_in_quit(popb);
 134.768 +    }else{
 134.769 +      logwrite(LOG_ALERT|LOG_VERBOSE,
 134.770 +	       "pop3 login failed for user %s, host = %s\n", user, popb->remote_host);
 134.771 +    }
 134.772 +  }
 134.773 +  if(!ok){
 134.774 +    logwrite(LOG_ALERT|LOG_VERBOSE, "pop3 failed, error = %d\n", popb->error);
 134.775 +  }
 134.776 +
 134.777 +  while(num_children > 0){
 134.778 +    int status;
 134.779 +    pid_t pid;
 134.780 +    if((pid = wait(&status)) > 0){
 134.781 +      num_children--;
 134.782 +      if(WEXITSTATUS(status) != EXIT_SUCCESS)
 134.783 +	logwrite(LOG_WARNING,
 134.784 +		 "delivery process with pid %d returned %d\n",
 134.785 +		 pid, WEXITSTATUS(status));
 134.786 +      if(WIFSIGNALED(status))
 134.787 +	logwrite(LOG_WARNING,
 134.788 +		 "delivery process with pid %d got signal: %d\n",
 134.789 +		 pid, WTERMSIG(status));
 134.790 +    }else{
 134.791 +      logwrite(LOG_WARNING, "wait got error: %s\n", strerror(errno));
 134.792 +    }
 134.793 +  }
 134.794 +
 134.795 +  return ok;
 134.796 +}
 134.797 +
 134.798 +/* function just to log into a pop server,
 134.799 +   for pop_before_smtp (or is it smtp_after_pop?)
 134.800 +*/
 134.801 +
 134.802 +gboolean pop3_login(gchar *host, gint port, GList *resolve_list,
 134.803 +		    gchar *user, gchar *pass, guint flags)
 134.804 +{
 134.805 +  gboolean ok = FALSE;
 134.806 +  pop3_base *popb;
 134.807 +
 134.808 +  signal(SIGCHLD, SIG_IGN);
 134.809 +
 134.810 +  if((popb = pop3_in_open(host, port, resolve_list, flags))){
 134.811 +    if(pop3_in_init(popb)){
 134.812 +      if(pop3_in_login(popb, user, pass))
 134.813 +	ok = TRUE;
 134.814 +      else
 134.815 +	logwrite(LOG_ALERT|LOG_VERBOSE,
 134.816 +		 "pop3 login failed for user %s, host = %s\n", user, host);
 134.817 +    }
 134.818 +    pop3_in_close(popb);
 134.819 +  }
 134.820 +  return ok;
 134.821 +}
 134.822 +
 134.823 +#endif
   135.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.2 +++ b/src/pop3_in.h	Fri Sep 26 17:05:23 2008 +0200
   135.3 @@ -0,0 +1,87 @@
   135.4 +/* pop3_in.h, Copyright 2000 (C) Oliver Kurth,
   135.5 + *
   135.6 + * This program is free software; you can redistribute it and/or modify
   135.7 + * it under the terms of the GNU General Public License as published by
   135.8 + * the Free Software Foundation; either version 2 of the License, or
   135.9 + * (at your option) any later version.
  135.10 + * 
  135.11 + * This program is distributed in the hope that it will be useful,
  135.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  135.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  135.14 + * GNU General Public License for more details.
  135.15 + *
  135.16 + * You should have received a copy of the GNU General Public License
  135.17 + * along with this program; if not, write to the Free Software
  135.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  135.19 + */
  135.20 +
  135.21 +#ifdef ENABLE_POP3
  135.22 +
  135.23 +#define POP3_BUF_LEN 1024
  135.24 +
  135.25 +#define POP3_INITIAL_TIMEOUT 5*60
  135.26 +#define POP3_CMD_TIMEOUT 5*60
  135.27 +#define POP3_DATA_TIMEOUT 5*60
  135.28 +#define POP3_FINAL_TIMEOUT 10*60
  135.29 +
  135.30 +#define POP3_FLAG_DELETE 0x01
  135.31 +#define POP3_FLAG_UIDL 0x02
  135.32 +#define POP3_FLAG_UIDL_DELE 0x04
  135.33 +#define POP3_FLAG_APOP 0x08
  135.34 +
  135.35 +#define POP3_MAX_CHILDREN 2
  135.36 +
  135.37 +typedef
  135.38 +enum _pop3_error{
  135.39 +  pop3_ok = 0,
  135.40 +  pop3_fail,
  135.41 +  pop3_eof,
  135.42 +  pop3_timeout,
  135.43 +  pop3_login_failure,
  135.44 +  pop3_syntax
  135.45 +} pop3_error;
  135.46 +
  135.47 +typedef struct pop3_base{
  135.48 +  FILE *in;
  135.49 +  FILE *out;
  135.50 +  gint sock;
  135.51 +  gint dup_sock;
  135.52 +
  135.53 +  gchar *remote_host;
  135.54 +  gchar *buffer;
  135.55 +
  135.56 +  gint next_id;
  135.57 +  gint msg_cnt;
  135.58 +  gint uidl_known_cnt;
  135.59 +  gint mbox_size;
  135.60 +
  135.61 +  GList *list_uid_old;
  135.62 +  GList *drop_list;
  135.63 +
  135.64 +  gchar* timestamp;
  135.65 +
  135.66 +  guint flags;
  135.67 +
  135.68 +  pop3_error error;
  135.69 +} pop3_base;
  135.70 +
  135.71 +typedef struct _msg_info{
  135.72 +  gint number;
  135.73 +  gint size;
  135.74 +  gchar *uid;
  135.75 +  gboolean is_fetched;
  135.76 +  gboolean is_in_uidl;
  135.77 +} msg_info;
  135.78 +
  135.79 +pop3_base *pop3_in_open(gchar *host, gint port, GList *resolve_list, guint flags);
  135.80 +pop3_base *pop3_in_open_child(gchar *cmd, guint flags);
  135.81 +void pop3_in_close(pop3_base *popb);
  135.82 +gboolean pop3_get(pop3_base *popb,
  135.83 +		  gchar *user, gchar *pass, address *rcpt, address *return_path,
  135.84 +		  gint max_count, gint max_size, gboolean max_size_delete);
  135.85 +gboolean pop3_login(gchar *host, gint port, GList *resolve_list,
  135.86 +		    gchar *user, gchar *pass, guint flags);
  135.87 +
  135.88 +
  135.89 +
  135.90 +#endif
   136.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.2 +++ b/src/queue.c	Fri Sep 26 17:05:23 2008 +0200
   136.3 @@ -0,0 +1,224 @@
   136.4 +/*  MasqMail
   136.5 +    Copyright (C) 1999-2001 Oliver Kurth
   136.6 +
   136.7 +    This program is free software; you can redistribute it and/or modify
   136.8 +    it under the terms of the GNU General Public License as published by
   136.9 +    the Free Software Foundation; either version 2 of the License, or
  136.10 +    (at your option) any later version.
  136.11 +
  136.12 +    This program is distributed in the hope that it will be useful,
  136.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  136.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  136.15 +    GNU General Public License for more details.
  136.16 +
  136.17 +    You should have received a copy of the GNU General Public License
  136.18 +    along with this program; if not, write to the Free Software
  136.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  136.20 +*/
  136.21 +
  136.22 +#include "masqmail.h"
  136.23 +
  136.24 +#include <sys/stat.h>
  136.25 +#include <glob.h>
  136.26 +
  136.27 +static
  136.28 +void mix_arr(int *buf, int len)
  136.29 +{
  136.30 +  int i;
  136.31 +
  136.32 +  for(i = 0; i < len; i++)
  136.33 +    buf[i] = i;
  136.34 +  for(i = 0; i < len-1; i++){
  136.35 +    int j = (int)((float)(len-i) * ((float)rand())/(RAND_MAX + 1.0));
  136.36 +    int tmp;
  136.37 +
  136.38 +    if(i != j){
  136.39 +      tmp = buf[i]; buf[i] = buf[j]; buf[j] = tmp;
  136.40 +    }
  136.41 +  }
  136.42 +}
  136.43 +
  136.44 +GList *read_queue(gboolean do_readdata)
  136.45 +{
  136.46 +  GList *msg_list = NULL;
  136.47 +  glob_t gl;
  136.48 +  gchar *pattern;
  136.49 +  int i, *idx_arr;
  136.50 +
  136.51 +  pattern = g_strdup_printf("%s/input/??????-???-??-H", conf.spool_dir);
  136.52 +  gl.gl_offs = 0;
  136.53 +  glob(pattern, 0, NULL, &gl);
  136.54 +
  136.55 +  g_free(pattern);
  136.56 +
  136.57 +  DEBUG(4){
  136.58 +    int i;
  136.59 +    for(i = 0; i < gl.gl_pathc; i++){
  136.60 +      debugf("spoolfile: %s\n", gl.gl_pathv[i]);
  136.61 +    }
  136.62 +  }
  136.63 +
  136.64 +  idx_arr = g_malloc(sizeof(int) * gl.gl_pathc);
  136.65 +  mix_arr(idx_arr, gl.gl_pathc);
  136.66 +
  136.67 +  for(i = 0; i < gl.gl_pathc; i++){
  136.68 +    gchar *uid;
  136.69 +
  136.70 +    /* copy 13 chars, offset spooldir path + 7 chars for /input/ */
  136.71 +    /* uid length = 6 chars + '-' + 3 chars + '-' + 2 = 13 chars */
  136.72 +    uid = g_strndup(&(gl.gl_pathv[idx_arr[i]][strlen(conf.spool_dir) + 7]), 13);
  136.73 +
  136.74 +    DEBUG(5) debugf("uid: %s\n", uid);
  136.75 +
  136.76 +    msg_list = g_list_append(msg_list, msg_spool_read(uid, do_readdata));
  136.77 +
  136.78 +    DEBUG(5) debugf("after read spool file for %s\n", uid);
  136.79 +
  136.80 +    g_free(uid);
  136.81 +  }
  136.82 +  return msg_list;
  136.83 +}
  136.84 +
  136.85 +gboolean queue_run()
  136.86 +{
  136.87 +  GList *msg_list;
  136.88 +  gboolean ok = TRUE;
  136.89 +
  136.90 +  logwrite(LOG_NOTICE, "Starting queue run.\n");
  136.91 +
  136.92 +  msg_list = read_queue(FALSE);
  136.93 +
  136.94 +  if(msg_list != NULL){
  136.95 +    ok = deliver_msg_list(msg_list, DLVR_ALL);
  136.96 +    destroy_msg_list(msg_list);
  136.97 +  }
  136.98 +  logwrite(LOG_NOTICE, "Finished queue run.\n");
  136.99 +
 136.100 +  return ok;
 136.101 +}
 136.102 +
 136.103 +gboolean queue_run_online()
 136.104 +{
 136.105 +  GList *msg_list = read_queue(FALSE);
 136.106 +  gboolean ok = TRUE;
 136.107 +
 136.108 +  logwrite(LOG_NOTICE, "Starting online queue run.\n");
 136.109 +  if(msg_list != NULL){
 136.110 +    ok = deliver_msg_list(msg_list, DLVR_ONLINE);
 136.111 +    destroy_msg_list(msg_list);
 136.112 +  }
 136.113 +  logwrite(LOG_NOTICE, "Finished online queue run.\n");
 136.114 +
 136.115 +  return ok;
 136.116 +}
 136.117 +
 136.118 +static
 136.119 +gchar *format_difftime(double secs)
 136.120 +{
 136.121 +  if(secs > 86400)
 136.122 +    return g_strdup_printf("%.1fd", secs/86400);
 136.123 +  else if(secs > 3600)
 136.124 +    return g_strdup_printf("%.1fh", secs/3600);
 136.125 +  else if(secs > 60)
 136.126 +    return g_strdup_printf("%.1fm", secs/60);
 136.127 +  else
 136.128 +    return g_strdup_printf("%.0fs", secs);
 136.129 +}  
 136.130 +
 136.131 +void queue_list()
 136.132 +{
 136.133 +  GList *msg_list;
 136.134 +  GList *msg_node;
 136.135 +
 136.136 +  msg_list = read_queue(FALSE);
 136.137 +
 136.138 +  if(msg_list != NULL){
 136.139 +    foreach(msg_list, msg_node){
 136.140 +      message *msg = (message *)(msg_node->data);
 136.141 +      GList *rcpt_node;
 136.142 +      gchar *size_str = NULL;
 136.143 +      gchar *time_str = NULL;
 136.144 +      gchar *host_str = NULL;
 136.145 +      gchar *ident_str = NULL;
 136.146 +    
 136.147 +      if(msg->data_size >= 0)
 136.148 +	size_str = g_strdup_printf(" size=%d", msg->data_size);
 136.149 +      if(msg->received_time > 0){
 136.150 +	gchar *tmp_str;
 136.151 +	time_str =
 136.152 +	  g_strdup_printf(" age=%s",
 136.153 +			  tmp_str = format_difftime(difftime(time(NULL),
 136.154 +							     msg->received_time)));
 136.155 +	g_free(tmp_str);
 136.156 +      }
 136.157 +      if(msg->received_host != NULL)
 136.158 +	host_str = g_strdup_printf(" host=%s", msg->received_host);
 136.159 +      if(msg->ident != NULL)
 136.160 +	ident_str = g_strdup_printf(" ident=%s", msg->ident);
 136.161 +
 136.162 +      printf("%s <= %s%s%s%s%s\n", msg->uid,
 136.163 +	     addr_string(msg->return_path),
 136.164 +	     size_str ? size_str : "",
 136.165 +	     time_str ? time_str : "",
 136.166 +	     host_str ? host_str : "",
 136.167 +	     ident_str ? ident_str : ""
 136.168 +	     );
 136.169 +
 136.170 +      if(size_str) g_free(size_str);
 136.171 +      if(time_str) g_free(time_str);
 136.172 +      if(host_str) g_free(host_str);
 136.173 +      if(ident_str) g_free(ident_str);
 136.174 +
 136.175 +      foreach(msg->rcpt_list, rcpt_node){
 136.176 +	address *rcpt = (address *)(rcpt_node->data);
 136.177 +      
 136.178 +	printf("              %s %s\n",
 136.179 +	       addr_is_delivered(rcpt) ? "=>" : (addr_is_failed(rcpt) ? "!=" : "=="),
 136.180 +	       addr_string(rcpt));
 136.181 +      }
 136.182 +      g_free(msg);
 136.183 +    }
 136.184 +  }else
 136.185 +    printf("mail queue is empty.\n");
 136.186 +}  
 136.187 +
 136.188 +gboolean queue_delete(gchar *uid)
 136.189 +{
 136.190 +  gboolean hdr_ok = TRUE;
 136.191 +  gboolean dat_ok = TRUE;
 136.192 +  gchar *hdr_name = g_strdup_printf("%s/input/%s-H", conf.spool_dir, uid);
 136.193 +  gchar *dat_name = g_strdup_printf("%s/input/%s-D", conf.spool_dir, uid);
 136.194 +  struct stat stat_buf;
 136.195 +
 136.196 +  if(spool_lock(uid)){
 136.197 +
 136.198 +    if(stat(hdr_name, &stat_buf) == 0){
 136.199 +      if(unlink(hdr_name) != 0){
 136.200 +	fprintf(stderr, "could not unlink %s: %s\n", hdr_name, strerror(errno));
 136.201 +	hdr_ok = FALSE;
 136.202 +      }
 136.203 +    }else{
 136.204 +      fprintf(stderr, "could not stat file %s: %s\n", hdr_name, strerror(errno));
 136.205 +      hdr_ok = FALSE;
 136.206 +    }
 136.207 +    if(stat(dat_name, &stat_buf) == 0){
 136.208 +      if(unlink(dat_name) != 0){
 136.209 +	fprintf(stderr, "could not unlink %s: %s\n", dat_name, strerror(errno));
 136.210 +	dat_ok = FALSE;
 136.211 +      }
 136.212 +    }else{
 136.213 +      fprintf(stderr, "could not stat file %s: %s\n", dat_name, strerror(errno));
 136.214 +      dat_ok = FALSE;
 136.215 +    }
 136.216 +    printf("message %s deleted\n", uid);
 136.217 +
 136.218 +    spool_unlock(uid);
 136.219 +
 136.220 +  }else{
 136.221 +
 136.222 +    fprintf(stderr, "message %s is locked.\n", uid);
 136.223 +    return FALSE;
 136.224 +  }
 136.225 +
 136.226 +  return (dat_ok && hdr_ok);
 136.227 +}
   137.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.2 +++ b/src/readsock.c	Fri Sep 26 17:05:23 2008 +0200
   137.3 @@ -0,0 +1,182 @@
   137.4 +/*  MasqMail
   137.5 +    Copyright (C) 2000 Oliver Kurth
   137.6 +
   137.7 +    This program is free software; you can redistribute it and/or modify
   137.8 +    it under the terms of the GNU General Public License as published by
   137.9 +    the Free Software Foundation; either version 2 of the License, or
  137.10 +    (at your option) any later version.
  137.11 +
  137.12 +    This program is distributed in the hope that it will be useful,
  137.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  137.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  137.15 +    GNU General Public License for more details.
  137.16 +
  137.17 +    You should have received a copy of the GNU General Public License
  137.18 +    along with this program; if not, write to the Free Software
  137.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  137.20 +*/
  137.21 +
  137.22 +/*#include "masqmail.h"*/
  137.23 +#include <signal.h>
  137.24 +#include <stdio.h>
  137.25 +#include <stdlib.h>
  137.26 +#include <setjmp.h>
  137.27 +#include <unistd.h>
  137.28 +#include <ctype.h>
  137.29 +#include "readsock.h"
  137.30 +
  137.31 +jmp_buf jmp_timeout;
  137.32 +
  137.33 +static
  137.34 +void sig_timeout_handler(int sig)
  137.35 +{
  137.36 +  longjmp(jmp_timeout, 1);
  137.37 +}
  137.38 +
  137.39 +static struct sigaction old_sa_alrm;
  137.40 +
  137.41 +static
  137.42 +void alarm_on(int timeout)
  137.43 +{
  137.44 +  struct sigaction sa;
  137.45 +
  137.46 +  sa.sa_handler = sig_timeout_handler;
  137.47 +  sigemptyset(&(sa.sa_mask));
  137.48 +  sa.sa_flags = 0;
  137.49 +  sigaction(SIGALRM, &sa, &old_sa_alrm);
  137.50 +
  137.51 +  if(timeout > 0)
  137.52 +    alarm(timeout);
  137.53 +}
  137.54 +
  137.55 +static
  137.56 +void alarm_off()
  137.57 +{
  137.58 +  alarm(0);
  137.59 +
  137.60 +  sigaction(SIGALRM, &old_sa_alrm, NULL);
  137.61 +}
  137.62 +
  137.63 +static
  137.64 +void _read_chug(FILE *in)
  137.65 +{
  137.66 +  int c = 0;
  137.67 +
  137.68 +  c = fgetc(in);
  137.69 +  while(isspace(c) && (c != EOF)) c = fgetc(in);
  137.70 +  ungetc(c, in);
  137.71 +}
  137.72 +
  137.73 +static
  137.74 +int _read_line(FILE *in, char *buf, int buf_len, int timeout)
  137.75 +{
  137.76 +  int p = 0;
  137.77 +  int c = 0;
  137.78 +
  137.79 +  c = fgetc(in);
  137.80 +  while((c != '\n') && (c != EOF) && (p < buf_len-1)){
  137.81 +    buf[p++] = c;
  137.82 +    c = fgetc(in);
  137.83 +  }
  137.84 +
  137.85 +  buf[p] = 0;
  137.86 +
  137.87 +  if(c == EOF)
  137.88 +    return -1;
  137.89 +  else if(p >= buf_len){
  137.90 +    ungetc(c, in);
  137.91 +    return -2;
  137.92 +  }
  137.93 +
  137.94 +  buf[p++] = c; /* \n */
  137.95 +  buf[p] = 0;
  137.96 +
  137.97 +  return p;
  137.98 +}
  137.99 +
 137.100 +int read_sockline(FILE *in, char *buf, int buf_len, int timeout, unsigned int flags)
 137.101 +{
 137.102 +  int p = 0;
 137.103 +
 137.104 +  if(setjmp(jmp_timeout) != 0){
 137.105 +    alarm_off();
 137.106 +    return -3;
 137.107 +  }
 137.108 +
 137.109 +  alarm_on(timeout);
 137.110 +
 137.111 +  /* strip leading spaces */
 137.112 +  if(flags & READSOCKL_CHUG){
 137.113 +    _read_chug(in);
 137.114 +  }
 137.115 +
 137.116 +  p = _read_line(in, buf, buf_len, timeout);
 137.117 +
 137.118 +  alarm_off();
 137.119 +
 137.120 +  if(p > 1){
 137.121 +    /* here we are sure that buf[p-1] == '\n' */
 137.122 +    if(flags & READSOCKL_CVT_CRLF){
 137.123 +      if((buf[p-2] == '\r') && (buf[p-1] == '\n')){
 137.124 +	buf[p-2] = '\n';
 137.125 +	buf[p-1] = 0;
 137.126 +	p--;
 137.127 +      }
 137.128 +    }
 137.129 +  }
 137.130 +  return p;
 137.131 +}
 137.132 +
 137.133 +int read_sockline1(FILE *in, char **pbuf, int *buf_len, int timeout, unsigned int flags)
 137.134 +{
 137.135 +  int p = 0, size = *buf_len;
 137.136 +  char *buf;
 137.137 +
 137.138 +  if(setjmp(jmp_timeout) != 0){
 137.139 +    alarm_off();
 137.140 +    return -3;
 137.141 +  }
 137.142 +
 137.143 +  alarm_on(timeout);
 137.144 +
 137.145 +  /* strip leading spaces */
 137.146 +  if(flags & READSOCKL_CHUG){
 137.147 +    _read_chug(in);
 137.148 +  }
 137.149 +
 137.150 +  if(!*pbuf) *pbuf = malloc(size);
 137.151 +  buf = *pbuf;
 137.152 +  
 137.153 +  while(1){
 137.154 +    int pp;
 137.155 +
 137.156 +    pp = _read_line(in, buf, size, timeout);
 137.157 +    if(pp == -2){
 137.158 +      *pbuf = realloc(*pbuf, *buf_len + size);
 137.159 +      buf = *pbuf + *buf_len;
 137.160 +      *buf_len += size;
 137.161 +      p += size;
 137.162 +    }
 137.163 +    else{
 137.164 +      if(pp > 0) p += pp;
 137.165 +      else p = pp;
 137.166 +      break;
 137.167 +    }
 137.168 +  }
 137.169 +
 137.170 +  alarm_off();
 137.171 +
 137.172 +  if(p > 1){
 137.173 +    buf = *pbuf;
 137.174 +    /* here we are sure that buf[p-1] == '\n' */
 137.175 +    if(flags & READSOCKL_CVT_CRLF){
 137.176 +      if((buf[p-2] == '\r') && (buf[p-1] == '\n')){
 137.177 +	buf[p-2] = '\n';
 137.178 +	buf[p-1] = 0;
 137.179 +	p--;
 137.180 +      }
 137.181 +    }
 137.182 +  }
 137.183 +  return p;
 137.184 +}
 137.185 +
   138.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.2 +++ b/src/readsock.h	Fri Sep 26 17:05:23 2008 +0200
   138.3 @@ -0,0 +1,24 @@
   138.4 +/*  MasqMail
   138.5 +    Copyright (C) 2000 Oliver Kurth
   138.6 +
   138.7 +    This program is free software; you can redistribute it and/or modify
   138.8 +    it under the terms of the GNU General Public License as published by
   138.9 +    the Free Software Foundation; either version 2 of the License, or
  138.10 +    (at your option) any later version.
  138.11 +
  138.12 +    This program is distributed in the hope that it will be useful,
  138.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  138.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  138.15 +    GNU General Public License for more details.
  138.16 +
  138.17 +    You should have received a copy of the GNU General Public License
  138.18 +    along with this program; if not, write to the Free Software
  138.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  138.20 +*/
  138.21 +
  138.22 +#define READSOCKL_CHUG 0x01
  138.23 +#define READSOCKL_CVT_CRLF 0x02
  138.24 +
  138.25 +
  138.26 +int read_sockline(FILE *in, char *buf, int buf_len, int timeout, unsigned int flags);
  138.27 +int read_sockline1(FILE *in, char **pbuf, int *size, int timeout, unsigned int flags);
   139.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.2 +++ b/src/readtest.c	Fri Sep 26 17:05:23 2008 +0200
   139.3 @@ -0,0 +1,19 @@
   139.4 +
   139.5 +#include "masqmail.h"
   139.6 +#include "readsock.h"
   139.7 +
   139.8 +int main()
   139.9 +{
  139.10 +  char *buf = g_malloc(20);
  139.11 +  int size = 20, ret;
  139.12 +
  139.13 +  ret = read_sockline1(stdin, &buf, &size, 60, READSOCKL_CVT_CRLF);
  139.14 +  //  ret = read_sockline(stdin, buf, size, 60, READSOCKL_CHUG);
  139.15 +
  139.16 +  printf("%s\n", buf);
  139.17 +  printf("ret = %d, size = %d, strlen = %d\n", ret, size, strlen(buf));
  139.18 +
  139.19 +  return 0;
  139.20 +}
  139.21 +
  139.22 +
   140.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.2 +++ b/src/rewrite.c	Fri Sep 26 17:05:23 2008 +0200
   140.3 @@ -0,0 +1,100 @@
   140.4 +/*  MasqMail
   140.5 +    Copyright (C) 1999-2001 Oliver Kurth
   140.6 +
   140.7 +    This program is free software; you can redistribute it and/or modify
   140.8 +    it under the terms of the GNU General Public License as published by
   140.9 +    the Free Software Foundation; either version 2 of the License, or
  140.10 +    (at your option) any later version.
  140.11 +
  140.12 +    This program is distributed in the hope that it will be useful,
  140.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  140.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  140.15 +    GNU General Public License for more details.
  140.16 +
  140.17 +    You should have received a copy of the GNU General Public License
  140.18 +    along with this program; if not, write to the Free Software
  140.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  140.20 +*/
  140.21 +
  140.22 +#ifndef REWRITE_TEST
  140.23 +#include "masqmail.h"
  140.24 +#endif
  140.25 +
  140.26 +gboolean set_address_header_domain(header *hdr, gchar *domain)
  140.27 +{
  140.28 +  gchar *p = hdr->value;
  140.29 +  gchar *new_hdr = g_strndup(hdr->header, hdr->value - hdr->header);
  140.30 +  gint tmp;
  140.31 +
  140.32 +  while(*p){
  140.33 +    gchar *loc_beg, *loc_end;
  140.34 +    gchar *dom_beg, *dom_end;
  140.35 +    gchar *addr_end;
  140.36 +    gchar *rewr_string;
  140.37 +
  140.38 +    if(parse_address_rfc822(p,
  140.39 +			    &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end)){
  140.40 +      gchar *left, *right;
  140.41 +
  140.42 +      if(dom_beg != NULL){
  140.43 +	left = g_strndup(p, dom_beg - p);
  140.44 +	right = g_strndup(dom_end, addr_end - dom_end);
  140.45 +
  140.46 +	rewr_string = g_strconcat(left, domain, right, NULL);
  140.47 +      }else{
  140.48 +	left = g_strndup(p, loc_end - p);
  140.49 +	right = g_strndup(loc_end, addr_end - loc_end);
  140.50 +
  140.51 +	rewr_string = g_strconcat(left, "@", domain, right, NULL);
  140.52 +      }
  140.53 +      g_free(left);
  140.54 +      g_free(right);
  140.55 +
  140.56 +      p = addr_end;
  140.57 +      if(*p == ',') p++;
  140.58 +
  140.59 +      new_hdr =
  140.60 +	g_strconcat(new_hdr, rewr_string,
  140.61 +		    *p != 0 ? "," : NULL, NULL);
  140.62 +
  140.63 +    }else
  140.64 +      return FALSE;
  140.65 +  }
  140.66 +  tmp = (hdr->value - hdr->header);
  140.67 +  g_free(hdr->header);
  140.68 +  hdr->header = new_hdr;
  140.69 +  hdr->value = hdr->header + tmp;
  140.70 +
  140.71 +  return TRUE;
  140.72 +}
  140.73 +
  140.74 +gboolean map_address_header(header *hdr, GList *table)
  140.75 +{
  140.76 +  GList *addr_list = addr_list_append_rfc822(NULL, hdr->value, conf.host_name);
  140.77 +  GList *addr_node;
  140.78 +  gchar *new_hdr = g_strndup(hdr->header, hdr->value - hdr->header);
  140.79 +  gboolean did_change = FALSE;
  140.80 +
  140.81 +  foreach(addr_list, addr_node){
  140.82 +    address *addr = (address *)(addr_node->data);
  140.83 +    gchar *rewr_string = (gchar *)table_find_fnmatch(table, addr->local_part);
  140.84 +
  140.85 +    if(rewr_string == NULL)
  140.86 +      rewr_string = addr->address;
  140.87 +    else
  140.88 +      did_change = TRUE;
  140.89 +
  140.90 +    if(rewr_string)
  140.91 +      new_hdr =
  140.92 +	g_strconcat(new_hdr, rewr_string,
  140.93 +		    g_list_next(addr_node) ? "," : "\n", NULL);
  140.94 +  }
  140.95 +  if(did_change){
  140.96 +    g_free(hdr->header);
  140.97 +    hdr->header = new_hdr;
  140.98 +  }else
  140.99 +    g_free(new_hdr);
 140.100 +
 140.101 +  return did_change;
 140.102 +}
 140.103 +
   141.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.2 +++ b/src/route.c	Fri Sep 26 17:05:23 2008 +0200
   141.3 @@ -0,0 +1,436 @@
   141.4 +/*  MasqMail
   141.5 +    Copyright (C) 1999-2001 Oliver Kurth
   141.6 +
   141.7 +    This program is free software; you can redistribute it and/or modify
   141.8 +    it under the terms of the GNU General Public License as published by
   141.9 +    the Free Software Foundation; either version 2 of the License, or
  141.10 +    (at your option) any later version.
  141.11 +
  141.12 +    This program is distributed in the hope that it will be useful,
  141.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  141.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  141.15 +    GNU General Public License for more details.
  141.16 +
  141.17 +    You should have received a copy of the GNU General Public License
  141.18 +    along with this program; if not, write to the Free Software
  141.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  141.20 +*/
  141.21 +
  141.22 +#include "masqmail.h"
  141.23 +#include <fnmatch.h>
  141.24 +
  141.25 +msgout_perhost *create_msgout_perhost(gchar *host)
  141.26 +{
  141.27 +  msgout_perhost *mo_ph = g_malloc(sizeof(msgout_perhost));
  141.28 +  if(mo_ph){
  141.29 +    mo_ph->host = g_strdup(host);
  141.30 +    mo_ph->msgout_list = NULL;
  141.31 +  }
  141.32 +  return mo_ph;
  141.33 +}
  141.34 +
  141.35 +void destroy_msgout_perhost(msgout_perhost *mo_ph)
  141.36 +{
  141.37 +  GList *mo_node;
  141.38 +
  141.39 +  foreach(mo_ph->msgout_list, mo_node){
  141.40 +    msg_out *mo = (msg_out *)(mo_node->data);
  141.41 +    /* the rcpt_list is owned by the msgout's,
  141.42 +       but not the rcpt's themselves */
  141.43 +    g_list_free(mo->rcpt_list);
  141.44 +    g_free(mo);
  141.45 +  }
  141.46 +  g_list_free(mo_ph->msgout_list);
  141.47 +  g_free(mo_ph);
  141.48 +}
  141.49 +
  141.50 +void rewrite_headers(msg_out *msgout, connect_route *route)
  141.51 +{
  141.52 +  /* if set_h_from_domain is set, replace domain in all
  141.53 +     From: headers.
  141.54 +  */
  141.55 +  msgout->hdr_list = g_list_copy(msgout->msg->hdr_list);
  141.56 +
  141.57 +  /* map from addresses */
  141.58 +  if(route->map_h_from_addresses != NULL){
  141.59 +    GList *hdr_node;
  141.60 +    foreach(msgout->hdr_list, hdr_node){
  141.61 +      header *hdr = (header *)(hdr_node->data);
  141.62 +      if(hdr->id == HEAD_FROM){
  141.63 +	header *new_hdr = copy_header(hdr);
  141.64 +	if(map_address_header(new_hdr, route->map_h_from_addresses)){
  141.65 +	  hdr_node->data = new_hdr;
  141.66 +	  /* we need this list only to carefully free the extra headers: */
  141.67 +	  msgout->xtra_hdr_list =
  141.68 +	    g_list_append(msgout->xtra_hdr_list, new_hdr);
  141.69 +	}else
  141.70 +	  g_free(new_hdr);
  141.71 +      }
  141.72 +    }
  141.73 +  }else{
  141.74 +    /* replace from domain */
  141.75 +    if(route->set_h_from_domain != NULL){
  141.76 +      GList *hdr_node;
  141.77 +      
  141.78 +      foreach(msgout->hdr_list, hdr_node){
  141.79 +	header *hdr = (header *)(hdr_node->data);
  141.80 +	if(hdr->id == HEAD_FROM){
  141.81 +	  header *new_hdr = copy_header(hdr);
  141.82 +	  
  141.83 +	  DEBUG(5) debugf("setting From: domain to %s\n",
  141.84 +			  route->set_h_from_domain);
  141.85 +	  if(set_address_header_domain(new_hdr, route->set_h_from_domain)){
  141.86 +	    hdr_node->data = new_hdr;
  141.87 +	    /* we need this list only to carefully free the extra headers: */
  141.88 +	    DEBUG(6) debugf("header = %s\n",
  141.89 +			    new_hdr->header);
  141.90 +	    msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr);
  141.91 +	  }else{
  141.92 +	    logwrite(LOG_ALERT, "error in set_address_header_domain(%s, %s)\n",
  141.93 +		     new_hdr->value, route->set_h_from_domain);
  141.94 +	  }
  141.95 +	}
  141.96 +      }
  141.97 +    }
  141.98 +  }
  141.99 +
 141.100 +  /* map reply-to addresses */
 141.101 +  if(route->map_h_reply_to_addresses != NULL){
 141.102 +    GList *hdr_node;
 141.103 +    foreach(msgout->hdr_list, hdr_node){
 141.104 +      header *hdr = (header *)(hdr_node->data);
 141.105 +      if(hdr->id == HEAD_REPLY_TO){
 141.106 +	header *new_hdr = copy_header(hdr);
 141.107 +	if(map_address_header(new_hdr, route->map_h_reply_to_addresses)){
 141.108 +	  hdr_node->data = new_hdr;
 141.109 +	  /* we need this list only to carefully free the extra headers: */
 141.110 +	  msgout->xtra_hdr_list =
 141.111 +	    g_list_append(msgout->xtra_hdr_list, new_hdr);
 141.112 +	}else
 141.113 +	  g_free(new_hdr);
 141.114 +      }
 141.115 +    }
 141.116 +  }else{
 141.117 +    /* replace Reply-to domain */
 141.118 +    if(route->set_h_reply_to_domain != NULL){
 141.119 +      GList *hdr_node;
 141.120 +      
 141.121 +      foreach(msgout->hdr_list, hdr_node){
 141.122 +	header *hdr = (header *)(hdr_node->data);
 141.123 +	if(hdr->id == HEAD_REPLY_TO){
 141.124 +	  header *new_hdr = copy_header(hdr);
 141.125 +	  
 141.126 +	  set_address_header_domain(new_hdr, route->set_h_reply_to_domain);
 141.127 +	  hdr_node->data = new_hdr;
 141.128 +	  /* we need this list only to carefully free the extra headers: */
 141.129 +	  msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr);
 141.130 +	}
 141.131 +      }
 141.132 +    }
 141.133 +  }
 141.134 +
 141.135 +  /* map Mail-Followup-To addresses */
 141.136 +  if(route->map_h_mail_followup_to_addresses != NULL){
 141.137 +    GList *hdr_node;
 141.138 +    foreach(msgout->hdr_list, hdr_node){
 141.139 +      header *hdr = (header *)(hdr_node->data);
 141.140 +      if(strncasecmp(hdr->header, "Mail-Followup-To", 16) == 0){
 141.141 +	header *new_hdr = copy_header(hdr);
 141.142 +	if(map_address_header(new_hdr, route->map_h_mail_followup_to_addresses)){
 141.143 +	  hdr_node->data = new_hdr;
 141.144 +	  /* we need this list only to carefully free the extra headers: */
 141.145 +	  msgout->xtra_hdr_list =
 141.146 +	    g_list_append(msgout->xtra_hdr_list, new_hdr);
 141.147 +	}else
 141.148 +	  g_free(new_hdr);
 141.149 +      }
 141.150 +    }
 141.151 +  }
 141.152 +
 141.153 +  /* set Sender: domain to return_path->domain */
 141.154 +  if(route->expand_h_sender_domain){
 141.155 +    GList *hdr_node;
 141.156 +
 141.157 +    foreach(msgout->hdr_list, hdr_node){
 141.158 +      header *hdr = (header *)(hdr_node->data);
 141.159 +      if(hdr->id == HEAD_SENDER){
 141.160 +	header *new_hdr = copy_header(hdr);
 141.161 +
 141.162 +	set_address_header_domain(new_hdr, msgout->return_path->domain);
 141.163 +	hdr_node->data = new_hdr;
 141.164 +	/* we need this list only to carefully free the extra headers: */
 141.165 +	msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr);
 141.166 +      }
 141.167 +    }
 141.168 +  }
 141.169 +
 141.170 +  /* set Sender: domain to return_path->domain */
 141.171 +  if(route->expand_h_sender_address){
 141.172 +    GList *hdr_node;
 141.173 +
 141.174 +    foreach(msgout->hdr_list, hdr_node){
 141.175 +      header *hdr = (header *)(hdr_node->data);
 141.176 +      if(hdr->id == HEAD_SENDER){
 141.177 +	header *new_hdr;
 141.178 +
 141.179 +	new_hdr =
 141.180 +	  create_header(HEAD_SENDER, "Sender: %s@%s\n",
 141.181 +			msgout->return_path->local_part, msgout->return_path->domain);
 141.182 +	hdr_node->data = new_hdr;
 141.183 +	/* we need this list only to carefully free the extra headers: */
 141.184 +	msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr);
 141.185 +      }
 141.186 +    }
 141.187 +  }
 141.188 +
 141.189 +  if(msgout->xtra_hdr_list == NULL){
 141.190 +    /* nothing was changed */
 141.191 +    g_list_free(msgout->hdr_list);
 141.192 +    msgout->hdr_list = NULL;
 141.193 +  }
 141.194 +  DEBUG(5) debugf("rewrite_headers() returning\n");
 141.195 +}
 141.196 +
 141.197 +void rcptlist_with_one_of_hostlist(GList *rcpt_list, GList *host_list,
 141.198 +				   GList **p_rcpt_list, GList **p_non_rcpt_list)
 141.199 +{
 141.200 +  GList *rcpt_node;
 141.201 +
 141.202 +  if(rcpt_list == NULL)
 141.203 +    return;
 141.204 +
 141.205 +  foreach(rcpt_list, rcpt_node){
 141.206 +    address *rcpt = (address *)(rcpt_node->data);
 141.207 +    GList *host_node = NULL;
 141.208 +
 141.209 +    foreach(host_list, host_node){
 141.210 +      gchar *host = (gchar *)(host_node->data);
 141.211 +      if(fnmatch(host, rcpt->domain, FNM_CASEFOLD) == 0)
 141.212 +	break;
 141.213 +    }
 141.214 +    if(host_node){
 141.215 +      if(p_rcpt_list)
 141.216 +	*p_rcpt_list = g_list_append(*p_rcpt_list, rcpt);
 141.217 +    }else{
 141.218 +      if(p_non_rcpt_list)
 141.219 +	*p_non_rcpt_list = g_list_append(*p_non_rcpt_list, rcpt);
 141.220 +    }
 141.221 +
 141.222 +  }
 141.223 +}
 141.224 +
 141.225 +void rcptlist_with_addr_is_local(GList *rcpt_list,
 141.226 +				 GList **p_rcpt_list, GList **p_non_rcpt_list)
 141.227 +{
 141.228 +  GList *rcpt_node;
 141.229 +
 141.230 +  if(rcpt_list == NULL)
 141.231 +    return;
 141.232 +
 141.233 +  foreach(rcpt_list, rcpt_node){
 141.234 +    address *rcpt = (address *)(rcpt_node->data);
 141.235 +    if(addr_is_local(rcpt)){
 141.236 +      if(p_rcpt_list)
 141.237 +	*p_rcpt_list = g_list_append(*p_rcpt_list, rcpt);
 141.238 +    }else{
 141.239 +      if(p_non_rcpt_list)
 141.240 +	*p_non_rcpt_list = g_list_append(*p_non_rcpt_list, rcpt);
 141.241 +    }
 141.242 +
 141.243 +  }
 141.244 +}
 141.245 +
 141.246 +static gint _g_list_addrcmp(gconstpointer a, gconstpointer b)
 141.247 +{
 141.248 +  return addr_match((address *)a, (address *)b);
 141.249 +}
 141.250 +
 141.251 +gboolean route_is_allowed_return_path(connect_route *route, address *ret_path)
 141.252 +{
 141.253 +  if(route->not_allowed_return_paths != NULL){
 141.254 +    if(g_list_find_custom(route->not_allowed_return_paths, ret_path,
 141.255 +			  _g_list_addrcmp) != NULL){
 141.256 +      return FALSE;
 141.257 +    }
 141.258 +  }
 141.259 +  if(route->allowed_return_paths != NULL){
 141.260 +    if(g_list_find_custom(route->allowed_return_paths, ret_path,
 141.261 +			  _g_list_addrcmp) != NULL){
 141.262 +      return TRUE;
 141.263 +    }else{
 141.264 +      return FALSE;
 141.265 +    }
 141.266 +  }
 141.267 +  return TRUE;
 141.268 +}
 141.269 +
 141.270 +static gint _g_list_strcmp(gconstpointer a, gconstpointer b)
 141.271 +{
 141.272 +  return (gint)strcmp(a, b);
 141.273 +}
 141.274 +
 141.275 +gboolean route_is_allowed_mail_local(connect_route *route, address *ret_path)
 141.276 +{
 141.277 +  gchar *loc_part = ret_path->local_part;
 141.278 +
 141.279 +  if(route->not_allowed_mail_locals != NULL){
 141.280 +    if(g_list_find_custom(route->not_allowed_mail_locals, loc_part,
 141.281 +			 _g_list_strcmp) != NULL)
 141.282 +      return FALSE;
 141.283 +  }
 141.284 +  if(route->allowed_mail_locals != NULL){
 141.285 +    if(g_list_find_custom(route->allowed_mail_locals, loc_part,
 141.286 +			  _g_list_strcmp) != NULL)
 141.287 +      return TRUE;
 141.288 +    else
 141.289 +      return FALSE;
 141.290 +  }
 141.291 +  return TRUE;
 141.292 +}
 141.293 +
 141.294 +/* 
 141.295 +   Make lists of matching/not matching rcpts.
 141.296 +   Local domains are NOT regared here, these should be sorted out previously
 141.297 +*/
 141.298 +void msg_rcptlist_route(connect_route *route, GList *rcpt_list,
 141.299 +			GList **p_rcpt_list, GList **p_non_rcpt_list)
 141.300 +{
 141.301 +  GList *tmp_list = NULL;
 141.302 +  /* sort out those domains that can be sent over this connection: */
 141.303 +  if(route->allowed_rcpt_domains){
 141.304 +    DEBUG(5) debugf("testing for route->allowed_rcpt_domains\n");
 141.305 +    rcptlist_with_one_of_hostlist(rcpt_list, route->allowed_rcpt_domains, &tmp_list, p_non_rcpt_list);
 141.306 +  }else{
 141.307 +    DEBUG(5) debugf("route->allowed_rcpt_domains == NULL\n");
 141.308 +    tmp_list = g_list_copy(rcpt_list);
 141.309 +  }
 141.310 +
 141.311 +  /* sort out those domains that cannot be sent over this connection: */
 141.312 +  rcptlist_with_one_of_hostlist(tmp_list, route->not_allowed_rcpt_domains, p_non_rcpt_list, p_rcpt_list);
 141.313 +  g_list_free(tmp_list);
 141.314 +}
 141.315 +
 141.316 +msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout)
 141.317 +{
 141.318 +  message *msg = msgout->msg;
 141.319 +  GList *rcpt_list = msgout->rcpt_list;
 141.320 +
 141.321 +  if(rcpt_list != NULL){
 141.322 +    /* found a few */
 141.323 +    DEBUG(5){
 141.324 +      GList *node;
 141.325 +      debugf("rcpts for routed delivery, route = %s, id = %s\n", route->name, msg->uid);
 141.326 +      foreach(rcpt_list, node){
 141.327 +	address *rcpt = (address *)(node->data);
 141.328 +	debugf("rcpt for routed delivery: <%s@%s>\n",
 141.329 +	       rcpt->local_part, rcpt->domain);
 141.330 +      }
 141.331 +    }
 141.332 +      
 141.333 +    /* rewrite return path
 141.334 +       if there is a table, use that
 141.335 +       if an address is found and if it has a domain, use that
 141.336 +    */
 141.337 +    if(route->map_return_path_addresses){
 141.338 +      address *ret_path = NULL;
 141.339 +      DEBUG(5) debugf("looking up %s in map_return_path_addresses\n",
 141.340 +		      msg->return_path->local_part);
 141.341 +      ret_path =
 141.342 +	(address *)table_find_fnmatch(route->map_return_path_addresses,
 141.343 +			      msg->return_path->local_part);
 141.344 +      if(ret_path){
 141.345 +	DEBUG(5) debugf("found <%s@%s>\n",
 141.346 +			ret_path->local_part, ret_path->domain); 
 141.347 +	if(ret_path->domain == NULL)
 141.348 +	  ret_path->domain =
 141.349 +	    route->set_return_path_domain ?
 141.350 +	    route->set_return_path_domain : msg->return_path->domain;
 141.351 +	msgout->return_path = copy_address(ret_path);
 141.352 +      }
 141.353 +    }
 141.354 +    if(msgout->return_path == NULL){
 141.355 +      DEBUG(5) debugf("setting return path to %s\n",
 141.356 +		      route->set_return_path_domain);
 141.357 +      msgout->return_path =
 141.358 +	copy_modify_address(msg->return_path,
 141.359 +			    NULL, route->set_return_path_domain);
 141.360 +    }
 141.361 +    rewrite_headers(msgout, route);
 141.362 +
 141.363 +    return msgout;
 141.364 +  }
 141.365 +  return NULL;
 141.366 +}
 141.367 +
 141.368 +/* put msgout's is msgout_list into bins (msgout_perhost structs) for each
 141.369 +   host. Used if there is no mail_host.
 141.370 +   route param is not used, we leave it here because that may change.
 141.371 + */
 141.372 +
 141.373 +GList *route_msgout_list(connect_route *route, GList *msgout_list)
 141.374 +{
 141.375 +  GList *mo_ph_list = NULL;
 141.376 +  GList *msgout_node;
 141.377 +
 141.378 +  foreach(msgout_list, msgout_node){
 141.379 +    msg_out *msgout = (msg_out *)(msgout_node->data);
 141.380 +    msg_out *msgout_new;
 141.381 +    GList *rcpt_list = msgout->rcpt_list;
 141.382 +    GList *rcpt_node;
 141.383 +
 141.384 +    foreach(rcpt_list, rcpt_node){
 141.385 +      address *rcpt = rcpt_node->data;
 141.386 +      msgout_perhost *mo_ph = NULL;
 141.387 +      GList *mo_ph_node = NULL;
 141.388 +
 141.389 +      /* search host in mo_ph_list */
 141.390 +      foreach(mo_ph_list, mo_ph_node){
 141.391 +	mo_ph = (msgout_perhost *)(mo_ph_node->data);
 141.392 +	if(strcasecmp(mo_ph->host, rcpt->domain) == 0)
 141.393 +	  break;
 141.394 +      }
 141.395 +      if(mo_ph_node != NULL){
 141.396 +	/* there is already a rcpt for this host */
 141.397 +	msg_out *msgout_last =
 141.398 +	  (msg_out *)((g_list_last(mo_ph->msgout_list))->data);
 141.399 +	if(msgout_last->msg == msgout->msg){
 141.400 +	  /* if it is also the same message, it must be the last one
 141.401 +	     appended to mo_ph->msgout_list (since outer loop goes through
 141.402 +	     msgout_list) */
 141.403 +	  msgout_last->rcpt_list =
 141.404 +	    g_list_append(msgout_last->rcpt_list, rcpt);
 141.405 +	}else{
 141.406 +	  /* if not, we append a new msgout */
 141.407 +	  /* make a copy of msgout */
 141.408 +	  msgout_new = create_msg_out(msgout->msg);
 141.409 +	  msgout_new->return_path = msgout->return_path;
 141.410 +	  msgout_new->hdr_list = msgout->hdr_list;
 141.411 +
 141.412 +	  /* append our rcpt to it */
 141.413 +	  /* It is the 1st rcpt for this msg to this host,
 141.414 +	     therefore we safely give NULL */
 141.415 +	  msgout_new->rcpt_list = g_list_append(NULL, rcpt);
 141.416 +	  mo_ph->msgout_list =
 141.417 +	    g_list_append(mo_ph->msgout_list, msgout_new);
 141.418 +	}
 141.419 +      }else{
 141.420 +	/* this rcpt to goes to another host */
 141.421 +	mo_ph = create_msgout_perhost(rcpt->domain);
 141.422 +	mo_ph_list = g_list_append(mo_ph_list, mo_ph);
 141.423 +
 141.424 +	/* make a copy of msgout */
 141.425 +	msgout_new = create_msg_out(msgout->msg);
 141.426 +	msgout_new->return_path = msgout->return_path;
 141.427 +	msgout_new->hdr_list = msgout->hdr_list;
 141.428 +	    
 141.429 +	/* append our rcpt to it */
 141.430 +	/* It is the 1st rcpt for this msg to this host,
 141.431 +	   therefore we safely give NULL */
 141.432 +	msgout_new->rcpt_list = g_list_append(NULL, rcpt);
 141.433 +	mo_ph->msgout_list = g_list_append(mo_ph->msgout_list, msgout_new);
 141.434 +      }/* if mo_ph != NULL */
 141.435 +    }/* foreach(rcpt_list, ... */
 141.436 +  }/* foreach(msgout_list, ... */
 141.437 +
 141.438 +  return mo_ph_list;
 141.439 +}
   142.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.2 +++ b/src/smtp_in.c	Fri Sep 26 17:05:23 2008 +0200
   142.3 @@ -0,0 +1,358 @@
   142.4 +/*  MasqMail
   142.5 +    Copyright (C) 1999-2001 Oliver Kurth
   142.6 +
   142.7 +    This program is free software; you can redistribute it and/or modify
   142.8 +    it under the terms of the GNU General Public License as published by
   142.9 +    the Free Software Foundation; either version 2 of the License, or
  142.10 +    (at your option) any later version.
  142.11 +
  142.12 +    This program is distributed in the hope that it will be useful,
  142.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  142.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  142.15 +    GNU General Public License for more details.
  142.16 +
  142.17 +    You should have received a copy of the GNU General Public License
  142.18 +    along with this program; if not, write to the Free Software
  142.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  142.20 +*/
  142.21 +
  142.22 +#include "masqmail.h"
  142.23 +#include "readsock.h"
  142.24 +
  142.25 +/*
  142.26 +  I always forget these rfc numbers:
  142.27 +  RFC 821  (SMTP)
  142.28 +  RFC 1869 (ESMTP)
  142.29 +  RFC 1870 (ESMTP SIZE)
  142.30 +  RFC 2197 (ESMTP PIPELINE)
  142.31 +  RFC 2554 (ESMTP AUTH)
  142.32 +*/
  142.33 +
  142.34 +#ifdef ENABLE_SMTP_SERVER
  142.35 +
  142.36 +smtp_cmd smtp_cmds[] =
  142.37 +{
  142.38 +  { SMTP_HELO, "HELO", },
  142.39 +  { SMTP_EHLO, "EHLO", },
  142.40 +  { SMTP_MAIL_FROM, "MAIL FROM:", },
  142.41 +  { SMTP_RCPT_TO, "RCPT TO:", },
  142.42 +  { SMTP_DATA, "DATA", },
  142.43 +  { SMTP_QUIT, "QUIT", },
  142.44 +  { SMTP_RSET, "RSET", },
  142.45 +  { SMTP_NOOP, "NOOP", },
  142.46 +  { SMTP_HELP, "HELP" },
  142.47 +};
  142.48 +
  142.49 +static
  142.50 +smtp_cmd_id get_id(const gchar *line)
  142.51 +{
  142.52 +  gint i;
  142.53 +  for(i = 0; i < SMTP_NUM_IDS; i++){
  142.54 +    if(strncasecmp(smtp_cmds[i].cmd, line, strlen(smtp_cmds[i].cmd)) == 0)
  142.55 +      return (smtp_cmd_id)i;
  142.56 +  }
  142.57 +  return SMTP_ERROR;
  142.58 +}
  142.59 +
  142.60 +/* this is a quick hack: we expect the address to be syntactically correct
  142.61 +   and containing the mailbox only:
  142.62 +*/
  142.63 +
  142.64 +static
  142.65 +gboolean get_address(gchar *line, gchar *addr)
  142.66 +{
  142.67 +  gchar *p = line, *q = addr;
  142.68 +
  142.69 +  /* skip MAIL FROM: and RCPT TO: */
  142.70 +  while(*p && (*p != ':')) p++;
  142.71 +  p++;
  142.72 +
  142.73 +  /* skip spaces: */
  142.74 +  while(*p && isspace(*p)) p++;
  142.75 +
  142.76 +  /* get address: */
  142.77 +  while(*p && !isspace(*p) && (q < addr+MAX_ADDRESS-1)) *(q++) = *(p++);
  142.78 +  *q = 0;
  142.79 +
  142.80 +  return TRUE;
  142.81 +}
  142.82 +
  142.83 +static
  142.84 +smtp_connection *create_base(gchar *remote_host)
  142.85 +{
  142.86 +  smtp_connection *base = g_malloc(sizeof(smtp_connection));
  142.87 +  if(base){
  142.88 +    base->remote_host = g_strdup(remote_host);
  142.89 +
  142.90 +    base->prot = PROT_SMTP;
  142.91 +    base->next_id = 0;
  142.92 +    base->helo_seen = 0;
  142.93 +    base->from_seen = 0;
  142.94 +    base->rcpt_seen = 0;
  142.95 +    base->msg = NULL;
  142.96 +
  142.97 +    return base;
  142.98 +  }
  142.99 +  return NULL;
 142.100 +}
 142.101 +
 142.102 +static
 142.103 +void smtp_printf(FILE *out, gchar *fmt, ...)
 142.104 +{
 142.105 +  va_list args;
 142.106 +  va_start(args, fmt);
 142.107 +
 142.108 +  DEBUG(4){
 142.109 +    gchar buf[256];
 142.110 +    va_list args_copy;
 142.111 +
 142.112 +    va_copy(args_copy, args);
 142.113 +    vsnprintf(buf, 255, fmt, args_copy);
 142.114 +    va_end(args_copy);
 142.115 +
 142.116 +    debugf(">>>%s", buf);
 142.117 +  }
 142.118 +
 142.119 +  vfprintf(out, fmt, args);  fflush(out);
 142.120 +
 142.121 +  va_end(args);
 142.122 +}
 142.123 +
 142.124 +void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident)
 142.125 +{
 142.126 +  gchar *buffer;
 142.127 +  smtp_cmd_id cmd_id;
 142.128 +  message *msg = NULL;
 142.129 +  smtp_connection *psc;
 142.130 +  int len;
 142.131 +
 142.132 +  DEBUG(5) debugf("smtp_in entered, remote_host = %s\n", remote_host);
 142.133 +
 142.134 +  psc = create_base(remote_host);
 142.135 +  psc->msg = msg;
 142.136 +
 142.137 +  buffer = (gchar *)g_malloc(BUF_LEN);
 142.138 +  if(buffer){
 142.139 +    /* send greeting string, containing ESMTP: */
 142.140 +    smtp_printf(out, "220 %s MasqMail %s ESMTP\r\n",
 142.141 +		conf.host_name, VERSION);
 142.142 +    
 142.143 +    while((len = read_sockline(in, buffer, BUF_LEN, 5*60, READSOCKL_CHUG)) >= 0){
 142.144 +      cmd_id = get_id(buffer);
 142.145 +      
 142.146 +      switch(cmd_id){
 142.147 +      case SMTP_EHLO:
 142.148 +	psc->prot = PROT_ESMTP;
 142.149 +	/* fall through */
 142.150 +      case SMTP_HELO:
 142.151 +	psc->helo_seen = TRUE;
 142.152 +
 142.153 +	if(!conf.defer_all){ /* I need this to debug delivery failures */
 142.154 +	  if(psc->prot == PROT_ESMTP){
 142.155 +	    smtp_printf(out, "250-%s Nice to meet you with ESMTP\r\n",
 142.156 +			conf.host_name);
 142.157 +	    /* not yet: fprintf(out, "250-SIZE\r\n"); */
 142.158 +	    smtp_printf(out,
 142.159 +			"250-PIPELINING\r\n"
 142.160 +			"250 HELP\r\n");
 142.161 +	  }else{
 142.162 +	    smtp_printf(out, "250 %s pretty old mailer, huh?\r\n",
 142.163 +			conf.host_name);
 142.164 +	  }
 142.165 +	  break;
 142.166 +	}else{
 142.167 +	  smtp_printf(out, "421 %s service temporarily unavailable.\r\n",
 142.168 +		      conf.host_name);
 142.169 +	}
 142.170 +
 142.171 +      case SMTP_MAIL_FROM:
 142.172 +	if(psc->helo_seen && !psc->from_seen){
 142.173 +	  gchar buf[MAX_ADDRESS];
 142.174 +	  address *addr;
 142.175 +
 142.176 +	  msg = create_message();
 142.177 +	  msg->received_host = remote_host ? g_strdup(remote_host) : NULL;
 142.178 +	  msg->received_prot = psc->prot;
 142.179 +	  msg->ident = ident ? g_strdup(ident) : NULL;
 142.180 +	  /* get transfer id and increment for next one */
 142.181 +	  msg->transfer_id = (psc->next_id)++;
 142.182 +
 142.183 +	  get_address(buffer, buf);
 142.184 +	  if((addr = remote_host ?
 142.185 +	     create_address(buf, TRUE) :
 142.186 +	      create_address_qualified(buf, TRUE, conf.host_name))){
 142.187 +	    if(addr->domain != NULL){
 142.188 +	      psc->from_seen = TRUE;
 142.189 +	      msg->return_path = addr;
 142.190 +		smtp_printf(out, "250 OK %s is a nice guy.\r\n", addr->address);
 142.191 +	    }else{
 142.192 +	      smtp_printf(out,
 142.193 +			  "501 return path must be qualified.\r\n", buf);
 142.194 +	    }
 142.195 +	  }else{
 142.196 +	    smtp_printf(out, "501 %s: syntax error.\r\n", buf);
 142.197 +	  }
 142.198 +	}else{
 142.199 +	  if(!psc->helo_seen)
 142.200 +	    smtp_printf(out, "503 need HELO or EHLO\r\n");
 142.201 +	  else
 142.202 +	    smtp_printf(out, "503 MAIL FROM: already given.\r\n");
 142.203 +	}
 142.204 +	break;
 142.205 +
 142.206 +      case SMTP_RCPT_TO:
 142.207 +
 142.208 +	if(psc->helo_seen && psc->from_seen){
 142.209 +	  char buf[MAX_ADDRESS];
 142.210 +	  address *addr;
 142.211 +
 142.212 +	  get_address(buffer, buf);
 142.213 +	  if((addr = remote_host ?
 142.214 +	      create_address(buf, TRUE) :
 142.215 +	      create_address_qualified(buf, TRUE, conf.host_name))){
 142.216 +	    if(addr->local_part[0] != '|'){
 142.217 +	      if(addr->domain != NULL){
 142.218 +		gboolean do_relay = conf.do_relay;
 142.219 +		if(!do_relay){
 142.220 +		  if((do_relay = addr_is_local(msg->return_path)));
 142.221 +		  if(!do_relay){
 142.222 +		    do_relay = addr_is_local(addr);
 142.223 +		  }
 142.224 +		}
 142.225 +		if(do_relay){
 142.226 +		  psc->rcpt_seen = TRUE;
 142.227 +		  msg->rcpt_list = g_list_append(msg->rcpt_list, addr);
 142.228 +		  smtp_printf(out, "250 OK %s is our friend.\r\n", addr->address);
 142.229 +		}else{
 142.230 +		  smtp_printf(out, "550 relaying to %s denied.\r\n",
 142.231 +			      addr_string(addr));
 142.232 +		}
 142.233 +	      }else{
 142.234 +		smtp_printf(out,
 142.235 +			    "501 recipient address must be qualified.\r\n", buf);
 142.236 +	      }
 142.237 +	    }else
 142.238 +	      smtp_printf(out, "501 %s: no pipe allowed for SMTP connections\r\n", buf);
 142.239 +	  }else{
 142.240 +	    smtp_printf(out, "501 %s: syntax error in address.\r\n", buf);
 142.241 +	  }
 142.242 +	}else{
 142.243 +
 142.244 +	  if(!psc->helo_seen)
 142.245 +	    smtp_printf(out, "503 need HELO or EHLO.\r\n");
 142.246 +	  else
 142.247 +	    smtp_printf(out, "503 need MAIL FROM: before RCPT TO:\r\n");
 142.248 +	}
 142.249 +	break;
 142.250 +	  
 142.251 +      case SMTP_DATA:
 142.252 +	if(psc->helo_seen && psc->rcpt_seen){
 142.253 +	  accept_error err;
 142.254 +
 142.255 +	  smtp_printf(out, "354 okay, and do not forget the dot\r\n");
 142.256 +
 142.257 +	  if((err = accept_message(in, msg, conf.do_save_envelope_to ? ACC_SAVE_ENVELOPE_TO : 0))
 142.258 +	     == AERR_OK){
 142.259 +	    if(spool_write(msg, TRUE)){
 142.260 +	      pid_t pid;
 142.261 +	      smtp_printf(out, "250 OK id=%s\r\n", msg->uid);
 142.262 +	      
 142.263 +	      if(remote_host != NULL)
 142.264 +		logwrite(LOG_NOTICE, "%s <= <%s@%s> host=%s with %s\n",
 142.265 +			 msg->uid, msg->return_path->local_part,
 142.266 +			 msg->return_path->domain, remote_host,
 142.267 +			 prot_names[psc->prot]);
 142.268 +	      else
 142.269 +		logwrite(LOG_NOTICE, "%s <= <%s@%s> with %s\n",
 142.270 +			 msg->uid, msg->return_path->local_part,
 142.271 +			 msg->return_path->domain,
 142.272 +			 prot_names[psc->prot]);
 142.273 +	      
 142.274 +	      if(!conf.do_queue){
 142.275 +		if((pid = fork()) == 0){
 142.276 +		  
 142.277 +		  if(deliver(msg))
 142.278 +		    _exit(EXIT_SUCCESS);
 142.279 +		  else
 142.280 +		    _exit(EXIT_FAILURE);
 142.281 +		  
 142.282 +		}else if(pid < 0){
 142.283 +		  logwrite(LOG_ALERT, "could not fork for delivery, id = %s",
 142.284 +			   msg->uid);
 142.285 +		}
 142.286 +	      }else{
 142.287 +		DEBUG(1) debugf("queuing forced by configuration or option.\n");
 142.288 +	      }
 142.289 +	    }else{
 142.290 +	      smtp_printf(out, "451 Could not write spool file\r\n");
 142.291 +	      return;
 142.292 +	    }
 142.293 +	  }else{
 142.294 +	    switch(err){
 142.295 +	    case AERR_TIMEOUT:
 142.296 +	      return;
 142.297 +	    case AERR_EOF:
 142.298 +	      return;
 142.299 +	    default:
 142.300 +	      /* should never happen: */
 142.301 +	      smtp_printf(out, "451 Unknown error\r\n");
 142.302 +	      return;
 142.303 +	    }
 142.304 +	  }
 142.305 +	  psc->rcpt_seen = psc->from_seen = FALSE;
 142.306 +	  destroy_message(msg);
 142.307 +	  msg = NULL;
 142.308 +	}else{
 142.309 +	  if(!psc->helo_seen)
 142.310 +	    smtp_printf(out, "503 need HELO or EHLO.\r\n");
 142.311 +	  else
 142.312 +	    smtp_printf(out, "503 need RCPT TO: before DATA\r\n");
 142.313 +	}
 142.314 +	break;
 142.315 +      case SMTP_QUIT:
 142.316 +	smtp_printf(out, "221 goodbye\r\n");
 142.317 +	if(msg != NULL) destroy_message(msg);
 142.318 +	return;
 142.319 +      case SMTP_RSET:
 142.320 +	psc->from_seen = psc->rcpt_seen = FALSE;
 142.321 +	if(msg != NULL)
 142.322 +	  destroy_message(msg);
 142.323 +	msg = NULL;
 142.324 +	smtp_printf(out, "250 OK\r\n");
 142.325 +	break;
 142.326 +      case SMTP_NOOP:
 142.327 +	smtp_printf(out, "250 OK\r\n");
 142.328 +	break;
 142.329 +      case SMTP_HELP:
 142.330 +	{
 142.331 +	  int i;
 142.332 +
 142.333 +	  smtp_printf(out, "214-supported commands:\r\n");
 142.334 +	  for(i = 0; i < SMTP_NUM_IDS-1; i++){
 142.335 +	    smtp_printf(out, "214-%s\r\n", smtp_cmds[i].cmd);
 142.336 +	  }
 142.337 +	  smtp_printf(out, "214 %s\r\n", smtp_cmds[i].cmd);
 142.338 +	}
 142.339 +	break;
 142.340 +      default:
 142.341 +	smtp_printf(out, "501 command not recognized\r\n");
 142.342 +	DEBUG(1) debugf("command not recognized, was '%s'\n", buffer);
 142.343 +	break;
 142.344 +      }
 142.345 +    }
 142.346 +    switch(len){
 142.347 +    case -3:
 142.348 +      logwrite(LOG_NOTICE, "connection timed out\n");
 142.349 +      break;
 142.350 +    case -2:
 142.351 +      logwrite(LOG_NOTICE, "line overflow\n");
 142.352 +      break;
 142.353 +    case -1:
 142.354 +      logwrite(LOG_NOTICE, "received EOF\n");
 142.355 +      break;
 142.356 +    default:
 142.357 +      break;
 142.358 +    }
 142.359 +  }
 142.360 +}
 142.361 +#endif
   143.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.2 +++ b/src/smtp_out.c	Fri Sep 26 17:05:23 2008 +0200
   143.3 @@ -0,0 +1,918 @@
   143.4 +/* smtp_out.c, Copyright (C) 1999-2001 Oliver Kurth,
   143.5 + *
   143.6 + * This program is free software; you can redistribute it and/or modify
   143.7 + * it under the terms of the GNU General Public License as published by
   143.8 + * the Free Software Foundation; either version 2 of the License, or
   143.9 + * (at your option) any later version.
  143.10 + * 
  143.11 + * This program is distributed in the hope that it will be useful,
  143.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  143.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  143.14 + * GNU General Public License for more details.
  143.15 + *
  143.16 + * You should have received a copy of the GNU General Public License
  143.17 + * along with this program; if not, write to the Free Software
  143.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  143.19 + */
  143.20 +
  143.21 +/*
  143.22 + send bugs to: kurth@innominate.de
  143.23 +*/
  143.24 +
  143.25 +/*
  143.26 +  I always forget these rfc numbers:
  143.27 +  RFC 821  (SMTP)
  143.28 +  RFC 1869 (ESMTP)
  143.29 +  RFC 1870 (ESMTP SIZE)
  143.30 +  RFC 2197 (ESMTP PIPELINE)
  143.31 +  RFC 2554 (ESMTP AUTH)
  143.32 +*/
  143.33 +
  143.34 +#include "masqmail.h"
  143.35 +#include "smtp_out.h"
  143.36 +#include "readsock.h"
  143.37 +
  143.38 +#ifdef ENABLE_AUTH
  143.39 +
  143.40 +#ifdef USE_LIB_CRYPTO
  143.41 +#include <openssl/hmac.h>
  143.42 +#include <openssl/md5.h>
  143.43 +#include <openssl/evp.h>
  143.44 +#else
  143.45 +#include "md5/global.h"
  143.46 +#include "md5/md5.h"
  143.47 +#include "md5/hmac_md5.h"
  143.48 +#endif
  143.49 +
  143.50 +#include "base64/base64.h"
  143.51 +#endif
  143.52 +
  143.53 +void destroy_smtpbase(smtp_base *psb)
  143.54 +{
  143.55 +  fclose(psb->in);
  143.56 +  fclose(psb->out);
  143.57 +
  143.58 +  close(psb->sock);
  143.59 +
  143.60 +  if(psb->helo_name) g_free(psb->helo_name);
  143.61 +  if(psb->buffer) g_free(psb->buffer);
  143.62 +  if(psb->auth_names) g_strfreev(psb->auth_names);
  143.63 +
  143.64 +  if(psb->auth_name) g_free(psb->auth_name);
  143.65 +  if(psb->auth_login) g_free(psb->auth_login);
  143.66 +  if(psb->auth_secret) g_free(psb->auth_secret);
  143.67 +}
  143.68 +
  143.69 +gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct)
  143.70 +{
  143.71 +  struct sockaddr_in sname;
  143.72 +  int len = sizeof(struct sockaddr_in);
  143.73 +  struct hostent *host_entry;
  143.74 +
  143.75 +  if(do_correct){
  143.76 +    getsockname(psb->sock, (struct sockaddr *)(&sname), &len);
  143.77 +    DEBUG(5) debugf("socket: name.sin_addr = %s\n", inet_ntoa(sname.sin_addr));
  143.78 +    host_entry =
  143.79 +      gethostbyaddr((const char *)&(sname.sin_addr),
  143.80 +		    sizeof(sname.sin_addr), AF_INET);
  143.81 +    if(host_entry){
  143.82 +      psb->helo_name = g_strdup(host_entry->h_name);
  143.83 +    }else{
  143.84 +      /* we failed to look up our own name. Instead of giving our local hostname,
  143.85 +	 we may give our IP number to show the server that we are at least
  143.86 +	 willing to be honest. For the really picky ones.*/
  143.87 +      DEBUG(5) debugf("failed to look up own host name.\n");
  143.88 +      psb->helo_name = g_strdup_printf("[%s]", inet_ntoa(sname.sin_addr));
  143.89 +    }
  143.90 +    DEBUG(5) debugf("helo_name = %s\n", psb->helo_name);
  143.91 +  }
  143.92 +  if(psb->helo_name == NULL){
  143.93 +    psb->helo_name = g_strdup(default_name);
  143.94 +  }
  143.95 +  return psb->helo_name;
  143.96 +} 
  143.97 +
  143.98 +#ifdef ENABLE_AUTH
  143.99 +
 143.100 +gboolean set_auth(smtp_base *psb, gchar *name, gchar *login, gchar *secret)
 143.101 +{
 143.102 +  if((strcasecmp(name, "CRAM-MD5") == 0) ||
 143.103 +     (strcasecmp(name, "LOGIN") == 0)) {
 143.104 +    psb->auth_name = g_strdup(name);
 143.105 +    psb->auth_login = g_strdup(login);
 143.106 +    psb->auth_secret = g_strdup(secret);
 143.107 +    
 143.108 +    return TRUE;
 143.109 +  }
 143.110 +  return FALSE;
 143.111 +}
 143.112 +
 143.113 +#endif
 143.114 +
 143.115 +static
 143.116 +smtp_base *create_smtpbase(gint sock)
 143.117 +{
 143.118 +  gint dup_sock;
 143.119 +
 143.120 +  smtp_base *psb = (smtp_base *)g_malloc(sizeof(smtp_base));
 143.121 +
 143.122 +  psb->sock = sock;
 143.123 +
 143.124 +  psb->use_esmtp = FALSE;
 143.125 +  psb->use_size = FALSE;
 143.126 +  psb->use_pipelining = FALSE;
 143.127 +  psb->use_auth = FALSE;
 143.128 +
 143.129 +  psb->max_size = 0;
 143.130 +  psb->auth_names = NULL;
 143.131 +
 143.132 +  psb->buffer = (gchar *)g_malloc(SMTP_BUF_LEN);
 143.133 +
 143.134 +  dup_sock = dup(sock);
 143.135 +  psb->out = fdopen(sock, "w");
 143.136 +  psb->in = fdopen(dup_sock, "r");
 143.137 +
 143.138 +  psb->error = smtp_ok;
 143.139 +
 143.140 +  psb->helo_name = NULL;
 143.141 +  
 143.142 +  psb->auth_name = psb->auth_login = psb->auth_secret = NULL;
 143.143 +
 143.144 +  return psb;
 143.145 +}
 143.146 +
 143.147 +static
 143.148 +gboolean read_response(smtp_base *psb, int timeout)
 143.149 +{
 143.150 +  gint buf_pos = 0;
 143.151 +  gchar code[5];
 143.152 +  gint i, len;
 143.153 +
 143.154 +  do{
 143.155 +    len = read_sockline(psb->in, &(psb->buffer[buf_pos]),
 143.156 +			SMTP_BUF_LEN - buf_pos, timeout, READSOCKL_CHUG);
 143.157 +    if(len == -3){
 143.158 +      psb->error = smtp_timeout;
 143.159 +      return FALSE;
 143.160 +    }
 143.161 +    else if(len == -2){
 143.162 +      psb->error = smtp_syntax;
 143.163 +      return FALSE;
 143.164 +    }
 143.165 +    else if(len == -1){
 143.166 +      psb->error = smtp_eof;
 143.167 +      return FALSE;
 143.168 +    }
 143.169 +    for(i = 0; i < 4; i++)
 143.170 +      code[i] = psb->buffer[buf_pos+i];
 143.171 +    code[i] = 0;
 143.172 +    psb->last_code = atoi(code);
 143.173 +
 143.174 +    buf_pos += len;
 143.175 +
 143.176 +  }while(code[3] == '-');
 143.177 +
 143.178 +  return TRUE;
 143.179 +}
 143.180 +
 143.181 +static
 143.182 +gboolean check_response(smtp_base *psb, gboolean after_data)
 143.183 +{
 143.184 +  char c = psb->buffer[0];
 143.185 +
 143.186 +  if(((c == '2') && !after_data) || ((c == '3') && after_data)){
 143.187 +    psb->error = smtp_ok;
 143.188 +    DEBUG(6) debugf("response OK:'%s' after_date = %d\n", psb->buffer, (int)after_data);
 143.189 +    return TRUE;
 143.190 +  }else{
 143.191 +    if(c == '4')
 143.192 +      psb->error = smtp_trylater;
 143.193 +    else if(c == '5')
 143.194 +      psb->error = smtp_fail;
 143.195 +    else
 143.196 +      psb->error = smtp_syntax;
 143.197 +    DEBUG(6) debugf("response failure:'%s' after_date = %d\n", psb->buffer, (int)after_data);
 143.198 +    return FALSE;
 143.199 +  }
 143.200 +}
 143.201 +
 143.202 +static
 143.203 +gboolean check_init_response(smtp_base *psb)
 143.204 +{
 143.205 +  if(check_response(psb, FALSE)){
 143.206 +    psb->use_esmtp = (strstr(psb->buffer, "ESMTP") != NULL);
 143.207 +
 143.208 +    DEBUG(4) debugf(psb->use_esmtp ? "uses esmtp\n" : "no esmtp\n");
 143.209 +
 143.210 +    return TRUE;
 143.211 +  }
 143.212 +  return FALSE;
 143.213 +}
 143.214 +
 143.215 +static
 143.216 +gchar *get_response_arg(gchar *response)
 143.217 +{
 143.218 +  gchar buf[SMTP_BUF_LEN];
 143.219 +  gchar *p = response, *q = buf;
 143.220 +
 143.221 +  while(*p && (*p != '\n') && isspace(*p)) p++;
 143.222 +  if(*p && (*p != '\n')){
 143.223 +    while(*p && (*p != '\n') && (*p != '\r') && (q < buf+SMTP_BUF_LEN-1)) *(q++) = *(p++);
 143.224 +    *q = 0;
 143.225 +    return g_strdup(buf);
 143.226 +  }
 143.227 +  return NULL;
 143.228 +}
 143.229 +
 143.230 +static
 143.231 +gboolean check_helo_response(smtp_base *psb)
 143.232 +{
 143.233 +  gchar *ptr = psb->buffer;
 143.234 +
 143.235 +  if(!check_response(psb, FALSE))
 143.236 +    return FALSE;
 143.237 +
 143.238 +  while(*ptr){
 143.239 +    if(strncasecmp(&(ptr[4]), "SIZE", 4) == 0){
 143.240 +      gchar *arg;
 143.241 +      psb->use_size = TRUE;
 143.242 +      arg = get_response_arg(&(ptr[8]));
 143.243 +      if(arg){
 143.244 +	psb->max_size = atoi(arg);
 143.245 +	g_free(arg);
 143.246 +      }
 143.247 +    }
 143.248 +
 143.249 +    if(strncasecmp(&(ptr[4]), "PIPELINING", 10) == 0)
 143.250 +      psb->use_pipelining = TRUE;
 143.251 +
 143.252 +    if(strncasecmp(&(ptr[4]), "AUTH", 4) == 0){
 143.253 +      if((ptr[8] == ' ') || (ptr[8] == '=') || (ptr[8] == '\t')){ /* not sure about '\t' */
 143.254 +	gchar *arg;
 143.255 +	psb->use_auth = TRUE;
 143.256 +	arg = get_response_arg(&(ptr[9])); /* after several years I finally learnt to count */
 143.257 +	if(arg){
 143.258 +	  psb->auth_names = g_strsplit(arg, " " , 0);
 143.259 +	  g_free(arg);
 143.260 +	  
 143.261 +	  DEBUG(4){
 143.262 +	    gint i = 0;
 143.263 +	    while(psb->auth_names[i]){
 143.264 +	      debugf("offered AUTH %s\n", psb->auth_names[i]);
 143.265 +	      i++;
 143.266 +	    }
 143.267 +	  }
 143.268 +	}
 143.269 +      }
 143.270 +    }
 143.271 +
 143.272 +    while(*ptr != '\n') ptr++;
 143.273 +    ptr++;
 143.274 +  }
 143.275 +
 143.276 +  DEBUG(4){
 143.277 +    debugf(psb->use_size ? "uses SIZE\n" : "no size\n");
 143.278 +    debugf(psb->use_pipelining ? "uses PIPELINING\n" : "no pipelining\n");
 143.279 +    debugf(psb->use_auth ? "uses AUTH\n" : "no auth\n");
 143.280 +  }
 143.281 +
 143.282 +  return TRUE;
 143.283 +}
 143.284 +
 143.285 +static
 143.286 +gboolean smtp_helo(smtp_base *psb, gchar *helo)
 143.287 +{
 143.288 +  while(TRUE){
 143.289 +    if(psb->use_esmtp){
 143.290 +      fprintf(psb->out, "EHLO %s\r\n", helo); fflush(psb->out);
 143.291 +
 143.292 +      DEBUG(4) debugf("EHLO %s\r\n", helo);
 143.293 +
 143.294 +    }else{
 143.295 +      fprintf(psb->out, "HELO %s\r\n", helo); fflush(psb->out);
 143.296 +
 143.297 +      DEBUG(4) debugf("HELO %s\r\n", helo);
 143.298 +
 143.299 +    }
 143.300 +    
 143.301 +    if(!read_response(psb, SMTP_CMD_TIMEOUT))
 143.302 +      return FALSE;
 143.303 +
 143.304 +    if(check_helo_response(psb))
 143.305 +      return TRUE;
 143.306 +    else{
 143.307 +      if(psb->error == smtp_fail){
 143.308 +	if(psb->use_esmtp){
 143.309 +	  /* our guess that server understands EHLO was wrong,
 143.310 +	     try again with HELO
 143.311 +	  */
 143.312 +	  psb->use_esmtp = FALSE;
 143.313 +	}else{
 143.314 +	  /* what sort of server ist THAT ?!
 143.315 +	     give up...
 143.316 +	  */
 143.317 +	  return FALSE;
 143.318 +	}
 143.319 +      }else
 143.320 +	return FALSE;
 143.321 +    }
 143.322 +  }
 143.323 +}
 143.324 +
 143.325 +static
 143.326 +void smtp_cmd_mailfrom(smtp_base *psb, address *return_path, guint size)
 143.327 +{
 143.328 +  if(psb->use_size){
 143.329 +    fprintf(psb->out, "MAIL FROM:%s SIZE=%d\r\n",
 143.330 +	    addr_string(return_path), size);
 143.331 +    fflush(psb->out);
 143.332 +
 143.333 +    DEBUG(4) debugf("MAIL FROM:%s SIZE=%d\r\n",
 143.334 +		    addr_string(return_path), size);
 143.335 +
 143.336 +  }else{
 143.337 +    fprintf(psb->out, "MAIL FROM:%s\r\n", addr_string(return_path));
 143.338 +    fflush(psb->out);
 143.339 +
 143.340 +    DEBUG(4) debugf("MAIL FROM:%s\r\n", addr_string(return_path));
 143.341 +  }
 143.342 +}
 143.343 +
 143.344 +static
 143.345 +void smtp_cmd_rcptto(smtp_base *psb, address *rcpt)
 143.346 +{
 143.347 +  fprintf(psb->out, "RCPT TO:%s\r\n", addr_string(rcpt));
 143.348 +  fflush(psb->out);
 143.349 +  DEBUG(4) debugf("RCPT TO:%s\n", addr_string(rcpt));
 143.350 +}
 143.351 +
 143.352 +static
 143.353 +void send_data_line(smtp_base *psb, gchar *data)
 143.354 +{
 143.355 +  /* According to RFC 821 each line should be terminated with CRLF.
 143.356 +     Since a dot on a line itself marks the end of data, each line
 143.357 +     beginning with a dot is prepended with another dot.
 143.358 +  */
 143.359 +  gchar *ptr;
 143.360 +  gboolean new_line = TRUE; /* previous versions assumed that each item was
 143.361 +			       exactly one line. This is no longer the case */
 143.362 +
 143.363 +  ptr = data;
 143.364 +  while(*ptr){
 143.365 +    int c = (int)(*ptr);
 143.366 +    if(c == '.')
 143.367 +      if(new_line)
 143.368 +	putc('.', psb->out);
 143.369 +    if(c == '\n'){
 143.370 +      putc('\r', psb->out);
 143.371 +      putc('\n', psb->out);
 143.372 +      new_line = TRUE;
 143.373 +    }else{
 143.374 +      putc(c, psb->out);
 143.375 +      new_line = FALSE;
 143.376 +    }
 143.377 +    ptr++;
 143.378 +  }
 143.379 +}
 143.380 +
 143.381 +static
 143.382 +void send_header(smtp_base *psb, GList *hdr_list)
 143.383 +{
 143.384 +  GList *node;
 143.385 +  gint num_hdrs = 0;
 143.386 +
 143.387 +  /* header */
 143.388 +  if(hdr_list){
 143.389 +    foreach(hdr_list, node){
 143.390 +      if(node->data){
 143.391 +	header *hdr = (header *)(node->data);
 143.392 +	if(hdr->header){
 143.393 +	  send_data_line(psb, hdr->header);
 143.394 +	  num_hdrs++;
 143.395 +	}
 143.396 +      }
 143.397 +    }
 143.398 +  }
 143.399 +
 143.400 +  /* empty line separating headers from data: */
 143.401 +  putc('\r', psb->out);
 143.402 +  putc('\n', psb->out);
 143.403 +
 143.404 +  DEBUG(4) debugf("sent %d headers\n", num_hdrs);
 143.405 +}
 143.406 +
 143.407 +static
 143.408 +void send_data(smtp_base *psb, message *msg)
 143.409 +{
 143.410 +  GList *node;
 143.411 +  gint num_lines = 0;
 143.412 +
 143.413 +  /* data */
 143.414 +  if(msg->data_list){
 143.415 +    for(node = g_list_first(msg->data_list); node; node = g_list_next(node)){
 143.416 +      if(node->data){
 143.417 +	send_data_line(psb, node->data);
 143.418 +	num_lines++;
 143.419 +      }
 143.420 +    }
 143.421 +  }
 143.422 +
 143.423 +  DEBUG(4) debugf("sent %d lines of data\n", num_lines);
 143.424 +
 143.425 +  fprintf(psb->out, ".\r\n");
 143.426 +  fflush(psb->out);
 143.427 +}
 143.428 +
 143.429 +void smtp_out_mark_rcpts(smtp_base *psb, GList *rcpt_list)
 143.430 +{
 143.431 +  GList *rcpt_node;
 143.432 +  for(rcpt_node = g_list_first(rcpt_list);
 143.433 +      rcpt_node;
 143.434 +      rcpt_node = g_list_next(rcpt_node)){
 143.435 +    address *rcpt = (address *)(rcpt_node->data);
 143.436 +
 143.437 +    addr_unmark_delivered(rcpt);
 143.438 +
 143.439 +    if((psb->error == smtp_trylater) || (psb->error == smtp_timeout) ||
 143.440 +       (psb->error == smtp_eof)){
 143.441 +      addr_mark_defered(rcpt);
 143.442 +    }else{
 143.443 +      addr_mark_failed(rcpt);
 143.444 +    }
 143.445 +  }
 143.446 +}
 143.447 +
 143.448 +void smtp_out_log_failure(smtp_base *psb, message *msg)
 143.449 +{
 143.450 +  gchar *err_str;
 143.451 +
 143.452 +  if(psb->error == smtp_timeout)
 143.453 +    err_str = g_strdup("connection timed out.");
 143.454 +  else if(psb->error == smtp_eof)
 143.455 +    err_str = g_strdup("connection terminated prematurely.");
 143.456 +  else if(psb->error == smtp_syntax)
 143.457 +    err_str = g_strdup_printf("got unexpected response: %s", psb->buffer);
 143.458 +  else if(psb->error == smtp_cancel)
 143.459 +    err_str = g_strdup("delivery was canceled.\n");
 143.460 +  else
 143.461 +    /* error message should still be in the buffer */
 143.462 +    err_str = g_strdup_printf("failed: %s\n", psb->buffer);
 143.463 +
 143.464 +  if(msg == NULL)
 143.465 +    logwrite(LOG_NOTICE, "host=%s %s\n",
 143.466 +	     psb->remote_host, err_str);
 143.467 +  else
 143.468 +    logwrite(LOG_NOTICE, "%s == host=%s %s\n",
 143.469 +	     msg->uid, psb->remote_host, err_str);
 143.470 +
 143.471 +  g_free(err_str);
 143.472 +}
 143.473 +
 143.474 +smtp_base *smtp_out_open(gchar *host, gint port, GList *resolve_list)
 143.475 +{
 143.476 +  smtp_base *psb;
 143.477 +  gint sock;
 143.478 +  mxip_addr *addr;
 143.479 +
 143.480 +  DEBUG(5) debugf("smtp_out_open entered, host = %s\n", host);
 143.481 +
 143.482 +  if((addr = connect_resolvelist(&sock, host, port, resolve_list))){
 143.483 +    /* create structure to hold status data: */
 143.484 +    psb = create_smtpbase(sock);
 143.485 +    psb->remote_host = addr->name;
 143.486 +
 143.487 +    DEBUG(5){
 143.488 +      struct sockaddr_in name;
 143.489 +      int len = sizeof(struct sockaddr);
 143.490 +      getsockname(sock, (struct sockaddr *)(&name), &len);
 143.491 +      debugf("socket: name.sin_addr = %s\n", inet_ntoa(name.sin_addr));
 143.492 +    }
 143.493 +    return psb;
 143.494 +  }else{
 143.495 +    DEBUG(5) debugf("connect_resolvelist failed: %s %s\n", strerror(errno), hstrerror(h_errno));
 143.496 +  }
 143.497 +
 143.498 +  return NULL;
 143.499 +}
 143.500 +
 143.501 +smtp_base *smtp_out_open_child(gchar *cmd)
 143.502 +{
 143.503 +  smtp_base *psb;
 143.504 +  gint sock;
 143.505 +
 143.506 +  DEBUG(5) debugf("smtp_out_open_child entered, cmd = %s\n", cmd);
 143.507 +
 143.508 +  sock = child(cmd);
 143.509 +
 143.510 +  if(sock > 0){
 143.511 +    psb = create_smtpbase(sock);
 143.512 +    psb->remote_host = NULL;
 143.513 +
 143.514 +    return psb;
 143.515 +  }
 143.516 +
 143.517 +  return NULL;
 143.518 +}
 143.519 +
 143.520 +gboolean smtp_out_rset(smtp_base *psb)
 143.521 +{
 143.522 +  gboolean ok;
 143.523 +  
 143.524 +  fprintf(psb->out, "RSET\r\n"); fflush(psb->out);
 143.525 +  DEBUG(4) debugf("RSET\n");
 143.526 +
 143.527 +  if((ok = read_response(psb, SMTP_CMD_TIMEOUT)))
 143.528 +    if(check_response(psb, FALSE))
 143.529 +      return TRUE;
 143.530 +
 143.531 +  smtp_out_log_failure(psb, NULL);
 143.532 +
 143.533 +  return FALSE;
 143.534 +}
 143.535 +
 143.536 +#ifdef ENABLE_AUTH
 143.537 +
 143.538 +static
 143.539 +gboolean smtp_out_auth_cram_md5(smtp_base *psb)
 143.540 +{
 143.541 +  gboolean ok = FALSE;
 143.542 +
 143.543 +  fprintf(psb->out, "AUTH CRAM-MD5\r\n"); fflush(psb->out);
 143.544 +  DEBUG(4) debugf("AUTH CRAM-MD5\n");
 143.545 +  if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){
 143.546 +    if((ok = check_response(psb, TRUE))){
 143.547 +      gchar *chall64 = get_response_arg(&(psb->buffer[4]));
 143.548 +      gint chall_size;
 143.549 +      gchar *chall = base64_decode(chall64, &chall_size);
 143.550 +      guchar digest[16], *reply64, *reply;
 143.551 +      gchar digest_string[33];
 143.552 +      gint i;
 143.553 +#ifdef USE_LIB_CRYPTO
 143.554 +      unsigned int digest_len;
 143.555 +#endif
 143.556 +      
 143.557 +      DEBUG(5) debugf("encoded challenge = %s\n", chall64);
 143.558 +      DEBUG(5) debugf("decoded challenge = %s, size = %d\n", chall, chall_size);
 143.559 +      
 143.560 +      DEBUG(5) debugf("secret = %s\n", psb->auth_secret);
 143.561 +      
 143.562 +#ifdef USE_LIB_CRYPTO
 143.563 +      HMAC(EVP_md5(), psb->auth_secret, strlen(psb->auth_secret), chall, chall_size, digest, &digest_len);
 143.564 +#else
 143.565 +      hmac_md5(chall, chall_size, psb->auth_secret, strlen(psb->auth_secret), digest);
 143.566 +#endif
 143.567 +      
 143.568 +      for(i = 0; i < 16; i++)
 143.569 +	sprintf(&(digest_string[i+i]), "%02x", (unsigned int)(digest[i]));
 143.570 +      digest_string[32] = 0;
 143.571 +      
 143.572 +      DEBUG(5) debugf("digest = %s\n", digest_string);
 143.573 +      
 143.574 +      reply = g_strdup_printf("%s %s", psb->auth_login, digest_string);
 143.575 +      DEBUG(5) debugf("unencoded reply = %s\n", reply);
 143.576 +      
 143.577 +      reply64 = base64_encode(reply, strlen(reply));
 143.578 +      DEBUG(5) debugf("encoded reply = %s\n", reply64);
 143.579 +          
 143.580 +      fprintf(psb->out, "%s\r\n", reply64); fflush(psb->out);
 143.581 +      DEBUG(4) debugf("%s\n", reply64);
 143.582 +          
 143.583 +      if((ok = read_response(psb, SMTP_CMD_TIMEOUT)))
 143.584 +	ok = check_response(psb, FALSE);
 143.585 +          
 143.586 +      g_free(reply64);
 143.587 +      g_free(reply);
 143.588 +      g_free(chall);
 143.589 +      g_free(chall64);
 143.590 +    }
 143.591 +  }
 143.592 +  return ok;
 143.593 +}
 143.594 +
 143.595 +static
 143.596 +gboolean smtp_out_auth_login(smtp_base *psb)
 143.597 +{
 143.598 +  gboolean ok = FALSE;
 143.599 +  fprintf(psb->out, "AUTH LOGIN\r\n"); fflush(psb->out);
 143.600 +  if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){
 143.601 +    if((ok = check_response(psb, TRUE))){
 143.602 +      gchar *resp64;
 143.603 +      guchar *resp;
 143.604 +      gint resp_size;
 143.605 +      gchar *reply64;
 143.606 +      
 143.607 +      resp64 = get_response_arg(&(psb->buffer[4]));
 143.608 +      DEBUG(5) debugf("encoded response = %s\n", resp64);
 143.609 +      resp = base64_decode(resp64, &resp_size);
 143.610 +      g_free(resp64);
 143.611 +      DEBUG(5) debugf("decoded response = %s, size = %d\n", 
 143.612 +                                        resp, resp_size);
 143.613 +      g_free(resp);
 143.614 +      reply64 = base64_encode(psb->auth_login,
 143.615 +			      strlen(psb->auth_login));
 143.616 +      fprintf(psb->out, "%s\r\n", reply64); fflush(psb->out);
 143.617 +      g_free(reply64);
 143.618 +      if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) {
 143.619 +	if ((ok = check_response(psb, TRUE))) {
 143.620 +	  resp64 = get_response_arg(&(psb->buffer[4]));
 143.621 +	  DEBUG(5) debugf("encoded response = %s\n", resp64);
 143.622 +	  resp = base64_decode(resp64, &resp_size);
 143.623 +	  g_free(resp64);
 143.624 +	  DEBUG(5) debugf("decoded response = %s, size = %d\n", 
 143.625 +			  resp, resp_size);
 143.626 +	  g_free(resp);
 143.627 +	  reply64 = base64_encode(psb->auth_secret,
 143.628 +				  strlen(psb->auth_secret));
 143.629 +	  fprintf(psb->out, "%s\r\n", reply64); fflush(psb->out);
 143.630 +	  g_free(reply64);
 143.631 +	  if((ok = read_response(psb, SMTP_CMD_TIMEOUT)))
 143.632 +	    ok = check_response(psb, FALSE);
 143.633 +	}
 143.634 +      }          
 143.635 +    }
 143.636 +  }
 143.637 +  return ok;
 143.638 +}
 143.639 +
 143.640 +gboolean smtp_out_auth(smtp_base *psb)
 143.641 +{
 143.642 +  gboolean ok = FALSE;
 143.643 +  gint i = 0;
 143.644 +  while(psb->auth_names[i]){
 143.645 +    if(strcasecmp(psb->auth_names[i], psb->auth_name) == 0)
 143.646 +      break;
 143.647 +    i++;
 143.648 +  }
 143.649 +  if(psb->auth_names[i]){
 143.650 +    if(strcasecmp(psb->auth_name, "cram-md5") == 0){
 143.651 +      smtp_out_auth_cram_md5(psb);
 143.652 +    }else if(strcasecmp(psb->auth_name, "login") == 0){
 143.653 +      smtp_out_auth_login(psb);
 143.654 +    }else{
 143.655 +      logwrite(LOG_ERR, "auth method %s not supported\n",  psb->auth_name);
 143.656 +    }
 143.657 +  }else{
 143.658 +    logwrite(LOG_ERR, "no auth method %s found.\n", psb->auth_name);
 143.659 +  }
 143.660 +  return ok;
 143.661 +}
 143.662 +
 143.663 +#endif
 143.664 +
 143.665 +gboolean smtp_out_init(smtp_base *psb)
 143.666 +{
 143.667 +  gboolean ok;
 143.668 +
 143.669 +  if((ok = read_response(psb, SMTP_INITIAL_TIMEOUT))){
 143.670 +    if((ok = check_init_response(psb))){
 143.671 + 
 143.672 +      if((ok = smtp_helo(psb, psb->helo_name))){
 143.673 +#ifdef ENABLE_AUTH
 143.674 +	if(psb->auth_name && psb->use_auth){
 143.675 +	  /* we completely disregard the response of server here. If
 143.676 +             authentication fails, the server will complain later
 143.677 +             anyway. I know, this is not polite... */
 143.678 +	  smtp_out_auth(psb);
 143.679 +	}
 143.680 +#endif
 143.681 +      }
 143.682 +    }
 143.683 +  }
 143.684 +  if(!ok)
 143.685 +    smtp_out_log_failure(psb, NULL);
 143.686 +  return ok;
 143.687 +}
 143.688 +
 143.689 +gint smtp_out_msg(smtp_base *psb,
 143.690 +		  message *msg, address *return_path, GList *rcpt_list,
 143.691 +		  GList *hdr_list)
 143.692 +{
 143.693 +  gint i, size;
 143.694 +  gboolean ok = TRUE;
 143.695 +  int rcpt_cnt;
 143.696 +  int rcpt_accept = 0;
 143.697 +
 143.698 +  DEBUG(5) debugf("smtp_out_msg entered\n");
 143.699 +
 143.700 +  /* defaults: */
 143.701 +  if(return_path == NULL)
 143.702 +    return_path = msg->return_path;
 143.703 +  if(hdr_list == NULL)
 143.704 +    hdr_list = msg->hdr_list;
 143.705 +  if(rcpt_list == NULL)
 143.706 +    rcpt_list = msg->rcpt_list;
 143.707 +  rcpt_cnt = g_list_length(rcpt_list);
 143.708 +
 143.709 +  size = msg_calc_size(msg, TRUE);
 143.710 +
 143.711 +  /* respect maximum size given by server: */
 143.712 +  if((psb->max_size > 0) && (size > psb->max_size)){
 143.713 +    logwrite(LOG_WARNING,
 143.714 +	     "%s == host=%s message size (%d) > fixed maximum message size of server (%d)",
 143.715 +	     msg->uid, psb->remote_host, size, psb->max_size);
 143.716 +    psb->error = smtp_cancel;
 143.717 +    ok = FALSE;
 143.718 +  }
 143.719 +
 143.720 +  if(ok){
 143.721 +    smtp_cmd_mailfrom(psb, return_path,
 143.722 +		      psb->use_size ? 
 143.723 +		      size + SMTP_SIZE_ADD : 0);
 143.724 +    
 143.725 +    if(!psb->use_pipelining){
 143.726 +      if((ok = read_response(psb, SMTP_CMD_TIMEOUT)))
 143.727 +	ok = check_response(psb, FALSE);
 143.728 +    }
 143.729 +  }
 143.730 +  if(ok){
 143.731 +    GList *rcpt_node;
 143.732 +    rcpt_accept = 0;
 143.733 +
 143.734 +    for(rcpt_node = g_list_first(rcpt_list);
 143.735 +	rcpt_node != NULL;
 143.736 +	rcpt_node = g_list_next(rcpt_node)){
 143.737 +      address *rcpt = (address *)(rcpt_node->data);
 143.738 +      smtp_cmd_rcptto(psb, rcpt);
 143.739 +      if(!psb->use_pipelining){
 143.740 +	if((ok = read_response(psb, SMTP_CMD_TIMEOUT)))
 143.741 +	  if(check_response(psb, FALSE)){
 143.742 +	    rcpt_accept++;
 143.743 +	    addr_mark_delivered(rcpt);
 143.744 +	  }
 143.745 +	  else{
 143.746 +	    /* if server returned an error for one recp. we
 143.747 +	       may still try the others. But if it is a timeout, eof
 143.748 +	       or unexpected response, it is more serious and we should
 143.749 +	       give up. */
 143.750 +	    if((psb->error != smtp_trylater) &&
 143.751 +	       (psb->error != smtp_fail)){
 143.752 +	      ok = FALSE;
 143.753 +	      break;
 143.754 +	    }else{
 143.755 +	      logwrite(LOG_NOTICE, "%s == %s host=%s failed: %s",
 143.756 +		       msg->uid, addr_string(rcpt),
 143.757 +		       psb->remote_host, psb->buffer);
 143.758 +	      if(psb->error == smtp_trylater){
 143.759 +		addr_mark_defered(rcpt);
 143.760 +	      }else{
 143.761 +		addr_mark_failed(rcpt);
 143.762 +	      }
 143.763 +	    }
 143.764 +	  }
 143.765 +	else
 143.766 +	  break;
 143.767 +      }
 143.768 +    }
 143.769 +
 143.770 +    /* There is no point in going on if no recp.s were accpted.
 143.771 +       But we can check that at this point only if not pipelining: */
 143.772 +    ok = (ok && (psb->use_pipelining || (rcpt_accept > 0)));
 143.773 +    if(ok){
 143.774 +
 143.775 +      fprintf(psb->out, "DATA\r\n"); fflush(psb->out);
 143.776 +
 143.777 +      DEBUG(4) debugf("DATA\r\n");
 143.778 +	
 143.779 +      if(psb->use_pipelining){
 143.780 +	/* the first pl'ed command was MAIL FROM
 143.781 +	   the last was DATA, whose response can be handled by the 'normal' code
 143.782 +	   all in between were RCPT TO:
 143.783 +	*/
 143.784 +	/* response to MAIL FROM: */
 143.785 +	if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){
 143.786 +	  if((ok = check_response(psb, FALSE))){
 143.787 +
 143.788 +	    /* response(s) to RCPT TO:
 143.789 +	       this is very similar to the sequence above for no pipeline
 143.790 +	    */
 143.791 +	    for(i = 0; i < rcpt_cnt; i++){
 143.792 +	      if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){
 143.793 +		address *rcpt = g_list_nth_data(rcpt_list, i);
 143.794 +		if(check_response(psb, FALSE)){
 143.795 +		  rcpt_accept++;
 143.796 +		  addr_mark_delivered(rcpt);
 143.797 +		}
 143.798 +		else{
 143.799 +		  /* if server returned an error 4xx or 5xx for one recp. we
 143.800 +		     may still try the others. But if it is a timeout, eof
 143.801 +		     or unexpected response, it is more serious and we
 143.802 +		     should give up. */
 143.803 +		  if((psb->error != smtp_trylater) &&
 143.804 +		     (psb->error != smtp_fail)){
 143.805 +		    ok = FALSE;
 143.806 +		    break;
 143.807 +		  }else{
 143.808 +		    logwrite(LOG_NOTICE, "%s == %s host=%s failed: %s",
 143.809 +			     msg->uid, addr_string(rcpt),
 143.810 +			     psb->remote_host, psb->buffer);
 143.811 +		    if(psb->error == smtp_trylater){
 143.812 +		      addr_mark_defered(rcpt);
 143.813 +		    }else{
 143.814 +		      addr_mark_failed(rcpt);
 143.815 +		    }
 143.816 +		  }
 143.817 +		}
 143.818 +	      }else{
 143.819 +		DEBUG(5) debugf("check_response failed after RCPT TO\n");
 143.820 +		break;
 143.821 +	      }
 143.822 +	    }
 143.823 +	    if(rcpt_accept == 0)
 143.824 +	      ok = FALSE;
 143.825 +	  }else{
 143.826 +	    DEBUG(5) debugf("check_response failed after MAIL FROM\n");
 143.827 +	  }
 143.828 +	}else{
 143.829 +	  DEBUG(5) debugf("read_response failed after MAIL FROM\n");
 143.830 +	}
 143.831 +      } /* if(psb->use_pipelining) */
 143.832 +
 143.833 +      /* response to the DATA cmd */
 143.834 +      if(ok){
 143.835 +	if(read_response(psb, SMTP_DATA_TIMEOUT)){
 143.836 +	  if(check_response(psb, TRUE)){
 143.837 +	    send_header(psb, hdr_list);
 143.838 +	    send_data(psb, msg);
 143.839 +	      
 143.840 +	    if(read_response(psb, SMTP_FINAL_TIMEOUT))
 143.841 +	      ok = check_response(psb, FALSE);
 143.842 +	  }
 143.843 +	}
 143.844 +      }
 143.845 +    }
 143.846 +  }
 143.847 +
 143.848 +  DEBUG(5){
 143.849 +    debugf("psb->error = %d\n", psb->error);
 143.850 +    debugf("ok = %d\n", ok);
 143.851 +    debugf("rcpt_accept = %d\n", rcpt_accept);
 143.852 +  }
 143.853 +
 143.854 +  if(psb->error == smtp_ok){
 143.855 +    GList *rcpt_node;
 143.856 +    for(rcpt_node = g_list_first(rcpt_list);
 143.857 +	rcpt_node;
 143.858 +	rcpt_node = g_list_next(rcpt_node)){
 143.859 +      address *rcpt = (address *)(rcpt_node->data);
 143.860 +      if(addr_is_delivered(rcpt))
 143.861 +	logwrite(LOG_NOTICE, "%s => %s host=%s with %s\n",
 143.862 +		 msg->uid, addr_string(rcpt), psb->remote_host,
 143.863 +		 psb->use_esmtp ? "esmtp" : "smtp");
 143.864 +    }
 143.865 +  }else{
 143.866 +    /* if something went wrong,
 143.867 +       we have to unmark the rcpts prematurely marked as delivered
 143.868 +       and mark the status */
 143.869 +    smtp_out_mark_rcpts(psb, rcpt_list);
 143.870 +
 143.871 +    /* log the failure: */
 143.872 +    smtp_out_log_failure(psb, msg);
 143.873 +  }
 143.874 +  return rcpt_accept;
 143.875 +}
 143.876 +
 143.877 +gboolean smtp_out_quit(smtp_base *psb)
 143.878 +{
 143.879 +  fprintf(psb->out, "QUIT\r\n"); fflush(psb->out);
 143.880 +  
 143.881 +  DEBUG(4) debugf("QUIT\n");
 143.882 +
 143.883 +  signal(SIGALRM, SIG_DFL);
 143.884 +
 143.885 +  return TRUE;
 143.886 +}
 143.887 +  
 143.888 +gint smtp_deliver(gchar *host, gint port, GList *resolve_list,
 143.889 +		  message *msg,
 143.890 +		  address *return_path,
 143.891 +		  GList *rcpt_list)
 143.892 +{
 143.893 +  smtp_base *psb;
 143.894 +  smtp_error err;
 143.895 +
 143.896 +  DEBUG(5) debugf("smtp_deliver entered\n");
 143.897 +
 143.898 +  if(return_path == NULL)
 143.899 +    return_path = msg->return_path;
 143.900 +
 143.901 +  if((psb = smtp_out_open(host, port, resolve_list))){
 143.902 +    set_heloname(psb, return_path->domain, TRUE);
 143.903 +    /* initiate connection, send message and quit: */
 143.904 +    if(smtp_out_init(psb)){
 143.905 +      smtp_out_msg(psb, msg, return_path, rcpt_list, NULL);
 143.906 +      if(psb->error == smtp_ok ||
 143.907 +	 (psb->error == smtp_fail) ||
 143.908 +	 (psb->error == smtp_trylater) ||
 143.909 +	 (psb->error == smtp_syntax) ||
 143.910 +	 (psb->error == smtp_cancel))
 143.911 +	
 143.912 +	smtp_out_quit(psb);
 143.913 +    }
 143.914 +    
 143.915 +    err = psb->error;
 143.916 +    destroy_smtpbase(psb);
 143.917 +    
 143.918 +    return err;
 143.919 +  }
 143.920 +  return -1;
 143.921 +}
   144.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.2 +++ b/src/smtp_out.h	Fri Sep 26 17:05:23 2008 +0200
   144.3 @@ -0,0 +1,91 @@
   144.4 +/* smtp_out.h, Copyright (C) Oliver Kurth,
   144.5 + *
   144.6 + * This program is free software; you can redistribute it and/or modify
   144.7 + * it under the terms of the GNU General Public License as published by
   144.8 + * the Free Software Foundation; either version 2 of the License, or
   144.9 + * (at your option) any later version.
  144.10 + * 
  144.11 + * This program is distributed in the hope that it will be useful,
  144.12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  144.13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  144.14 + * GNU General Public License for more details.
  144.15 + *
  144.16 + * You should have received a copy of the GNU General Public License
  144.17 + * along with this program; if not, write to the Free Software
  144.18 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  144.19 + */
  144.20 +
  144.21 +#include <unistd.h>
  144.22 +#include <sys/types.h>
  144.23 +#include <sys/socket.h>
  144.24 +#include <sys/time.h>
  144.25 +#include <netinet/in.h>
  144.26 +#include <netdb.h>
  144.27 +
  144.28 +#define SMTP_BUF_LEN 1024
  144.29 +#define SMTP_SIZE_ADD 1024
  144.30 +
  144.31 +#define SMTP_INITIAL_TIMEOUT 5*60
  144.32 +#define SMTP_CMD_TIMEOUT 5*60
  144.33 +#define SMTP_DATA_TIMEOUT 5*60
  144.34 +#define SMTP_FINAL_TIMEOUT 10*60
  144.35 +
  144.36 +typedef
  144.37 +enum _smtp_error{
  144.38 +  smtp_ok = 0,   /* mail was delivered to at least one recpient */
  144.39 +  smtp_trylater, /* server responded with 4xx */
  144.40 +  smtp_fail,     /* server responded with 5xx */
  144.41 +  smtp_timeout,  /* connection timed out */
  144.42 +  smtp_eof,      /* got unexpected EOF */
  144.43 +  smtp_syntax,   /* unexpected response */
  144.44 +  smtp_cancel    /* we gave up (eg. size) */
  144.45 +} smtp_error;
  144.46 +
  144.47 +
  144.48 +typedef
  144.49 +struct _smtp_base{
  144.50 +  FILE *in;
  144.51 +  FILE *out;
  144.52 +
  144.53 +  gint sock;
  144.54 +  gint dup_sock;
  144.55 +
  144.56 +  gchar *remote_host;
  144.57 +  gchar *helo_name;
  144.58 +
  144.59 +  gchar *buffer;
  144.60 +  gint last_code;
  144.61 +
  144.62 +  gboolean use_esmtp;
  144.63 +  gboolean use_size;
  144.64 +  gboolean use_pipelining;
  144.65 +  gboolean use_auth;
  144.66 +  
  144.67 +  gint max_size;
  144.68 +
  144.69 +  gchar **auth_names;
  144.70 +
  144.71 +  gchar *auth_name;
  144.72 +  gchar *auth_login;
  144.73 +  gchar *auth_secret;
  144.74 +
  144.75 +  smtp_error error;
  144.76 +
  144.77 +} smtp_base;
  144.78 +
  144.79 +gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct);
  144.80 +gboolean set_auth(smtp_base *psb, gchar *name, gchar *login, gchar *secret);
  144.81 +void destroy_smtpbase(smtp_base *psb);
  144.82 +smtp_base *smtp_out_open(gchar *host, gint port, GList *resolve_list);
  144.83 +smtp_base *smtp_out_open_child(gchar *cmd);
  144.84 +gboolean smtp_out_rset(smtp_base *psb);
  144.85 +gboolean smtp_out_init(smtp_base *psb);
  144.86 +gint smtp_out_msg(smtp_base *psb,
  144.87 +		  message *msg, address *return_path,
  144.88 +		  GList *rcpt_list, GList *hdr_list);
  144.89 +gboolean smtp_out_quit(smtp_base *psb);
  144.90 +
  144.91 +gint smtp_deliver(gchar *host, gint port, GList *resolve_list,
  144.92 +		  message *msg,
  144.93 +		  address *return_path,
  144.94 +		  GList *rcpt_list);
   145.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.2 +++ b/src/smtpsend.c	Fri Sep 26 17:05:23 2008 +0200
   145.3 @@ -0,0 +1,114 @@
   145.4 +/*  MasqMail
   145.5 +    Copyright (C) 1999 Oliver Kurth
   145.6 +
   145.7 +    This program is free software; you can redistribute it and/or modify
   145.8 +    it under the terms of the GNU General Public License as published by
   145.9 +    the Free Software Foundation; either version 2 of the License, or
  145.10 +    (at your option) any later version.
  145.11 +
  145.12 +    This program is distributed in the hope that it will be useful,
  145.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  145.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  145.15 +    GNU General Public License for more details.
  145.16 +
  145.17 +    You should have received a copy of the GNU General Public License
  145.18 +    along with this program; if not, write to the Free Software
  145.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  145.20 +*/
  145.21 +
  145.22 +#include <stdio.h>
  145.23 +#include <errno.h>
  145.24 +#include <stdlib.h>
  145.25 +#include <string.h>
  145.26 +#include <unistd.h>
  145.27 +
  145.28 +#include <glib.h>
  145.29 +
  145.30 +#include "masqmail.h"
  145.31 +#include "smtp_out.h"
  145.32 +
  145.33 +masqmail_conf conf;
  145.34 +
  145.35 +extern char *optarg;
  145.36 +extern int optind, opterr, optopt;
  145.37 +
  145.38 +void logwrite(int pri, const char *fmt, ...)
  145.39 +{
  145.40 +  va_list args;
  145.41 +  va_start(args, fmt);
  145.42 +
  145.43 +  vfprintf(stdout, fmt, args);
  145.44 +
  145.45 +  va_end(args);
  145.46 +}
  145.47 +
  145.48 +void debugf(const char *fmt, ...)
  145.49 +{
  145.50 +  va_list args;
  145.51 +  va_start(args, fmt);
  145.52 +
  145.53 +  vfprintf(stdout, fmt, args);
  145.54 +
  145.55 +  va_end(args);
  145.56 +}
  145.57 +
  145.58 +int
  145.59 +main(int argc, char *argv[])
  145.60 +{
  145.61 +  gchar *helo_name = g_malloc(64);
  145.62 +  gchar *server_name = g_strdup("localhost");
  145.63 +  gint server_port = 25;
  145.64 +  GList *resolve_list = g_list_append(NULL, resolve_byname);
  145.65 +
  145.66 +  gethostname(helo_name, 63);
  145.67 +
  145.68 +  conf.host_name = g_strdup(helo_name);
  145.69 +
  145.70 +  while(1){
  145.71 +    int c;
  145.72 +    c = getopt(argc, argv, "d:p:s:H:");
  145.73 +    if(c == -1)
  145.74 +      break;
  145.75 +    switch(c){
  145.76 +    case 'd':
  145.77 +      conf.debug_level = atoi(optarg);
  145.78 +      break;
  145.79 +    case 'p':
  145.80 +      server_port = atoi(optarg);
  145.81 +      break;
  145.82 +    case 's':
  145.83 +      g_free(server_name);
  145.84 +      server_name = g_strdup(optarg);
  145.85 +      break;
  145.86 +    case 'H':
  145.87 +      g_free(helo_name);
  145.88 +      helo_name = g_strdup(optarg);
  145.89 +      break;
  145.90 +    default:
  145.91 +      break;
  145.92 +    }
  145.93 +  }
  145.94 +
  145.95 +  if (optind < argc){
  145.96 +    gint ret;
  145.97 +    message *msg = create_message();
  145.98 +
  145.99 +    while (optind < argc){
 145.100 +      msg->rcpt_list =
 145.101 +	g_list_append(msg->rcpt_list,
 145.102 +		      create_address_qualified(argv[optind++], TRUE, conf.host_name));
 145.103 +    }
 145.104 +    
 145.105 +    if((ret = accept_message(stdin, msg, ACC_NODOT_TERM|ACC_HEAD_FROM_RCPT)) == AERR_OK){
 145.106 +      if((ret = smtp_deliver(server_name, server_port, resolve_list, msg, NULL, NULL)) == smtp_ok){
 145.107 +	exit(EXIT_SUCCESS);
 145.108 +      }
 145.109 +      fprintf(stderr, "deliver failed: %d\n", ret);
 145.110 +    }
 145.111 +    fprintf(stderr, "accept failed: %d\n", ret);
 145.112 +    exit(ret);
 145.113 +  }else{
 145.114 +    fprintf(stderr, "no recipients given.\n");
 145.115 +    exit(-1);
 145.116 +  }
 145.117 +}
   146.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.2 +++ b/src/spool.c	Fri Sep 26 17:05:23 2008 +0200
   146.3 @@ -0,0 +1,437 @@
   146.4 +/*  MasqMail
   146.5 +    Copyright (C) 1999-2001 Oliver Kurth
   146.6 +
   146.7 +    This program is free software; you can redistribute it and/or modify
   146.8 +    it under the terms of the GNU General Public License as published by
   146.9 +    the Free Software Foundation; either version 2 of the License, or
  146.10 +    (at your option) any later version.
  146.11 +
  146.12 +    This program is distributed in the hope that it will be useful,
  146.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  146.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  146.15 +    GNU General Public License for more details.
  146.16 +
  146.17 +    You should have received a copy of the GNU General Public License
  146.18 +    along with this program; if not, write to the Free Software
  146.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  146.20 +*/
  146.21 +
  146.22 +#include "masqmail.h"
  146.23 +#include <sys/stat.h>
  146.24 +#include "dotlock.h"
  146.25 +
  146.26 +static
  146.27 +gint read_line(FILE *in, gchar *buf, gint buf_len)
  146.28 +{
  146.29 +  gint p = 0;
  146.30 +  gint c;
  146.31 +
  146.32 +  while((c = getc(in)) != '\n' && (c != EOF)){
  146.33 +    if(p >= buf_len-1) { return 0; }
  146.34 +    buf[p++] = c;
  146.35 +  }
  146.36 +
  146.37 +  if(c == EOF){
  146.38 +    return -1;
  146.39 +  }
  146.40 +  if((p > 0) && (buf[p-1] == '\r'))
  146.41 +    p--;
  146.42 +  buf[p++] = '\n';
  146.43 +  buf[p] = 0;
  146.44 +
  146.45 +  return p;
  146.46 +}
  146.47 +
  146.48 +static
  146.49 +void spool_write_rcpt(FILE *out, address *rcpt)
  146.50 +{
  146.51 +  gchar dlvrd_char = addr_is_delivered(rcpt) ? 'X' : (addr_is_failed(rcpt) ? 'F' : ' ');
  146.52 +
  146.53 +  if(rcpt->local_part[0] != '|'){
  146.54 +    /* this is a paranoid check, in case it slipped through: */
  146.55 +    /* if this happens, it is a bug */
  146.56 +    if(rcpt->domain == NULL){
  146.57 +      logwrite(LOG_WARNING, "BUG: null domain for address %s, setting to %s\n",
  146.58 +	       rcpt->local_part, conf.host_name);
  146.59 +      logwrite(LOG_WARNING, "please report this bug.\n");
  146.60 +      rcpt->domain = g_strdup(conf.host_name);
  146.61 +    }
  146.62 +    fprintf(out, "RT:%c%s\n", dlvrd_char, addr_string(rcpt));
  146.63 +  }else{
  146.64 +    fprintf(out, "RT:%c%s\n", dlvrd_char, rcpt->local_part);
  146.65 +  }
  146.66 +}
  146.67 +
  146.68 +static
  146.69 +address *spool_scan_rcpt(gchar *line)
  146.70 +{
  146.71 +  address *rcpt = NULL;
  146.72 +
  146.73 +  if(line[3] != 0){
  146.74 +    if(line[4] != '|'){
  146.75 +      rcpt = create_address(&(line[4]), TRUE);
  146.76 +    }else{
  146.77 +      rcpt = create_address_pipe(&(line[4]));
  146.78 +    }
  146.79 +    if(line[3] == 'X'){
  146.80 +      addr_mark_delivered(rcpt);
  146.81 +    }else if(line[3] == 'F'){
  146.82 +      addr_mark_failed(rcpt);
  146.83 +    }
  146.84 +  }
  146.85 +  return rcpt;
  146.86 +}
  146.87 +
  146.88 +gboolean spool_read_data(message *msg)
  146.89 +{
  146.90 +  FILE *in;
  146.91 +  gboolean ok = FALSE;
  146.92 +  gchar *spool_file;
  146.93 +
  146.94 +  DEBUG(5) debugf("spool_read_data entered\n");
  146.95 +  spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid);
  146.96 +  DEBUG(5) debugf("reading data spool file '%s'\n", spool_file);
  146.97 +  if((in = fopen(spool_file, "r"))){
  146.98 +    char buf[MAX_DATALINE];
  146.99 +    int len;
 146.100 +    
 146.101 +    /* msg uid */
 146.102 +    read_line(in, buf, MAX_DATALINE);
 146.103 +      
 146.104 +    /* data */
 146.105 +    msg->data_list = NULL;
 146.106 +    while((len = read_line(in, buf, MAX_DATALINE)) > 0){
 146.107 +      msg->data_list = g_list_prepend(msg->data_list, g_strdup(buf));
 146.108 +    }
 146.109 +    msg->data_list = g_list_reverse(msg->data_list);
 146.110 +    fclose(in);
 146.111 +    ok = TRUE;
 146.112 +  }else
 146.113 +    logwrite(LOG_ALERT, "could not open spool data file %s: %s\n",
 146.114 +	     spool_file, strerror(errno));
 146.115 +  return ok;
 146.116 +}
 146.117 +
 146.118 +gboolean spool_read_header(message *msg)
 146.119 +{
 146.120 +  FILE *in;
 146.121 +  gboolean ok = FALSE;
 146.122 +  gchar *spool_file;
 146.123 +
 146.124 +  /* header spool: */
 146.125 +  spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid);
 146.126 +  if((in = fopen(spool_file, "r"))){
 146.127 +    header *hdr = NULL;
 146.128 +    char buf[MAX_DATALINE];
 146.129 +    int len;
 146.130 +
 146.131 +    /* msg uid */
 146.132 +    read_line(in, buf, MAX_DATALINE);
 146.133 +    
 146.134 +    /* envelope header */
 146.135 +    while((len = read_line(in, buf, MAX_DATALINE)) > 0){
 146.136 +      if(buf[0] == '\n')
 146.137 +	break;
 146.138 +      else if(strncasecmp(buf, "MF:", 3) == 0){
 146.139 +	msg->return_path = create_address(&(buf[3]), TRUE);
 146.140 +	DEBUG(3) debugf("spool_read: MAIL FROM: %s",
 146.141 +			msg->return_path->address);
 146.142 +      }else if(strncasecmp(buf, "RT:", 3) == 0){
 146.143 +	address *addr;
 146.144 +	addr = spool_scan_rcpt(buf);
 146.145 +	if(!addr_is_delivered(addr) && !addr_is_failed(addr)){
 146.146 +	  msg->rcpt_list = g_list_append(msg->rcpt_list, addr);
 146.147 +	}else{
 146.148 +	  msg->non_rcpt_list = g_list_append(msg->non_rcpt_list, addr);
 146.149 +	}
 146.150 +      }else if(strncasecmp(buf, "PR:", 3) == 0){
 146.151 +	prot_id i;
 146.152 +	for(i = 0; i < PROT_NUM; i++){
 146.153 +	  if(strncasecmp(prot_names[i], &(buf[3]),
 146.154 +			 strlen(prot_names[i])) == 0){
 146.155 +	    break;
 146.156 +	  }
 146.157 +	}
 146.158 +	msg->received_prot = i;
 146.159 +      }else if(strncasecmp(buf, "RH:", 3) == 0){
 146.160 +	g_strchomp(buf);
 146.161 +	msg->received_host = g_strdup(&(buf[3]));
 146.162 +      }else if(strncasecmp(buf, "ID:", 3) == 0){
 146.163 +	g_strchomp(buf);
 146.164 +	msg->ident = g_strdup(&(buf[3]));
 146.165 +      }else if(strncasecmp(buf, "DS:", 3) == 0){
 146.166 +	msg->data_size = atoi(&(buf[3]));
 146.167 +      }else if(strncasecmp(buf, "TR:", 3) == 0){
 146.168 +	msg->received_time = (time_t)(atoi(&(buf[3])));
 146.169 +      }else if(strncasecmp(buf, "TW:", 3) == 0){
 146.170 +	msg->warned_time = (time_t)(atoi(&(buf[3])));
 146.171 +      }
 146.172 +      /* so far ignore other tags */
 146.173 +    }
 146.174 +    
 146.175 +    /* mail headers */
 146.176 +    while((len = read_line(in, buf, MAX_DATALINE)) > 0){
 146.177 +      if(strncasecmp(buf, "HD:", 3) == 0){
 146.178 +	hdr = get_header(&(buf[3]));
 146.179 +	msg->hdr_list = g_list_append(msg->hdr_list, hdr);
 146.180 +      }else if((buf[0] == ' ' || buf[0] == '\t') && hdr){
 146.181 +	char *tmp = hdr->header;
 146.182 +	/* header continuation */
 146.183 +	hdr->header = g_strconcat(hdr->header, buf, NULL);
 146.184 +	hdr->value = hdr->header + (hdr->value - tmp);
 146.185 +      }else
 146.186 +	break;
 146.187 +    }
 146.188 +    fclose(in);
 146.189 +    ok = TRUE;
 146.190 +  }else
 146.191 +    logwrite(LOG_ALERT, "could not open spool header file %s: %s\n",
 146.192 +	     spool_file, strerror(errno));
 146.193 +  return ok;
 146.194 +}
 146.195 +
 146.196 +message *msg_spool_read(gchar *uid, gboolean do_readdata)
 146.197 +{
 146.198 +  message *msg;
 146.199 +  gboolean ok = FALSE;
 146.200 +  
 146.201 +  msg = create_message();
 146.202 +  msg->uid = g_strdup(uid);
 146.203 +
 146.204 +  /* header spool: */
 146.205 +  ok = spool_read_header(msg);
 146.206 +  if(ok && do_readdata){
 146.207 +    /* data spool: */
 146.208 +    ok = spool_read_data(msg);
 146.209 +  }
 146.210 +  return msg;
 146.211 +}
 146.212 +
 146.213 +/* write header. uid and gid should already be set to the
 146.214 +   mail ids. Better call spool_write(msg, FALSE).
 146.215 +*/
 146.216 +static
 146.217 +gboolean spool_write_header(message *msg)
 146.218 +{
 146.219 +  GList *node;
 146.220 +  gchar *spool_file, *tmp_file;
 146.221 +  FILE *out;
 146.222 +  gboolean ok = TRUE;
 146.223 +
 146.224 +  /* header spool: */
 146.225 +  tmp_file = g_strdup_printf("%s/input/%d-H.tmp", conf.spool_dir, getpid());
 146.226 +  DEBUG(4) debugf("tmp_file = %s\n", tmp_file);
 146.227 +
 146.228 +  if((out = fopen(tmp_file, "w"))){
 146.229 +    DEBUG(6) debugf("opened tmp_file %s\n", tmp_file);
 146.230 +
 146.231 +    fprintf(out, "%s\n", msg->uid);
 146.232 +    fprintf(out, "MF:%s\n", addr_string(msg->return_path));
 146.233 +
 146.234 +    DEBUG(6) debugf("after MF\n");
 146.235 +    foreach(msg->rcpt_list, node){
 146.236 +      address *rcpt = (address *)(node->data);
 146.237 +      spool_write_rcpt(out, rcpt);
 146.238 +    }
 146.239 +    foreach(msg->non_rcpt_list, node){
 146.240 +      address *rcpt = (address *)(node->data);
 146.241 +      spool_write_rcpt(out, rcpt);
 146.242 +    }
 146.243 +    DEBUG(6) debugf("after RT\n");
 146.244 +    fprintf(out, "PR:%s\n", prot_names[msg->received_prot]);
 146.245 +    if(msg->received_host != NULL)
 146.246 +      fprintf(out, "RH:%s\n", msg->received_host);
 146.247 +
 146.248 +    if(msg->ident != NULL)
 146.249 +      fprintf(out, "ID:%s\n", msg->ident);
 146.250 +
 146.251 +    if(msg->data_size >= 0)
 146.252 +      fprintf(out, "DS: %d\n", msg->data_size);
 146.253 +
 146.254 +    if(msg->received_time > 0)
 146.255 +      fprintf(out, "TR: %u\n", (int)(msg->received_time));
 146.256 +
 146.257 +    if(msg->warned_time > 0)
 146.258 +      fprintf(out, "TW: %u\n", (int)(msg->warned_time));
 146.259 +
 146.260 +    DEBUG(6) debugf("after RH\n");
 146.261 +    fprintf(out, "\n");
 146.262 +
 146.263 +    foreach(msg->hdr_list, node){
 146.264 +      header *hdr = (header *)(node->data);
 146.265 +      fprintf(out, "HD:%s", hdr->header);
 146.266 +    }
 146.267 +    if(fflush(out) == EOF) ok = FALSE;
 146.268 +    else if(fdatasync(fileno(out)) != 0){
 146.269 +      if(errno != EINVAL) /* some fs do not support this..
 146.270 +			     I hope this also means that it is not necessary */
 146.271 +	ok = FALSE;
 146.272 +    }
 146.273 +    fclose(out);
 146.274 +    if(ok){
 146.275 +      spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid);
 146.276 +      DEBUG(4) debugf("spool_file = %s\n", spool_file);
 146.277 +      ok = (rename(tmp_file, spool_file) != -1);
 146.278 +      g_free(spool_file);
 146.279 +    }
 146.280 +  }else{
 146.281 +    logwrite(LOG_ALERT, "could not open temporary header spool file '%s': %s\n", tmp_file, strerror(errno));
 146.282 +    DEBUG(1) debugf("euid = %d, egid = %d\n", geteuid(), getegid());
 146.283 +    ok = FALSE;
 146.284 +  }
 146.285 +
 146.286 +  g_free(tmp_file);
 146.287 +
 146.288 +  return ok;
 146.289 +}
 146.290 +
 146.291 +gboolean spool_write(message *msg, gboolean do_write_data)
 146.292 +{
 146.293 +  GList *list;
 146.294 +  gchar *spool_file, *tmp_file;
 146.295 +  FILE *out;
 146.296 +  gboolean ok = TRUE;
 146.297 +  uid_t saved_uid, saved_gid;
 146.298 +  /* user can read/write, group can read, others cannot do anything: */
 146.299 +  mode_t saved_mode = saved_mode = umask(026);
 146.300 +
 146.301 +  /* set uid and gid to the mail ids */
 146.302 +  if(!conf.run_as_user){
 146.303 +    set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid);
 146.304 +  }
 146.305 +
 146.306 +  /* header spool: */
 146.307 +  ok = spool_write_header(msg);
 146.308 +
 146.309 +  if(ok){
 146.310 +
 146.311 +    if(do_write_data){
 146.312 +      /* data spool: */
 146.313 +      tmp_file = g_strdup_printf("%s/input/%d-D.tmp",
 146.314 +				 conf.spool_dir, getpid());
 146.315 +      DEBUG(4) debugf("tmp_file = %s\n", tmp_file);
 146.316 +
 146.317 +      if((out = fopen(tmp_file, "w"))){
 146.318 +	fprintf(out, "%s\n", msg->uid);
 146.319 +	for(list = g_list_first(msg->data_list);
 146.320 +	    list != NULL;
 146.321 +	    list = g_list_next(list)){
 146.322 +	  fprintf(out, "%s", (gchar *)(list->data));
 146.323 +	}
 146.324 +
 146.325 +	/* possibly paranoid ;-) */
 146.326 +	if(fflush(out) == EOF) ok = FALSE;
 146.327 +	else if(fdatasync(fileno(out)) != 0){
 146.328 +	  if(errno != EINVAL) /* some fs do not support this..
 146.329 +				 I hope this also means that it is not necessary */
 146.330 +	    ok = FALSE;
 146.331 +	}
 146.332 +	fclose(out);
 146.333 +	if(ok){
 146.334 +	  spool_file = g_strdup_printf("%s/input/%s-D",
 146.335 +				       conf.spool_dir, msg->uid);
 146.336 +	  DEBUG(4) debugf("spool_file = %s\n", spool_file);
 146.337 +	  ok = (rename(tmp_file, spool_file) != -1);
 146.338 +	  g_free(spool_file);
 146.339 +	}
 146.340 +      }else{
 146.341 +	logwrite(LOG_ALERT, "could not open temporary data spool file: %s\n",
 146.342 +		 strerror(errno));
 146.343 +	ok = FALSE;
 146.344 +      }
 146.345 +      g_free(tmp_file);
 146.346 +    }
 146.347 +  }
 146.348 +
 146.349 +  /* set uid and gid back */
 146.350 +  if(!conf.run_as_user){
 146.351 +    set_euidgid(saved_uid, saved_gid, NULL, NULL);
 146.352 +  }
 146.353 +
 146.354 +  umask(saved_mode);
 146.355 +
 146.356 +  return ok;
 146.357 +}
 146.358 +
 146.359 +#define MAX_LOCKAGE 300
 146.360 +
 146.361 +gboolean spool_lock(gchar *uid)
 146.362 +{
 146.363 +  uid_t saved_uid, saved_gid;
 146.364 +  gchar *hitch_name;
 146.365 +  gchar *lock_name;
 146.366 +  gboolean ok = FALSE;
 146.367 +
 146.368 +  hitch_name = g_strdup_printf("%s/%s-%d.lock", conf.lock_dir, uid, getpid());
 146.369 +  lock_name = g_strdup_printf("%s/%s.lock", conf.lock_dir, uid);
 146.370 +
 146.371 +  /* set uid and gid to the mail ids */
 146.372 +  if(!conf.run_as_user){
 146.373 +    set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid);
 146.374 +  }
 146.375 +
 146.376 +  ok = dot_lock(lock_name, hitch_name);
 146.377 +  if(!ok) logwrite(LOG_WARNING, "spool file %s is locked\n", uid);
 146.378 +
 146.379 +  /* set uid and gid back */
 146.380 +  if(!conf.run_as_user){
 146.381 +    set_euidgid(saved_uid, saved_gid, NULL, NULL);
 146.382 +  }
 146.383 +
 146.384 +  g_free(lock_name);
 146.385 +  g_free(hitch_name);
 146.386 +
 146.387 +  return ok;
 146.388 +}
 146.389 +
 146.390 +gboolean spool_unlock(gchar *uid)
 146.391 +{
 146.392 +  uid_t saved_uid, saved_gid;
 146.393 +  gchar *lock_name;
 146.394 +
 146.395 +  /* set uid and gid to the mail ids */
 146.396 +  if(!conf.run_as_user){
 146.397 +    set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid);
 146.398 +  }
 146.399 +
 146.400 +  lock_name = g_strdup_printf("%s/%s.lock", conf.lock_dir, uid);
 146.401 +  dot_unlock(lock_name);
 146.402 +  g_free(lock_name);
 146.403 +
 146.404 +  /* set uid and gid back */
 146.405 +  if(!conf.run_as_user){
 146.406 +    set_euidgid(saved_uid, saved_gid, NULL, NULL);
 146.407 +  }
 146.408 +  return TRUE;
 146.409 +}
 146.410 +
 146.411 +gboolean spool_delete_all(message *msg)
 146.412 +{
 146.413 +  uid_t saved_uid, saved_gid;
 146.414 +  gchar *spool_file;
 146.415 +
 146.416 +  /* set uid and gid to the mail ids */
 146.417 +  if(!conf.run_as_user){
 146.418 +    set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid);
 146.419 +  }
 146.420 +
 146.421 +  /* header spool: */
 146.422 +  spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid);
 146.423 +  if(unlink(spool_file) != 0)
 146.424 +    logwrite(LOG_ALERT, "could not delete spool file %s: %s\n",
 146.425 +	     spool_file, strerror(errno));
 146.426 +  g_free(spool_file);
 146.427 +
 146.428 +  /* data spool: */
 146.429 +  spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid);
 146.430 +  if(unlink(spool_file) != 0)
 146.431 +    logwrite(LOG_ALERT, "could not delete spool file %s: %s\n",
 146.432 +	     spool_file, strerror(errno));
 146.433 +  g_free(spool_file);
 146.434 +
 146.435 +  /* set uid and gid back */
 146.436 +  if(!conf.run_as_user){
 146.437 +    set_euidgid(saved_uid, saved_gid, NULL, NULL);
 146.438 +  }
 146.439 +  return TRUE;
 146.440 +}
   147.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.2 +++ b/src/tables.c	Fri Sep 26 17:05:23 2008 +0200
   147.3 @@ -0,0 +1,138 @@
   147.4 +/*  MasqMail
   147.5 +    Copyright (C) 1999-2001 Oliver Kurth
   147.6 +
   147.7 +    This program is free software; you can redistribute it and/or modify
   147.8 +    it under the terms of the GNU General Public License as published by
   147.9 +    the Free Software Foundation; either version 2 of the License, or
  147.10 +    (at your option) any later version.
  147.11 +
  147.12 +    This program is distributed in the hope that it will be useful,
  147.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  147.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  147.15 +    GNU General Public License for more details.
  147.16 +
  147.17 +    You should have received a copy of the GNU General Public License
  147.18 +    along with this program; if not, write to the Free Software
  147.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  147.20 +*/
  147.21 +
  147.22 +#include "masqmail.h"
  147.23 +#include <fnmatch.h>
  147.24 +
  147.25 +table_pair *create_pair(gchar *key, gpointer value)
  147.26 +{
  147.27 +  table_pair *pair;
  147.28 +  
  147.29 +  pair = g_malloc(sizeof(table_pair));
  147.30 +  pair->key = g_strdup(key);
  147.31 +  pair->value = value;
  147.32 +
  147.33 +  return pair;
  147.34 +}
  147.35 +
  147.36 +table_pair *create_pair_string(gchar *key, gpointer value)
  147.37 +{
  147.38 +  table_pair *pair;
  147.39 +  
  147.40 +  pair = g_malloc(sizeof(table_pair));
  147.41 +  pair->key = g_strdup(key);
  147.42 +  pair->value = (gpointer)(g_strdup(value));
  147.43 +
  147.44 +  return pair;
  147.45 +}
  147.46 +
  147.47 +table_pair *parse_table_pair(gchar *line, char delim)
  147.48 +{
  147.49 +  gchar buf[256];
  147.50 +  gchar *p, *q;
  147.51 +  table_pair *pair;
  147.52 +
  147.53 +  p = line;
  147.54 +  q = buf;
  147.55 +  while((*p != 0) && (*p != delim) && q < buf+255)
  147.56 +    *(q++) = *(p++);
  147.57 +  *q = 0;
  147.58 +
  147.59 +  pair = g_malloc(sizeof(table_pair));
  147.60 +  pair->key = g_strdup(g_strstrip(buf));
  147.61 +
  147.62 +  if(*p){
  147.63 +    p++;
  147.64 +    /*    while(isspace(*p)) p++; */
  147.65 +    pair->value = (gpointer *)(g_strdup(g_strstrip(p)));
  147.66 +  }else
  147.67 +    pair->value = (gpointer *)g_strdup("");
  147.68 +
  147.69 +  return pair;
  147.70 +}
  147.71 +
  147.72 +gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func)(const char *, const char *))
  147.73 +{
  147.74 +  GList *node;
  147.75 +
  147.76 +  foreach(table_list, node){
  147.77 +    table_pair *pair = (table_pair *)(node->data);
  147.78 +    if(cmp_func(pair->key, key) == 0)
  147.79 +      return pair->value;
  147.80 +  }
  147.81 +  return NULL;
  147.82 +}
  147.83 +
  147.84 +gpointer *table_find(GList *table_list, gchar *key)
  147.85 +{
  147.86 +  return table_find_func(table_list, key, strcmp);
  147.87 +}
  147.88 +
  147.89 +gpointer *table_find_case(GList *table_list, gchar *key)
  147.90 +{
  147.91 +  return table_find_func(table_list, key, strcasecmp);
  147.92 +}
  147.93 +
  147.94 +static
  147.95 +int fnmatch0(const char *pattern, const char *string)
  147.96 +{
  147.97 +  return fnmatch(pattern, string, 0);
  147.98 +}
  147.99 +
 147.100 +gpointer *table_find_fnmatch(GList *table_list, gchar *key)
 147.101 +{
 147.102 +  return table_find_func(table_list, key, fnmatch0);
 147.103 +}
 147.104 +
 147.105 +GList *table_read(gchar *fname, gchar delim)
 147.106 +{
 147.107 +  GList *list = NULL;
 147.108 +  FILE *fptr;
 147.109 +
 147.110 +  if((fptr = fopen(fname, "rt"))){
 147.111 +    gchar buf[256];
 147.112 +
 147.113 +    while(fgets(buf, 255, fptr)){
 147.114 +      if(buf[0] && (buf[0] != '#') && (buf[0] != '\n')){
 147.115 +	table_pair *pair;
 147.116 +	g_strchomp(buf);
 147.117 +	pair = parse_table_pair(buf, delim);
 147.118 +	list = g_list_append(list, pair);
 147.119 +      }
 147.120 +    }
 147.121 +    fclose(fptr);
 147.122 +    return list;
 147.123 +  }
 147.124 +  logwrite(LOG_ALERT, "could not open table file %s: %s\n", fname, strerror(errno));
 147.125 +
 147.126 +  return NULL;
 147.127 +}
 147.128 +
 147.129 +void destroy_table(GList *table)
 147.130 +{
 147.131 +  GList *node;
 147.132 +
 147.133 +  foreach(table, node){
 147.134 +    table_pair *p = (table_pair *)(node->data);
 147.135 +    g_free(p->key);
 147.136 +    g_free(p->value);
 147.137 +    g_free(p);
 147.138 +  }
 147.139 +  g_list_free(table);
 147.140 +}
 147.141 +
   148.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.2 +++ b/src/timeival.c	Fri Sep 26 17:05:23 2008 +0200
   148.3 @@ -0,0 +1,54 @@
   148.4 +/*  MasqMail
   148.5 +    Copyright (C) 1999-2002 Oliver Kurth
   148.6 +
   148.7 +    This program is free software; you can redistribute it and/or modify
   148.8 +    it under the terms of the GNU General Public License as published by
   148.9 +    the Free Software Foundation; either version 2 of the License, or
  148.10 +    (at your option) any later version.
  148.11 +
  148.12 +    This program is distributed in the hope that it will be useful,
  148.13 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
  148.14 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  148.15 +    GNU General Public License for more details.
  148.16 +
  148.17 +    You should have received a copy of the GNU General Public License
  148.18 +    along with this program; if not, write to the Free Software
  148.19 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  148.20 +*/
  148.21 +
  148.22 +#include <ctype.h>
  148.23 +#include <glib.h>
  148.24 +
  148.25 +#include "masqmail.h"
  148.26 +
  148.27 +gint time_interval(gchar *str, gint *pos)
  148.28 +{
  148.29 +  gchar buf[16];
  148.30 +  gchar *p = str, *q = buf;
  148.31 +  gint factor = 1, val;
  148.32 +
  148.33 +  while(*p && isdigit(*p) && (q < buf+15)){
  148.34 +    *(q++) = *(p++);
  148.35 +    (*pos)++;
  148.36 +  }
  148.37 +  (*pos)++;
  148.38 +  *q = 0;
  148.39 +  val = atoi(buf);
  148.40 +  
  148.41 +  /* fall through: */
  148.42 +  switch(*p){
  148.43 +  case 'w':
  148.44 +    factor *= 7;
  148.45 +  case 'd':
  148.46 +    factor *= 24;
  148.47 +  case 'h':
  148.48 +    factor *= 60;
  148.49 +  case 'm':
  148.50 +    factor *= 60;
  148.51 +  case 's':
  148.52 +    break;
  148.53 +  default:
  148.54 +    return -1;
  148.55 +  }
  148.56 +  return val * factor;
  148.57 +}
   149.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.2 +++ b/suse/masqmail	Fri Sep 26 17:05:23 2008 +0200
   149.3 @@ -0,0 +1,83 @@
   149.4 +#! /bin/sh
   149.5 +# Author: Oliver Kurth <okurth@uni-sw.gwdg.de>
   149.6 +#
   149.7 +# /sbin/init.d/masqmail
   149.8 +#
   149.9 +
  149.10 +. /etc/rc.config
  149.11 +
  149.12 +# Determine the base and follow a runlevel link name.
  149.13 +base=${0##*/}
  149.14 +link=${base#*[SK][0-9][0-9]}
  149.15 +
  149.16 +# Force execution if not called by a runlevel directory.
  149.17 +test $link = $base && SMTP=yes
  149.18 +test "$SMTP" = yes || exit 0
  149.19 +
  149.20 +if test -z "$MASQMAIL_ARGS" ; then
  149.21 +	MASQMAIL_ARGS="-bd -q30m"
  149.22 +fi
  149.23 +
  149.24 +# The echo return value for success (defined in /etc/rc.config).
  149.25 +return=$rc_done
  149.26 +case "$1" in
  149.27 +    start)
  149.28 +	echo -n "Starting SMTP (MasqMail)"
  149.29 +	## Start daemon with startproc(8). If this fails
  149.30 +	## the echo return value is set appropriate.
  149.31 +
  149.32 +	startproc /usr/sbin/sendmail $MASQMAIL_ARGS || return=$rc_failed
  149.33 +
  149.34 +	echo -e "$return"
  149.35 +	;;
  149.36 +    stop)
  149.37 +	echo -n "Shutting down SMTP (MasqMail)"
  149.38 +	## Stop daemon with killproc(8) and if this fails
  149.39 +	## set echo the echo return value.
  149.40 +
  149.41 +	killproc -TERM /usr/sbin/sendmail || return=$rc_failed
  149.42 +
  149.43 +	echo -e "$return"
  149.44 +	;;
  149.45 +    restart)
  149.46 +	## If first returns OK call the second, if first or
  149.47 +	## second command fails, set echo return value.
  149.48 +	$0 stop  &&  $0 start  ||  return=$rc_failed
  149.49 +	;;
  149.50 +    reload)
  149.51 +	## Choose ONE of the following two cases:
  149.52 +
  149.53 +	## First possibility: A few services accepts a signal
  149.54 +	## to reread the (changed) configuration.
  149.55 +
  149.56 +	#echo -n "Reload service MasqMail"
  149.57 +	#killproc -HUP /usr/sbin/sendmail || return=$rc_failed
  149.58 +	#echo -e "$return"
  149.59 +
  149.60 +	## Exclusive possibility: Some services must be stopped
  149.61 +	## and started to force a new load of the configuration.
  149.62 +
  149.63 +	$0 stop  &&  $0 start  ||  return=$rc_failed
  149.64 +	;;
  149.65 +    status)
  149.66 +	echo -n "Checking for service SMTP (MasqMail): "
  149.67 +	## Check status with checkproc(8), if process is running
  149.68 +	## checkproc will return with exit status 0.
  149.69 +
  149.70 +	checkproc /usr/sbin/sendmail && echo OK || echo No process
  149.71 +	;;
  149.72 +#    probe)
  149.73 +	## Optional: Probe for the necessity of a reload,
  149.74 +	## give out the argument which is required for a reload.
  149.75 +
  149.76 +#	test /usr/exim/configure -nt /var/lock/exim.pid && echo reload
  149.77 +#	;;
  149.78 +    *)
  149.79 +	echo "Usage: $0 {start|stop|status|restart|reload|probe}"
  149.80 +	exit 1
  149.81 +	;;
  149.82 +esac
  149.83 +
  149.84 +# Inform the caller not only verbosely and set an exit status.
  149.85 +test "$return" = "$rc_done" || exit 1
  149.86 +exit 0
   150.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.2 +++ b/suse/masqmail.spec	Fri Sep 26 17:05:23 2008 +0200
   150.3 @@ -0,0 +1,124 @@
   150.4 +Summary: An offline mail server with pop3 client support
   150.5 +Name: masqmail
   150.6 +Version: 0.2.21
   150.7 +Release: 1
   150.8 +Copyright: GPL
   150.9 +Group: Networking/Daemons
  150.10 +Distribution: innominate
  150.11 +Packager: Oliver Kurth <kurth@innominate.de>
  150.12 +Source: http://masqmail.cx/masqmail/download/masqmail-0.2.21.tar.gz
  150.13 +BuildRoot: /var/tmp/masqmail-root/
  150.14 +
  150.15 +%description
  150.16 +MasqMail is a mail server designed for hosts that do not have a
  150.17 +permanent internet connection eg. a home network or a single host at
  150.18 +home. It has special support for connections to different ISPs. It
  150.19 +replaces sendmail or other MTAs such as qmail or exim.
  150.20 +
  150.21 +%prep
  150.22 +
  150.23 +%setup -n masqmail-0.2.21
  150.24 +
  150.25 +%build
  150.26 +#
  150.27 +#choose a line or a combination:
  150.28 +#
  150.29 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --disable-pop3
  150.30 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth
  150.31 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-ident
  150.32 +CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth --enable-ident
  150.33 +
  150.34 +CFLAGS="$RPM_OPT_FLAGS" make
  150.35 +
  150.36 +%install
  150.37 +if [ -d $RPM_BUILD_ROOT ] ; then
  150.38 +	rm -rf $RPM_BUILD_ROOT
  150.39 +fi
  150.40 +
  150.41 +# setup directory environment:
  150.42 +mkdir $RPM_BUILD_ROOT
  150.43 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail
  150.44 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input
  150.45 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/lock
  150.46 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl
  150.47 +mkdir -p $RPM_BUILD_ROOT/usr/sbin
  150.48 +mkdir -p $RPM_BUILD_ROOT/usr/bin
  150.49 +mkdir -p $RPM_BUILD_ROOT/usr/lib
  150.50 +mkdir -p $RPM_BUILD_ROOT/etc
  150.51 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail
  150.52 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl
  150.53 +mkdir -p $RPM_BUILD_ROOT/var/masqmail
  150.54 +
  150.55 +# install
  150.56 +make DESTDIR=$RPM_BUILD_ROOT install
  150.57 +/usr/bin/strip --remove-section=.comment --remove-section=.note --strip-unneeded $RPM_BUILD_ROOT/usr/sbin/masqmail
  150.58 +
  150.59 +# sendmail links
  150.60 +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail
  150.61 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq
  150.62 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailrm
  150.63 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail
  150.64 +
  150.65 +# SuSE specific startup stuff:
  150.66 +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/
  150.67 +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc2.d/
  150.68 +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc3.d/
  150.69 +cp -p suse/masqmail $RPM_BUILD_ROOT/sbin/init.d/
  150.70 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/S20masqmail
  150.71 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/K20masqmail
  150.72 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/S20masqmail
  150.73 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/K20masqmail
  150.74 +ln -fs '../../sbin/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail
  150.75 +
  150.76 +# configuration examples:
  150.77 +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/masqmail/
  150.78 +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/
  150.79 +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/
  150.80 +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl/
  150.81 +
  150.82 +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/
  150.83 +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/
  150.84 +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/
  150.85 +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/
  150.86 +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/
  150.87 +
  150.88 +# gzip the man pages:
  150.89 +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8
  150.90 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5
  150.91 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5
  150.92 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5
  150.93 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5
  150.94 +
  150.95 +%clean
  150.96 +rm -rf $RPM_BUILD_ROOT
  150.97 +
  150.98 +%files
  150.99 +%defattr(-,root,root)
 150.100 +/usr/sbin/masqmail
 150.101 +/usr/sbin/sendmail
 150.102 +/usr/bin/mailq
 150.103 +/usr/bin/mailrm
 150.104 +/usr/lib/sendmail
 150.105 +%config /sbin/init.d/masqmail
 150.106 +/sbin/init.d/rc2.d/S20masqmail
 150.107 +/sbin/init.d/rc2.d/K20masqmail
 150.108 +/sbin/init.d/rc3.d/S20masqmail
 150.109 +/sbin/init.d/rc3.d/K20masqmail
 150.110 +/usr/sbin/rcmasqmail
 150.111 +%config /etc/masqmail/masqmail.conf
 150.112 +%config /etc/masqmail/tpl/failmsg.tpl
 150.113 +%doc README INSTALL COPYING NEWS
 150.114 +/usr/man/man8/masqmail.8.gz
 150.115 +/usr/man/man5/masqmail.conf.5.gz
 150.116 +/usr/man/man5/masqmail.route.5.gz
 150.117 +/usr/man/man5/masqmail.get.5.gz
 150.118 +/usr/man/man5/masqmail.aliases.5.gz
 150.119 +
 150.120 +%defattr(-,mail,trusted)
 150.121 +%dir /var/masqmail/
 150.122 +%dir /var/spool/masqmail/
 150.123 +%dir /var/spool/masqmail/popuidl/
 150.124 +%dir /var/spool/masqmail/lock/
 150.125 +%dir /var/spool/masqmail/input/
 150.126 +
 150.127 +
   151.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.2 +++ b/suse/masqmail.spec.in	Fri Sep 26 17:05:23 2008 +0200
   151.3 @@ -0,0 +1,124 @@
   151.4 +Summary: An offline mail server with pop3 client support
   151.5 +Name: masqmail
   151.6 +Version: @VERSION@
   151.7 +Release: 1
   151.8 +Copyright: GPL
   151.9 +Group: Networking/Daemons
  151.10 +Distribution: innominate
  151.11 +Packager: Oliver Kurth <kurth@innominate.de>
  151.12 +Source: http://masqmail.cx/masqmail/download/masqmail-@VERSION@.tar.gz
  151.13 +BuildRoot: /var/tmp/masqmail-root/
  151.14 +
  151.15 +%description
  151.16 +MasqMail is a mail server designed for hosts that do not have a
  151.17 +permanent internet connection eg. a home network or a single host at
  151.18 +home. It has special support for connections to different ISPs. It
  151.19 +replaces sendmail or other MTAs such as qmail or exim.
  151.20 +
  151.21 +%prep
  151.22 +
  151.23 +%setup -n masqmail-@VERSION@
  151.24 +
  151.25 +%build
  151.26 +#
  151.27 +#choose a line or a combination:
  151.28 +#
  151.29 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --disable-pop3
  151.30 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth
  151.31 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-ident
  151.32 +CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth --enable-ident
  151.33 +
  151.34 +CFLAGS="$RPM_OPT_FLAGS" make
  151.35 +
  151.36 +%install
  151.37 +if [ -d $RPM_BUILD_ROOT ] ; then
  151.38 +	rm -rf $RPM_BUILD_ROOT
  151.39 +fi
  151.40 +
  151.41 +# setup directory environment:
  151.42 +mkdir $RPM_BUILD_ROOT
  151.43 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail
  151.44 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input
  151.45 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/lock
  151.46 +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl
  151.47 +mkdir -p $RPM_BUILD_ROOT/usr/sbin
  151.48 +mkdir -p $RPM_BUILD_ROOT/usr/bin
  151.49 +mkdir -p $RPM_BUILD_ROOT/usr/lib
  151.50 +mkdir -p $RPM_BUILD_ROOT/etc
  151.51 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail
  151.52 +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl
  151.53 +mkdir -p $RPM_BUILD_ROOT/var/masqmail
  151.54 +
  151.55 +# install
  151.56 +make DESTDIR=$RPM_BUILD_ROOT install
  151.57 +/usr/bin/strip --remove-section=.comment --remove-section=.note --strip-unneeded $RPM_BUILD_ROOT/usr/sbin/masqmail
  151.58 +
  151.59 +# sendmail links
  151.60 +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail
  151.61 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq
  151.62 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailrm
  151.63 +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail
  151.64 +
  151.65 +# SuSE specific startup stuff:
  151.66 +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/
  151.67 +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc2.d/
  151.68 +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc3.d/
  151.69 +cp -p suse/masqmail $RPM_BUILD_ROOT/sbin/init.d/
  151.70 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/S20masqmail
  151.71 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/K20masqmail
  151.72 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/S20masqmail
  151.73 +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/K20masqmail
  151.74 +ln -fs '../../sbin/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail
  151.75 +
  151.76 +# configuration examples:
  151.77 +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/masqmail/
  151.78 +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/
  151.79 +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/
  151.80 +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl/
  151.81 +
  151.82 +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/
  151.83 +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/
  151.84 +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/
  151.85 +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/
  151.86 +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/
  151.87 +
  151.88 +# gzip the man pages:
  151.89 +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8
  151.90 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5
  151.91 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5
  151.92 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5
  151.93 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5
  151.94 +
  151.95 +%clean
  151.96 +rm -rf $RPM_BUILD_ROOT
  151.97 +
  151.98 +%files
  151.99 +%defattr(-,root,root)
 151.100 +/usr/sbin/masqmail
 151.101 +/usr/sbin/sendmail
 151.102 +/usr/bin/mailq
 151.103 +/usr/bin/mailrm
 151.104 +/usr/lib/sendmail
 151.105 +%config /sbin/init.d/masqmail
 151.106 +/sbin/init.d/rc2.d/S20masqmail
 151.107 +/sbin/init.d/rc2.d/K20masqmail
 151.108 +/sbin/init.d/rc3.d/S20masqmail
 151.109 +/sbin/init.d/rc3.d/K20masqmail
 151.110 +/usr/sbin/rcmasqmail
 151.111 +%config /etc/masqmail/masqmail.conf
 151.112 +%config /etc/masqmail/tpl/failmsg.tpl
 151.113 +%doc README INSTALL COPYING NEWS
 151.114 +/usr/man/man8/masqmail.8.gz
 151.115 +/usr/man/man5/masqmail.conf.5.gz
 151.116 +/usr/man/man5/masqmail.route.5.gz
 151.117 +/usr/man/man5/masqmail.get.5.gz
 151.118 +/usr/man/man5/masqmail.aliases.5.gz
 151.119 +
 151.120 +%defattr(-,mail,trusted)
 151.121 +%dir /var/masqmail/
 151.122 +%dir /var/spool/masqmail/
 151.123 +%dir /var/spool/masqmail/popuidl/
 151.124 +%dir /var/spool/masqmail/lock/
 151.125 +%dir /var/spool/masqmail/input/
 151.126 +
 151.127 +
   152.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.2 +++ b/tests/Makefile.am	Fri Sep 26 17:05:23 2008 +0200
   152.3 @@ -0,0 +1,20 @@
   152.4 +test.conf: $(srcdir)/conf.templ
   152.5 +	sed s/SMTP_HOST/`hostname`/ $(srcdir)/conf.templ > test.conf
   152.6 +
   152.7 +local.sh: $(srcdir)/test.templ
   152.8 +	sed s/RECV_HOST/localhost/ $(srcdir)/test.templ > local.sh
   152.9 +	chmod ugo+x local.sh
  152.10 +
  152.11 +smtpout.sh: $(srcdir)/test.templ
  152.12 +	sed s/RECV_HOST/`hostname`/ $(srcdir)/test.templ > smtpout.sh
  152.13 +	chmod ugo+x smtpout.sh
  152.14 +
  152.15 +input/:
  152.16 +	mkdir input
  152.17 +
  152.18 +all: test.conf local.sh smtpout.sh input/
  152.19 +
  152.20 +EXTRA_DIST=conf.templ test.templ
  152.21 +
  152.22 +conf.templ:
  152.23 +test.templ:
   153.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.2 +++ b/tests/Makefile.in	Fri Sep 26 17:05:23 2008 +0200
   153.3 @@ -0,0 +1,282 @@
   153.4 +# Makefile.in generated by automake 1.7.9 from Makefile.am.
   153.5 +# @configure_input@
   153.6 +
   153.7 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
   153.8 +# Free Software Foundation, Inc.
   153.9 +# This Makefile.in is free software; the Free Software Foundation
  153.10 +# gives unlimited permission to copy and/or distribute it,
  153.11 +# with or without modifications, as long as this notice is preserved.
  153.12 +
  153.13 +# This program is distributed in the hope that it will be useful,
  153.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  153.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  153.16 +# PARTICULAR PURPOSE.
  153.17 +
  153.18 +@SET_MAKE@
  153.19 +
  153.20 +srcdir = @srcdir@
  153.21 +top_srcdir = @top_srcdir@
  153.22 +VPATH = @srcdir@
  153.23 +pkgdatadir = $(datadir)/@PACKAGE@
  153.24 +pkglibdir = $(libdir)/@PACKAGE@
  153.25 +pkgincludedir = $(includedir)/@PACKAGE@
  153.26 +top_builddir = ..
  153.27 +
  153.28 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
  153.29 +INSTALL = @INSTALL@
  153.30 +install_sh_DATA = $(install_sh) -c -m 644
  153.31 +install_sh_PROGRAM = $(install_sh) -c
  153.32 +install_sh_SCRIPT = $(install_sh) -c
  153.33 +INSTALL_HEADER = $(INSTALL_DATA)
  153.34 +transform = $(program_transform_name)
  153.35 +NORMAL_INSTALL = :
  153.36 +PRE_INSTALL = :
  153.37 +POST_INSTALL = :
  153.38 +NORMAL_UNINSTALL = :
  153.39 +PRE_UNINSTALL = :
  153.40 +POST_UNINSTALL = :
  153.41 +ACLOCAL = @ACLOCAL@
  153.42 +AMDEP_FALSE = @AMDEP_FALSE@
  153.43 +AMDEP_TRUE = @AMDEP_TRUE@
  153.44 +AMTAR = @AMTAR@
  153.45 +AUTOCONF = @AUTOCONF@
  153.46 +AUTOHEADER = @AUTOHEADER@
  153.47 +AUTOMAKE = @AUTOMAKE@
  153.48 +AWK = @AWK@
  153.49 +BASE64_LIBS = @BASE64_LIBS@
  153.50 +CC = @CC@
  153.51 +CCDEPMODE = @CCDEPMODE@
  153.52 +CFLAGS = @CFLAGS@
  153.53 +CPP = @CPP@
  153.54 +CPPFLAGS = @CPPFLAGS@
  153.55 +CYGPATH_W = @CYGPATH_W@
  153.56 +DEFS = @DEFS@
  153.57 +DEPDIR = @DEPDIR@
  153.58 +ECHO_C = @ECHO_C@
  153.59 +ECHO_N = @ECHO_N@
  153.60 +ECHO_T = @ECHO_T@
  153.61 +EGREP = @EGREP@
  153.62 +EXEEXT = @EXEEXT@
  153.63 +GLIB_CFLAGS = @GLIB_CFLAGS@
  153.64 +GLIB_LIBS = @GLIB_LIBS@
  153.65 +IDENT_LIBS = @IDENT_LIBS@
  153.66 +INSTALL_DATA = @INSTALL_DATA@
  153.67 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
  153.68 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
  153.69 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  153.70 +LDFLAGS = @LDFLAGS@
  153.71 +LIBOBJS = @LIBOBJS@
  153.72 +LIBS = @LIBS@
  153.73 +LOCKFILE_LIBS = @LOCKFILE_LIBS@
  153.74 +LTLIBOBJS = @LTLIBOBJS@
  153.75 +MAKEINFO = @MAKEINFO@
  153.76 +MD5_LIBS = @MD5_LIBS@
  153.77 +OBJEXT = @OBJEXT@
  153.78 +PACKAGE = @PACKAGE@
  153.79 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  153.80 +PACKAGE_NAME = @PACKAGE_NAME@
  153.81 +PACKAGE_STRING = @PACKAGE_STRING@
  153.82 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
  153.83 +PACKAGE_VERSION = @PACKAGE_VERSION@
  153.84 +PATH_SEPARATOR = @PATH_SEPARATOR@
  153.85 +PKG_CONFIG = @PKG_CONFIG@
  153.86 +RANLIB = @RANLIB@
  153.87 +RESOLV_LIBS = @RESOLV_LIBS@
  153.88 +SET_MAKE = @SET_MAKE@
  153.89 +SHELL = @SHELL@
  153.90 +STRIP = @STRIP@
  153.91 +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@
  153.92 +VERSION = @VERSION@
  153.93 +ac_ct_CC = @ac_ct_CC@
  153.94 +ac_ct_RANLIB = @ac_ct_RANLIB@
  153.95 +ac_ct_STRIP = @ac_ct_STRIP@
  153.96 +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
  153.97 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  153.98 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
  153.99 +am__include = @am__include@
 153.100 +am__leading_dot = @am__leading_dot@
 153.101 +am__quote = @am__quote@
 153.102 +bindir = @bindir@
 153.103 +build_alias = @build_alias@
 153.104 +datadir = @datadir@
 153.105 +exec_prefix = @exec_prefix@
 153.106 +has_ident = @has_ident@
 153.107 +host_alias = @host_alias@
 153.108 +includedir = @includedir@
 153.109 +infodir = @infodir@
 153.110 +install_sh = @install_sh@
 153.111 +libdir = @libdir@
 153.112 +libexecdir = @libexecdir@
 153.113 +localstatedir = @localstatedir@
 153.114 +mandir = @mandir@
 153.115 +oldincludedir = @oldincludedir@
 153.116 +prefix = @prefix@
 153.117 +program_transform_name = @program_transform_name@
 153.118 +sbindir = @sbindir@
 153.119 +sharedstatedir = @sharedstatedir@
 153.120 +sysconfdir = @sysconfdir@
 153.121 +target_alias = @target_alias@
 153.122 +with_confdir = @with_confdir@
 153.123 +with_group = @with_group@
 153.124 +with_logdir = @with_logdir@
 153.125 +with_spooldir = @with_spooldir@
 153.126 +with_user = @with_user@
 153.127 +
 153.128 +EXTRA_DIST = conf.templ test.templ
 153.129 +subdir = tests
 153.130 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 153.131 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 153.132 +CONFIG_HEADER = $(top_builddir)/config.h
 153.133 +CONFIG_CLEAN_FILES =
 153.134 +DIST_SOURCES =
 153.135 +DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am
 153.136 +all: all-am
 153.137 +
 153.138 +.SUFFIXES:
 153.139 +$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
 153.140 +	cd $(top_srcdir) && \
 153.141 +	  $(AUTOMAKE) --gnu  tests/Makefile
 153.142 +Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
 153.143 +	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
 153.144 +uninstall-info-am:
 153.145 +tags: TAGS
 153.146 +TAGS:
 153.147 +
 153.148 +ctags: CTAGS
 153.149 +CTAGS:
 153.150 +
 153.151 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 153.152 +
 153.153 +top_distdir = ..
 153.154 +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 153.155 +
 153.156 +distdir: $(DISTFILES)
 153.157 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 153.158 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 153.159 +	list='$(DISTFILES)'; for file in $$list; do \
 153.160 +	  case $$file in \
 153.161 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
 153.162 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
 153.163 +	  esac; \
 153.164 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 153.165 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
 153.166 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
 153.167 +	    dir="/$$dir"; \
 153.168 +	    $(mkinstalldirs) "$(distdir)$$dir"; \
 153.169 +	  else \
 153.170 +	    dir=''; \
 153.171 +	  fi; \
 153.172 +	  if test -d $$d/$$file; then \
 153.173 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
 153.174 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
 153.175 +	    fi; \
 153.176 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
 153.177 +	  else \
 153.178 +	    test -f $(distdir)/$$file \
 153.179 +	    || cp -p $$d/$$file $(distdir)/$$file \
 153.180 +	    || exit 1; \
 153.181 +	  fi; \
 153.182 +	done
 153.183 +check-am: all-am
 153.184 +check: check-am
 153.185 +all-am: Makefile
 153.186 +
 153.187 +installdirs:
 153.188 +install: install-am
 153.189 +install-exec: install-exec-am
 153.190 +install-data: install-data-am
 153.191 +uninstall: uninstall-am
 153.192 +
 153.193 +install-am: all-am
 153.194 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 153.195 +
 153.196 +installcheck: installcheck-am
 153.197 +install-strip:
 153.198 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
 153.199 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
 153.200 +	  `test -z '$(STRIP)' || \
 153.201 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 153.202 +mostlyclean-generic:
 153.203 +
 153.204 +clean-generic:
 153.205 +
 153.206 +distclean-generic:
 153.207 +	-rm -f $(CONFIG_CLEAN_FILES)
 153.208 +
 153.209 +maintainer-clean-generic:
 153.210 +	@echo "This command is intended for maintainers to use"
 153.211 +	@echo "it deletes files that may require special tools to rebuild."
 153.212 +clean: clean-am
 153.213 +
 153.214 +clean-am: clean-generic mostlyclean-am
 153.215 +
 153.216 +distclean: distclean-am
 153.217 +	-rm -f Makefile
 153.218 +distclean-am: clean-am distclean-generic
 153.219 +
 153.220 +dvi: dvi-am
 153.221 +
 153.222 +dvi-am:
 153.223 +
 153.224 +info: info-am
 153.225 +
 153.226 +info-am:
 153.227 +
 153.228 +install-data-am:
 153.229 +
 153.230 +install-exec-am:
 153.231 +
 153.232 +install-info: install-info-am
 153.233 +
 153.234 +install-man:
 153.235 +
 153.236 +installcheck-am:
 153.237 +
 153.238 +maintainer-clean: maintainer-clean-am
 153.239 +	-rm -f Makefile
 153.240 +maintainer-clean-am: distclean-am maintainer-clean-generic
 153.241 +
 153.242 +mostlyclean: mostlyclean-am
 153.243 +
 153.244 +mostlyclean-am: mostlyclean-generic
 153.245 +
 153.246 +pdf: pdf-am
 153.247 +
 153.248 +pdf-am:
 153.249 +
 153.250 +ps: ps-am
 153.251 +
 153.252 +ps-am:
 153.253 +
 153.254 +uninstall-am: uninstall-info-am
 153.255 +
 153.256 +.PHONY: all all-am check check-am clean clean-generic distclean \
 153.257 +	distclean-generic distdir dvi dvi-am info info-am install \
 153.258 +	install-am install-data install-data-am install-exec \
 153.259 +	install-exec-am install-info install-info-am install-man \
 153.260 +	install-strip installcheck installcheck-am installdirs \
 153.261 +	maintainer-clean maintainer-clean-generic mostlyclean \
 153.262 +	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
 153.263 +	uninstall-info-am
 153.264 +
 153.265 +test.conf: $(srcdir)/conf.templ
 153.266 +	sed s/SMTP_HOST/`hostname`/ $(srcdir)/conf.templ > test.conf
 153.267 +
 153.268 +local.sh: $(srcdir)/test.templ
 153.269 +	sed s/RECV_HOST/localhost/ $(srcdir)/test.templ > local.sh
 153.270 +	chmod ugo+x local.sh
 153.271 +
 153.272 +smtpout.sh: $(srcdir)/test.templ
 153.273 +	sed s/RECV_HOST/`hostname`/ $(srcdir)/test.templ > smtpout.sh
 153.274 +	chmod ugo+x smtpout.sh
 153.275 +
 153.276 +input/:
 153.277 +	mkdir input
 153.278 +
 153.279 +all: test.conf local.sh smtpout.sh input/
 153.280 +
 153.281 +conf.templ:
 153.282 +test.templ:
 153.283 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
 153.284 +# Otherwise a system limit (for SysV at least) may be exceeded.
 153.285 +.NOEXPORT:
   154.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.2 +++ b/tests/README	Fri Sep 26 17:05:23 2008 +0200
   154.3 @@ -0,0 +1,37 @@
   154.4 +Here a two test programs: local.sh and smtpout.sh. They both send
   154.5 +three mails, using different options. Run them from within this
   154.6 +directory, preferably NOT as root, but you got to have write
   154.7 +permission for this directory.
   154.8 +
   154.9 +local.sh sends mail accepted from stdin and sends them to a fake local
  154.10 +mailbox, using your login name. If it works, there should be a file
  154.11 +named with your login name with the mails. You can look at it with cat
  154.12 +or less, or with an ordinary mail program.
  154.13 +
  154.14 +smtpout.sh sends mail accepted from stdin and sends them to your local
  154.15 +MTA, so use it only if you have an MTA running on your box (sendmail,
  154.16 +exim, qmail or whatever, or masqmail when you have it already
  154.17 +installed). If it works, you should get three mails.
  154.18 +
  154.19 +The scripts assume that your login name corresponds to your mailbox
  154.20 +(quite probable) and that your MTA listens on port 25 with the
  154.21 +interface which corresponds to the hostname as returned by the shell
  154.22 +command "hostname" (without quotes...), also very probable. They are
  154.23 +created with make from test.templ. They use a special configuration
  154.24 +(test.conf) for masqmail, which is also created with make from
  154.25 +conf.templ.
  154.26 +
  154.27 +Two log files, masqmail.log and debug.log will also be created within
  154.28 +this directory. They may give some information if anything went wrong.
  154.29 +
  154.30 +If the log files reveal that your MTA is not willing to relay, you may
  154.31 +have to qualify the hostname: Say
  154.32 +
  154.33 +sed s/RECV_HOST/foo.bar.com/ test.templ > smtpout.sh
  154.34 +
  154.35 +where you set your fully qualified host name for foo.bar.com.
  154.36 +
  154.37 +If they do not work, there could be some problem with either the test
  154.38 +programs, the configuration file or masqmail itself. If you have
  154.39 +installed masqmail successfully and these scripts do not work, do not
  154.40 +worry too much :-).
   155.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.2 +++ b/tests/conf.templ	Fri Sep 26 17:05:23 2008 +0200
   155.3 @@ -0,0 +1,66 @@
   155.4 +# Example configuration for MasqMail
   155.5 +# Copyright (C) 1999 Oliver Kurth
   155.6 +#
   155.7 +# This program is free software; you can redistribute it and/or modify
   155.8 +# it under the terms of the GNU General Public License as published by
   155.9 +# the Free Software Foundation; either version 2 of the License, or
  155.10 +# (at your option) any later version.
  155.11 +
  155.12 +# This program is distributed in the hope that it will be useful,
  155.13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  155.14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  155.15 +# GNU General Public License for more details.
  155.16 +
  155.17 +# You should have received a copy of the GNU General Public License
  155.18 +# along with this program; if not, write to the Free Software
  155.19 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  155.20 +#
  155.21 +
  155.22 +# this is just for testing. In real life it does not make much sense:
  155.23 +run_as_user=true
  155.24 +
  155.25 +# set debug level (0 = no debugging, 5 = very much, 6 = too much)
  155.26 +# can also be set with the -d option on the cmd line
  155.27 +debug_level = 5
  155.28 +
  155.29 +do_queue = false
  155.30 +
  155.31 +# The name with which MasqMail identifies itself to others:
  155.32 +host_name="blue.patchwork.net"
  155.33 +
  155.34 +# Hosts considered local:
  155.35 +#local_hosts="localhost;blue.patchwork.net;blue"
  155.36 +local_hosts="localhost"
  155.37 +
  155.38 +# Nets considered local, for immediate delivery attempts:
  155.39 +# ALL hosts not included in either local_host or local_nets are
  155.40 +# considered to be 'outside', meaning that messages to them will be queued
  155.41 +local_nets="SMTP_HOST"
  155.42 +
  155.43 +# accept connections on these interfaces:
  155.44 +listen_addresses="localhost:2525"
  155.45 +
  155.46 +# send messages to this port:
  155.47 +# probably this will also be configurable on host basis
  155.48 +remote_port=25
  155.49 +
  155.50 +# where MasqMail stores its spool files and other stuff:
  155.51 +#spool_dir="/var/spool/masqmail"
  155.52 +spool_dir="."
  155.53 +
  155.54 +# where local mail will be written to:
  155.55 +#mail_dir="/var/spool/mail"
  155.56 +mail_dir="."
  155.57 +
  155.58 +# use syslogd for logs?
  155.59 +use_syslog=false
  155.60 +
  155.61 +# directory for log files if not using syslogd:
  155.62 +#log_dir="/var/masqmail"
  155.63 +log_dir="."
  155.64 +
  155.65 +# special routes:
  155.66 +
  155.67 +connect_route.GWDG = "src/gwdg.route"
  155.68 +connect_route.Argon = "src/argon.route"
  155.69 +
   156.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.2 +++ b/tests/test.templ	Fri Sep 26 17:05:23 2008 +0200
   156.3 @@ -0,0 +1,81 @@
   156.4 +#! /bin/bash
   156.5 +
   156.6 +# should be run from within tests dir
   156.7 +# set if you move this:
   156.8 +mm_src_dir=../src
   156.9 +mm_bin=$mm_src_dir/masqmail
  156.10 +
  156.11 +#
  156.12 +hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
  156.13 +hto=$hfrom
  156.14 +to=`logname`@RECV_HOST
  156.15 +hsubject="MasqMail stdin Test"
  156.16 +
  156.17 +#
  156.18 +# Testing with rcpt on cmd line
  156.19 +# (dot does end)
  156.20 +#
  156.21 +# the command to be run:
  156.22 +cmd="$mm_bin -C ./test.conf $to"
  156.23 +
  156.24 +$cmd <<EOF
  156.25 +From: $hfrom
  156.26 +To: $hto
  156.27 +Subject: $hsubject
  156.28 +
  156.29 +Hallo Fritz!
  156.30 +
  156.31 +..
  156.32 +there is a dot above (Yes, one and not two).
  156.33 +
  156.34 +command was: $cmd
  156.35 +
  156.36 +Fritz
  156.37 +.
  156.38 +
  156.39 +EOF
  156.40 +
  156.41 +#
  156.42 +# Testing with rcpt on cmd line with -oi option
  156.43 +# (dot does not end)
  156.44 +#
  156.45 +# the command to be run:
  156.46 +cmd="$mm_bin -C ./test.conf -oi $to"
  156.47 +
  156.48 +$cmd <<EOF
  156.49 +From: $hfrom
  156.50 +To: $hto
  156.51 +Subject: $hsubject
  156.52 +
  156.53 +Hallo Fritz!
  156.54 +.
  156.55 +there is a dot above.
  156.56 +
  156.57 +command was: $cmd
  156.58 +
  156.59 +Fritz
  156.60 +
  156.61 +EOF
  156.62 +
  156.63 +#
  156.64 +# Testing with rcpt read from headers (-t option)
  156.65 +# (dot does end)
  156.66 +#
  156.67 +# the command to be run:
  156.68 +cmd="$mm_bin -C ./test.conf -t"
  156.69 +
  156.70 +$cmd <<EOF
  156.71 +From: $hfrom
  156.72 +To: $hto
  156.73 +Subject: $hsubject
  156.74 +
  156.75 +Hallo Fritz!
  156.76 +..
  156.77 +there is a dot above.
  156.78 +
  156.79 +command was: $cmd
  156.80 +
  156.81 +Fritz
  156.82 +.
  156.83 +
  156.84 +EOF
   157.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.2 +++ b/tpl/failmsg.tpl	Fri Sep 26 17:05:23 2008 +0200
   157.3 @@ -0,0 +1,40 @@
   157.4 +Subject: Mail Delivery Failure Notice
   157.5 +From: MAILER-DAEMON@${host_name}
   157.6 +To: ${return_path}
   157.7 +MIME-Version: 1.0
   157.8 +Content-Type: multipart/mixed;
   157.9 +        boundary="${uid}/${host_name}"
  157.10 +
  157.11 +This is a MIME-encapsulated message.
  157.12 +
  157.13 +--${uid}/${host_name}
  157.14 +Content-Description: Notification
  157.15 +Content-Type: text/plain
  157.16 +
  157.17 +This message was sent to you by the mailer daemon (${package} ${version})
  157.18 +at ${host_name}.
  157.19 +
  157.20 +Sorry, but your mail could not be delivered to all recipients.
  157.21 +Delivery to the following recipients failed permanently and has been given
  157.22 +up:
  157.23 +
  157.24 +@failed_rcpts
  157.25 +
  157.26 +This error message may give you a hint about what caused the
  157.27 +failure:
  157.28 +
  157.29 +${err_msg}
  157.30 +
  157.31 +If you need help, write to <postmaster@${host_name}>.
  157.32 +
  157.33 +Your message follows attached, including all headers:
  157.34 +
  157.35 +--${uid}/${host_name}
  157.36 +Content-Description: Undelivered Message
  157.37 +Content-Type: message/rfc822
  157.38 +
  157.39 +@msg_headers
  157.40 +
  157.41 +@msg_body
  157.42 +
  157.43 +--${uid}/${host_name}--
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/tpl/failmsg.tpl.de	Fri Sep 26 17:05:23 2008 +0200
   158.3 @@ -0,0 +1,52 @@
   158.4 +Subject: Mail Delivery Failure Notice
   158.5 +From: MAILER-DAEMON@${host_name}
   158.6 +To: ${return_path}
   158.7 +MIME-Version: 1.0
   158.8 +Content-Type: multipart/mixed;
   158.9 +        boundary="${uid}/${host_name}"
  158.10 +
  158.11 +Dies ist eine MIME-formatierte Nachricht.
  158.12 +This is a MIME-encapsulated message.
  158.13 +
  158.14 +--${uid}/${host_name}
  158.15 +Content-Description: Notification
  158.16 +Content-Type: text/plain;
  158.17 +  charset=iso-8859-1
  158.18 +
  158.19 +Diese Nachricht wurde Ihnen von dem Mail Agenten
  158.20 +(${package} ${version}) auf ${host_name} geschickt.
  158.21 +(This message was sent to you by the mailer daemon (${package} ${version})
  158.22 +at ${host_name}.)
  158.23 +
  158.24 +Bedauerlicherweise konnte Ihre Mail nicht an alle Empfänger weitergeleitet
  158.25 +werden.
  158.26 +(Sorry, but your mail could not be delivered to all recipients.)
  158.27 +
  158.28 +Die Zustellung zu den folgenden Empfängern ist permanent
  158.29 +fehlgeschlagen. Es wird kein weiterer Versuch unternommen:
  158.30 +(Delivery to the following recipients failed permanently and has been given
  158.31 +up:)
  158.32 +
  158.33 +@failed_rcpts
  158.34 +
  158.35 +Diese Fehlermeldung könnte einen Hinweis über die Ursache geben:
  158.36 +(This error message may give you a hint about what caused the
  158.37 +failure:)
  158.38 +
  158.39 +${err_msg}
  158.40 +
  158.41 +Für weitere Hilfe, schreiben Sie an <postmaster@${host_name}>.
  158.42 +(If you need help, write to <postmaster@${host_name}>.)
  158.43 +
  158.44 +Ihre Nachricht folgt im Anhang, einschliesslich aller Header:
  158.45 +(Your message follows attached, including all headers:)
  158.46 +
  158.47 +--${uid}/${host_name}
  158.48 +Content-Description: Undelivered Message
  158.49 +Content-Type: message/rfc822
  158.50 +
  158.51 +@msg_headers
  158.52 +
  158.53 +@msg_body
  158.54 +
  158.55 +--${uid}/${host_name}--
   159.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.2 +++ b/tpl/failmsg.tpl.fr	Fri Sep 26 17:05:23 2008 +0200
   159.3 @@ -0,0 +1,52 @@
   159.4 +Subject: Mail Delivery Failure Notice
   159.5 +From: MAILER-DAEMON@${host_name}
   159.6 +To: ${return_path}
   159.7 +MIME-Version: 1.0
   159.8 +Content-Type: multipart/mixed;
   159.9 +        boundary="${uid}/${host_name}"
  159.10 +
  159.11 +Ce message est encapsule avec le format MIME.
  159.12 +This is a MIME-encapsulated message.
  159.13 +
  159.14 +--${uid}/${host_name}
  159.15 +Content-Description: Notification
  159.16 +Content-Type: text/plain;
  159.17 +  charset=iso-8859-1
  159.18 +
  159.19 +Ce message vous a été envoyé par le serveur de messagerie
  159.20 +(${package} ${version}) sur ${host_name}.
  159.21 +(This message was sent to you by the mailer daemon (${package} ${version})
  159.22 +at ${host_name}.)
  159.23 +
  159.24 +J'ai le regret de vous informer que votre courrier n'a pas pu être transmis à
  159.25 +tous ses destinataires.
  159.26 +(Sorry, but your mail could not be delivered to all recipients.)
  159.27 +
  159.28 +L'expédition vers les destinataires suivants a échoué et a été définitivement
  159.29 +abandonnée:
  159.30 +(Delivery to the following recipients failed permanently and has been given
  159.31 +up:)
  159.32 +
  159.33 +@failed_rcpts
  159.34 +
  159.35 +Ce message d'erreur peut vous aider à déterminer la cause de l'échec:
  159.36 +(This error message may give you a hint about what caused the
  159.37 +failure:)
  159.38 +
  159.39 +${err_msg}
  159.40 +
  159.41 +Si vous avez besoin d'aide, veuillez écrire à <postmaster@${host_name}>.
  159.42 +(If you need help, write to <postmaster@${host_name}>.)
  159.43 +
  159.44 +Votre message original est attaché, avec tous ces entêtes:
  159.45 +(Your message follows attached, including all headers:)
  159.46 +
  159.47 +--${uid}/${host_name}
  159.48 +Content-Description: Undelivered Message
  159.49 +Content-Type: message/rfc822
  159.50 +
  159.51 +@msg_headers
  159.52 +
  159.53 +@msg_body
  159.54 +
  159.55 +--${uid}/${host_name}--
   160.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.2 +++ b/tpl/failmsg.tpl.it	Fri Sep 26 17:05:23 2008 +0200
   160.3 @@ -0,0 +1,50 @@
   160.4 +From: MAILER-DAEMON@${host_name}
   160.5 +To: ${return_path}
   160.6 +Subject: invio messaggio FALLITO / Mail Delivery Failure Notice
   160.7 +
   160.8 +MIME-Version: 1.0
   160.9 +Content-Type: multipart/mixed;
  160.10 +        boundary="${uid}/${host_name}"
  160.11 +
  160.12 +Messaggio in formato MIME multi-parti.
  160.13 +This is a MIME-encapsulated message.
  160.14 +
  160.15 +--${uid}/${host_name}--
  160.16 +Content-Description: Notifica-Notify
  160.17 +Content-Type: text/plain
  160.18 +
  160.19 +Questo messaggio ti e' stato spedito dal demone: 
  160.20 + (This message was sent to you by the mailer daemon:)
  160.21 +(${package} ${version}) @ ${host_name}:
  160.22 +
  160.23 +Spiacente ma non e' stato possibile spedire il tuo msg a tutti
  160.24 +i destinatari. L'invio ai seguenti destinatari e' fallito in modo
  160.25 +permanente e non verra' ritentato:
  160.26 + (Sorry, but your mail could not be delivered to all recipients.
  160.27 +  Delivery to the following recipients failed permanently and has 
  160.28 +  been given up:)
  160.29 +
  160.30 +@failed_rcpts
  160.31 +
  160.32 +Il seguente msg d'errore potrebbe aiutarti a capire la causa 
  160.33 +dell'errore:
  160.34 + (This error message may give you a hint about what caused the
  160.35 +  failure:)
  160.36 +
  160.37 +${err_msg}
  160.38 +
  160.39 +In caso ti serva aiuto scrivi a <postmatster@${host_name}>.
  160.40 +Il tuo msg segue in allegato.
  160.41 + (If you need help, write to <postmaster@${host_name}>.
  160.42 +  Your message follows attached, including all headers:)
  160.43 +
  160.44 +--${uid}/${host_name}
  160.45 +Content-Description: Messaggio non spedito - Unsent message
  160.46 +Content-Type: message/rfc822
  160.47 +
  160.48 +@msg_headers
  160.49 +
  160.50 +[corpo del messaggio - tralasciato]
  160.51 + ([message body - stripped off])
  160.52 +
  160.53 +--${uid}/${host_name}--
   161.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.2 +++ b/tpl/warnmsg.tpl	Fri Sep 26 17:05:23 2008 +0200
   161.3 @@ -0,0 +1,42 @@
   161.4 +Subject: Warning: could not yet send message
   161.5 +From: MAILER-DAEMON@${host_name}
   161.6 +To: ${return_path}
   161.7 +MIME-Version: 1.0
   161.8 +Content-Type: multipart/mixed;
   161.9 +        boundary="${uid}/${host_name}"
  161.10 +
  161.11 +This is a MIME-encapsulated message.
  161.12 +
  161.13 +--${uid}/${host_name}
  161.14 +Content-Description: Notification
  161.15 +Content-Type: text/plain
  161.16 +
  161.17 +This message was sent to you by the mailer daemon (${package} ${version})
  161.18 +at ${host_name}.
  161.19 +
  161.20 +Sorry, but your mail could not yet be delivered to all recipients.
  161.21 +Delivery to the following recipients has been defered:
  161.22 +
  161.23 +@failed_rcpts
  161.24 +
  161.25 +Delivery will be tried again, until it is either successful or a
  161.26 +timeout has been reached. If the latter happens, you will get a
  161.27 +delivery failure notice.
  161.28 +
  161.29 +
  161.30 +This error message may give you a hint about what caused the
  161.31 +delay:
  161.32 +
  161.33 +${err_msg}
  161.34 +
  161.35 +If you need help, write to <postmaster@${host_name}>.
  161.36 +
  161.37 +The headers of your message follow attached:
  161.38 +
  161.39 +--${uid}/${host_name}
  161.40 +Content-Description: Undelivered Message Headers
  161.41 +Content-Type: message/rfc822
  161.42 +
  161.43 +@msg_headers
  161.44 +
  161.45 +--${uid}/${host_name}--
   162.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.2 +++ b/tpl/warnmsg.tpl.de	Fri Sep 26 17:05:23 2008 +0200
   162.3 @@ -0,0 +1,54 @@
   162.4 +Subject: Warning: could not yet send message
   162.5 +From: MAILER-DAEMON@${host_name}
   162.6 +To: ${return_path}
   162.7 +MIME-Version: 1.0
   162.8 +Content-Type: multipart/mixed;
   162.9 +        boundary="${uid}/${host_name}"
  162.10 +
  162.11 +This is a MIME-encapsulated message.
  162.12 +
  162.13 +--${uid}/${host_name}
  162.14 +Content-Description: Notification
  162.15 +Content-Type: text/plain;
  162.16 +  charset=iso-8859-1
  162.17 +
  162.18 +Diese Nachricht wurde Ihnen von dem Mail Agenten
  162.19 +(${package} ${version}) auf ${host_name} geschickt.
  162.20 +(This message was sent to you by the mailer daemon (${package} ${version})
  162.21 +at ${host_name}.)
  162.22 +
  162.23 +Bedauerlicherweise konnte Ihre Mail noch nicht an alle Empfänger
  162.24 +zugestellt werden.
  162.25 +(Sorry, but your mail could not yet be delivered to all recipients.)
  162.26 +
  162.27 +Die Mail konnte bis jetzt zu folgenden Empfängern nicht zugestellt werden:
  162.28 +(Delivery to the following recipients has been defered:)
  162.29 +
  162.30 +@failed_rcpts
  162.31 +
  162.32 +Die Zustellung wird weiterhin versucht, bis sie entweder erfolgreich
  162.33 +ist oder ein Zeitlimit eingetreten ist. In letzterem Fall wird
  162.34 +Ihnen eine Fehlermeldung zugestellt.
  162.35 +(Delivery will be tried again, until it is either successfull or a
  162.36 +timeout has been reached. If the latter happens, you will get a
  162.37 +delivery failure notice.)
  162.38 +
  162.39 +Diese Fehlermeldung könnte einen Hinweis über die Ursache geben:
  162.40 +(This error message may give you a hint about what caused the
  162.41 +delay:)
  162.42 +
  162.43 +${err_msg}
  162.44 +
  162.45 +Für weitere Hilfe, schreiben Sie an <postmaster@${host_name}>.
  162.46 +(If you need help, write to <postmaster@${host_name}>.)
  162.47 +
  162.48 +Die header Ihrer Mail folgen im Anhang:
  162.49 +(The headers of your message follow attached:)
  162.50 +
  162.51 +--${uid}/${host_name}
  162.52 +Content-Description: Undelivered Message Headers
  162.53 +Content-Type: message/rfc822
  162.54 +
  162.55 +@msg_headers
  162.56 +
  162.57 +--${uid}/${host_name}--
   163.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.2 +++ b/tpl/warnmsg.tpl.fr	Fri Sep 26 17:05:23 2008 +0200
   163.3 @@ -0,0 +1,74 @@
   163.4 +Subject: Attention: impossible d'envoyer un message
   163.5 +From: MAILER-DAEMON@${host_name}
   163.6 +To: ${return_path}
   163.7 +MIME-Version: 1.0
   163.8 +Content-Type: multipart/mixed;
   163.9 +        boundary="${uid}/${host_name}"
  163.10 +
  163.11 +Ce message est encapsule avec le format MIME.
  163.12 +This is a MIME-encapsulated message.
  163.13 +
  163.14 +--${uid}/${host_name}
  163.15 +Content-Description: Notification
  163.16 +Content-Type: text/plain;
  163.17 +  charset=iso-8859-1
  163.18 +
  163.19 +[ENGLISH BELOW]
  163.20 +
  163.21 +------------------------------[ FRANCAIS ]------------------------------
  163.22 +
  163.23 +Ce message vous a été envoyé par le serveur de messagerie
  163.24 +(${package} ${version}) sur ${host_name}.
  163.25 +
  163.26 +J'ai le regret de vous informer que votre courrier n'a pas pu être transmis
  163.27 +à tous ses destinataires. L'expédition vers les destinataires suivants a été
  163.28 +différée:
  163.29 +
  163.30 +@failed_rcpts
  163.31 +
  163.32 +D'autres tentatives d'envoi vont être effectuées, jusqu'à ce que cela
  163.33 +réussisse ou dépasse une certaine limite dans le temps. Dans ce cas, vous
  163.34 +recevrez une notification d'échec d'expédition.
  163.35 +
  163.36 +
  163.37 +Ce message d'erreur peut peut-être vous aider à déterminer l'origine du
  163.38 +délai:
  163.39 +
  163.40 +${err_msg}
  163.41 +
  163.42 +Si vous avez besoin d'aide, écrivez à <postmaster@${host_name}>.
  163.43 +
  163.44 +Les entêtes de votre message sont inclus en pièce jointe.
  163.45 +
  163.46 +
  163.47 +------------------------------[ ENGLISH ]------------------------------
  163.48 +
  163.49 +This message was sent to you by the mailer daemon (${package} ${version})
  163.50 +at ${host_name}.
  163.51 +
  163.52 +Sorry, but your mail could not yet be delivered to all recipients.
  163.53 +Delivery to the following recipients has been defered:
  163.54 +
  163.55 +@failed_rcpts
  163.56 +
  163.57 +Delivery will be tried again, until it is either successfull or a
  163.58 +timeout has been reached. If the latter happens, you will get a
  163.59 +delivery failure notice.
  163.60 +
  163.61 +
  163.62 +This error message may give you a hint about what caused the
  163.63 +delay:
  163.64 +
  163.65 +${err_msg}
  163.66 +
  163.67 +If you need help, write to <postmaster@${host_name}>.
  163.68 +
  163.69 +The headers of your message follow attached:
  163.70 +
  163.71 +--${uid}/${host_name}
  163.72 +Content-Description: Undelivered Message Headers
  163.73 +Content-Type: message/rfc822
  163.74 +
  163.75 +@msg_headers
  163.76 +
  163.77 +--${uid}/${host_name}--