# HG changeset patch # User meillo@marmaro.de # Date 1222441523 -7200 # Node ID 08114f7dcc234e48503cbe2616a85a7cd2db1a8d this is masqmail-0.2.21 from oliver kurth diff -r 000000000000 -r 08114f7dcc23 AUTHORS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AUTHORS Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,2 @@ +Project Maintainer and ~99% of coding done by: +Oliver Kurth diff -r 000000000000 -r 08114f7dcc23 COPYING --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/COPYING Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -r 000000000000 -r 08114f7dcc23 ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ChangeLog Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,440 @@ +0.2.20 Mon, 19 May 2003 21:14:06 +0200 + * fixed a segfaulting bug in spool.c caused by folded headers + * regard connect_error_fail when failing for pipes (Debian Bug #186364) + * hopefully fixed uid/gid problem in peidopen.c +0.2.19 Wed, 12 Mar 2003 21:33:53 +0100 + * fixed a bug in addr_string (set buffer = NULL if g_free'd buffer) +0.2.18 Fri, 06 Dec 2002 14:57:41 +0100 + * new option connect_error_fail + * install /var/{log,spool} before subdirs, so + they get correct ownerships, if installing to a tmp. directory + Thx to Juergen Daubert. + * failure notices and warnings also if connection fails +0.2.17 Thu, 28 Nov 2002 14:59:24 +0100 + * fixed errors in man page masqmail.conf.5 about online_detect + Thx to Juergen Daubert. + * fixed a segfaulting bug in accept.c on pop retrieval, if there + is no return_path in the mail and Sender: is empty. + Thx to Olaf Buddenhagen for debug information. + * implemented 'last_route' option + * moved *.tpl to /usr/share/masqmail/tpl (from /etc/masqmail/tpl) + * french translation of warnmsg.tpl by Rémi Denis-Courmont + * added delivery warn messages for deferals + new options: 'warn_intervals', 'warnmsg_file', 'max_defer_time' + * warn/fail also if remote SMTP server replies with 4xx or 5xx + just after EHLO/HELO (yes, that was a bug) + * removed a few -Wall warnings. Thanks to Juergen Daubert. +0.2.16 Tue, 12 Nov 2002 17:27:13 +0100 + * fixed debugging, which has been broken in 0.2.15 +0.2.15 Wed, 06 Nov 2002 12:19:55 +0100 + * added french translation of delivery failure message template. + Thanks to Rémi Denis-Courmont + * accept -f "" without segfaulting. Thanks to Ralf Friedl. + * fixed buffer overflows in conf.c. Thanks to Damian M Gryski. + * read conf file _after_ dropping privileges +0.2.14 Sat, 26 Oct 2002 14:40:49 +0200 + * corrected html version of documentation + * include masqmail.8 man page (was garbled in 0.2.13) + * small lintian fixes for Debian +0.2.13 Wed, 23 Oct 2002 20:54:39 +0200 + * fixed a possible buffer overflow (IMHO not exploitable) Thanks to Anonymous. +0.2.12 Wed, 23 Oct 2002 18:57:42 +0200 + * new do_pipelining option (to switch it off if necessary) + * new helo_name option for route + * fixed remote_port option (but marked it as deprecated) + * swapped setegid/seteuid in maildir_out() + * try again on EAGAIN failure for local delivery via mbox +0.2.11: + * make it possible for *.route file to have mode 600, owned by root. + Thx to Juergen Daubert for noticing. + * do not choke on trailing blanks after comments in conf file. Anonymous + again. + * try again on EAGAIN failure for local delivery via mda + * fixed a potential buffer overflow in conf.c. Thanks to Anonymous + again. + * set umask 066 for log files. Thanks to Anonymous. + * implemented map_h_mail_followup_to_addresses + * fixed a bug: masqmail -t with empty body caused weird + errors. Thanks to Anonymous. + * added do_save_envelope_to option +0.2.10: + * fixed a small bug in mserver.c (atoi) (Thanks to Gert Ohme) + * allow ';' in rval also if rval is unqoted + * write pidfiles to /var/run/masqmail{,-get}.pid + * now runs on freebsd without leaving zombies + * use setjmp() in readsock.c for timeouts +0.2.9: + * attempts to make it compile on freebsd + - works, but leaves zombies behind (will be done next release, I hope) + * removed some bashisms from configure.ac + * fixed segfault when called with -t under some circumstances + * some fixes about locking when fetching mail (yes, 0 _is_ a valid fd...) + * some speedups for uidl handling, and do not bloat log files any more +0.2.8: + * use flock() for locking in retrieving mails (get.c) + * can use /etc/mailname as host_name (for Debian) + * added ESMTP LOGIN + * made uidl handling even more safe +0.2.7: + * fixed stupid locking bug + * do not complain about 'unknown mode' when getting mail + * added italian version of failmsg.tpl (by Paolo) + * changed MIME boundaries in failmsg.tpl (Paolo) + * applied patches from Paolo (Gabel - ): + mostly replacing g_strdup_printf() with g_strdup(), a few ticks ('), + changed SENDER_LOCAL environment variable and fixed missing '\' in + debian/masqmail.ip-up +0.2.6: + * rediscovered previously undocumented allowed_return_paths option for + routes and made it usable for null sender addresses. + * added mbox_default, and {mbox,mda,maildir}_users options + * changes to vsnprintf function use in pop3_in.c and smtp_in.c (by egp) + * fixes to ip-up/ip-down scripts (by Ben Low) + * ENABLE_SMTP_SERVER define was incorrectly written as + ENABLE_MODE_SMTP (by Ben Low) + * fixed bug in get_header() in src/header.c (by egp) +0.2.5: + * PowerPC fix for varargs functions + * relay checking: if do_relay is set to false, do not allow non local + to non local addresses + * alias is always caseless for postmaster (disregarding + alias_local_caseless option) + * do not rebounce to postmaster + * implemented Maildir support + * rearranged append_file in local.c + * use sysexits.h for correct error reply for failure messages (mda only) +0.2.4: + * fixed uidl bug: uidl list was not written if a mail was not + fetched because it was in the list + * fixed bug in src/conf.c: g_free'd twice in destroy_route() + * security fix, Debian Bug#102092: 'Privilege escalation in masqmail + piped alias handling': fixed by using set[ug]id instead of sete[ug]id + in peopen.c (noted by Colin Phipps) + * limit count of children in pop3_in.c and wait for them + * ignore SIGPIPE signal + * docu updates by Uli Funcke + * find path to masqmail via --prefix or --exec-prefix option for configure + * implemented -v (log to stdout) option +0.2.3: + * local_addresses and not_local_addreses option (patch by Uli Funcke) + * replaced /usr/sbin/masqmail in fail_msg.c with /usr/sbin/sendmail + * typo in man pages (noted by Sebastian Inacker) + * hostnames can now begin with a digit (noted by CatcherInTheRye) + * chdir to '/' (on some systems getcwd() failes when changing uid) + * implemented lock_dir option + * ignore EINVAL after fdatasync + * configure option to link with libcrypto + * configure option to disable resolver support + * configure option to enable mserver support + * configure option to disable smtp server + * configure option to link glib statically + * msg_count option for get configuration + * bug fix: do not terminate if accept() return + error (patch by Edouard G. Parmelan) + * removed some files from package in + debian (by Edouard G. Parmelan)) + * mailrm alias (by Edouard G. Parmelan) + * bug fix: removed superfluous g_free from + dot_unlock() (by Edouard G. Parmelan) + * write uidl list to temporary file first + * write uidl list each time a message was retrieved + (avoid duplicate mails when interupted) +0.2.2: + * fix of Debian Bug#92894 by Gregor Hoffleit + (correct error reply for lacking permissions) + * fixed 'last line missing' bug + * fixed spool locking bug: lock was deleted + if unsuccessful (unlocking it) + * added patch from Uli Funcke for log_user + (user getting all delivered mail) + * implemented get daemon + * create lock file when getting mail + * use tables for finding route and get lists +0.2.1: + * expand_h_sender_address now defaults to true (as described in docs) + * included documentation patch by Marc Herbert (masqmail call in ifup configuration) + * complain to log if failure message template cannot be opened + * errmsg_file defaults to /etc/masqmail/tpl/failmsg.tpl + * corrected error message for insufficient permissions (Debian Bug #92894) + * get mail depending on connection: -go option and online_get +0.2.0: + * included the debian/ directory from the debian package. + * added return_path option for get configuration + * added max_messages option for get configuration + * added independent program 'mservdetect', which can be used with + online_detect=pipe as replacement for online_detect=mserver + * added online detection method 'pipe' + * replaced configure option --with-conffile with --with-confdir, default + is now /etc/masqmail/ (/etc/masqmail/masqmail.conf for the conf file). + * added do_uidl_dele option (delete messages in uid listing on server) + * qualify address for get configuration. + * better checking for valid From: address when retrieving mail via pop3 + and this is used as the return path. + * port number for mail_host in routes possible + * introduce delivery failue notices + * added addr_string() function for easy output of addresses + * expire spool lock files after a while (currently 300s) + * started development branch 0.2.x + +0.1.12: + * previous fix auf AUTH broke it - reverted it partially and fixed it again + * bug fix in get.c: retrieval via pop from different server could cause mail to be lost +0.1.11: + * bug fix in smtp_out.c: of AUTH methods supplied by server, only the first was recognized +0.1.10: + * added support for IP address as mail_host in routes + * include in masqmail.h to make it compile with glibc 2.2.2 +0.1.9: + * fixed a few typos in man pages + * ignore -v option + * added patch from Bernhard Ehlers to program aliases runq, rmail, smtpd and in.smtpd + * added patch from Edouard G. Parmelan to correct default directories to install + * implemtented pipe, pipe_fromhack and pipe_fromline options + for routes (for protocol 'pipe') + * implememted 'pipe' protocol for routes + * memset to 0 of configuration structures (it is safer and easier) + * list of routes for each connection + * do not be picky about EOF if locally received message is not terminated by a dot + * speeded up accept.c for large messages (noted by Falko Flessner) +0.1.8: + * security bug fix (Debian Bug#81079): if local address cannot be + resolved, masqmail listened on an arbitrary port (fixed by Adel + Belhouane) + * bug fix: -d without argument caused segfault (Thanks to Jan Setzer) + * added more help for configure + * Iain Lea sent a spec file for Redhat. Thanks! + * lines can now be indefinetely long for mail acception (well, nearly...) + * implemented 'wrapper' options for routes and get configurations for ssl and maybe other purposes + * unified read_sockline() for smtp_out.c, smtp_in.c, pop3_in.c, accept.c and mserver.c + * escaping of quotes in configuration now possible and now works + correctly in alias file (Edouard G. Parmelan sent a patch, but I fixed it differently) + * kill -HUP seems to work now. + * close all file descriptors >= 3 on start (patch by Edouard G. Parmelan) + * replaced exit() with _exit where appropriate (children) + * added pipe_fromhack and pipe_fromline options + * added mda support and mda_fromhack and mda_fromline options + * user can delete his own mail if received via smtp from one of ident_trusted_nets + * bug fix in lookup.c: if the name that an MX points could not be resolved, delete entry + * added expand_h_sender_address option. expend_h_sender_domain should be obsolete now. + * unprivileged user can delete his own mail from queue if received locally + * replaced popen() in local.c with peopen() from snippet from sourceforge. Fixed a bug there. +0.1.7: + * debug option can be changed for privileged users only + * fixed a security hole: -C option for unprivileged users now implies + run_as_user and drops _all_ privileges + * environment variables for pipe transport + * wildcards for map_* options + * rearranged interface handling, IP addresses now possible for + listen_addresses and mserver_iface + * beautified masqmail.c + * revised uid and gid settings in spool.c and local.c (pipe transport) + * optionally use ident protocol (RFC 1413) and store user id in spool file + * proper spool file locking +0.1.6: + * record user id in spool file (though it is not used anywhere) + * command line option to remove messages from queue (-Mrm) + * command line option for version information (-bV) +0.1.5: + * implemented -F option + * removed bug in accept.c (dot bug, noted by Andre Masloch) + * location of main conf is now configurable with ./configure + (suggested by Greger Hoffleit). Default is /etc/masqmail.conf. + * remote_port defaults to 25 (noted by Andre Masloch) + * docu fixes: remote_port documented and typo fix (noted by Andre Masloch. Again :-)) + * do not return failure on exit on delivery if mail queue was empty (noted by Andre Masloch) + * qualify -f address with host_name if unqualified (noted by Andre Masloch) +0.1.4: + * Jens Askengren discovered a segfaulting bug when parsing headers. +0.1.3: + * warn if pop/auth options are given, but compiled without support + * fixed allowed_rcpt_domains option (was broken since 0.1.0, but nobody noticed) + * exit with 1 if queue run fails for any reason (not for daemon) + * fail if alias file cannot be read + * better handling of SMTP SIZE error + * implemented alias_local_caseless option (suggestion by Andre Masloch) + * case insensitive domain matching (noted by Andre Masloch) + * removed nearly all warnings if compiled with -Wall +0.1.2: + * some changes in configure.in + * continue if get conf could not be read. Thanks to Edouard G. Parmelan! + * fixed another bug on pipe addresses in spool.c + * Andre Masloch found a bug in spool.c which caused a segfault on pipe addresses. Thanks! +0.1.1: + * Edouard G. Parmelan sent a patch for starting a queue run on start of daemon. Thanks! + * rpm packages for SuSE + * regard CFLAGS in Makefile.am + * implemtented -g option + * be more verbose in pop3_get.c + * implemented -f option (set return path) + * fixed bug: "no debug file, msg was:" in smtp_out.c when debugging was off + * internal changes of smtp_out_log_failure() + * removed 'no log file' error + * complain if host name could not be resolved in connect.c + * added option resolve_list for route and get configurations + * removed bug in rcptlist_with_one_of_hostlist(): exited when + list was empty +0.1.0: + * included ESMTP AUTH support (as client), CRAM-MD5 only + * included pop3 client support, with UIDL and APOP, single drop only + * rearranged routing code: + - messages will be deleted from spool earlier, as soon as they are delivered + - unified online/offline delivery, making it more simple + +0.0.13: + * ignore set_h_{from,reply_to}_domain if map_h_{from,reply_to}_addresses + is set and warn in logs about misconfiguration. + * fail if there are no recipients + * fixed bug: if called with -t, qualify recipient address with host_name + * fixed bug: if called with -bi, no longer wait for message on stdin +0.0.12: + * warn if spool file could not be deleted (Thanks to Alberto González + Palomo) + * fixed bug: set len for getsockname + * fixed bug: set local_net_routes to NULL if there is no local net + (noted by Frank Schnekenbuehl) + * say 'mail queue is empty' if mail queue is empty (Thanks to + Frank Schnekenbuehl) + * fixed bug: setegid in local.c (was noted by both Michael Piefel and + Alberto González Palomo) +0.0.11: + * if Bcc: headers have been removed (-t option), and there is no To: + or Cc: header,an empty Bcc: header will be created (RFC 822 + compliance!) + * fixed bug: if rcpts are given on command line To: headers were + created, even if they already existed. This caused Bcc: recipient + addresses to be revealed if they were given on the cmd line. + Now a To: header is only created if there is no To:, Cc: or Bcc: + header. Thanks to Richard Clamp for pointing this out. + * fixed bug: segfault when -d option was given without arguments + * fixed bug: segfault when configuration file not found +0.0.10: + * removed -g option from Makefile + * fixed bug: -odq did not work, was broken in some earlier version + * addresses with leading '\' will not be expanded any further in aliases + * pipe transport implemented + * alias support implemented. + * changed permissions for queue runs again: got to be root, + mail or in group trusted. + * some configuration parameters can be read from files + * internal changes in routing logics/deliver code, preparing for + aliases support. + * Gregor Hoffleit sent another patch: use liblockfile if available + (Debian!) and DESTDIR will be used. Also updated the NEWS file. Thanks + again! + * define fdatasync to fsync if not available. + * lookup.c includes sys/types.h, some environments need this + * fixed bug in RFC 822 parsing: name in brackets after address + caused problems. Thanks to David Maslen. + * values in tables without leading spaces +0.0.9: + * anyone in group 'trusted' is now allowed to do queue runs. Thanks to + Alberto Gonzalez Palomo for the suggestion. + * changed umask for spool writing to 026. + * removed silly 'no rcpt domain for this route' message + * there is now a mailing list + (see http://www.innominate.org/mailman/listinfo/masqmail) + * Gregor Hoffleit sent a patch to make masqmail work with mutt (and + balsa and any other MUA that uses the mutt libs): it now supports + '--' in options. Thanks! + * accept_message() supports flag ACC_NO_RECVD_HDR (but this is not + used in masqmail). + * accept_message() is no longer responsible for queuing, makes it + easier to recycle the code for other projects (eg. jpilot-Mail) +0.0.8: + * added a FAQ page. + * removed all warnings, at least for egcs. Output of make looks + pretty now ;-) + * added allowed_mail_locals and not_allowed_mail_locals options for + routes. + * implemented folding und unfolding of headers (but currently used + for the Received: header only). + * corrected docs: should be 'online_detect', NOT 'detect_online'. + * mailq now gives information about the time mails spent in the queue, + the message size and the received host. + * added allowed_rcpt_domains option for routes. + * increased buffer size to 1024 for SMTP responses when delivering. + * fixed minor bug: slash in unquoted strings in conf parsing was not + allowed. +0.0.7: + * fixed a bug in smtp_out.c: sock was tested before it was initialized. + * fixed a bug in the configuration code: for statements in two + adjacent lines, the second was not recognized. +0.0.6: + * rewrote part of the configuration parsing code because it caused + problems with reading config statements on multiple lines. + * added a LF after each mail local mail spool file, as this + seems to be required for some MUAs and especially cucipop when + it reads mails. Otherwise mails seem to be concatenated. Thanks + to Dale Perkel for pointing this out. +0.0.5: + * added expand_h_sender_domain option (boolean, default: true) + because some clients use the Sender: address as the sender address + (though it should be the From: address). + * changed configure script to better recognize whether libresolv + should be linked or not. + * fixed a nasty bug: if masqmail -q was called (or qo + and a mail was not delivered), the headers were lost! Problem was an + additional LF after received_host in the spool file. +0.0.4: + * 'From' hack is now a 'From ' hack. + * configure now accepts options --with-logdir=LOGDIR and + --with-spooldir=SPOOLDIR. + * the directories /var/masqmail and /var/spool/masqmail will now be + created with make install; user and group will be set appropriately + * configure now accepts options --with-user=USER and --with-group=GROUP + * dove into autoconf: configure now recognizes libc5 and links with + libresolv only for libc6 and defines getline for libc5 + * fixed timeout code when sending. This was broken in some earlier + version. +0.0.3: + * fixed bug in spool write code: rcpt address was written incorrectly + to spool file under some circumstances (with a LF). + * added methods for online detection (file and mserver) and added code + to deliver immediately when mail is received at online time. + * too many changes to list: rearranged routing code, unified smtp + deliveries to the local net with online deliveries, so now route + configurations can be used for the local net. Also multiple messages + per connection for the local net possible. And reduced code size. + * fixed bug: if server does not use neither the esmtp size extension + nor pipelining, output after MAIL FROM was not flushed. So MM waited + forever for a response... +0.0.2: + * fixed bug: euid was not set properly for local delivery + * when debugging, it does not write the whole message to the log + any more. + * added 'From' hack + * qualified address for return path and recipients is now required + if not accepted locally, if locally accepted the addresses will be + qualified with host_name. (Thereby fixed a seg fault bug) + * added -i option (same as -oi) + * added more header rewriting (set_ and map_ options) + * fixed bug: potential seg fault when writing spool files because it + was not read properly + * multiple messages per connection now also if mail is sent directly + (same for local_nets is still missing, but I will use routes for these + anyway in the future) + * the queue will now be read in random order + * implemented multiple messages per connection (but only online + and if mail_host is defined) + * implemented rewriting of local parts in return path for online + delivery + * domain matching is no longer case sensitive (had to define + _GNU_SOURCE so that I could use FNM_CASEFOLD for fnmatch) + * added do_correct_helo option for routes + * fixed bug: corrected retrying hosts if one failed (connect.c). +0.0.1: + * fixed bug: seg fault when delivering online directly and there was + more than one rcpt to a single host. + * fixed bug: if mail was succesfully delivered in online mode to all + rcpts, and if there were additional (local) rcpts for which the mail + was not yet delivered, the mail was deleted from spool. + * rearranged smtp_out.c to prepare for multiple messages per connection + * log now shows the real host a message is sent to by SMTP (previously + it was the one looked for, now it is the one that was found by DNS) + * added NOOP, HELP and not recognized replies in smtp_in + * fixed bug: forgot to close dup_sock in accept_connect (listen.c) + * can now list the queue with the -bp option or when called as mailq + * debug_level is now configurable and -d option added + * corrected rfc821 address parsing and rearranged code +0.0.0: + * initial release diff -r 000000000000 -r 08114f7dcc23 INSTALL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/INSTALL Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,135 @@ +simple installation instructions, see docs/install.html for more. + +To compile MasqMail you need glib 1.2 (http://www.gtk.org). + +You need a user and a group for masqmail to run, I suggest user +'mail' and group 'trusted'. Say: + +groupadd -g 42 trusted +useradd -u 42 -g 42 -d / -s /bin/sh -c "Mail Transfer Agent" mail + +If you use other names than 'mail' and 'trusted' use the options +described below for configure. The 42 is just a suggestion, you can +use any number you like, but preferably one < 100. It does not have +to be the same for the user 'mail' and the group 'trusted'. + +Then do: + +./configure +make +make install + +Debian: +If you compile for Debian, do the configure with at least these options, +this makes it compatible with the official debian package: +./configure --with-liblockfile --with-group=mail +you do not need the group 'trusted', use 'mail' instead. + +You can also build your own Debian package with +dpkg-buildpackage -rfakeroot +You need to have fakeroot installed to do this. Or, as root, do: +dpkg-buildpackage + +SuSE/Redhat: +There are spec files for rpm creation in suse/ or redhat/. You may have to adjust these files. + + +Sorry, but after that you are not yet finished. For instruction on how +to deliver mail using a connection to your ISP see +docs/install.html. It is probably a good idea to copy the files +docs/*.html to a directory where you can access them with a browser. + +additional options for configure: +--------------------------------- + +--with-user=USER sets the user as which MasqMail will run. Default is +'mail'. USER has to exist before you 'make install'. + +--with-group=GROUP sets the group as which MasqMail will run. Default +is 'trusted'. GROUP has to exist before you 'make install'. + +--with-logdir=LOGDIR sets the directory where MasqMail stores its log +files. It will be created if it does not exist. Default is /var/masqmail/. + +--with-spooldir=SPOOLDIR sets the directory where MasqMail stores its +spool files. It will be created if it does not exist. Default is +/var/spool/masqmail/. + +--with-confdir=CONFDIR sets the default configuration directory to +CONFDIR, in case you prefer another location than /etc/masqmail/. + +--enable-auth enables ESMTP AUTH support (disabled by default) + +--disable-pop3 disables pop3 support (enabled by default) + +--enable-maildir enables qmail style Maildir support (disabled by default) + +--enable-ident enable RFC 1413 support. If you have the libident +dynamic library installed, this will be linked, otherwise it will be +statically linked using the sources included in the package. + +--disable-resolver disable resolver support. Without the resolver functions, +masqmail uses only gethostbyname() to resolve DNS names, and you cannot send +mail without a smart host. Not recommended. You save 3K at most. + +--disable-smtp-server disable SMTP server support. You may want this if you do +not need masqmail to listen. In this case, you cannot use masqmail as a smart +host for other hosts on your LAN, you cannot use mail clients that send SMTP, +you cannot even use pine. In short, use of this option is discouraged unless +your resources are extremely limited. + +--enable-mserver enable online detection by connecting to the mserver +(masqdialer system). + +--with-libcryto instead of using the md5 and hmac functions within the package, +link dynamically with libcrypto. This applies only if you have pop3 or SMTP +AUTH enabled. Makes only sense if your resources are limited and you have +libcrypto installed. Untested. + +--with-glib-static link with glib statically. This makes the binary larger +by around 30K (i386 architecture), but if masqmail is the only binary using +glib, you save some space in total, because you do not need the shared glib +library installed. + +--disable-debug disable debugging, setting it on by command line or configuration +has no effect. Strongly discouraged, since you miss valuable information if something +goes wrong. You save 6K. + +BTW, to get 3K of space, call +strip --remove-section=.comment --remove-section=.note --strip-unneeded src/masqmail + +after make install: +------------------- + +You can also use these instructions to omit 'make install' if you do +not want to use it. + +Check that 'make install' worked correctly. The following command: + +ls -ld /usr/sbin/masqmail /var/masqmail/ /var/spool/masqmail /var/spool/masqmail/input + +should give output similar to + +-rwsr-xr-x 1 root root 86955 Oct 14 14:27 /usr/sbin/masqmail +drwxr-xr-x 2 mail trusted 1024 Oct 14 14:29 /var/masqmail/ +drwxr-xr-x 3 mail trusted 1024 Oct 14 14:27 /var/spool/masqmail +drwxr-xr-x 2 mail trusted 1024 Oct 14 18:32 /var/spool/masqmail/input +drwxr-xr-x 2 mail trusted 1024 Oct 14 18:32 /var/spool/masqmail/lock +drwxr-xr-x 2 mail trusted 1024 Oct 14 18:32 /var/spool/masqmail/popuidl + +(important is the set-user-id bit for /usr/sbin/masqmail and the +ownership of all items). + +Use the example configuration files in examples/ to edit your own. The +main configuration should go to /etc/masqmail.conf. I recommend to +make a directory /etc/masqmail for the *.route amd *.get files. + +The default destination for the executable 'masqmail' is +/usr/sbin. Check that it has the set user id bit set. (chmod u+s +/usr/sbin/masqmail does no harm in any case). + +If you want to replace sendmail, move your old sendmail binary to +another name and make a symbolic link /usr/sbin/sendmail -> +/usr/sbin/masqmail. + + diff -r 000000000000 -r 08114f7dcc23 INSTALL.agenda --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/INSTALL.agenda Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,37 @@ + +prerequesites: +-------------- +cp /usr/lib/glib-config /usr/mipsel-linux/bin +and apply this patch: + +3c3 +< prefix=/usr +--- +> prefix=/usr/mipsel-linux/ + + +compile +------- +export CONFIG_SITE=./agenda-config.site + +./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 +make + +mipsel-linux-strip --remove-section=.comment --remove-section=.note --strip-unneeded src/masqmail + +install +------- + +# Become root and do: +make DESTDIR=/tmp/agenda-masqmail/ install + +# make the configuration directory writable for user mail +# (this is needed for sqilconf) +chown mail.mail /tmp/agenda-masqmail/etc/masqmail/ +chmod g+rw /tmp/agenda-masqmail/etc/masqmail/ + +# delete man pages and unneeded binaries: +rm -rf /tmp/agenda-masqmail/usr/local/man/ /tmp/agenda-masqmail/usr/local/bin/ + +You can now rsync the files you need to your agenda from DESTDIR. + diff -r 000000000000 -r 08114f7dcc23 INSTALL.ipaq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/INSTALL.ipaq Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,15 @@ +For a cross compiler: + +Download ipaq-config.site from http://masqmail.cx/ipaq/cross/. There +are also some more instructions. + +export CONFIG_SITE=./ipaq-config.site + +./configure --with-glib-prefix=/skiff/local/ \ + --disable-smtp-server --disable-resolver \ + --with-group=mail --disable-debug --enable-auth +make + +su +make DESTDIR=/tmp/masqmail install + diff -r 000000000000 -r 08114f7dcc23 Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,50 @@ +EXTRA_DIST = \ +examples/example.get examples/example.route examples/masqmail.conf \ +docs/README docs/man/m*.[0-9] \ +suse/masqmail suse/masqmail.spec suse/masqmail.spec.in \ +redhat/masqmail redhat/masqmail.spec redhat/masqmail.spec.in \ +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 \ +INSTALL.agenda INSTALL.ipaq agenda-config.site + +SUBDIRS = src tests docs debian + +install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir + +conf_dir: $(DESTDIR)@with_confdir@ + +$(DESTDIR)@with_confdir@: + install -d $(DESTDIR)@with_confdir@ + +tpl_dir: $(DESTDIR)@datadir@/tpl + +$(DESTDIR)@datadir@/tpl: conf_dir + install -d $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/failmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/failmsg.tpl.{de,fr,it} $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/warnmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/warnmsg.tpl.{de,fr} $(DESTDIR)@datadir@/masqmail/tpl + +log_dir: $(DESTDIR)@with_logdir@ + +spool_dir: $(DESTDIR)@with_spooldir@ + +uid_bit: $(DESTDIR)@prefix@/sbin/masqmail + chmod u+s $(DESTDIR)@prefix@/sbin/masqmail + +run_dir: + install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail + +$(DESTDIR)@with_logdir@: + [ -d `dirname $(DESTDIR)@with_logdir@` ] || \ + install -d `dirname $(DESTDIR)@with_logdir@` + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@ + +$(DESTDIR)@with_spooldir@: + [ -d `dirname $(DESTDIR)@with_spooldir@` ] || \ + install -d `dirname $(DESTDIR)@with_spooldir@` + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@ + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/lock + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/input + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/popuidl + diff -r 000000000000 -r 08114f7dcc23 Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,581 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +EXTRA_DIST = \ +examples/example.get examples/example.route examples/masqmail.conf \ +docs/README docs/man/m*.[0-9] \ +suse/masqmail suse/masqmail.spec suse/masqmail.spec.in \ +redhat/masqmail redhat/masqmail.spec redhat/masqmail.spec.in \ +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 \ +INSTALL.agenda INSTALL.ipaq agenda-config.site + + +SUBDIRS = src tests docs debian +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = suse/masqmail.spec redhat/masqmail.spec +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL Makefile.am NEWS TODO acconfig.h \ + aclocal.m4 config.guess config.h.in config.sub configure \ + configure.ac depcomp install-sh missing mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): configure.ac + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h + +$(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) $(top_srcdir)/acconfig.h + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/config.h.in + +distclean-hdr: + -rm -f config.h stamp-h1 +suse/masqmail.spec: $(top_builddir)/config.status $(top_srcdir)/suse/masqmail.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +redhat/masqmail.spec: $(top_builddir)/config.status $(top_srcdir)/redhat/masqmail.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + else \ + include_option=--include; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/docs $(distdir)/docs/man $(distdir)/examples $(distdir)/redhat $(distdir)/suse $(distdir)/tpl + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-recursive ctags ctags-recursive dist \ + dist-all dist-gzip distcheck distclean distclean-generic \ + distclean-hdr distclean-recursive distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am dvi-recursive info \ + info-am info-recursive install install-am install-data \ + install-data-am install-data-local install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ + ps-recursive tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-info-recursive uninstall-recursive + + +install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir + +conf_dir: $(DESTDIR)@with_confdir@ + +$(DESTDIR)@with_confdir@: + install -d $(DESTDIR)@with_confdir@ + +tpl_dir: $(DESTDIR)@datadir@/tpl + +$(DESTDIR)@datadir@/tpl: conf_dir + install -d $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/failmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/failmsg.tpl.{de,fr,it} $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/warnmsg.tpl $(DESTDIR)@datadir@/masqmail/tpl + install -m 644 tpl/warnmsg.tpl.{de,fr} $(DESTDIR)@datadir@/masqmail/tpl + +log_dir: $(DESTDIR)@with_logdir@ + +spool_dir: $(DESTDIR)@with_spooldir@ + +uid_bit: $(DESTDIR)@prefix@/sbin/masqmail + chmod u+s $(DESTDIR)@prefix@/sbin/masqmail + +run_dir: + install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail + +$(DESTDIR)@with_logdir@: + [ -d `dirname $(DESTDIR)@with_logdir@` ] || \ + install -d `dirname $(DESTDIR)@with_logdir@` + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@ + +$(DESTDIR)@with_spooldir@: + [ -d `dirname $(DESTDIR)@with_spooldir@` ] || \ + install -d `dirname $(DESTDIR)@with_spooldir@` + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@ + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/lock + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/input + install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/popuidl +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 NEWS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NEWS Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,263 @@ +Here I add changes which may be important for you. See ChangeLog for more +details and the manual pages for a more complete description +of added options. + +0.2.18 + +- delivery warnings and failures are now also implermented if the +connection to a server fails. Because masqmail is designed for dialup +networks, a connection failure will merely generate a warning by default. +If you deliver in a local network and use the default local_net route, +this would generte a failure. You can change this behaviour by setting +connect_error_fail +to either true or false in the route configurations. + +0.2.17 + +- delivery warnings have been finally implemented: if delivery of a mail +fails temporarily, warning mail will be generated, informing the sender +of the problem. After some time, the mail will be handled as failing +permanently, and be bounced. New options: 'warn_intervals', +'max_defer_time' and 'warnmsg_file'. + +- the message templates for failures and warnings will now be installed +into /usr/share/masqmail/tpl/, and no longer to /etc/masqmail/tpl/. The +default for the search path (options 'errmsg_file' and 'warnmsg_file' +has been changed accordingly. + +- new option 'last_route'. See man 5 masqmail.route. + +0.2.12 +two new options have been added: +- do_pipelining will be used only in broken mail setups. Actually, I +implemented it only to test such a setup. + +- helo_name for routes sets the helo_name. This may be useful for +eg. ssh tunneling, or if do_correcthelo does not work, because you are +behind a firewall. + +- the old 'remote_port' option should not be used any more. Set the +port with mail_host="foo.bar.com:1234" in the route file instead. + +0.2.11 + +- two new options have been added: do_save_envelope_to for the main +configuration and map_h_mail_followup_to_addresses for the route +files. See the man pages on purpose and usage. + +- the route files can now be mode 0400, owned by root. Previous +versions had problems when sendmail was called directly by a +non-priviledged user, because the route files could not be read. + +0.2.10 + +- this version should work on FreeBSD. At least I care now if it does not. + +- masqmail now writes pid files to /var/run/, one for the smtp/queue +daemon and one for the get daemon. So you now know whom to kill ;-) + +- much effort has been put into the Debian package, which now uses debconf. + +0.2.7 + +- sorry for my reluctany in the last months... +- my email address is oku@masqmail.cx. I hope that I keep this for the rest +of my life... + +0.2.6 + +- you can configure the prefered local delivery mechanism for each user. See +man page masqmail.conf (5), options mbox_default, mbox_users, mda_users and +maildir_users. BIT FAT NOTE: if you used an mda, set mbox_default = "mda" +(or use the mda_users option). Just setting mda is not enough any more. + +- there are the allowed_return_paths and not_allowed_return_paths for the +route configurations, this enables better checking for return path addresses +than allowed_mail_locals. You can also use this to enable or disable messages +from null sender addresses (<>) using "<>". +note: this option has been there for quite a time... I just forgot to document it. + +0.2.5 + +- simple relay checking: if you set do_relay=false in masqmail.conf, users +with a return path that is not local will get a 550 reply if they try to +deliver to a not local address. This is for users to force them to have a +proper configuration. It is _not_ to prevent spammers from using your MTA +as a relay, it can be easily forged! masqmail is not designed to be an always +accessible MTA for an internet site. + +- added Maildir support. To use it, add --enable-maildir as ./configure +optiom. Currently, if enabled, all local deliveries are to Maildir +(in ~user/Maildir), and none to mailbox. This is preliminary, future versions +will be configurable (probably together with mda delivery). + +0.2.4 + +- added -v option, this logs to stdout, so you see what happens when +calling masqmail from command line. This is not yet finished, and only +for fetching mails completed. + +0.2.3 + +- new option lock_dir where locks will be put to. Defaults to the spool +dir with '/lock/' appended (if spool_dir is /var/spool/masqmail/, lock_dir +is /var/spool/masqmail/lock/). + +- You can use the 'do_uidl_dele' option more reliably. The uidl list +will be written immediately after a message was fetched, so if you use the +do_uidl and do_uidl_dele option you can safely interrupt masqmail when it is +getting mail via pop3, and do not get the message again next time. + +- there are a lot of new options for ./configure to customize masqmail +to your needs. See INSTALL. + +- Uli Funcke sent a patch with the new options 'local_addresses' and +'not_local_addresses' for masqmail.conf. With these, you can declare single +email addresses as local, though they normally are not, and vice versa, +declare addresses as not local though normally they are (determined with +local_hosts). These options are not yet documented. + +0.2.2 +- with -go5m you can now run a get daemon, the command 'masqmail -go5m' will fetch +mail every five minutes, using the detected online configuration. + +0.2.1 + +- there is a new option for the main conf: online_gets. Using this option, +you can retrieve mail with just calling masqmail -go, masqmail will detect +whether it is online (similar to conect_routes (which is now called +online_routes)). + +0.2.0 + +This is the first release of he development branch of masqmail + +- the default configuration is now /etc/masqmail/masqmail.conf + (as it already was for the debian package). The --with-conffile + option for configure has been replaced by the --with-confdir option. + +- added delivery failure notices: + o you can customize your own delivery failure report, its + default location is /etc/masqmail/tpl/failmsg.tpl + o if a delivery via a route fails permanently (the server replied with a 5xx status) + the message will be bounced, if it is bounced, no further delivery will be attempted. + This is different to previous versions, where failed messages were kept in the queue until + it was finally delivered, deleted or forever. + +- there is a new online detection method: pipe. This allows you more + flexibility to detect the current online status, eg. the DHCP status on notebooks. + +This method will once replace the 'mserver' option, +you can already use the program mservdetect to use it: + +online_method=pipe +online_pipe="/usr/bin/mservdetect localhost 222" + +instead of + +online_etect=mserver +mserver_iface="localhost:222" + +0.1.9 + +- you can use pipes in routes to implement gateways to uucp, fax, sms etc. +The setup is similar to mda transport. See man pages. + +- for each connection (connect_routes), you can now give a list of +route files, which will be used in the order given. You can use the +filter rules (allowed_* and not_allowed_* rules) within each route. + +0.1.8 + +- for pop retrieval and smtp sending you can use a wrapper for eg. ssl +tunneling. See man pages. + +- a user can delete his mail from the spool with -Mrm if received +locally, and if you configure with --enable-ident and set +ident_trusted_nets also if received via smtp. + +- a backslash now works to escape characters in the configuration, so +you can now use quotes inside quotes. All other characters with a +leading backslash will be converted to itself (\a becomes a, \\ +becomes \). + +- you can now use an mda for local mails. The mda will be called +*after* alias expansion. See documentation for more. + +0.1.0 +- masqmail can now retrieve mail with pop3. See the manual on how to do that. +- supports now ESMTP AUTH as a client. +- when called with -qo (without a connection name), the online status +will be checked with the configured method. + +0.0.10 +- there is now alias support. Give the location of the alias file (usually /etc/aliases) with eg. +alias_file = "/etc/aliases" +- delivery to pipes is now possible, but only if it appears in an alias file. Example: +pipe: |/usr/bin/command +will expand the address pipe to "|/usr/bin/command" which invokes '/usr/bin/command' +as the user and group masqmail is running as. +- entries starting with '\' in alias files will not be exanded further + +- changed permissions for queue runs again: got to be root, mail or in group trusted. + +- some configuration parameters can be read from files, these are +allowed_mail_locals, not_allowed_mail_locals, allowed_rcpt_domains, not_allowed_rcpt_domains, +map_return_path_addresses, map_h_from_addresses, map_h_reply_to_addresses +any entry in these list beginning with a '/' are regarded as +filenames, the content of these will be put at that location. Entries +in these files are separated by new lines. Example: +in the route file you have: +map_h_from_addresses = "/etc/masqmail/hfrom.map" +and hfrom.map contains: + +john: John Smith +cmiller: "Charlie Miller" + +UPDATE (Jan 2000): The new home location of MasqMail is +http://www.innominate.org/~oku/masqmail/, the new email adress of the +author is Oliver Kurth . + +0.0.9 +- see ChangeLog. + +NOTE: The home location of MasqMail at +http://merlin.uni-sw.gwdg.de/~okurth/masqmail/ is uncertain from the +beginning of Nov. 1999! See http://www.freshmeat.net for new +announcements. I leave the university and begin a new job on Nov. 1st 1999 +in Berlin :-). + +0.0.8: +- there is now a FAQ page. See docs/faq.html. +- added allowed_rcpt_domains option for routes. +- added allowed_mail_locals and not_allowed_mail_locals options for routes. +- mailq now gives information about the time mails spent in the queue, +the message size and the received host. + +0.0.7: +-bug fix release: for statements in two adjacent lines, the second was not recognized. + +0.0.6: +- bug fix release: some MUAs (cucipop) saw the locally delivered mails +concatenated. (cucipop is not a MUA but a pop server, but it has to read the +mails). + +0.0.5: +- fixed a bug that caused the headers to be lost under some circumstances. +- added expand_h_sender_domain option for routes. +- rewrote the libresolv part in configure. Should work better now. + +0.0.4: +- MM should now recognize whether libresolv should be linked. +- added --with-logdir=LOGDIR and --with-spooldir=SPOOLDIR to set directories. + These will be created if not already existent. +- added --with-user=USER, --with-group=GROUP options to set user and group id + for MasqMail. + +0.0.3: +- MasqMail can now deliver mails that are received at online + time immediately to the internet. See the options detect_online, + mserver_iface and online_file. +- You can define a route configuration for the local net. See option + local_net_route. + diff -r 000000000000 -r 08114f7dcc23 README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,82 @@ +MasqMail README + +MasqMail is a mail server designed for hosts that are not permanently +connected to the internet. It handles outgoing messages, i.e. those +that are to be sent over the non-permanent link (usually a ppp or slip +connection over a modem or ISDN adapter) specially and delivers them +only when explicitely told to do so. There is support for multiple +providers, it is possible to write different configurations for each +one. The configuration chosen is selected at delivery time, so that if +for example a delivery of a message failed while connected with +provider 1, it may be delivered when connected to provider 2. For each +provider another mail host (or none) can be specified. + +MasqMail provides (a yet simple) mechanism to rewrite headers, also +depending on the current connection. This makes it possible to deliver +messages with a return address on the local network which will be +rewitten at delivery time. The purpose of this is: + +- to allow delivery failure messages that are produced on the local +network to be delivered immediately, while those that are produced +outside can be delivered to a mailbox on the internet, to be retrieved +later. + +- to give mail servers a return address which they can accept if they +check for spam mail. Many mail servers require a return address which +has the same domain as the server it is getting the message from. If +you normally connect to only one provider, this is usually not a +problem as you can configure your mailer to a fixed address (but then +there is still the problem with the failure messages...), but it is a +problem if you use different ones from time to time. + +MasqMail shall once be a complete replacement for sendmail (or other +MTAs such as exim, qmail or smail) on a local network, but it is NOT +supposed to be installed in a network with a permanent internet +connection (at least if it is not behind a secure firewall) because +it has no ability to check for undesired relaying or spam filtering. + +Missing, but soon to be realized features: + +- .forward file support (alias file is supported) +- mailer demon messages (mail from the server in cases of delivery failures +or malformed addresses) + +Future plans are: + +- initiate connections on its own +- integration to the masqdialer system (mserver) as an option +- possibly a pop3 server + +For installation instructions, see INSTALL. + +Bugs: MasqMail is still very young, and there are probably at lot of +bugs in it. I need every bug reported to me! If you do, please send me +the configuration files, the logs, the version, and a good description +on how to reproduce the error. The more bug reports I get, the better +masqmail will get! + +CREDITS: +-------- + +I would like to thank everyone who has submitted suggestions and bug +reports. Special thanks to: + +Gregor Hoffleit for beta testing and his suggestions for delivering +mail immediately when online. +Gregor Hoffleit again for supplying a patch which made maqmail work with mutt. +And again for making the Debian package. And more patches. + +Dale Perkel for patiently trying to make MM compile and run with libc5 and +various bug reports. + +Andre Masloch for finding most bugs. + +Edouard G. Parmelan for many patches and bug reports + +Iain Lea for the Redhat spec file + +...and many others +-- +Oliver Kurth +http://masqmail.cx/ +last change: Feb. 3, 2000 diff -r 000000000000 -r 08114f7dcc23 TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TODO Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,21 @@ +general: +- look carefully were memory is not freed +- add forwarding support +- improve Mailer-Daemon error messages +- ODMR support +- temporary delivery delay notifications + +conf: +- more configuration options +- make conf more fool proof + +pop: +- multidrop support + +lookup: +- optimize MX lookup + +...update this file from time to time... + +...and (you guessed it): +- bug fixing diff -r 000000000000 -r 08114f7dcc23 acconfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/acconfig.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,29 @@ +#undef DEF_MAIL_GROUP +#undef DEF_MAIL_USER + +/* Define if you want to use lockfile library. */ +#undef USE_LIBLOCKFILE + +#undef ENABLE_DEBUG + +#undef ENABLE_RESOLVER + +#undef ENABLE_SMTP_SERVER + +#undef ENABLE_POP3 + +#undef ENABLE_AUTH + +#undef ENABLE_MAILDIR + +#undef USE_LIB_CRYPTO + +#undef ENABLE_IDENT + +#undef ENABLE_MSERVER + +#undef CONF_DIR + +#undef DATA_DIR + +#undef SBINDIR diff -r 000000000000 -r 08114f7dcc23 aclocal.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aclocal.m4 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1018 @@ +# generated automatically by aclocal 1.7.9 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 10 + +AC_PREREQ([2.54]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.7.9])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# serial 5 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + : > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# isc-posix.m4 serial 2 (gettext-0.11.2) +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. + +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +if test $pkg_failed = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met. +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details.])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details. + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + diff -r 000000000000 -r 08114f7dcc23 agenda-config.site --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agenda-config.site Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,71 @@ +# config.site for configure +# Agenda Vr3 TARGET + +# You could put this file to /usr/local/mipsel-linux/etc/agenda-config.site + +# run with +# CONFIG_SITE=/wherever/you/store/it/agenda-config.site ./configure +# or +# export CONFIG_SITE=/wherever/you/store/it/agenda-config.site +# if this is going to be a whole compilation orgy + +# Modified from the one provided by Bradley D. LaRonde + +# Edited by Andrej Cedilnik + +# Used some of solutions by Tilman Vogel + +HOSTCC=gcc + +# Names of the cross-compilers +CC=mipsel-linux-gcc +CXX=mipsel-linux-gcc + +# The cross compiler specific options +CFLAGS="-s -mips2 -O2 -fno-exceptions" +CXXFLAGS="-s -mips2 -O2 -fno-exceptions -I/usr/mipsel-linux/include/g++" +CPPFLAGS="-s -mips2 -O2 -fno-exceptions -I/usr/mipsel-linux/include/g++" +LDFLAGS="-s -mips2" + +# Some other programs +AR=mipsel-linux-ar +RANLIB=mipsel-linux-ranlib +NM=mipsel-linux-nm +ac_cv_path_NM=mipsel-linux-nm +ac_cv_func_setpgrp_void=yes +host=mipsel-linux +#prefix=/usr/mipsel-linux +x_includes=/usr/mipsel-linux/include +x_libraries=/usr/mipsel-linux/X11R6/lib + +# These are for GNU shellutils +jm_cv_have_proc_uptime=yes +jm_cv_func_working_gnu_strftime=yes + +# Some options for ease of compiling python +ac_cv_sizeof_int=4 +ac_cv_sizeof_char=1 +ac_cv_sizeof_short=2 +ac_cv_sizeof_float=4 +ac_cv_sizeof_double=8 +ac_cv_sizeof_pthread_t=4 +ac_cv_sizeof_long=4 +ac_cv_sizeof_void_p=4 +ac_cv_sizeof_long_long=8 +ac_cv_sizeof_off_t=4 +ac_cv_sizeof_fpos_t=4 +ac_cv_sizeof_time_t=4 + +# Some other stuff nobody knows why +bad_forward=no +LDSHARED='mipsel-linux-gcc -msoft-float -shared' +ac_cv_malloc_zero=nonnull + +# squeak wants this +# can't do misaligned access to doubles +ac_cv_double_align=no +# dunno what order doubles are in +ac_cv_double_order=no + +ac_cv_header_wchar_h=no + diff -r 000000000000 -r 08114f7dcc23 config.guess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.guess Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1466 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-08-03' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 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) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -r 000000000000 -r 08114f7dcc23 config.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.h.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,183 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ +#undef DEF_MAIL_GROUP +#undef DEF_MAIL_USER + +/* Define if you want to use lockfile library. */ +#undef USE_LIBLOCKFILE + +#undef ENABLE_DEBUG + +#undef ENABLE_RESOLVER + +#undef ENABLE_SMTP_SERVER + +#undef ENABLE_POP3 + +#undef ENABLE_AUTH + +#undef ENABLE_MAILDIR + +#undef USE_LIB_CRYPTO + +#undef ENABLE_IDENT + +#undef ENABLE_MSERVER + +#undef CONF_DIR + +#undef DATA_DIR + +#undef SBINDIR + +/* The configuration file location */ +#undef CONF_DIR + +/* The data directory */ +#undef DATA_DIR + +/* The mail group */ +#undef DEF_MAIL_GROUP + +/* The mail user */ +#undef DEF_MAIL_USER + +/* If AUTH is enabled */ +#undef ENABLE_AUTH + +/* If debugging is enabled */ +#undef ENABLE_DEBUG + +/* If ident is enabled */ +#undef ENABLE_IDENT + +/* If Maildirs are enabled */ +#undef ENABLE_MAILDIR + +/* If mserver support is enabled */ +#undef ENABLE_MSERVER + +/* If the POP3 support is enabled */ +#undef ENABLE_POP3 + +/* If the resolver is to be used */ +#undef ENABLE_RESOLVER + +/* If the SMTP server is enabled */ +#undef ENABLE_SMTP_SERVER + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fdatasync' function. */ +#undef HAVE_FDATASYNC + +/* Define to 1 if your system has a working POSIX `fnmatch' function. */ +#undef HAVE_FNMATCH + +/* Define to 1 if you have the `getline' function. */ +#undef HAVE_GETLINE + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* The sbin directory */ +#undef SBINDIR + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* If liblockfile is to be used */ +#undef USE_LIBLOCKFILE + +/* If libcrypto is available */ +#undef USE_LIB_CRYPTO + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff -r 000000000000 -r 08114f7dcc23 config.sub --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.sub Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -r 000000000000 -r 08114f7dcc23 configure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,7269 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for masqmail 0.2.21. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='masqmail' +PACKAGE_TARNAME='masqmail' +PACKAGE_VERSION='0.2.21' +PACKAGE_STRING='masqmail 0.2.21' +PACKAGE_BUGREPORT='oku@debian.org' + +ac_unique_file="src/masqmail.c" +ac_default_prefix=/usr +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +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' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_GLIB_CFLAGS_set=${GLIB_CFLAGS+set} +ac_env_GLIB_CFLAGS_value=$GLIB_CFLAGS +ac_cv_env_GLIB_CFLAGS_set=${GLIB_CFLAGS+set} +ac_cv_env_GLIB_CFLAGS_value=$GLIB_CFLAGS +ac_env_GLIB_LIBS_set=${GLIB_LIBS+set} +ac_env_GLIB_LIBS_value=$GLIB_LIBS +ac_cv_env_GLIB_LIBS_set=${GLIB_LIBS+set} +ac_cv_env_GLIB_LIBS_value=$GLIB_LIBS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures masqmail 0.2.21 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of masqmail 0.2.21:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + --disable-resolver disable resolver support + --disable-debug disable debugging + --disable-smtp-server disable smtp server support + --disable-pop3 disable pop3 support + --enable-auth enable AUTH (RFC 2554) client support + --enable-maildir enable qmail style maildir support + --enable-ident enable ident (RFC 1413) support + --enable-mserver enable mserver support + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-user=USER set user mail + --with-group=GROUP set group trusted + --with-glib-static=path link glib statically (path mandatory!) + --with-libcrypto use libcrypto + --with-liblockfile use liblock (for Debian) + --with-logdir=DIR set log directory /var/masqmail + --with-spooldir=DIR set spool directory /var/spool/masqmail + --with-confdir directory for configuration /etc/masqmail + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd "$ac_popdir" + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +masqmail configure 0.2.21 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by masqmail $as_me 0.2.21, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" + +am__api_version="1.7" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='masqmail' + VERSION='0.2.21' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + : > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + + echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 +echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 +if test "${ac_cv_lib_cposix_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cposix_strerror=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_cposix_strerror=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 +echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 +if test $ac_cv_lib_cposix_strerror = yes; then + LIBS="$LIBS -lcposix" +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for GLIB" >&5 +echo $ECHO_N "checking for GLIB... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null` +else + pkg_failed=yes +fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null` +else + pkg_failed=yes +fi +else + pkg_failed=untried +fi + +if test $pkg_failed = yes; then + GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0"` + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" 1>&5 + + { { echo "$as_me:$LINENO: error: Package requirements (glib-2.0) were not met. +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details." >&5 +echo "$as_me: error: Package requirements (glib-2.0) were not met. +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details." >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively you may set the GLIB_CFLAGS and GLIB_LIBS environment variables +to avoid the need to call pkg-config. See the pkg-config man page for +more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi + + + +# Check whether --enable-resolver or --disable-resolver was given. +if test "${enable_resolver+set}" = set; then + enableval="$enable_resolver" + if test "$enable_resolver" != 'no'; then + resolver_enabled='yes' + fi +else + resolver_enabled='yes' + +fi; + +if test "$resolver_enabled" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_RESOLVER 1 +_ACEOF + + echo "$as_me:$LINENO: checking for res_search in -lc" >&5 +echo $ECHO_N "checking for res_search in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_res_search+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_search (); +int +main () +{ +res_search (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_res_search=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_res_search=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_res_search" >&5 +echo "${ECHO_T}$ac_cv_lib_c_res_search" >&6 +if test $ac_cv_lib_c_res_search = yes; then + need_resolv=no +else + need_resolv=yes +fi + + if test "$need_resolv" = yes; then + echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5 +echo $ECHO_N "checking for res_search in -lresolv... $ECHO_C" >&6 +if test "${ac_cv_lib_resolv_res_search+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char res_search (); +int +main () +{ +res_search (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_resolv_res_search=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_resolv_res_search=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5 +echo "${ECHO_T}$ac_cv_lib_resolv_res_search" >&6 +if test $ac_cv_lib_resolv_res_search = yes; then + has_resolv=yes +else + { { echo "$as_me:$LINENO: error: \"no libresolv\"" >&5 +echo "$as_me: error: \"no libresolv\"" >&2;} + { (exit 1); exit 1; }; } +fi + + RESOLV_LIBS='-lresolv' + else + RESOLV_LIBS='' + fi +else + RESOLV_LIBS='' +fi + + + +for ac_func in getline +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +for ac_func in fdatasync +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + +for ac_header in fcntl.h sys/time.h syslog.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to oku@debian.org ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_pid_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking for working POSIX fnmatch" >&5 +echo $ECHO_N "checking for working POSIX fnmatch... $ECHO_C" >&6 +if test "${ac_cv_func_fnmatch_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Some versions of Solaris, SCO, and the GNU C Library + # have a broken or incompatible fnmatch. + # So we run a test program. If we are cross-compiling, take no chance. + # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. + if test "$cross_compiling" = yes; then + ac_cv_func_fnmatch_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +# define y(a, b, c) (fnmatch (a, b, c) == 0) +# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) + +int +main () +{ +exit + (!(y ("a*", "abc", 0) + && n ("d*/*1", "d/s/1", FNM_PATHNAME) + && y ("a\\\\bc", "abc", 0) + && n ("a\\\\bc", "abc", FNM_NOESCAPE) + && y ("*x", ".x", 0) + && n ("*x", ".x", FNM_PERIOD) + && 1)); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fnmatch_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_fnmatch_works=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_works" >&5 +echo "${ECHO_T}$ac_cv_func_fnmatch_works" >&6 +if test $ac_cv_func_fnmatch_works = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FNMATCH 1 +_ACEOF + +fi + + + +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_signal=int +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + +for ac_func in strftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 +echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_strftime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strftime (); +int +main () +{ +strftime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_strftime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_intl_strftime=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 +if test $ac_cv_lib_intl_strftime = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF + +LIBS="-lintl $LIBS" +fi + +fi +done + + +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +echo "$as_me:$LINENO: checking for _doprnt" >&5 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 +if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case declares _doprnt. + For example, HP-UX 11i declares gettimeofday. */ +#define _doprnt innocuous__doprnt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _doprnt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +char (*f) () = _doprnt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != _doprnt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func__doprnt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func__doprnt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6 +if test $ac_cv_func__doprnt = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOPRNT 1 +_ACEOF + +fi + +fi +done + + + + + + +for ac_func in select socket strerror strstr +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +# Check whether --with-user or --without-user was given. +if test "${with_user+set}" = set; then + withval="$with_user" + +fi; +if test "x$with_user" = 'x'; then + with_user='mail' +fi + + +# Check whether --with-group or --without-group was given. +if test "${with_group+set}" = set; then + withval="$with_group" + +fi; +if test "x$with_group" = 'x'; then + with_group='trusted' +fi + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + if test "x$enable_debug" != 'xno'; then + debug_enabled='yes' + fi +else + debug_enabled='yes' + +fi; +if test "x$debug_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_DEBUG 1 +_ACEOF + +fi + + +cat >>confdefs.h <<_ACEOF +#define DEF_MAIL_USER "${with_user}" +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define DEF_MAIL_GROUP "${with_group}" +_ACEOF + + + + +# Check whether --with-glib_static or --without-glib_static was given. +if test "${with_glib_static+set}" = set; then + withval="$with_glib_static" + +fi; +if test "x$with_glib_static" != 'x'; then + GLIB_LIBS=$with_glib_static + +fi + +MD5_LIBS='' +BASE64_LIBS='' + +# Check whether --enable-smtp_server or --disable-smtp_server was given. +if test "${enable_smtp_server+set}" = set; then + enableval="$enable_smtp_server" + if test "x$enable_smtp_server" != 'xno'; then + smtp_server_enabled='yes' + fi +else + smtp_server_enabled='yes' + +fi; +if test "x$smtp_server_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_SMTP_SERVER 1 +_ACEOF + +fi + +# Check whether --enable-pop3 or --disable-pop3 was given. +if test "${enable_pop3+set}" = set; then + enableval="$enable_pop3" + if test "x$enable_pop3" != 'xno'; then + pop3_enabled='yes' + fi +else + pop3_enabled='yes' + +fi; +if test "x$pop3_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_POP3 1 +_ACEOF + +# MD5_LIBS='md5/libmd5c.a' + need_md5='yes' +fi + +# Check whether --enable-auth or --disable-auth was given. +if test "${enable_auth+set}" = set; then + enableval="$enable_auth" + if test "x$enable_auth" != 'xno'; then + auth_enabled='yes' + fi +fi; +if test "x$auth_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_AUTH 1 +_ACEOF + + BASE64_LIBS='base64/libbase64.a' +# MD5_LIBS='md5/libmd5c.a' + need_md5='yes' +fi + + +# Check whether --enable-maildir or --disable-maildir was given. +if test "${enable_maildir+set}" = set; then + enableval="$enable_maildir" + if test "x$enable_maildir" != 'xno'; then + maildir_enabled='yes' + fi +fi; +if test "x$maildir_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MAILDIR 1 +_ACEOF + +fi + + +# Check whether --with-libcrypto or --without-libcrypto was given. +if test "${with_libcrypto+set}" = set; then + withval="$with_libcrypto" + +fi; +if test "x$with_libcrypto" != 'xyes'; then + with_libcrypto='no' +fi + +if test "x$need_md5" = 'xyes'; then + if test "x$with_libcrypto" = "xyes"; then + echo "$as_me:$LINENO: checking for MD5 in -lcrypto" >&5 +echo $ECHO_N "checking for MD5 in -lcrypto... $ECHO_C" >&6 +if test "${ac_cv_lib_crypto_MD5+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char MD5 (); +int +main () +{ +MD5 (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_crypto_MD5=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypto_MD5=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_MD5" >&6 +if test $ac_cv_lib_crypto_MD5 = yes; then + has_crypto='yes' +else + { { echo "$as_me:$LINENO: error: 'no libcrypto'" >&5 +echo "$as_me: error: 'no libcrypto'" >&2;} + { (exit 1); exit 1; }; } +fi + + if test "x$has_crypto" = 'xyes'; then + +cat >>confdefs.h <<\_ACEOF +#define USE_LIB_CRYPTO 1 +_ACEOF + + MD5_LIBS='-lcrypto' + fi + else + MD5_LIBS='md5/libmd5c.a' + fi +fi + + +IDENT_LIBS='' +# Check whether --enable-ident or --disable-ident was given. +if test "${enable_ident+set}" = set; then + enableval="$enable_ident" + if test "x$enable_ident" != 'xno'; then + ident_enabled='yes' + fi +fi; + +if test "x$ident_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_IDENT 1 +_ACEOF + + echo "$as_me:$LINENO: checking for ident_id in -lident" >&5 +echo $ECHO_N "checking for ident_id in -lident... $ECHO_C" >&6 +if test "${ac_cv_lib_ident_ident_id+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lident $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ident_id (); +int +main () +{ +ident_id (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ident_ident_id=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ident_ident_id=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ident_ident_id" >&5 +echo "${ECHO_T}$ac_cv_lib_ident_ident_id" >&6 +if test $ac_cv_lib_ident_ident_id = yes; then + IDENT_LIBS='-lident' +else + IDENT_LIBS='libident/libident.a' +fi + +fi + + +# Check whether --enable-mserver or --disable-mserver was given. +if test "${enable_mserver+set}" = set; then + enableval="$enable_mserver" + if test "x$enable_mserver" != 'xno'; then + mserver_enabled='yes' + fi +fi; +if test "x$mserver_enabled" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MSERVER 1 +_ACEOF + +fi + + +# Check whether --with-liblockfile or --without-liblockfile was given. +if test "${with_liblockfile+set}" = set; then + withval="$with_liblockfile" + +fi; +if test "x$with_liblockfile" != 'x'; then + with_liblockfile='yes' +fi +if test "x$with_liblockfile" = xyes; then + echo "$as_me:$LINENO: checking for maillock in -llockfile" >&5 +echo $ECHO_N "checking for maillock in -llockfile... $ECHO_C" >&6 +if test "${ac_cv_lib_lockfile_maillock+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llockfile $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char maillock (); +int +main () +{ +maillock (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_lockfile_maillock=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_lockfile_maillock=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_maillock" >&5 +echo "${ECHO_T}$ac_cv_lib_lockfile_maillock" >&6 +if test $ac_cv_lib_lockfile_maillock = yes; then + has_lockfile=yes +else + { { echo "$as_me:$LINENO: error: \"no liblockfile\"" >&5 +echo "$as_me: error: \"no liblockfile\"" >&2;} + { (exit 1); exit 1; }; } +fi + + LOCKFILE_LIBS='-llockfile' + +cat >>confdefs.h <<\_ACEOF +#define USE_LIBLOCKFILE 1 +_ACEOF + +else + LOCKFILE_LIBS='' +fi + + + + +# Check whether --with-logdir or --without-logdir was given. +if test "${with_logdir+set}" = set; then + withval="$with_logdir" + +else + with_logdir='/var/log/masqmail/' + +fi; + + + +# Check whether --with-spooldir or --without-spooldir was given. +if test "${with_spooldir+set}" = set; then + withval="$with_spooldir" + +else + with_spooldir='/var/spool/masqmail/' + +fi; + + + +# Check whether --with-confdir or --without-confdir was given. +if test "${with_confdir+set}" = set; then + withval="$with_confdir" + +else + with_confdir='/etc/masqmail' + +fi; + +cat >>confdefs.h <<_ACEOF +#define CONF_DIR "${with_confdir}" +_ACEOF + + + +test "x$prefix" = xNONE && prefix="$ac_default_prefix" + +cat >>confdefs.h <<_ACEOF +#define DATA_DIR "`eval echo \""$datadir"\"`/masqmail" +_ACEOF + + +if test "x${exec_prefix}" != 'xNONE'; then + +cat >>confdefs.h <<_ACEOF +#define SBINDIR "${exec_prefix}/sbin" +_ACEOF + +else + if test "x${prefix}" != 'xNONE'; then + cat >>confdefs.h <<_ACEOF +#define SBINDIR "${prefix}/sbin" +_ACEOF + + else + cat >>confdefs.h <<_ACEOF +#define SBINDIR "/usr/sbin" +_ACEOF + + fi +fi + + 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" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by masqmail $as_me 0.2.21, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +masqmail config.status 0.2.21 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "debian/Makefile" ) CONFIG_FILES="$CONFIG_FILES debian/Makefile" ;; + "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/man/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/man/Makefile" ;; + "docs/xml/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/xml/Makefile" ;; + "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/base64/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/base64/Makefile" ;; + "src/md5/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/md5/Makefile" ;; + "src/libident/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libident/Makefile" ;; + "suse/masqmail.spec" ) CONFIG_FILES="$CONFIG_FILES suse/masqmail.spec" ;; + "redhat/masqmail.spec" ) CONFIG_FILES="$CONFIG_FILES redhat/masqmail.spec" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t +s,@GLIB_LIBS@,$GLIB_LIBS,;t t +s,@RESOLV_LIBS@,$RESOLV_LIBS,;t t +s,@with_user@,$with_user,;t t +s,@with_group@,$with_group,;t t +s,@BASE64_LIBS@,$BASE64_LIBS,;t t +s,@MD5_LIBS@,$MD5_LIBS,;t t +s,@has_ident@,$has_ident,;t t +s,@IDENT_LIBS@,$IDENT_LIBS,;t t +s,@LOCKFILE_LIBS@,$LOCKFILE_LIBS,;t t +s,@USE_LIBLOCKFILE@,$USE_LIBLOCKFILE,;t t +s,@with_logdir@,$with_logdir,;t t +s,@with_spooldir@,$with_spooldir,;t t +s,@with_confdir@,$with_confdir,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff -r 000000000000 -r 08114f7dcc23 configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure.ac Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,289 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT(masqmail, 0.2.21, oku@debian.org) +AC_CONFIG_SRCDIR([src/masqmail.c]) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE() + +AC_PREFIX_DEFAULT(/usr) + +dnl Checks for programs. + +dnl Checks for libraries. + +AC_PROG_CC +AC_ISC_POSIX +AC_STDC_HEADERS +dnl AC_ARG_PROGRAM +AC_PROG_RANLIB + +PKG_CHECK_MODULES(GLIB, glib-2.0) +AC_SUBST(GLIB_LIBS) +AC_SUBST(GLIB_CFLAGS) + +dnl resolver support (default is use it) +AC_ARG_ENABLE(resolver, + [ --disable-resolver disable resolver support], + if test "$enable_resolver" != 'no'; then + resolver_enabled='yes' + fi, + resolver_enabled='yes' + ) + +if test "$resolver_enabled" = yes; then + AC_DEFINE(ENABLE_RESOLVER, 1, [If the resolver is to be used]) +dnl checks necessary for libc5: +dnl if there is res_search in libc, it is probably libc5 +dnl if not, it is probably libc6 and we need libresolv + AC_CHECK_LIB(c, res_search, need_resolv=no, need_resolv=yes) + if test "$need_resolv" = yes; then + AC_CHECK_LIB(resolv, res_search,has_resolv=yes,AC_MSG_ERROR("no libresolv")) + RESOLV_LIBS='-lresolv' + else + RESOLV_LIBS='' + fi +else + RESOLV_LIBS='' +fi +AC_SUBST(RESOLV_LIBS) + +dnl if there is no getline, we define it using getdelim in src/masqmail.h +AC_CHECK_FUNCS(getline) + +dnl if there is no fdatasync, we define it to fsync in src/masqmail.h +AC_CHECK_FUNCS(fdatasync) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM + +dnl Checks for library functions. +AC_FUNC_FNMATCH +AC_TYPE_SIGNAL +AC_FUNC_STRFTIME +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(select socket strerror strstr) + +dnl user and group configuration +AC_ARG_WITH(user, + [ --with-user=USER set user [mail]], + ) +if test "x$with_user" = 'x'; then + with_user='mail' +fi + +AC_ARG_WITH(group, + [ --with-group=GROUP set group [trusted]], + ) +if test "x$with_group" = 'x'; then + with_group='trusted' +fi + +dnl debugging support (default is use it) +AC_ARG_ENABLE(debug, + [ --disable-debug disable debugging], + if test "x$enable_debug" != 'xno'; then + debug_enabled='yes' + fi, + debug_enabled='yes' + ) +if test "x$debug_enabled" = xyes; then + AC_DEFINE(ENABLE_DEBUG, 1, [If debugging is enabled]) +fi + +AC_DEFINE_UNQUOTED(DEF_MAIL_USER, "${with_user}", [The mail user]) +AC_SUBST(with_user) +AC_DEFINE_UNQUOTED(DEF_MAIL_GROUP, "${with_group}", [The mail group]) +AC_SUBST(with_group) + +dnl link glib statically? +AC_ARG_WITH(glib_static, + [ --with-glib-static=path link glib statically (path mandatory!)], + ) +if test "x$with_glib_static" != 'x'; then + GLIB_LIBS=$with_glib_static + AC_SUBST(GLIB_LIBS) +fi + +dnl optional features +MD5_LIBS='' +BASE64_LIBS='' + +dnl smtp server support (default is use it) +AC_ARG_ENABLE(smtp_server, + [ --disable-smtp-server disable smtp server support], + if test "x$enable_smtp_server" != 'xno'; then + smtp_server_enabled='yes' + fi, + smtp_server_enabled='yes' + ) +if test "x$smtp_server_enabled" = xyes; then + AC_DEFINE(ENABLE_SMTP_SERVER, 1, [If the SMTP server is enabled]) +fi + +dnl pop support (default is use it) +AC_ARG_ENABLE(pop3, + [ --disable-pop3 disable pop3 support], + if test "x$enable_pop3" != 'xno'; then + pop3_enabled='yes' + fi, + pop3_enabled='yes' + ) +if test "x$pop3_enabled" = xyes; then + AC_DEFINE(ENABLE_POP3, 1, [If the POP3 support is enabled]) +# MD5_LIBS='md5/libmd5c.a' + need_md5='yes' +fi + +dnl auth support (default is to not use it) +AC_ARG_ENABLE(auth, + [ --enable-auth enable AUTH (RFC 2554) client support], + if test "x$enable_auth" != 'xno'; then + auth_enabled='yes' + fi, + ) +if test "x$auth_enabled" = xyes; then + AC_DEFINE(ENABLE_AUTH, 1, [If AUTH is enabled]) + BASE64_LIBS='base64/libbase64.a' +# MD5_LIBS='md5/libmd5c.a' + need_md5='yes' +fi +AC_SUBST(BASE64_LIBS) + +dnl maildir support (default is to not use it) +AC_ARG_ENABLE(maildir, + [ --enable-maildir enable qmail style maildir support], + if test "x$enable_maildir" != 'xno'; then + maildir_enabled='yes' + fi, + ) +if test "x$maildir_enabled" = xyes; then + AC_DEFINE(ENABLE_MAILDIR, 1, [If Maildirs are enabled]) +fi + +dnl libcrypto +AC_ARG_WITH(libcrypto, + [ --with-libcrypto use libcrypto], + ) +if test "x$with_libcrypto" != 'xyes'; then + with_libcrypto='no' +fi + +if test "x$need_md5" = 'xyes'; then +dnl check whether we have md5 in libcrypto if md5 needed and we shall link with libcrypto + if test "x$with_libcrypto" = "xyes"; then + AC_CHECK_LIB(crypto, MD5, has_crypto='yes', AC_MSG_ERROR('no libcrypto')) + if test "x$has_crypto" = 'xyes'; then + AC_DEFINE(USE_LIB_CRYPTO, 1, [If libcrypto is available]) + MD5_LIBS='-lcrypto' + fi + else + MD5_LIBS='md5/libmd5c.a' + fi +fi +AC_SUBST(MD5_LIBS) + +dnl ident support (default is to not use it) +IDENT_LIBS='' +AC_ARG_ENABLE(ident, + [ --enable-ident enable ident (RFC 1413) support], + if test "x$enable_ident" != 'xno'; then + ident_enabled='yes' + fi, + ) +AC_SUBST(has_ident) +if test "x$ident_enabled" = xyes; then + AC_DEFINE(ENABLE_IDENT, 1, [If ident is enabled]) + AC_CHECK_LIB(ident, ident_id, IDENT_LIBS='-lident', IDENT_LIBS='libident/libident.a') +fi +AC_SUBST(IDENT_LIBS) + +dnl mserver support (default is to not use it) +AC_ARG_ENABLE(mserver, + [ --enable-mserver enable mserver support], + if test "x$enable_mserver" != 'xno'; then + mserver_enabled='yes' + fi, + ) +if test "x$mserver_enabled" = xyes; then + AC_DEFINE(ENABLE_MSERVER, 1, [If mserver support is enabled]) +fi + +dnl liblockfile +AC_ARG_WITH(liblockfile, + [ --with-liblockfile use liblock (for Debian)], + ) +if test "x$with_liblockfile" != 'x'; then + with_liblockfile='yes' +fi +if test "x$with_liblockfile" = xyes; then + AC_CHECK_LIB(lockfile, maillock, has_lockfile=yes, AC_MSG_ERROR("no liblockfile")) + LOCKFILE_LIBS='-llockfile' + AC_DEFINE(USE_LIBLOCKFILE, 1, [If liblockfile is to be used]) +else + LOCKFILE_LIBS='' +fi +AC_SUBST(LOCKFILE_LIBS) +AC_SUBST(USE_LIBLOCKFILE) + +dnl log and spool directories +AC_ARG_WITH(logdir, + [ --with-logdir=DIR set log directory [/var/masqmail]], + , + with_logdir='/var/log/masqmail/' + ) +AC_SUBST(with_logdir) + +AC_ARG_WITH(spooldir, + [ --with-spooldir=DIR set spool directory [/var/spool/masqmail]], + , + with_spooldir='/var/spool/masqmail/' + ) +AC_SUBST(with_spooldir) + +dnl configuration file +AC_ARG_WITH(confdir, + [ --with-confdir directory for configuration [/etc/masqmail]], + , + with_confdir='/etc/masqmail' + ) +AC_DEFINE_UNQUOTED(CONF_DIR, "${with_confdir}", [The configuration file location]) +AC_SUBST(with_confdir) + +dnl well, /me/ thought that autoconf should make things _easy_ ... +test "x$prefix" = xNONE && prefix="$ac_default_prefix" +AC_DEFINE_UNQUOTED(DATA_DIR, "`eval echo \""$datadir"\"`/masqmail", [The data directory]) + +dnl gymnastics to get the correct path where masqmail should be installed +dnl we need this to call ourselves in failmsg.c +if test "x${exec_prefix}" != 'xNONE'; then + AC_DEFINE_UNQUOTED(SBINDIR, "${exec_prefix}/sbin", [The sbin directory]) +else + if test "x${prefix}" != 'xNONE'; then + AC_DEFINE_UNQUOTED(SBINDIR, "${prefix}/sbin") + else + AC_DEFINE_UNQUOTED(SBINDIR, "/usr/sbin") + fi +fi + +AC_OUTPUT(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 + ) diff -r 000000000000 -r 08114f7dcc23 debian/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,24 @@ +EXTRA_DIST = \ +README.Debian \ +README.online \ +changelog \ +control \ +copyright \ +dirs \ +docs \ +mailq.8 \ +mailrm.8 \ +masqmail.config \ +masqmail.init \ +masqmail.ip-up \ +masqmail.links \ +masqmail.logrotate \ +masqmail.templates \ +newaliases \ +newaliases.8 \ +postinst \ +postrm \ +preinst \ +rules \ +sendmail.8 \ +masqmail.lintian diff -r 000000000000 -r 08114f7dcc23 debian/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,287 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +EXTRA_DIST = \ +README.Debian \ +README.online \ +changelog \ +control \ +copyright \ +dirs \ +docs \ +mailq.8 \ +mailrm.8 \ +masqmail.config \ +masqmail.init \ +masqmail.ip-up \ +masqmail.links \ +masqmail.logrotate \ +masqmail.templates \ +newaliases \ +newaliases.8 \ +postinst \ +postrm \ +preinst \ +rules \ +sendmail.8 \ +masqmail.lintian + +subdir = debian +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am TODO +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu debian/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 debian/README.Debian --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/README.Debian Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,38 @@ + +MasqMail for Debian +------------------- + +This is the Debian package of my MasqMail MTA. + +masqmail is an MTA specially designed for hosts with intermittent +internet connections, i.e. hosts (or networks) at home or notebooks. It has +special support for changing providers. It works both for sending mail +(replacing exim, sendmail, postfix or qmail) and receiving mail (replacing +fetchmail, but it also works in conjunction with fetchmail). + +Special support for 'changing providers' means individual configurations +depending on the current connection to the internet and rewriting of sender +addresses. + +It has been compiled with the options: + --prefix=/usr --mandir='$${prefix}/share/man' \ + --with-logdir=/var/log/masqmail \ + --with-spooldir=/var/spool/masqmail \ + --with-user=mail --with-group=mail \ + --with-confdir=/etc/masqmail \ + --with-liblockfile \ + --enable-auth \ + --enable-ident \ + --enable-maildir + +i.e. with ESMTP AUTH support, with ident support and with Maildir support. + +You will find all information necessary to configure masqmail in the man +pages masqmail (8), masqmail.conf (5), masqmail.route (5), masqmail.get (5) +and masqmail.aliases (5). Its configuration files live in the directory +/etc/masqmail/ and in /etc/aliases. + +For more information about masqmail see +http://masqmail.cx/masqmail + +Oliver Kurth Tue, 16 Apr 2002 13:44:18 +0200 diff -r 000000000000 -r 08114f7dcc23 debian/README.online --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/README.online Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,92 @@ +Different methods for online detection +-------------------------------------- + +/etc/ppp/peers/ +------------------------- + +The scripts /etc/ppp/ip-{up,down}.d/{1,99}masqmail make use of the variable +$IPPARAM, which you can defibe in your /etc/ppp/peers/ +configuration with the ippparam option, eg: + +ippparam arcor + +If this is set, $IPPARAM will be written to a 'route' file. Using some +awk magic, the scripts finds out which file you have defined for +online detection (if online_detect=file) and writes the value of +$IPPARAM to this file. masqmail then uses this file to determine its +online status. + + +/etc/network/interfaces +----------------------- + +You can use the /etc/network/interfaces script to tell masqmail +when a link goes up, and masqmail shall flush its queue and/or fetch mail. + +This is an example for a static interface: + +iface eth0 inet static + # mroute/name used by ip-up.d/masqmail BDL May02 + name SNRC + address 130.130.10.233 + netmask 255.255.255.0 + gateway 130.130.10.254 + +(This example is from Ben Low. Thanks, Ben :-)) + +If you use masqmail on a notebook, you can define several interfaces, +depending on the network you are in. Read +/usr/share/doc/ifupdown/examples/interfaces.gz +for examples. + +The scripts /etc/network/if-{up,down}.d/1masqmail make use of the NAME +in the same way as the /etc/ppp/ip-{up,down}.d/ scripts. See above. + + +guessnet and /etc/network/interfaces +------------------------------------ + +Another nice tool is guessnet. See /usr/share/doc/guessnet/README.gz, +if you have guessnet installed. You can use it in combination with the +method described above for /etc/network/interfaces. + + +guessnet and the 'online_pipe' option +------------------------------------- + +Alternatively you can also use guessnet directly to check the online +status. To do this, set in +/etc/masqmail/masqmail.conf + +# +online_detect=pipe +online_pipe="/usr/bin/guessnet < /etc/masqmail/guessnet.conf" +# + +and create a file +/etc/masqmail/guessnet.conf + +Example: +192.168.0.35 00:10:5A:24:C5:B6 192.168.0.1 default +192.168.2.1 00:80:AD:97:D5:2D 192.168.0.1 home + + +masqdialer and the 'online_pipe' option +--------------------------------------- + +Yet another possibility for ppp dialups is masqdialer: + +Example: +# +online_detect=pipe +online_pipe="/usr/bin/mservdetect 192.168.1.2 224" +# + +This is useful if you have a gateway with masqdialer running +and masqmail on another host behind ('behind' as seen from the internet) + +Note: +The online detect method 'mserver' is deprecated, and this debian +package comes with that option disabled. You can still recompile the +package with the ./configure option --enable-mserver, but this may be +removed in future version of masqmail. diff -r 000000000000 -r 08114f7dcc23 debian/TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/TODO Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,2 @@ +- ip-up, ip-down script for online_detect=file +- better Debian docs diff -r 000000000000 -r 08114f7dcc23 debian/changelog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/changelog Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,395 @@ +masqmail (0.2.21-1) unstable; urgency=low + + * security fixes (closes: #329307) + - do not use shell when executing sub programs + - do not accept backtick in email adresses + - write log files as 'mail' user + * changed default online status file to /var/run/masqmail/masqmail-route + (closes: #332841) + * depend on debconf | debconf-2.0 (closes: #332023) + * add debug.log to logrotate script (closes: #332960) + * fix typo in templates ('failure') (closes: #224273) + * use glib2 instead of old glib1.2 (closes: #337921) + + -- Oliver Kurth Sat, 17 Sep 2005 13:45:11 -0700 + +masqmail (0.2.20-1) unstable; urgency=low + + * new upstream version + * regard connect_error_fail when failing for pipes (closes: #186364) + + -- Oliver Kurth Tue, 03 Jun 2003 17:56:07 +0200 + +masqmail (0.2.19-1) unstable; urgency=low + + * new upstream version (closes: #182950) + * fixed typos (closes: #171780, #178752) + * added IFUP_IFACES to /etc/default/masqmail + * changed maintainer address to oku@debian.org + + -- Oliver Kurth Wed, 12 Mar 2003 21:33:53 +0100 + +masqmail (0.2.18-1) unstable; urgency=low + + * new upstream version (delivery delay warnings also if connection fails) + * fixed typo in man page (Closes: #171813) + + -- Oliver Kurth Mon, 02 Dec 2002 16:38:22 +0100 + +masqmail (0.2.17-1) unstable; urgency=low + + * new upstream version (delivery delay warnings) + + -- Oliver Kurth Thu, 28 Nov 2002 15:05:53 +0100 + +masqmail (0.2.16-1) unstable; urgency=low + + * new upstream version (debugging works again) + + -- Oliver Kurth Tue, 12 Nov 2002 17:27:13 +0100 + +masqmail (0.2.15-1) unstable; urgency=low + + * new upstream version, other changes see ChangeLog + * security fixes (buffer overflows) + + -- Oliver Kurth Wed, 06 Nov 2002 13:27:39 +0100 + +masqmail (0.2.14-1) unstable; urgency=low + + * new upstream version, other changes see ChangeLog + * included examples for the route locations in masqmail.conf + (Closes: #166207) + * removed bashisms from debian/masqmail.config (== -> =) + * remote_port option works again (Closes: #163850) + (but it is marked as deprecated) + + -- Oliver Kurth Wed, 16 Oct 2002 17:51:40 +0200 + +masqmail (0.2.11-2) unstable; urgency=low + + * ip-up scripts: chmod online file only if it exists + * ip-up scripts: swapped -go and -qo + (brain dead bug :-(, closes: #158385) + * init script: tell which services are started/stopped + (all of these were noted by Christop Hertel. Thanx :-)) + * removed quotes from daemon args in init script (closes: #157164) + (somehow this bug reappeared) + + -- Oliver Kurth Thu, 15 Aug 2002 21:43:24 +0200 + +masqmail (0.2.11-1) unstable; urgency=low + + * removed quotes from daemon args in init script + * deleted emacs local variables from bottom of this file. + * new upstream version, other changes see ChangeLog + (closes: #155021) + + -- Oliver Kurth Mon, 5 Aug 2002 22:12:44 +0200 + +masqmail (0.2.10-2) unstable; urgency=low + + * call /etc/init.d/masqmail stop in config, + so service is stopped when called with dpkg-reconfigure + (closes: #151528) + * removed call to message, + do not try to write masqmail.conf if user does not want + to move it away (closes: #151549) + * remove superfluous 'fi' in ip-up script + + -- Oliver Kurth Mon, 1 Jul 2002 21:44:57 +0200 + +masqmail (0.2.10-1) unstable; urgency=low + + * make ip-up scripts useful also for detect methods other than file + * Added a note for the deprecated /etc/pcmcia/ip-up.d/ scripts. + * use debconf + * rewrote init and /etc/ppp/ip-up.d/ scripts, + removed /etc/pcmcia/ip-up.d/ scripts and added + /etc/network/if-up.d/ scripts (closes: #145500) + (Thanks, Ben Low :-)) + * new file README.online, which describes various + methods for online detection + * new upstream version, other changes see ChangeLog + + -- Oliver Kurth Thu, 27 Jun 2002 12:36:49 +0200 + +masqmail (0.2.9-1) unstable; urgency=low + + * use dpkg --compare-versions in preinst for upgrades + from very old versions. + * fixed segfault when called with -t (closes: #147890) + * pipe output for reloading masqmail to /dev/null (closes: #146704) + * listen only on localhost:25 by default (closes: #134384) + * added mbox_default=mda in conf file (closes: #143592) + * new upstream version, + other changes see ChangeLog + + -- Oliver Kurth Fri, 24 May 2002 16:26:40 +0200 + +masqmail (0.2.8-1) unstable; urgency=low + + * New maintainer: oku@masqmail.cx, sponsored + by Thimo Neubauer + * new upstream version, (closes: #100594), + other changes see ChangeLog + * uses ESMTP LOGIN (closes: #129795) + * use /etc/mailname for host_name (closes: #134385) + * get daemon (closes: #134422) + * uncommented alias_file option (closes: #136653) + + -- Oliver Kurth Mon, 8 Apr 2002 01:00:02 +0200 + +masqmail (0.1.16-2) unstable; urgency=low + + * Orphan the package (maintainer set to qa@packages.debian.org). + * src/connect.c: If last character of hostname is a digit, we conclude + that the hostname will be an IP address (closes: #138124). + * Make masqmail use /var/mail instead of /var/spool/mail (closes: #134383). + + -- Gregor Hoffleit Tue, 26 Mar 2002 09:53:43 +0100 + +masqmail (0.1.16-1) unstable; urgency=low + + * New upstream version: bug fixes: + - PowerPC fix for varargs functions + - g_free fix in src/conf.c + + -- Gregor Hoffleit Mon, 31 Dec 2001 18:02:29 +0100 + +masqmail (0.1.15-1) unstable; urgency=low + + * New upstream version: + this is a security fix release. When an alias expansion expands to a + pipe, only the effective uid was changed to mail, but not the real uid. + This way, a command could gain root privileges. This is no longer + possible, masqmail drops prvileges completely before executing the pipe + command (closes: #102092). + * src/conf.c: Correct a typo (bugfix from upstream). Maybe this fixes the + spurious segfault on m68k (#100594). + * Add a dependency on netbase (closes: #101273). + * Don't install the example configuration file for masqmail.conf in + /etc/masqmail/, it's available in /usr/share/doc/masqmail/examples + (closes: #101457). + + -- Gregor Hoffleit Thu, 19 Jul 2001 22:57:13 +0200 + +masqmail (0.1.14-1) unstable; urgency=low + + * New upstream version: + - correct error reply for lacking permissions (closes: #92894, + was already fixed in 0.1.13-2). + - fixed 'last line missing' bug + - fixed spool locking bug: lock was deleted if unsuccessful + (unlocking it) + + -- Gregor Hoffleit Fri, 27 Apr 2001 21:09:51 +0200 + +masqmail (0.1.13-2) unstable; urgency=low + + * Change priority from optional to extra. + + -- Gregor Hoffleit Fri, 6 Apr 2001 16:07:36 +0200 + +masqmail (0.1.13-1) unstable; urgency=low + + * New upstream version: + - qualify address for get configuration. + - better checking for valid From: address when retrieving mail via pop3 + and this is used as the return path. + + -- Gregor Hoffleit Wed, 28 Mar 2001 23:09:06 +0200 + +masqmail (0.1.12-1) unstable; urgency=low + + * New upstream version e.g.: + + - support for pipes in routes + - a wrapper can now be used for POP and SMTP + - an MDA for local mail delivery can be used + - bug fixes + + For a complete list of changes since 0.1.7, see changelog and NEWS. + + * Add a patch by Edouard G. Parmelan : + - run daemon in queue mode. + - add support for PPP and PCMCIA startup scripts. + - add /etc/logrotate.d script. + - suggests logrotate. + + -- Gregor Hoffleit Wed, 14 Mar 2001 21:31:31 +0100 + +masqmail (0.1.7-2) unstable; urgency=low + + * Add debhelper to Build-Depends (closes: #76380). + + -- Gregor Hoffleit Mon, 6 Nov 2000 20:59:16 +0100 + +masqmail (0.1.7-1) unstable; urgency=low + + * New upstream version: + + - debug option can be changed for privileged users only + - fixed a security hole: -C option for unprivileged users now implies + run_as_user and drops _all_ privileges + - environment variables for pipe transport + - wildcards for map_* options + - rearranged interface handling, IP addresses now possible for + listen_addresses and mserver_iface + - beautified masqmail.c + - revised uid and gid settings in spool.c and local.c (pipe transport) + - optionally use ident protocol (RFC 1413) and store user id in + spool file + - proper spool file locking + + * i.e. the new upstream version includes fixes for the security problems + tackled in 0.1.6-2. + * We have compiled with libident support (--enable-ident). + + -- Gregor Hoffleit Sun, 22 Oct 2000 09:37:56 +0200 + +masqmail (0.1.6-2) unstable; urgency=low + + * Security bugfix: An unprivileged user could use masqmail -C' + (use alternative configuration file) and/or -d' (enable debug output) + for exploits. We disable these options for non-privileged users + (#74422 will be closed by the upload of 0.0.12-3 to stable). + + -- Gregor Hoffleit Sun, 15 Oct 2000 20:42:04 +0200 + +masqmail (0.1.6-1) unstable; urgency=low + + * New upstream version: + + - MasqMail can now retrieve mail with pop3 (new option -g) + - also supports SMTP after POP + - supports ESMTP AUTH as client (only CRAM-MD5 supported for now) + - `-qo' without a connection name works now + - new command line option `-Mrm' to remove mails from queue + - many bug fixes, e.g. + - fixed the segfault caused by unqualified recipient addresses + (closes: #69112) + - documentation in html format has been removed; instead, there's + a complete set of man pages. + + For a complete list of new features and bugs fixed since 0.0.12, please + refer to the changelog file. + + * Include Build-Dependencies (closes: #65514). + * Compiled with POP3 and AUTH support. + * Fixed a typo in example.route: must be "pop3_login" (not pop_login). + * configuration file masqmail.conf has been moved into /etc/masqmail/. + + -- Gregor Hoffleit Sat, 7 Oct 2000 12:49:01 +0200 + +masqmail (0.0.12-2) frozen unstable; urgency=low + + * Just found and fixed another important bug: newaliases (aka + masqmail -bi) would hang infinitely and therefore break postinst + scripts of various packages. A very small fix in src/masqmail.c. + + -- Gregor Hoffleit Wed, 29 Mar 2000 23:34:38 +0200 + +masqmail (0.0.12-1) frozen unstable; urgency=low + + * New upstream version: Bugfixes only (should go into frozen, since it + fixes an RC bug:) + - setegid in local.c (closes: #58893) + - set len for getsockname + - set local_net_routes to NULL if there is no local net + - warn if spool file could not be deleted + - say 'mail queue is empty' if mail queue is empty + * Moved mailq from /usr/sbin to /usr/bin (cf. exim et al). + + -- Gregor Hoffleit Wed, 29 Mar 2000 14:25:08 +0200 + +masqmail (0.0.11-1) frozen unstable; urgency=low + + * New upstream version: Bugfixes only compared to 0.0.10. + + * To the archive maintainer: I think this version should replace the + version 0.0.8-3, which is currently in frozen: + + Compared with upstream 0.0.8, the only new features are + - support to read certain configuration options from files. + - support for aliases in /etc/aliases. This is a necessary feature + to comply with Debian policy (closes: #58885). + + Then, there are a few bug fixes since 0.0.11 wrt RFC 822 compliance. + + -- Gregor Hoffleit Sat, 4 Mar 2000 17:40:56 +0100 + +masqmail (0.0.10-1) unstable; urgency=low + + * New upstream version: + - includes our liblockfile support. + - support for aliases (fixes: #58885). + * To conform with Debian policy, we include an shell script + /usr/bin/newaliases, that calls sendmail -bi (which has no effect + with MasqMail). + + -- Gregor Hoffleit Tue, 29 Feb 2000 13:37:18 +0100 + +masqmail (0.0.9-2) unstable; urgency=low + + * This release only has a small change in debian/rules that fixes an + important bug: /usr/sbin/masqmail was not installed setuid root and + therefore failed to work if suidmanager was not present at install + time. In frozen, this bug was fixed simultanously by 0.0.8-3. + + -- Gregor Hoffleit Thu, 24 Feb 2000 22:13:01 +0100 + +masqmail (0.0.9-1) unstable; urgency=low + + * New upstream version. + + -- Gregor Hoffleit Fri, 11 Feb 2000 13:30:10 +0100 + +masqmail (0.0.8-3) frozen; urgency=high + + * This release only has a small change in debian/rules that fixes an + important bug: /usr/sbin/masqmail was not installed setuid root and + therefore failed to work if suidmanager was not present at install + time (closes: Bug#58886, Bug#58893). + + -- Gregor Hoffleit Thu, 24 Feb 2000 13:16:41 +0100 + +masqmail (0.0.8-2) frozen unstable; urgency=low + + * Now new code, just a simple fix to the command line parsing, + therefore this upload is targetted for frozen. + * Patch to allow '--' on command line before the email adress, mimicking + sendmail's behavior. Necessary to make Debian's mutt package work with + masqmail, and therefore should go into frozen (closes: Bug#56341 + masqmail: Mutt can't send emails through masqmail). + * Therefore updates to the man page. + * Changed Oliver's address and the MasqMail homepage in all documents. + + -- Gregor Hoffleit Fri, 28 Jan 2000 11:51:06 +0100 + +masqmail (0.0.8-1) unstable; urgency=low + + * New upstream version. + * Made the source compile on both slink and potato. + + -- Gregor Hoffleit Fri, 29 Oct 1999 10:40:27 +0200 + +masqmail (0.0.3-1slink) stable; urgency=low + + * New upstream version. + * Compiled for slink. + + -- Gregor Hoffleit Mon, 4 Oct 1999 14:44:27 +0200 + +masqmail (0.0.2-1) unstable; urgency=low + + * New upstream version. + + -- Gregor Hoffleit Sat, 25 Sep 1999 12:32:02 +0200 + +masqmail (0.0.1-1) unstable; urgency=low + + * Initial Release. + + -- Gregor Hoffleit Wed, 15 Sep 1999 14:07:55 +0200 + diff -r 000000000000 -r 08114f7dcc23 debian/control --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/control Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,23 @@ +Source: masqmail +Section: mail +Priority: extra +Maintainer: Oliver Kurth +Standards-Version: 3.5.7 +Build-Depends: debhelper (>> 3.0), liblockfile-dev, libglib2.0-dev, libident-dev + +Package: masqmail +Architecture: any +Depends: ${shlibs:Depends}, debconf (>> 0.5) | debconf-2.0, netbase +Replaces: mail-transport-agent +Provides: mail-transport-agent +Suggests: mail-reader, logrotate +Conflicts: mail-transport-agent +Description: A mailer for hosts without permanent internet connection + MasqMail is a MTA (mail transport agent) and POP3 client for hosts + that don't have a permanent internet connection, eg. a home network + or a single host at home and notebooks. It has special support for + connections to different ISPs. + . + In these cases, MasqMail is a slim replacement for full-blown MTAs + such as sendmail, exim, qmail or postfix. The POP3 client can be + a small replacement for other full-featured tools like fetchmail. diff -r 000000000000 -r 08114f7dcc23 debian/copyright --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/copyright Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,29 @@ +This is Debian prepackaged version of MasqMail, a small mail transport agent +for hosts without a permanent internet connection. + +This package is maintained by Oliver Kurth . Its source +can be obtained from + + http://masqmail.cx/masqmail/ + +Upstream author: Oliver Kurth + + + Copyright (C) 1999 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. diff -r 000000000000 -r 08114f7dcc23 debian/dirs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/dirs Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,12 @@ +etc/masqmail +usr/sbin +usr/bin +var/log +var/spool +var/run/masqmail +etc/logrotate.d +etc/ppp/ip-up.d +etc/ppp/ip-down.d +etc/network/if-up.d +etc/network/if-down.d +usr/share/lintian/overrides diff -r 000000000000 -r 08114f7dcc23 debian/docs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/docs Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +AUTHORS INSTALL NEWS README TODO debian/README.online diff -r 000000000000 -r 08114f7dcc23 debian/mailq.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/mailq.8 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +.so man8/masqmail.8 diff -r 000000000000 -r 08114f7dcc23 debian/mailrm.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/mailrm.8 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +.so man8/masqmail.8 diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.config Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,192 @@ +#!/bin/bash -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +db_version 2.0 + +# This conf script is capable of backing up +db_capb backup + +if [ x"$1" = x"configure" ] ; then + if [ -n $2 ] ; then + if dpkg --compare-versions "$2" lt "0.2.10-0.2" ; then + PCMCIA_SCRIPT_UP=/etc/pcmcia/ip-up.d/1masqmail + PCMCIA_SCRIPT_DOWN=/etc/pcmcia/ip-down.d/99masqmail + if [ -x $PCMCIA_SCRIPT_UP ] || [ -x $PCMCIA_SCRIPT_DOWN ] ; then + chmod -x $PCMCIA_SCRIPT_UP $PCMCIA_SCRIPT_DOWN + db_input high masqmail/note_pcmcia_scripts || true; + db_go + fi + fi + fi +fi + +if [ x"$1" = x"configure" ] ; then + if [ -n $2 ] ; then + if dpkg --compare-versions "$2" lt "0.2.17-1" ; then + db_input medium masqmail/note_moved_tpl || true; + db_go + fi + fi +fi + +# shamelessly copied from xserver-common.config. +# Thanks to Branden. :-) + +CONFIGFILE=/etc/masqmail/masqmail.conf + +ASK_TO_REPLACE= +if [ -e $CONFIGFILE ]; then + # does the file have debconf markers in it? + if egrep -q '^### BEGIN DEBCONF SECTION' $CONFIGFILE && \ + egrep -q '^### END DEBCONF SECTION' $CONFIGFILE; then + PRIORITY=medium + else + ASK_TO_REPLACE=yes + PRIORITY=high + fi +else + PRIORITY=medium + # this is for the postinst, which tests this: + db_set masqmail/move_existing_nondebconf_config "true" +fi + +# use debconf to manage configuration file? +db_input $PRIORITY masqmail/manage_config_with_debconf || true +db_go +db_get masqmail/manage_config_with_debconf +if [ "$RET" = "false" ]; then + exit 0 +fi + +# move existing configuration file out of +# the way? +if [ x"$ASK_TO_REPLACE" = x"yes" ]; then + db_input $PRIORITY masqmail/move_existing_nondebconf_config || true + db_go + db_get masqmail/move_existing_nondebconf_config || true + if [ "$RET" = "true" ]; then + mv $CONFIGFILE $CONFIGFILE.debconf-backup + else + exit 0 + fi +fi + +if [ -f /etc/mailname ] ; then + hostfqdn=`cat /etc/mailname` +else + hostfqdn=`hostname -f` +fi +hostname=`hostname` + +db_fget masqmail/host_name seen +if [ "$RET" = "false" ]; then + db_set masqmail/host_name ${hostfqdn} +fi +db_fget masqmail/local_hosts seen +if [ "$RET" = "false" ]; then + db_set masqmail/local_hosts "localhost;${hostname};${hostfqdn}" +fi + +STATE=1 +while [ "$STATE" != 0 -a "$STATE" != 19 ]; do + case "$STATE" in + 1) + db_input medium masqmail/host_name || true + ;; + 2) + db_input medium masqmail/local_hosts || true + ;; + 3) + db_input medium masqmail/local_nets || true + ;; + 4) + db_input medium masqmail/listen_addresses || true + ;; + 5) + db_input low masqmail/use_syslog || true + ;; + 6) + db_input medium masqmail/online_detect || true + ;; + 7) + db_get masqmail/online_detect + if [ "$RET" = "file" ] ; then + db_input low masqmail/online_file || true + else + db_input medium masqmail/online_pipe || true + fi + ;; + 8) + db_input medium masqmail/mbox_default || true + ;; + 9) + db_get masqmail/mbox_default + if [ "$RET" = "mda" ] ; then + db_input medium masqmail/mda || true + else + db_input low masqmail/mda || true + fi + ;; + 10) + db_input low masqmail/alias_local_caseless || true + ;; + 11) + db_input low masqmail/init_smtp_daemon || true + ;; + 12) + db_input low masqmail/init_queue_daemon || true + ;; + 13) + db_get masqmail/init_queue_daemon + if [ "$RET" = "true" ] ; then + db_input low masqmail/queue_daemon_ival || true + fi + ;; + 14) + db_input medium masqmail/init_fetch_daemon || true + ;; + 15) + db_get masqmail/init_fetch_daemon + if [ "$RET" = "true" ] ; then + db_input low masqmail/fetch_daemon_ival || true + fi + ;; + 16) + db_input medium masqmail/ipup_runqueue || true + ;; + 17) + db_input medium masqmail/ipup_fetch || true + ;; + 18) + db_input medium masqmail/ifup_ifaces || true + ;; + + esac + + if db_go; then + STATE=$(($STATE + 1)) + else + STATE=$(($STATE - 1)) + fi +done + +db_input medium masqmail/you_are_not_finished || true +db_go + +# dpkg-reconfigure does not stop services: +# (cause of Bug#151528) +# in debhelper version < 1.2.9 + +DH_VERSION=`dpkg -l debconf | awk ' /^ii/ { print $3 }'` + +if dpkg --compare-versions $DH_VERSION lt "1.2.9" ; then + if [ x"$1" = x"reconfigure" ] ; then + if [ -x "/etc/init.d/masqmail" ]; then + /etc/init.d/masqmail stop || true + fi + fi +fi + +exit 0 diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.init --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.init Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,104 @@ +#!/bin/sh +# /etc/init.d/masqmail +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux by Ian Murdock . +# Modified for exim by Tim Cutts +# Modified for masqmail by Gregor Hoffleit +# Modified for masqmail by Oliver Kurth + +set -e + +# If you disable this file, masqmail can be run from /etc/inetd.conf +#exit 0 + +# defaults, do not edit here but in +# /etc/default/masqmail +INIT_SMTP_DAEMON=true +INIT_QUEUE_DAEMON=true +INIT_FETCH_DAEMON=false +QUEUE_DAEMON_IVAL=-q10m +FETCH_DAEMON_IVAL=-go5m + +RUN_DIR=/var/run/masqmail + +[ -r /etc/default/masqmail ] && . /etc/default/masqmail + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/masqmail +NAME=masqmail +DESC="MTA (masqmail)" + +test -x $DAEMON || exit 0 + +if [ ! -f /etc/masqmail/masqmail.conf ] ; then + echo "you have to configure masqmail first." + exit 0 +fi + +if [ x"$INIT_SMTP_DAEMON" = x"true" ] || [ x"$INIT_QUEUE_DAEMON" = x"true" ] ; then + DAEMON_ARGS= + if [ x"$INIT_SMTP_DAEMON" = x"true" ] ; then + DAEMON_ARGS=-bd + fi + + if [ x"$INIT_QUEUE_DAEMON" = x"true" ] ; then + DAEMON_ARGS="$DAEMON_ARGS $QUEUE_DAEMON_IVAL" + fi + INIT_DAEMON=true +else + INIT_DAEMON=false +fi + +case "$1" in + start) + echo -n "Starting $DESC: " + if [ x"$INIT_DAEMON" = x"true" ] ; then + update-inetd --disable smtp + start-stop-daemon --start --startas $DAEMON \ + --pidfile $RUN_DIR/masqmail.pid -- $DAEMON_ARGS + echo -n " listen/queue" + fi + if [ x"$INIT_FETCH_DAEMON" = x"true" ] ; then + start-stop-daemon --start --startas $DAEMON \ + --pidfile $RUN_DIR/masqmail-get.pid -- $FETCH_DAEMON_IVAL + echo -n " fetch" + fi + echo "." + ;; + stop) + echo -n "Stopping $DESC: " + if [ -f $RUN_DIR/masqmail.pid ] ; then + start-stop-daemon --stop --oknodo --retry 1 --name $NAME --pidfile $RUN_DIR/masqmail.pid + update-inetd --enable smtp + echo -n " listen/queue" + fi + if [ -f $RUN_DIR/masqmail-get.pid ] ; then + start-stop-daemon --stop --oknodo --retry 1 --name $NAME --pidfile $RUN_DIR/masqmail-get.pid + echo -n " fetch" + fi + echo "." + ;; + restart) + $0 stop + $0 start + ;; + reload|force-reload) + echo -n "Reloading $DESC configuration files: " + if [ -f $RUN_DIR/masqmail.pid ] ; then + start-stop-daemon --stop --signal 1 --pidfile $RUN_DIR/masqmail.pid + echo -n " listen/queue" + fi + if [ -f $RUN_DIR/masqmail-get.pid ] ; then + start-stop-daemon --stop --signal 1 --pidfile $RUN_DIR/masqmail-get.pid + echo -n " fetch" + fi + echo "." + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.ip-up --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.ip-up Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,71 @@ +#!/bin/sh + +# Exit if package was removed but not purged. +test -x /usr/sbin/masqmail || exit 0 + +# defaults, do not edit here but in +# /etc/default/masqmail +IPUP_RUNQUEUE=true +IPUP_FETCH=true + +[ -r /etc/default/masqmail ] && . /etc/default/masqmail + +if [ -n "$PPP_IFACE" ]; then + SCHEME="$PPP_IPPARAM" + IFACE=$PPP_IFACE +else + SCHEME="${IF_MROUTE:-$IF_NAME}" +fi + +if [ ! x"$IFUP_IFACES" = x"all" ] ; then + echo $IFUP_IFACES | grep $IFACE > /dev/null || exit 0 +fi + +DETECT="`awk -F'[ \t]*=[ \t]*' '/^online_detect/ \ + { print split($2,A,\"\\\"\") == 3 ? A[2] : $2 }' /etc/masqmail/masqmail.conf`" + +if [ x"$DETECT" = x"file" ] ; then + ROUTEFILE="`awk -F'[ \t]*=[ \t]*' '/^online_file/ \ + { print split($2,A,\"\\\"\") == 3 ? A[2] : $2 }' /etc/masqmail/masqmail.conf`" + + if [ -z "$ROUTEFILE" ]; then + echo "no online_file defined in /etc/masqmail/masqmail.conf" + exit 1 + fi +fi + +if [ -z "$MODE" ]; then + case `dirname "$0"` in + */if-up.d|*/ip-up.d) + MODE=start; + ;; + */if-down.d|*/ip-down.d) + MODE=stop; + ;; + esac +fi + +case "$MODE" in + start) + if [ -n "$SCHEME" ] ; then + echo -n "$SCHEME" > "$ROUTEFILE" + chmod 0644 "$ROUTEFILE" + fi + if [ x"$IPUP_RUNQUEUE" = x"true" ] ; then + /usr/sbin/masqmail -qo & + fi + if [ x"$IPUP_FETCH" = x"true" ] ; then + /usr/sbin/masqmail -go & + fi + ;; + stop) + rm -f "$ROUTEFILE" + ;; + *) + echo "$0: unknown MODE" + ;; +esac + +exit 0 + + diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.links --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.links Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,5 @@ +/usr/sbin/masqmail /usr/lib/sendmail +/usr/sbin/masqmail /usr/sbin/sendmail +/usr/sbin/masqmail /usr/bin/mailq +/usr/sbin/masqmail /usr/bin/mailrm + diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.lintian --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.lintian Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,4 @@ +# has to be setuid: +masqmail: setuid-binary usr/sbin/masqmail 4755 root/root +# worked around that in debian/masqmail.config: +masqmail: init-script-suggests-versioned-depends postinst diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.logrotate --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.logrotate Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,22 @@ +/var/log/masqmail/masqmail.log { + rotate 2 + weekly + compress + delaycompress + missingok + notifempty + postrotate + /etc/init.d/masqmail reload > /dev/null + endscript +} +/var/log/masqmail/debug.log { + rotate 2 + weekly + compress + delaycompress + missingok + notifempty + postrotate + /etc/init.d/masqmail reload > /dev/null + endscript +} diff -r 000000000000 -r 08114f7dcc23 debian/masqmail.templates --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/masqmail.templates Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,267 @@ +Template: masqmail/note_moved_tpl +Type: note +Description: Failure notice templates have been moved + The delivery failure notices that lived in /etc/masqmail/tpl are now in + /usr/share/masqmail/tpl/. + . + You will notice this only if you have changed the location in + masqmail.conf or changed the templates. + . + Since they are no longer conffiles because of the move, you should + give a customized version another name, otherwise it will be + overwritten on the next upgrade. + +Template: masqmail/note_pcmcia_scripts +Type: note +Description: Removed executable bit in scripts in /etc/pcmcia/ip-{up,down}.d/ + The scripts in /etc/pcmcia/ip-{up,down}.d/ are deprecated + and are replaced with the scripts /etc/network/if-{up,down}.d/1masqmail, which + will work for _any_ network card (not just pcmcia). The executable bit of the + old scripts has been removed, because otherwise they and the new scripts would be + exececuted, which is not desired. + . + You should remove these scripts from /etc/pcmcia/ip-{up,down}.d/. If you still want + to use them, just reset the executable bit. + . + Whatever you do, you will never see the note again. + +Template: masqmail/manage_config_with_debconf +Type: boolean +Default: true +Description: Manage masqmail.conf using debconf? + The /etc/masqmail/masqmail.conf file can be handled automatically + by debconf, or manually by you. + . + Note that only specific, marked sections of the configuration file will be + handled by debconf if you select this option; if those markers are absent, + you will have to update the file manually, or move or delete the file. + +Template: masqmail/move_existing_nondebconf_config +Type: boolean +Default: false +Description: Replace existing /etc/masqmail/masqmail.conf file? + The existing /etc/masqmail/masqmail.conf file currently on the system does + not contain a marked section for debconf to write its data. + . + If you select this option, the existing configuration + file will be backed up to /etc/masqmail/masqmail.conf.debconf-backup and a + new file written to /etc/masqmail/masqmail.conf. If you do not select this + option, the existing configuration file will not be managed by debconf, + and no further questions about masqmail configuration will be + asked. + +Template: masqmail/host_name +Type: string +Default: +Description: The name with which masqmail identifies itself to others + This is most likely your hostname. It is used in its SMTP greeting + banner, for expanding unqualified addresses, the Message ID and so on. + +Template: masqmail/local_hosts +Type: string +Default: +Description: hosts considered local + This is a list of hosts, separated with semicolons (;), which are + considered 'local', ie. mail to this host will be delivered to a + mailbox (or Maildir or MDA) on this host. + . + You will most likely insert 'localhost', your hostname in its fully + qualified version, and just the simple hostname here. + . + You can also use wildcard expressions like '*' and '?'. + +Template: masqmail/local_nets +Type: string +Default: +Description: nets considered local, for immediate delivery attempts + This is a list of hosts, separated with semicolons (;), which are + on your local network, ie. they are always reachable, without a + dialup connection. Mail to these hosts will be delivered immediately, + without checking for the online status. + . + You can use wildcards expressions like '*' and '?', eg. *.yournet.local + . + If you have only one box, you can leave this empty. If you do not want + to use masqmail as an offline MTA, and the whole internet or another mail + server which accepts outgoing mail is all time + reachable to you, just insert '*'. + +Template: masqmail/listen_addresses +Type: string +Default: localhost:25 +Description: accept connections on these interfaces + masqmail, for security reasons, does not listen an all network interfaces + by default. If there are no other hosts connected to your host, just leave + this 'localhost:25'. If there are other hosts that may want to send SMTP + messages to this host, add the address of you network interface here, + eg.: localhost:25;192.168.1.2:25. + . + Of course you can also replace the '25' with another port number, but + this is unusual. + +Template: masqmail/use_syslog +Type: boolean +Default: false +Description: use syslogd for logs? + You can decide whether masqmail should log via syslog or not. If not, + logs will be written to /var/log/masqmail/masqmail.log. + +Template: masqmail/online_detect +Type: select +Choices: file, pipe +Default: file +Description: the online detection method + masqmail has different methods to determine whether it is online or not, + these are 'file','pipe'. + . + For 'file', masqmail checks for the existence of a file, and, if it + exists, reads from it the name of the connection. + . + For 'pipe', masqmail calls a program or script, which outputs the name + if online or nothing if not. You can use eg. the program guessnet for this. + +Template: masqmail/online_file +Type: string +Default: /var/run/masqmail-route +Description: the name of the file to determine the online status + +Template: masqmail/online_pipe +Type: string +Default: +Description: the name of the program to determine the online status + Note that, when this program is called, masqmail has the user id 'mail'. + +Template: masqmail/mbox_default +Type: select +Choices: mbox, mda, maildir +Default: mbox +Description: local delivery style + Local mail can be delivered to a mailbox, to an MDA (eg. procmail) + or to a qmail style maildir in the users home dir. + . + You can select the default style here. You can configure this also + on a per-user basis with the options mbox_users, mda_users and + maildir_users. + +Template: masqmail/mda +Type: string +Default: /usr/bin/procmail -Y -d ${rcpt_local} +Description: The MDA command line including options + Give here the path to the mda, including its arguments. You can use + substitution values here, eg. ${rcpt_local} for the user name. + . + For other substitutions please see the man page. + . + (This question is also asked if you did not set mbox_default to mda, + since you can use mda for a set of users specially) + +Template: masqmail/alias_local_caseless +Type: boolean +Default: false +Description: Alias expansion regarding case or not + masqmail uses the file /etc/aliases to redirect local addresses. + The search for a match in /etc/aliases can be regarding upper/lower + case or insensitive to case. + +Template: masqmail/init_smtp_daemon +Type: boolean +Default: true +Description: Start SMTP listening daemon? + Select 'yes' if you want masqmail to start as an SMTP listening + daemon. You will need this if: + . + - there are other hosts in your local network that may want to send mail via this host + . + - you use a mail client that sends mail via SMTP (netscape, mozilla are examples) + . + If in doubt, select 'yes'. + +Template: masqmail/init_queue_daemon +Type: boolean +Default: true +Description: Start SMTP queue running daemon? + Select 'yes' if you want masqmail to start as a queue running daemon. You will + need this very likely. It is used for mail that cannot delivered immediately, + either because of delivery failures or because you were not online on + the first attempt to send a mail. + . + If in doubt, select 'yes'. + +Template: masqmail/queue_daemon_ival +Type: string +Default: -q10m +Description: The interval for the queue running daemon + Set the interval for the queue running daemon. -q10m means flush the queue every + 10 minutes. + . + The format is -q, followed by an numeric value and one of the letters s,m,h,d,w for + seconds, minutes, hours, days or weeks respectively. + . + Reasonable values are between 5 minutes (-q5m) and 2 hours (-q2h). + +Template: masqmail/init_fetch_daemon +Type: boolean +Default: false +Description: Start POP3 fetch daemon? + Select 'yes' if you want masqmail to start as a fetch daemon. If you say 'yes', + masqmail will try to fetch mail from pop servers that you configure in regular + intervals, detecting the online status first. + . + No matter what you choose here, you can later select whether you want to fetch + mail the moment you get online. + +Template: masqmail/fetch_daemon_ival +Type: string +Default: -go5m +Description: The interval for the fetch daemon + Set the interval for the fetch daemon. -go5m means try to fetch mail every + 5 minutes. + . + The format is -go, followed by an numeric value and one of the letters s,m,h,d,w for + seconds, minutes, hours, days or weeks respectively. + . + Reasonable values are between 2 minutes (-go2m) and 2 hours (-go2h). + +Template: masqmail/ipup_runqueue +Type: boolean +Default: true +Description: flush mail queue when you get online? + Select 'yes' if you want masqmail to immediately flush its mail queue as soon + as you go online. This will be done in the ip-up script in /etc/ppp/ip-up or + in /etc/network/if-up.d/. + +Template: masqmail/ipup_fetch +Type: boolean +Default: false +Description: fetch mail when you get online? + Select 'yes' if you want masqmail to immediately fetch mail from POP3 + servers as soon as you go online. This will be done in the ip-up script + in /etc/ppp/ip-up or in /etc/network/if-up.d/. + +Template: masqmail/ifup_ifaces +Type: string +Default: all +Description: a list of interfaces used for masqmail online detection + Set this to a list of network interfaces. When any of those interfaces go + up, the current online status will be used for queue runs and/or fetching + mails. The list will be used in the /etc/ppp/ip-up and /etc/network/if-up.d/ + scripts, when the interface goes up. + . + A reasonable choice is eg. 'ppp0' for a desktop at home, or 'ppp0 eth0' for + a notebook". If this is set to eg. 'ppp0', nothing happens if eth0 goes up. + . + Set to 'all' for all interfaces, or 'none' for no interfaces. + +Template: masqmail/you_are_not_finished +Type: note +Description: You are not finished + Although masqmail is not as feature rich as other MTAs like sendmail + or exim, this debconf does not (yet) do all configurations for you. + . + To make use of masqmail, you still have to create some sub configuration + files for sending mail to some ISP and/or to fetch mail. masqmail has + lots of man pages and examples which are hopefully clear enough to + explain to you how to do it. + . + You should start with the man pages masqmail.conf, masqmail.route + and masqmail.get. diff -r 000000000000 -r 08114f7dcc23 debian/newaliases --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/newaliases Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/lib/sendmail -bi diff -r 000000000000 -r 08114f7dcc23 debian/newaliases.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/newaliases.8 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,22 @@ +.TH newaliases 8 +.SH NAME +newaliases \- update /etc/aliases database +.SH SYNOPSIS +.B newaliases + +.SH DESCRIPTION +newaliases is called by many applications to notify the mail transport +agent of changes to the system mail aliases database. +MasqMail doesn't need to be notified of changes to /etc/aliases, therefore +this script does nothing. It is provided only for compatibility with +the sendmail program. + +.SH FILES +/etc/aliases + +.SH SEE ALSO +\fBmasqmail.aliases (5)\f1, \fBmasqmail.conf (5)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.get (5)\f1 + +.SH AUTHOR +This manual page was stitched together by Gregor Hoffleit + for the Debian project. diff -r 000000000000 -r 08114f7dcc23 debian/postinst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/postinst Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,166 @@ +#!/bin/sh -e + +# source debconf library +. /usr/share/debconf/confmodule + +CONFIGFILE=/etc/masqmail/masqmail.conf +WORKTMP=$CONFIGFILE.tmp +DEBCONFTMP=$CONFIGFILE.debconf + +DEFAULTSFILE=/etc/default/masqmail +DEBDEFTMP=$DEFAULTSFILE.debconf + +create_db_conf (){ + rm -f $WORKTMP $DEBCONFTMP + + cat >> $DEBCONFTMP << EOF +### BEGIN DEBCONF SECTION +# Do not edit within this region if you want your changes to be preserved by +# debconf. Instead, make changes after the "### END DEBCONF SECTION" line. +EOF + + db_get masqmail/host_name || true + echo "host_name=\"$RET\"" >> $DEBCONFTMP + db_get masqmail/local_hosts || true + echo "local_hosts=\"$RET\"" >> $DEBCONFTMP + db_get masqmail/local_nets || true + echo "local_nets=\"$RET\"" >> $DEBCONFTMP + db_get masqmail/listen_addresses || true + echo "listen_addresses=\"$RET\"" >> $DEBCONFTMP + + echo "spool_dir=\"/var/spool/masqmail\"" >> $DEBCONFTMP + echo "mail_dir=\"/var/mail\"" >> $DEBCONFTMP + echo "log_dir=\"/var/log/masqmail\"" >> $DEBCONFTMP + echo "do_queue=false" >> $DEBCONFTMP + + db_get masqmail/use_syslog || true + echo "use_syslog=$RET" >> $DEBCONFTMP + + db_get masqmail/online_detect || true + echo "online_detect=$RET" >> $DEBCONFTMP + if [ "$RET" = "file" ] ; then + db_get masqmail/online_file || true + echo "online_file=\"$RET\"" >> $DEBCONFTMP + else + db_get masqmail/online_pipe || true + echo "online_pipe=\"$RET\"" >> $DEBCONFTMP + fi + + db_get masqmail/mbox_default || true + echo "mbox_default=$RET" >> $DEBCONFTMP + db_get masqmail/mda || true + echo "mda=\"$RET\"" >> $DEBCONFTMP + + echo "alias_file=/etc/aliases" >> $DEBCONFTMP + db_get masqmail/alias_local_caseless || true + echo "alias_local_caseless=\"$RET\"" >> $DEBCONFTMP + + cat >> $DEBCONFTMP << EOF +### END DEBCONF SECTION +EOF +} + +write_db_conf (){ + + if [ -e $CONFIGFILE ]; then + # does the file have debconf markers in it? + if egrep -q '^### BEGIN DEBCONF SECTION' $CONFIGFILE && \ + egrep -q '^### END DEBCONF SECTION' $CONFIGFILE; then + # see if the beginning of the file was left alone; sed cannot backtrack in + # an address range + if ! head -1 $CONFIGFILE | egrep -q '^### BEGIN DEBCONF SECTION'; then + # sick, sick, sick + LINES=$(sed -n '1,/^### BEGIN DEBCONF SECTION/p' < $CONFIGFILE | wc -l) + sed -n 1,$(( $LINES - 1 ))p < $CONFIGFILE > $WORKTMP + fi + cat $DEBCONFTMP >> $WORKTMP + sed -n '/^### END DEBCONF SECTION/,$p' < $CONFIGFILE | tail +2 >> $WORKTMP + else + echo "Existing $CONFIGFILE has missing or half-open debconf region;" >&2; + echo "not writing masqmail configuration file." >&2; + exit 1 + fi + else + cat >> $DEBCONFTMP << EOF +# +# include the locations of your route and get configurations here. +# Examples: +# online_routes.default = "/etc/masqmail/default.route" +# online_gets.default = "/etc/masqmail/default.get" +# You can have more of those, with '.default' replaced with other +# names. See man 8 masqmail.conf. +# +EOF + cp $DEBCONFTMP $WORKTMP + fi + + mv $WORKTMP $CONFIGFILE + +# rm -f $WORKTMP $DEBCONFTMP +} + +create_db_defaults () { + cat >> $DEBDEFTMP << EOF +# +# better use 'dpkg-reconfigure masqmail' +# instead of editing by hand +# +EOF + + db_get masqmail/init_smtp_daemon || true + echo "INIT_SMTP_DAEMON=\"$RET\"" >> $DEBDEFTMP + db_get masqmail/init_queue_daemon || true + echo "INIT_QUEUE_DAEMON=\"$RET\"" >> $DEBDEFTMP + db_get masqmail/init_fetch_daemon || true + echo "INIT_FETCH_DAEMON=\"$RET\"" >> $DEBDEFTMP + + echo "#" >> $DEBDEFTMP + + db_get masqmail/queue_daemon_ival || true + echo "QUEUE_DAEMON_IVAL=\"$RET\"" >> $DEBDEFTMP + db_get masqmail/fetch_daemon_ival || true + echo "FETCH_DAEMON_IVAL=\"$RET\"" >> $DEBDEFTMP + + echo "#" >> $DEBDEFTMP + + db_get masqmail/ipup_runqueue || true + echo "IPUP_RUNQUEUE=\"$RET\"" >> $DEBDEFTMP + db_get masqmail/ipup_fetch || true + echo "IPUP_FETCH=\"$RET\"" >> $DEBDEFTMP + + db_get masqmail/ifup_ifaces || true + echo "IFUP_IFACES=\"$RET\"" >> $DEBDEFTMP +} + +write_db_defaults () { + mv $DEBDEFTMP $DEFAULTSFILE +} + +case "$1" in + configure) + + # Create spool and log directories + install -d -omail -gmail /var/log/masqmail + install -d -omail -gmail /var/spool/masqmail + install -d -omail -gmail /var/spool/masqmail/input + install -d -omail -gmail /var/spool/masqmail/lock + install -d -omail -gmail /var/spool/masqmail/popuidl + + db_get masqmail/manage_config_with_debconf || true + if [ "$RET" = "true" ]; then + db_get masqmail/move_existing_nondebconf_config || true + if [ "$RET" = "true" ]; then + create_db_conf + write_db_conf + fi + create_db_defaults + write_db_defaults + fi + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; +esac + +#DEBHELPER# diff -r 000000000000 -r 08114f7dcc23 debian/postrm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/postrm Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,17 @@ +#!/bin/sh -e + +case "$1" in + purge) + # On a purge we also... + # Remove spool and config file + rm -rf /var/log/masqmail /var/spool/masqmail /etc/masqmail + rm -f /etc/default/masqmail + # Remove from inetd.conf + ##update-inetd --remove masqmail + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; +esac + +#DEBHELPER# diff -r 000000000000 -r 08114f7dcc23 debian/preinst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/preinst Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,23 @@ +#!/bin/sh -e + +##$DEBIAN_SCRIPT_DEBUG || set -v -x + +if [ "$1" = "upgrade" ] ; then + if dpkg --compare-versions "$2" lt "0.1.6-1" ; then + + # move config file to new location + if [ -e /etc/masqmail.conf ]; then + if [ ! -d /etc/masqmail ]; then + mkdir /etc/masqmail + mv -f /etc/masqmail.conf /etc/masqmail/ + fi + fi + fi + + if dpkg --compare-versions "$2" le "0.2.20-1" ; then + [ -d /var/log/masqmail ] && chown -R mail:mail /var/log/masqmail/ + fi + +fi + +#DEBHELPER# diff -r 000000000000 -r 08114f7dcc23 debian/rules --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/rules Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,118 @@ +#!/usr/bin/make -f + +export DH_COMPAT=3 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 +DOC = usr/doc +MAN = usr/man +DAT = usr/lib + +export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +# FOR AUTOCONF 2.52 AND NEWER ONLY +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build $(DEB_HOST_GNU_TYPE) +else + confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +endif + +build: build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + ./configure $(confflags) \ + --prefix=/usr --mandir='$${prefix}/share/man' \ + --with-logdir=/var/log/masqmail \ + --with-spooldir=/var/spool/masqmail \ + --with-user=mail --with-group=mail \ + --with-confdir=/etc/masqmail \ + --with-liblockfile \ + --enable-auth \ + --enable-ident \ + --enable-maildir + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + -$(MAKE) distclean + rm -f tests/{test.conf,local.sh,smtpout.sh} + # see /usr/share/doc/autotools-dev/README.Debian.gz + -test -r /usr/share/misc/config.sub && \ + cp -f /usr/share/misc/config.sub config.sub + -test -r /usr/share/misc/config.guess && \ + cp -f /usr/share/misc/config.guess config.guess + rm -f config.log + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/masqmail. + $(MAKE) DESTDIR=`pwd`/debian/masqmail install + rmdir debian/masqmail/var/spool/masqmail/input \ + debian/masqmail/var/spool/masqmail/lock \ + debian/masqmail/var/spool/masqmail/popuidl \ + debian/masqmail/var/spool/masqmail debian/masqmail/var/spool \ + debian/masqmail/var/log/masqmail debian/masqmail/var/log + + rm -f debian/masqmail/usr/bin/expandtest debian/masqmail/usr/bin/readtest + install -m 755 debian/newaliases debian/masqmail/usr/bin/. + install -m 755 debian/masqmail.ip-up debian/masqmail/etc/ppp/ip-up.d/1masqmail + install -m 755 debian/masqmail.ip-up debian/masqmail/etc/network/if-up.d/1masqmail + install -m 755 debian/masqmail.ip-up debian/masqmail/etc/ppp/ip-down.d/99masqmail + install -m 755 debian/masqmail.ip-up debian/masqmail/etc/network/if-down.d/99masqmail + + install -m 644 debian/masqmail.logrotate debian/masqmail/etc/logrotate.d/masqmail + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + cp debian/masqmail.lintian debian/masqmail/usr/share/lintian/overrides/masqmail +# dh_testversion + dh_testdir + dh_testroot + dh_installdebconf + dh_installdocs + rm -f debian/masqmail/usr/share/doc/masqmail/INSTALL + ##cp -r docs debian/masqmail/$(DOC)/masqmail/html + dh_installexamples examples/* tests +# dh_installmenu +# dh_installemacsen + dh_installinit +# dh_installcron + dh_installman debian/mailq.8 debian/mailrm.8 debian/newaliases.8 debian/sendmail.8 +# dh_undocumented + dh_installchangelogs ChangeLog + dh_link + dh_strip + dh_compress + dh_fixperms -X/usr/sbin/masqmail + dh_installdeb + dh_shlibdeps + dh_gencontrol +# dh_makeshlibs + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff -r 000000000000 -r 08114f7dcc23 debian/sendmail.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/sendmail.8 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +.so man8/masqmail.8 diff -r 000000000000 -r 08114f7dcc23 depcomp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/depcomp Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,479 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi + +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff -r 000000000000 -r 08114f7dcc23 docs/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,46 @@ +SUBDIRS=man xml + +man: man/masqmail.8 man/mservdetect.8 man/masqmail.conf.5 man/masqmail.route.5 man/masqmail.get.5 man/masqmail.aliases.5 + +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 + +man/masqmail.8: xml/masqmail.8.xml + xmltoman $< >$@ + +man/mservdetect.8: xml/mservdetect.8.xml + xmltoman $< >$@ + +man/masqmail.conf.5: xml/masqmail.conf.5.xml + xmltoman $< >$@ + +man/masqmail.route.5: xml/masqmail.route.5.xml + xmltoman $< >$@ + +man/masqmail.get.5: xml/masqmail.get.5.xml + xmltoman $< >$@ + +man/masqmail.aliases.5: xml/masqmail.aliases.5.xml + xmltoman $< >$@ + + +html/masqmail.8.html: xml/masqmail.8.xml + xmlmantohtml $< >$@ + +html/mservdetect.8.html: xml/mservdetect.8.xml + xmlmantohtml $< >$@ + +html/masqmail.conf.5.html: xml/masqmail.conf.5.xml + xmlmantohtml $< >$@ + +html/masqmail.route.5.html: xml/masqmail.route.5.xml + xmlmantohtml $< >$@ + +html/masqmail.get.5.html: xml/masqmail.get.5.xml + xmlmantohtml $< >$@ + +html/masqmail.aliases.5.html: xml/masqmail.aliases.5.xml + xmlmantohtml $< >$@ + +#clean: +# rm -f man/*.[58] +# rm -r html/*.html diff -r 000000000000 -r 08114f7dcc23 docs/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,454 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +SUBDIRS = man xml +subdir = docs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + else \ + include_option=--include; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-recursive ctags ctags-recursive distclean \ + distclean-generic distclean-recursive distclean-tags distdir \ + dvi dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ + ps-recursive tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-info-recursive uninstall-recursive + + +man: man/masqmail.8 man/mservdetect.8 man/masqmail.conf.5 man/masqmail.route.5 man/masqmail.get.5 man/masqmail.aliases.5 + +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 + +man/masqmail.8: xml/masqmail.8.xml + xmltoman $< >$@ + +man/mservdetect.8: xml/mservdetect.8.xml + xmltoman $< >$@ + +man/masqmail.conf.5: xml/masqmail.conf.5.xml + xmltoman $< >$@ + +man/masqmail.route.5: xml/masqmail.route.5.xml + xmltoman $< >$@ + +man/masqmail.get.5: xml/masqmail.get.5.xml + xmltoman $< >$@ + +man/masqmail.aliases.5: xml/masqmail.aliases.5.xml + xmltoman $< >$@ + +html/masqmail.8.html: xml/masqmail.8.xml + xmlmantohtml $< >$@ + +html/mservdetect.8.html: xml/mservdetect.8.xml + xmlmantohtml $< >$@ + +html/masqmail.conf.5.html: xml/masqmail.conf.5.xml + xmlmantohtml $< >$@ + +html/masqmail.route.5.html: xml/masqmail.route.5.xml + xmlmantohtml $< >$@ + +html/masqmail.get.5.html: xml/masqmail.get.5.xml + xmlmantohtml $< >$@ + +html/masqmail.aliases.5.html: xml/masqmail.aliases.5.xml + xmlmantohtml $< >$@ + +#clean: +# rm -f man/*.[58] +# rm -r html/*.html +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 docs/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/README Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,11 @@ +Since version 0.1.1 the documentation within the masqmail package is +in man pages. The source is in in xml, the xml sources can be +converted to man pages or html pages with the perl scripts xml2man and +xmlman2html. + +The xml sources are availabe in another package. + +The perl scripts will be available at http://masqmail.cx/xml2man/ + +If you want to conribute to the documentation, please use the xml +sources, changes in html or man pages will be lost. diff -r 000000000000 -r 08114f7dcc23 docs/man/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +man_MANS=masqmail.8 mservdetect.8 masqmail.conf.5 masqmail.route.5 masqmail.get.5 masqmail.aliases.5 \ No newline at end of file diff -r 000000000000 -r 08114f7dcc23 docs/man/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,364 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +man_MANS = masqmail.8 mservdetect.8 masqmail.conf.5 masqmail.route.5 masqmail.get.5 masqmail.aliases.5 +subdir = docs/man +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +NROFF = nroff +MANS = $(man_MANS) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/man/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: + +man5dir = $(mandir)/man5 +install-man5: $(man5_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man5dir) + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ + done +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ + rm -f $(DESTDIR)$(man5dir)/$$inst; \ + done + +man8dir = $(mandir)/man8 +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man8dir) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ + done +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ + rm -f $(DESTDIR)$(man8dir)/$$inst; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(man5dir) $(DESTDIR)$(man8dir) +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-exec-am: + +install-info: install-info-am + +install-man: install-man5 install-man8 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-man + +uninstall-man: uninstall-man5 uninstall-man8 + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-man5 install-man8 install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ + uninstall-man uninstall-man5 uninstall-man8 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 docs/man/masqmail.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/masqmail.8 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,213 @@ +.TH masqmail 8 User Manuals +.SH NAME +masqmail \- An offline Mail Transfer Agent +.SH SYNOPSIS +\fB/usr/sbin/masqmail [-C \fIfile\f1\fB] [-odq] [-bd] [-q\fIinterval\f1\fB] + +\fB/usr/sbin/masqmail [-odq] [-bs] + +\fB/usr/sbin/masqmail [-bp] + +\fB/usr/sbin/masqmail [-q] + +\fB/usr/sbin/masqmail [-qo [\fIname\f1\fB]] + +\fB/usr/sbin/masqmail [-odq] [-g [\fIname\f1\fB]] + +\fB/usr/sbin/masqmail [-odq] [-go [\fIname\f1\fB]] + +\fB/usr/sbin/masqmail [-t] [-oi] [-f \fIaddress\f1\fB] [--] \fIaddress...\f1\fB + +\fB/usr/sbin/mailq + +\fB +.SH DESCRIPTION + +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. + +.SH OPTIONS + +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) +.TP + +\fB--\f1 + +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. +.TP + +\fB-bd\f1 + +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). +.TP + +\fB-bi\f1 + +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. +.TP + +\fB-bp\f1 + +Show the messages in the queue. Same as calling masqmail as 'mailq'. +.TP + +\fB-bs\f1 + +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. +.TP + +\fB-B \fIarg\f1\fB\f1 + +\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). +.TP + +\fB-bV \f1 + +Show version information. +.TP + +\fB-C \f1\fIfilename\f1 + +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. +.TP + +\fB-d \fInumber\f1\fB\f1 + +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. +.TP + +\fB-f [\fIaddress\f1\fB]\f1 + +Set the return path address to \fIaddress\f1. Only root, the user mail and anyoune in group trusted is allowed to do that. +.TP + +\fB-F [\fIstring\f1\fB]\f1 + +Set the full sender name (in the From: header) to \fIstring\f1. +.TP + +\fB-g [\fIname\f1\fB]\f1 + +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 +.TP + +\fB-go [\fIinterval\f1\fB] [\fIname\f1\fB]\f1 + +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). + +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. + +If called without \fIname\f1 the online status is determined with the configured method (see \fBonline_detect\f1 in config.html). +.TP + +\fB-i\f1 + +Same as -oi, see below. +.TP + +\fB-Mrm \fIlist\f1\fB\f1 + +Remove given messages from the queue. Only allowed for privileged users. +.TP + +\fB-oem\f1 + +If the -oi ist not also given, always return with a non zero return code. Maybe someone tells me what this is good for... +.TP + +\fB-odb\f1 + +Deliver in background. Masqmail always does this, which makes this option pretty much useless. +.TP + +\fB-odq\f1 + +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. +.TP + +\fB-oi\f1 + +A dot as a single character in a line does not terminate the message. +.TP + +\fB-q [\fIinterval\f1\fB]\f1 + +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. + +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. + +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). +.TP + +\fB-qo [\fIname\f1\fB]\f1 + +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). + +If called without \fIname\f1 the online status is determined with the configured method (see \fBonline_detect\f1 in config.html) +.TP + +\fB-t\f1 + +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. +.TP + +\fB-v\f1 + +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. +.SH ENVIRONMENT FOR PIPES AND MDAS + +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: + +SENDER, RETURN_PATH - the return path. + +SENDER_DOMAIN - the domain part of the return path. + +SENDER_LOCAL - the local part of the return path. + +RECEIVED_HOST - the host the message was received from (unless local). + +LOCAL_PART, USER, LOGNAME - the local part of the (original) recipient. + +MESSAGE_ID - the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header. + +QUALIFY_DOMAIN - the domain which will be appended to unqualified addresses. + +.SH FILES + +\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. + +\fI/etc/aliases\f1 is the alias file, if not set differently in \fI/etc/masqmail/masqmail.conf\f1. + +\fI/var/spool/masqmail/\f1 is the spool directory where masqmail stores its spooled messages and the uniq pop ids. + +\fI/var/spool/mail/\f1 is the directory where locally delivered mail will be put, if not configured differently in \fImasqmail.conf\f1. + +\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. + +.SH CONFORMING TO + +RFC 821, 822, 1869, 1870, 2197, 2554 (SMTP) + +RFC 1725, 1939 (POP3) + +RFC 1321 (MD5) + +RFC 2195 (CRAM-MD5) + +.SH AUTHOR + +masqmail was written by Oliver Kurth + +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. + +.SH BUGS + +You should report them to the mailing list. + +.SH SEE ALSO + +\fBmasqmail.conf (5)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.get (5)\f1, \fBmasqmail.aliases (5)\f1 + +.SH COMMENTS + +This man page was written using \fBxml2man (1)\f1 by the same author. + diff -r 000000000000 -r 08114f7dcc23 docs/man/masqmail.aliases.5 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/masqmail.aliases.5 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,41 @@ +.TH masqmail.aliases 5 User Manuals +.SH NAME +masqmail.aliases \- masqmail alias file format +.SH DESCRIPTION + +This man page describes the format of the masqmail alias file. Its usual location is \fI/etc/aliases\f1. + +.SH FILE FORMAT + +The alias file consists of lines of the form: +local_part: item1, item2, ... +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 '\'. + +A leading '\' indicates that this address shall not be further expanded. + +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. + +Loops will be detected, the offending address will be ignored. + +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. + +There is no need to restart masqmail or run any command when the alias file has been changed. + +.SH AUTHOR + +masqmail was written by Oliver Kurth + +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. + +.SH BUGS + +You should report them to the mailing list. + +.SH SEE ALSO + +\fBmasqmail.conf (5)\f1, \fBmasqmail (8)\f1, + +.SH COMMENTS + +This man page was written using \fBxml2man (1)\f1 by the same author. + diff -r 000000000000 -r 08114f7dcc23 docs/man/masqmail.conf.5 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/masqmail.conf.5 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,345 @@ +.TH masqmail.conf 5 User Manuals +.SH NAME +masqmail.conf \- masqmail configuration file +.SH DESCRIPTION + +This man page describes the syntax of the main configuration file of masqmail. Its usual location is \fI/etc/masqmail/masqmail.conf\f1 + +The configuration consists of lines of the form + +\fBval\f1 = \fIexpression\f1 + +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. + +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. + +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. + +Blank lines and lines starting with '#' are ignored. + +.SH OPTIONS +.TP + +\fBrun_as_user = \fIboolean\f1\fB\f1 + +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. +.TP + +\fBuse_syslog = \fIboolean\f1\fB\f1 + +If this is set, masqmail uses syslogd for logging. It uses facility MAIL. You still have to set \fBlog_dir\f1 for debug files. +.TP + +\fBdebug_level = \fIn\f1\fB\f1 + +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. +.TP + +\fBmail_dir = \fIfile\f1\fB\f1 + +The directory where local mail is stored, usually \fI/var/spool/mail\f1 or \fI/var/mail\f1. +.TP + +\fBspool_dir = \fIfile\f1\fB\f1 + +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. +.TP + +\fBhost_name = \fIstring\f1\fB\f1 + +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. + +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. + +It is not used to find whether an address is local. Use \fBlocal_hosts\f1 for that. +.TP + +\fBremote_port = \fIn\f1\fB\f1 + +The remote port number to be used. This defaults to port 25. + +This option is deprecated. Use \fBhost_name\f1 in the route configuration instead. See \fBmasqmail.route (5)\f1. +.TP + +\fBlocal_hosts = \fIlist\f1\fB\f1 + +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'. +.TP + +\fBlocal_nets = \fIlist\f1\fB\f1 + +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". +.TP + +\fBlocal_addresses = \fIlist\f1\fB\f1 + +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. + +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 + +local_addresses = "person1@yourdomain;person2@yourdomain" + +to your masqmail.conf. +.TP + +\fBnot_local_addresses = \fIlist\f1\fB\f1 + +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. + +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. + +Example: + +local_hosts = "localhost;myhost;mydomain.net" + +not_local_addresses = "eric@mydomain.net" +.TP + +\fBlisten_addresses = \fIlist\f1\fB\f1 + +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. + +You can set this to "localhost:25;foo:25" if your hostname is 'foo'. + +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. +.TP + +\fBdo_save_envelope_to = \fIboolean\f1\fB\f1 + +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. + +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. + +Default is false. +.TP + +\fBdo_relay = \fIboolean\f1\fB\f1 + +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. + +Note that this will not protect you from spammers using open relays, but from users unable to set their address in their mail clients. +.TP + +\fBdo_queue = \fIboolean\f1\fB\f1 + +If this is set, mail will not be delivered immediately when accepted. Same as calling masqmail with the \fB-odq\f1 option. +.TP + +\fBonline_routes.\fIname\f1\fB = \fIlist\f1\fB\f1 + +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. + +Example: Your ISP has the name FastNet. Then you write the following line in the main configuration: + +\fBonline_routes.FastNet\f1 = \fI"/etc/masqmail/fastnet.route"\f1 + +\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. +.TP + +\fBconnect_route.\fIname\f1\fB = \fIlist\f1\fB\f1 + +Old name for \fBonline_routes\f1. +.TP + +\fBlocal_net_route = \fIfile\f1\fB\f1 + +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. +.TP + +\fBalias_file = \fIfile\f1\fB\f1 + +Set this to the location of your alias file. If unset, no aliasing will be done. +.TP + +\fBalias_local_caseless = \fIboolean\f1\fB\f1 + +If this is set, local parts in the alias file will be matched disregarding upper/lower case. +.TP + +\fBpipe_fromline = \fIboolean\f1\fB\f1 + +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. +.TP + +\fBpipe_fromhack = \fIboolean\f1\fB\f1 + +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. +.TP + +\fBmbox_default = \fIstring\f1\fB\f1 + +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). +.TP + +\fBmbox_users = \fIlist\f1\fB\f1 + +A list of users which wish delivery to an mbox style mail folder. +.TP + +\fBmda_users = \fIlist\f1\fB\f1 + +A list of users which wish local delivery to an mda. You have to set \fBmda\f1 (see below) as well. +.TP + +\fBmaildir_users = \fIlist\f1\fB\f1 + +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. +.TP + +\fBmda = \fIexpand string\f1\fB\f1 + +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: + +uid - the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header. + +received_host - the host the mail was received from + +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. + +return_path_local - the local part of the return path (sender). + +return_path_domain - the domain part of the return path (sender). + +return_path - the complete return path (sender). + +rcpt_local - the local part of the recipient. + +rcpt_domain - the domain part of the recipient. + +rcpt - the complete recipient address. + +Example: + +mda="/usr/bin/procmail -Y -d ${rcpt_local}" + +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. +.TP + +\fBmda_fromline = \fIboolean\f1\fB\f1 + +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. +.TP + +\fBmda_fromhack = \fIboolean\f1\fB\f1 + +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. +.TP + +\fBonline_detect = \fIstring\f1\fB\f1 + +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. + +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). + +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. + +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. + +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. +.TP + +\fBonline_file = \fIfile\f1\fB\f1 + +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. + +echo -n > /tmp/connect_route + +chmod 0644 /tmp/connect_route + +Do not forget to delete it in your ip-down script. +.TP + +\fBonline_pipe = \fIfile\f1\fB\f1 + +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: + +#!/bin/sh + + + +[ -e /tmp/connect_route ] || exit 1 + +cat /tmp/connect_route + +exit 0 + +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. +.TP + +\fBmserver_iface = \fIinterface\f1\fB\f1 + +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". +.TP + +\fBget.\fIname\f1\fB = \fIfile\f1\fB\f1 + +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. +.TP + +\fBonline_gets.\fIname\f1\fB = \fIlist\f1\fB\f1 + +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. +.TP + +\fBident_trusted_nets = \fIlist\f1\fB\f1 + +\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. +.TP + +\fBerrmsg_file = \fIfile\f1\fB\f1 + +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. + +Default is /usr/share/masqmail/tpl/failmsg.tpl. +.TP + +\fBwarnmsg_file = \fIfile\f1\fB\f1 + +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. + +Default is /usr/share/masqmail/tpl/warnmsg.tpl. +.TP + +\fBwarn_intervals\f1 = \fIlist\f1 + +Set this to a list of time intervals, at which delivery warnings (starting with the receiving time of the message) shall be generated. + +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. + +Default is "1h;4h;8h;1d;2d;3d" +.TP + +\fBmax_defer_time\f1 = \fItime\f1 + +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. + +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. + +Default is 4d (4 days) +.TP + +\fBlog_user = \fIname\f1\fB\f1 + +Replace \fIname\f1 with a valid local or remote mail address. + +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. + +For example you can feed your mails into a program like hypermail for archiving purpose by placing an appropriate pipe command in masqmail.alias +.SH AUTHOR + +masqmail was written by Oliver Kurth + +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. + +.SH BUGS + +You should report them to the mailing list. + +.SH SEE ALSO + +\fBmasqmail (8)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.get (5)\f1 + +.SH COMMENTS + +This man page was written using \fBxml2man (1)\f1 by the same author. + diff -r 000000000000 -r 08114f7dcc23 docs/man/masqmail.get.5 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/masqmail.get.5 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,99 @@ +.TH masqmail.get 5 User Manuals +.SH NAME +masqmail.get \- masqmail get configuration file +.SH DESCRIPTION + +This man page describes the options available for the masqmail get configuration. + +.SH OPTIONS +.TP + +\fBprotocol\f1 = \fIstring\f1 + +The protocol with which you retrieve your mail. Currently only 'pop3' and 'apop' are supported. There is no default. +.TP + +\fBserver\f1 = \fIstring\f1 + +The server you get your mail from. +.TP + +\fBresolve_list\f1 = \fIlist\f1 + +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. + +The default is "dns_a;byname". It does not make much sense here to use 'dns_mx'. +.TP + +\fBuser\f1 = \fIstring\f1 + +Your login name. +.TP + +\fBpass\f1 = \fIstring\f1 + +Your password. +.TP + +\fBaddress\f1 = \fIaddress\f1 + +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. +.TP + +\fBreturn_path\f1 = \fIaddress\f1 + +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. + +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. +.TP + +\fBdo_keep\f1 = \fIboolean\f1 + +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. +.TP + +\fBdo_uidl\f1 = \fIboolean\f1 + +If set, MasqMail keeps a list of unique IDs of mails already fetched, so that they will not be retrieved again. Default is false. +.TP + +\fBdo_uidl_dele\f1 = \fIboolean\f1 + +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. +.TP + +\fBmax_size\f1 = \fInumeric\f1 + +If set to a value > 0, only messages smaller than this in bytes will be retrieved. The default is 0. +.TP + +\fBmax_count\f1 = \fInumeric\f1 + +If set to a value > 0, only \fBmax_count\f1 messages will be retrieved. The default is 0. +.TP + +\fBwrapper\f1 = \fIcommand\f1 + +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. + +Example for ssl tunneling: + +wrapper="/usr/bin/openssl s_client -quiet -connect pop.gmx.net:995 2>/dev/null" +.SH AUTHOR + +masqmail was written by Oliver Kurth + +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. + +.SH BUGS + +You should report them to the mailing list. + +.SH SEE ALSO + +\fBmasqmail (8)\f1, \fBmasqmail.route (5)\f1, \fBmasqmail.conf (5)\f1 + +.SH COMMENTS + +This man page was written using \fBxml2man (1)\f1 by the same author. + diff -r 000000000000 -r 08114f7dcc23 docs/man/masqmail.route.5 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/masqmail.route.5 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,212 @@ +.TH masqmail.route 5 User Manuals +.SH NAME +masqmail.route \- masqmail route configuration file +.SH DESCRIPTION + +This man page describes the syntax of the route configuration files of \fBmasqmail (8)\f1. Their usual locations are in \fI/etc/masqmail/\f1. + +.SH OPTIONS +.TP + +\fBprotocol\f1 = \fIstring\f1 + +\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. +.TP + +\fBmail_host\f1 = \fIstring\f1 + +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. + +You can optionally give a port number following the host name and a colon, eg mail_host="mail.foo.com:25". +.TP + +\fBresolve_list\f1 = \fIlist\f1 + +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. + +The default is "dns_mx;dns_a;byname". +.TP + +\fBconnect_error_fail\f1 = \fIboolean\f1 + +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. + +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. + +For the default local_net route is is set to true. +.TP + +\fBhelo_name\f1 = \fIstring\f1 + +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. +.TP + +\fBdo_correct_helo\f1 = \fIboolean\f1 + +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. +.TP + +\fBdo_pipelining\f1 = \fIboolean\f1 + +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. + +You do not want to set this to false unless the mail setup on the remote server side is really broken. Keywords: wingate. +.TP + +\fBallowed_mail_locals\f1 = \fIlist\f1 + +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. +.TP + +\fBnot_allowed_mail_locals\f1 = \fIlist\f1 + +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). +.TP + +\fBallowed_return_paths\f1 = \fIlist\f1 + +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). + +Patterns containing '?' and '*' can be used. The special item "<>" matches the null sender address (eg. failure notices or delivery notifications). +.TP + +\fBnot_allowed_return_paths\f1 = \fIlist\f1 + +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). + +Patterns containing '?' and '*' can be used. The special item "<>" matches the null sender address (eg. failure notices or delivery notifications). +.TP + +\fBallowed_rcpt_domains\f1 = \fIlist\f1 + +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. +.TP + +\fBnot_allowed_rcpt_domains\f1 = \fIlist\f1 + +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. +.TP + +\fBset_h_from_domain\f1 = \fIstring\f1 + +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. +.TP + +\fBset_return_path_domain\f1 = \fIstring\f1 + +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. +.TP + +\fBmap_h_from_addresses\f1 = \fIlist\f1 + +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 (':'). + +Example: + +map_h_from_addresses = "john: John Smith ; charlie: Charlie Miller " + +You can use patterns, eg. * as keys. +.TP + +\fBmap_h_reply_to_addresses\f1 = \fIlist\f1 + +Same as \fBmap_h_from_addresses\f1, but for the 'Reply-To:' header. +.TP + +\fBmap_h_mail_followup_to_addresses\f1 = \fIlist\f1 + +Same as \fBmap_h_from_addresses\f1, but for the 'Mail-Followup-To:' header. Useful when replying to mailing lists. +.TP + +\fBmap_return_path_addresses\f1 = \fIlist\f1 + +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. + +Example: + +map_return_path_addresses = "john: ; charlie: " + +You can use patterns, eg. * as keys. +.TP + +\fBexpand_h_sender_address\f1 = \fIboolean\f1 + +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. +.TP + +\fBexpand_h_sender_domain\f1 = \fIboolean\f1 + +Like \fBexpand_h_sender_address\f1, but sets the domain only. Deprecated, will be removed in a later version. +.TP + +\fBlast_route\f1 = \fIboolean\f1 + +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. + +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. + +Default is false. +.TP + +\fBauth_name\f1 = \fIstring\f1 + +Set the authentication type for ESMTP AUTH authentification. Currently only 'cram-md5' and 'login' are supported. +.TP + +\fBauth_login\f1 = \fIstring\f1 + +Your account name for ESMTP AUTH authentification. +.TP + +\fBauth_secret\f1 = \fIstring\f1 + +Your secret for ESMTP AUTH authentification. +.TP + +\fBpop3_login\f1 = \fIfile\f1 + +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. +.TP + +\fBwrapper\f1 = \fIcommand\f1 + +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. + +Example for ssl tunneling: + +wrapper="/usr/bin/openssl s_client -quiet -connect pop.gmx.net:995 2>/dev/null" +.TP + +\fBpipe\f1 = \fIcommand\f1 + +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. + +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. +.TP + +\fBpipe_fromline = \fIboolean\f1\fB\f1 + +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. +.TP + +\fBpipe_fromhack = \fIboolean\f1\fB\f1 + +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. +.SH AUTHOR + +masqmail was written by Oliver Kurth + +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. + +.SH BUGS + +You should report them to the mailing list. + +.SH SEE ALSO + +\fBmasqmail (8)\f1, \fBmasqmail.conf (5)\f1, \fBmasqmail.get (5)\f1 + +.SH COMMENTS + +This man page was written using \fBxml2man (1)\f1 by the same author. + diff -r 000000000000 -r 08114f7dcc23 docs/man/mservdetect.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/man/mservdetect.8 Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,42 @@ +.TH mservdetect 8 User Manuals +.SH NAME +mservdetect \- Helper for masqmail and masqdialer +.SH SYNOPSIS +\fB/usr/bin/masqmail \fIhost\f1\fB \fIport\f1\fB + +\fB +.SH DESCRIPTION + +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. + +If you want to use it, set \fBonline_detect\f1=\fIpipe\f1 and \fBonline_pipe\f1=\fI"/usr/bin/mservdetect host port"\f1. + +.SH OPTIONS +.TP + +\fBhost\f1 + +The hostname where the masqdialer server is running. +.TP + +\fBport\f1 + +The port number where the masqdialer server is listening. +.SH AUTHOR + +masqmail was written by Oliver Kurth + +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. + +.SH BUGS + +You should report them to the mailing list. + +.SH SEE ALSO + +\fBmasqmail.conf (5)\f1 + +.SH COMMENTS + +This man page was written using \fBxml2man (1)\f1 by the same author. + diff -r 000000000000 -r 08114f7dcc23 docs/xml/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +EXTRA_DIST = *.xml diff -r 000000000000 -r 08114f7dcc23 docs/xml/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,263 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +EXTRA_DIST = *.xml +subdir = docs/xml +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/xml/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 docs/xml/masqmail.8.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/masqmail.8.xml Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,302 @@ + + + + + + +/usr/sbin/masqmail [-C file] [-odq] [-bd] [-qinterval] +/usr/sbin/masqmail [-odq] [-bs] +/usr/sbin/masqmail [-bp] +/usr/sbin/masqmail [-q] +/usr/sbin/masqmail [-qo [name]] +/usr/sbin/masqmail [-odq] [-g [name]] +/usr/sbin/masqmail [-odq] [-go [name]] +/usr/sbin/masqmail [-t] [-oi] [-f address] [--] address... +/usr/sbin/mailq + + + +

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.

+
+ + +

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 connection and -g) +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

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:

+

SENDER, RETURN_PATH - the return path.

+

SENDER_DOMAIN - the domain part of the return path.

+

SENDER_LOCAL - the local part of the return path.

+

RECEIVED_HOST - the host the message was received from (unless local).

+

LOCAL_PART, USER, LOGNAME - the local part of the (original) recipient.

+

MESSAGE_ID - the unique message id. This is not necessarily identical with the Message ID as given in the Message ID: header.

+

QUALIFY_DOMAIN - the domain which will be appended to unqualified addresses.

+ +
+ +
+

/etc/masqmail/masqmail.conf is the main configuration +for masqmail. Depending on the settings in this file, you will also +have other configuration files in /etc/masqmail/.

+

/etc/aliases is the alias file, if not set differently +in /etc/masqmail/masqmail.conf.

+

/var/spool/masqmail/ is the spool directory where masqmail +stores its spooled messages and the uniq pop ids.

+

/var/spool/mail/ is the directory where locally delivered mail will be put, if not configured differently in masqmail.conf.

+

/var/log/masqmail/ 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.

+
+ +
+

RFC 821, 822, 1869, 1870, 2197, 2554 (SMTP)

+

RFC 1725, 1939 (POP3)

+

RFC 1321 (MD5)

+

RFC 2195 (CRAM-MD5)

+
+ +
+

masqmail was written by Oliver Kurth +<oku@masqmail.cx>

You will find the newest version of +masqmail at or search for it +in freshmeat (). There is also a mailing list, +you will find information about it at masqmails main site.

+
+ +
+

You should report them to the mailing list.

+
+ +
+

+, , , +

+
+ +
+

This man page was written using by the same author.

+
+ +
diff -r 000000000000 -r 08114f7dcc23 docs/xml/masqmail.aliases.5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/masqmail.aliases.5.xml Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,63 @@ + + + + + + +

This man page describes the format of the masqmail alias file. Its usual location is /etc/aliases.

+
+ +
+

The alias file consists of lines of the form:

+
+local_part: item1, item2, ...
+
+ +

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 '\'.

+ +

A leading '\' indicates that this address shall not be further +expanded.

+ +

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.

+ +

Loops will be detected, the offending address will be ignored.

+ +

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.

+ +

There is no need to restart masqmail or run any command when the +alias file has been changed.

+
+ +
+

masqmail was written by Oliver Kurth +<oku@masqmail.cx>

You will find the newest version of +masqmail at or search for it +in freshmeat (). There is also a mailing list, +you will find information about it at masqmails main site.

+
+ +
+

You should report them to the mailing list.

+
+ +
+

+, , +

+
+ +
+

This man page was written using by the same author.

+
+ +
diff -r 000000000000 -r 08114f7dcc23 docs/xml/masqmail.conf.5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/masqmail.conf.5.xml Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,561 @@ + + + + + + +

This man page describes the syntax of the main configuration file +of masqmail. Its usual location is /etc/masqmail/masqmail.conf

+ +

The configuration consists of lines of the form

+ +

val = expression

+ +

Where val is a variable name and expression 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.

+ +

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.

+ +

Most lists (exceptions: local_hosts, +local_nets, listen_addresses, online_routes and online_gets) 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.

+ +

Blank lines and lines starting with '#' are ignored.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

masqmail was written by Oliver Kurth +<oku@masqmail.cx>

You will find the newest version of +masqmail at or search for it +in freshmeat (). There is also a mailing list, +you will find information about it at masqmails main site.

+
+ +
+

You should report them to the mailing list.

+
+ +
+

+, , +

+
+ + +
+

This man page was written using by the same +author.

+
+ +
+ diff -r 000000000000 -r 08114f7dcc23 docs/xml/masqmail.get.5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/masqmail.get.5.xml Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,165 @@ + + + + + +

This man page describes the options available for the +masqmail get configuration.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

masqmail was written by Oliver Kurth +<oku@masqmail.cx>

You will find the newest version of +masqmail at or search for it +in freshmeat (). There is also a mailing list, +you will find information about it at masqmails main site.

+
+ +
+

You should report them to the mailing list.

+
+ +
+

+, , +

+
+ +
+

This man page was written using by the same +author.

+
+ +
+ diff -r 000000000000 -r 08114f7dcc23 docs/xml/masqmail.route.5.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/masqmail.route.5.xml Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,376 @@ + + + + + + +

This man page describes the syntax of the route configuration files +of . Their usual locations are in /etc/masqmail/.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

masqmail was written by Oliver Kurth +<oku@masqmail.cx>

You will find the newest version of +masqmail at or search for it +in freshmeat (). There is also a mailing list, +you will find information about it at masqmails main site.

+
+ +
+

You should report them to the mailing list.

+
+ +
+

+, , +

+
+ +
+

This man page was written using by the same +author.

+
+ +
+ diff -r 000000000000 -r 08114f7dcc23 docs/xml/mservdetect.8.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/xml/mservdetect.8.xml Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,60 @@ + + + + + + +/usr/bin/masqmail host port + + + +

+mservdetect is a small helper application for masqmail to detect its online +status if the modem server masqdialer is used. It connects to the +host at port and prints the connection name to +stdout.

+

If you want to use it, set online_detect=pipe and online_pipe="/usr/bin/mservdetect host port".

+
+ + + + + + + + + +
+

masqmail was written by Oliver Kurth +<oku@masqmail.cx>

You will find the newest version of +masqmail at or search for it +in freshmeat (). There is also a mailing list, +you will find information about it at masqmails main site.

+
+ +
+

You should report them to the mailing list.

+
+ +
+

+ +

+
+ +
+

This man page was written using by the same author.

+
+ +
diff -r 000000000000 -r 08114f7dcc23 examples/example.get --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/example.get Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,32 @@ +# example 'mail get' configuration +# +# the protocol, only 'pop3' or 'apop' are supported. apop is +# recommended if the server supports it (password encryption). +# Unfortunately most do not. +protocol=apop + +# the server: +server = pop.example.org + +# the account name: +user=okurth + +# and the password: +pass="keepInMind" + +# if you just use this for SMTP after POP, you do not need the settings below: + +# the (local) address, where the retrieved mail should be sent to: +address=okurth@localhost + +# should we keep the mail on server? +do_keep=false + +# if we do keep the mail, you should really set this to true, +# otherwise you will get it again next time you fetch mail. +# masqmail completely ignores any headers (which may mark a mail as read). +do_uidl=false + +# optionally, you can set the maximum size of a mail. Setting it to 0 +# means get all, disregarding size. +max_size=50000 diff -r 000000000000 -r 08114f7dcc23 examples/example.route --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/example.route Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,92 @@ +# Example route file for masqmail +# see also: man 5 masqmail.route + +# +# mail properties tested for: +# + +# users that can send mail over this connection: +# this is a list of the local parts of the original return addresses, as they are +# configured with your mail client. If not set, anybody may send. + +allowed_mail_locals = "okurth" + +# local_hosts and local_nets will be checked before this. +# cpwright.com uses the dialup up list of dul.maps.vix.com, +# so I cannot send any mail over this connection to that domain. +# There are probably many others... :-( (No, this is okay. Nobody +# wants his mailbox stuffed to the ceiling with spam...) +# +# You will find this necessary only if you send mail directly +# (if mail_host is not set below) + +not_allowed_rcpt_domains = "cpwright.com" + +# +# settings: +# + +# the mail server which relays mail for you: +# if this is not set, mail will be sent directly. +# If your ISP gives has a mail server, it is wiser to use it: + +mail_host = "mail.isp.com" + +# Make picky servers happy: +# If set, we look up our own name as seen from the network +# and send this in our HELO/EHLO message. Otherwise we send our host name, +# which is probably different for dialup conections and may be unknown outside. +# Some servers complain, +# which is really crazy, since it is senseless to lie about it... +# Unfortunately, some ISPs do not give you a name, just an ip address. In this case, +# we have a delay until the DNS lookup fails. + +do_correct_helo = true + +# 'forge' headers: + +# return path and From: address are TWO different things: +# +# the return path is address where delivery failure messages will go +# to, and this address will be checked by many MTAs in the outside +# world, so it should be valid. It canNOT contain a real name: +# 'miller@foo.com' is a valid return path, but 'Charlie Miller ' is NOT. +# +# The From: address is the address the recipient sees, and where +# replies will go to (if you do not set a Reply-to header). In most +# cases it corresponds to the return path, but this is not +# required. It CAN have a real name, both examples for Charlie above +# are correct, and it is more pretty to include a real name. +# +# The return path: +# if we send the mail directly, we can set any valid address here, +# use the one you prefer to get error messages to: +# Use EITHER set_return_path_domain OR map_return_path_addresses +# +# this sets the return path kurth@anywhere.org to kurth@innominate.de +#set_return_path_domain = "innominate.de" +# this sets okurth@somewhere.else.org to kurth@innominate.de, and +# leaves all other addresses untouched: +map_return_path_addresses = "okurth: kurth@innominate.de" + +# 'From:' header: +# Use EITHER set_h_from_domain OR map_h_from_addresses +#set_h_from_domain = "uni-sw.gwdg.de" +map_h_from_addresses = "okurth: Oliver Kurth " + +# if your mail server outside uses the AUTH machanism, set the following. +# You need to compile masqmail with AUTH support (--enable-auth option for ./configure): +# for auth_name, only 'cram-md5' and 'login' are supported. +# see also: man 5 masqmail.route + +#auth_name="cram-md5" +#auth_login="yourname" +#auth_secret="dontTellAnyBody" + +# if your mail server requires smtp after POP (eg. gmx), set this. +# It is not necessary if you fetch from the pop server just before you +# send mail (either masqmail, fetchmail or any other pop client). +# Set it to a get file. +# You need to compile masqmail with pop3 support (default) +# pop3_login = "/etc/masqmail/example.get" +# see also: man 5 masqmail.route, man 5 masqmail.get diff -r 000000000000 -r 08114f7dcc23 examples/masqmail.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/masqmail.conf Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,102 @@ +# Example configuration for MasqMail +# Copyright (C) 1999 Oliver Kurth +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# The name with which MasqMail identifies itself to others: +# CHANGING THIS IS REQUIRED! +host_name="striped.patchwork.net" + +# Hosts considered local: +# CHANGING THIS IS REQUIRED! +local_hosts="striped;striped.patchwork.net;localhost" + +# Nets considered local, for immediate delivery attempts: +# ALL hosts not included in either local_host or local_nets are +# considered to be 'outside', meaning that messages to them will be queued +# CHANGING THIS IS REQUIRED! +#local_nets="*.patchwork.net;blue;striped" + +# accept connections on these interfaces: +# CHANGING THIS IS REQUIRED! +listen_addresses="localhost:25" + +# send messages to this port: +# probably this will also be configurable on host basis in future versions. +remote_port=25 + +# where MasqMail stores its spool files and other stuff: +spool_dir="/var/spool/masqmail" + +# where local mail will be written to: +mail_dir="/var/mail" + +# use syslogd for logs? +use_syslog=false + +# directory for log files: +log_dir="/var/log/masqmail" + +# if set, accepted mail will not be delivered immediately but on the next queue run: +do_queue=false + +# online detection: +# +# for 'mserver' uncomment next 2 lines and optionally change mserver_iface: +#online_detect = mserver +#mserver_iface = "localhost:222" + +# for 'file' uncomment next 2 lines +#online_detect = file +#online_file = "/tmp/connect_route" + +# +# example for local delivery to an mda: +# +#mbox_default=mda +#mda="/usr/bin/procmail -Y -d ${rcpt_local}" +# default is false for these: +#mda_fromline=true +#mda_fromhack=true + +# +# alias expansion: +# +alias_file = "/etc/aliases" +# default is false: +#alias_local_caseless = true + +# +# configuration concerning pipes (after an alias expansion) +# +# default is false for these: +# pipe_fromline=true +# pipe_fromhack=true + +# special routes: + +# CHANGING THIS IS REQUIRED! +# You can use as many routes (one for each provider) as you like: +connect_route.GWDG = "/etc/masqmail/example.route" + +# you can also give a list of routes for a single connection: +#connect_route.foo = "/etc/masqmail/foo.route;/etc/masqmail/bar.route" + +# you can also set routes for the local net: +#local_net_route = "/etc/masqmail/local.route;/etc/masqmail/other_lan.route" + +# if you use masqmail to get mail, set some 'get' files: +#get.anyname = /etc/masqmail/example.get diff -r 000000000000 -r 08114f7dcc23 install-sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install-sh Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff -r 000000000000 -r 08114f7dcc23 missing --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/missing Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,336 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff -r 000000000000 -r 08114f7dcc23 mkinstalldirs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mkinstalldirs Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1.1.1 2001/03/19 15:45:28 okurth Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff -r 000000000000 -r 08114f7dcc23 redhat/masqmail --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/redhat/masqmail Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,48 @@ +#! /bin/sh +# Author: Oliver Kurth +# Iain Lea +# +# /etc/rc.d/init.d/masqmail +# + +# Source function library. +. /etc/rc.d/init.d/functions + +if test -z "$MASQMAIL_ARGS" ; then + MASQMAIL_ARGS="-bd -q30m" +fi + +RETVAL=0 + +# See how we were called. +case "$1" in + start) + echo -n "Starting SMTP (MasqMail): " + daemon /usr/sbin/sendmail $MASQMAIL_ARGS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/masqmail + echo + ;; + stop) + echo -n "Shutting down SMTP (MasqMail): " + killproc sendmail + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/masqmail + echo + ;; + restart|reload) + $0 stop + $0 start + RETVAL=$? + ;; + status) + status sendmail + RETVAL=$? + ;; + *) + echo "Usage: $0 {start|stop|status|restart|reload}" + exit 1 + ;; +esac + +exit $RETVAL diff -r 000000000000 -r 08114f7dcc23 redhat/masqmail.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/redhat/masqmail.spec Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,120 @@ +Summary: An offline mail server with pop3 client support +Name: masqmail +Version: 0.2.21 +Release: 1 +Copyright: GPL +Group: Networking/Daemons +Distribution: innominate +Packager: Iain Lea +Source: http://masqmail.cx/masqmail/download/masqmail-0.2.21.tar.gz +BuildRoot: /var/tmp/masqmail-root/ + +%description +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. + +%prep + +%setup -n masqmail-0.2.21 + +%build +# +#choose the a line or a combination: +# +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --disable-pop3 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-auth +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-ident +CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail + +CFLAGS="$RPM_OPT_FLAGS" make + +%install +if [ -d $RPM_BUILD_ROOT ] ; then + rm -rf $RPM_BUILD_ROOT +fi + +# setup directory environment: +mkdir $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl +mkdir -p $RPM_BUILD_ROOT/usr/sbin +mkdir -p $RPM_BUILD_ROOT/usr/bin +mkdir -p $RPM_BUILD_ROOT/usr/lib +mkdir -p $RPM_BUILD_ROOT/etc +mkdir -p $RPM_BUILD_ROOT/etc/masqmail +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl +mkdir -p $RPM_BUILD_ROOT/var/masqmail + +# install +make DESTDIR=$RPM_BUILD_ROOT install +/usr/bin/strip $RPM_BUILD_ROOT/usr/sbin/masqmail + +# sendmail links +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail + +# RedHat specific startup stuff: +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc2.d/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d/ +cp -p redhat/masqmail $RPM_BUILD_ROOT/etc/rc.d/init.d/ +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/S20masqmail +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/K20masqmail +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S20masqmail +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/K20masqmail +ln -fs '../../etc/rc.d/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail + +# configuration examples: +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/ +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/ +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/ +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl + +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/ +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/ + +# gzip the man pages: +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5 + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +/usr/sbin/masqmail +/usr/sbin/sendmail +/usr/bin/mailq +/usr/lib/sendmail +/etc/rc.d/init.d/masqmail +/etc/rc.d/rc2.d/S20masqmail +/etc/rc.d/rc2.d/K20masqmail +/etc/rc.d/rc3.d/S20masqmail +/etc/rc.d/rc3.d/K20masqmail +/usr/sbin/rcmasqmail +%config /etc/masqmail.conf /etc/masqmail/tpl/failmsg.tpl +//etc/masqmail/ +%doc README INSTALL COPYING NEWS +/usr/man/man8/masqmail.8.gz +/usr/man/man5/masqmail.conf.5.gz +/usr/man/man5/masqmail.route.5.gz +/usr/man/man5/masqmail.get.5.gz +/usr/man/man5/masqmail.aliases.5.gz + +%defattr(-,mail,mail) +%dir /var/masqmail/ +%dir /var/spool/masqmail/ +%dir /var/spool/masqmail/popuidl/ +%dir /var/spool/masqmail/input/ + + diff -r 000000000000 -r 08114f7dcc23 redhat/masqmail.spec.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/redhat/masqmail.spec.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,120 @@ +Summary: An offline mail server with pop3 client support +Name: masqmail +Version: @VERSION@ +Release: 1 +Copyright: GPL +Group: Networking/Daemons +Distribution: innominate +Packager: Iain Lea +Source: http://masqmail.cx/masqmail/download/masqmail-@VERSION@.tar.gz +BuildRoot: /var/tmp/masqmail-root/ + +%description +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. + +%prep + +%setup -n masqmail-@VERSION@ + +%build +# +#choose the a line or a combination: +# +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --disable-pop3 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-auth +#CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail --enable-ident +CFLAGS="$RPM_OPT_FLAGS" ./configure --with-user=mail --with-group=mail + +CFLAGS="$RPM_OPT_FLAGS" make + +%install +if [ -d $RPM_BUILD_ROOT ] ; then + rm -rf $RPM_BUILD_ROOT +fi + +# setup directory environment: +mkdir $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl +mkdir -p $RPM_BUILD_ROOT/usr/sbin +mkdir -p $RPM_BUILD_ROOT/usr/bin +mkdir -p $RPM_BUILD_ROOT/usr/lib +mkdir -p $RPM_BUILD_ROOT/etc +mkdir -p $RPM_BUILD_ROOT/etc/masqmail +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl +mkdir -p $RPM_BUILD_ROOT/var/masqmail + +# install +make DESTDIR=$RPM_BUILD_ROOT install +/usr/bin/strip $RPM_BUILD_ROOT/usr/sbin/masqmail + +# sendmail links +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail + +# RedHat specific startup stuff: +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc2.d/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d/ +cp -p redhat/masqmail $RPM_BUILD_ROOT/etc/rc.d/init.d/ +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/S20masqmail +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/K20masqmail +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S20masqmail +ln -fs '../init.d/masqmail' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/K20masqmail +ln -fs '../../etc/rc.d/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail + +# configuration examples: +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/ +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/ +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/ +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl + +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/ +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/ + +# gzip the man pages: +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5 + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +/usr/sbin/masqmail +/usr/sbin/sendmail +/usr/bin/mailq +/usr/lib/sendmail +/etc/rc.d/init.d/masqmail +/etc/rc.d/rc2.d/S20masqmail +/etc/rc.d/rc2.d/K20masqmail +/etc/rc.d/rc3.d/S20masqmail +/etc/rc.d/rc3.d/K20masqmail +/usr/sbin/rcmasqmail +%config /etc/masqmail.conf /etc/masqmail/tpl/failmsg.tpl +//etc/masqmail/ +%doc README INSTALL COPYING NEWS +/usr/man/man8/masqmail.8.gz +/usr/man/man5/masqmail.conf.5.gz +/usr/man/man5/masqmail.route.5.gz +/usr/man/man5/masqmail.get.5.gz +/usr/man/man5/masqmail.aliases.5.gz + +%defattr(-,mail,mail) +%dir /var/masqmail/ +%dir /var/spool/masqmail/ +%dir /var/spool/masqmail/popuidl/ +%dir /var/spool/masqmail/input/ + + diff -r 000000000000 -r 08114f7dcc23 src/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,90 @@ +SUBDIRS=base64 md5 libident + +AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE -DG_DISABLE_DEPRECATED + +sbin_PROGRAMS=masqmail +bin_PROGRAMS=mservdetect +noinst_PROGRAMS=smtpsend readtest + +masqmail_SOURCES=\ + dotlock.h\ + masqmail.h\ + readsock.h\ + smtp_out.h\ + lookup.h\ + mserver.h\ + accept.c\ + address.c\ + alias.c\ + child.c\ + connect.c\ + conf.c\ + deliver.c\ + dotlock.c\ + expand.c\ + fail_msg.c\ + get.c\ + header.c\ + interface.c\ + local.c\ + log.c\ + listen.c\ + lookup.c\ + masqmail.c\ + message.c\ + mserver.c\ + online.c\ + parse.c\ + peopen.c\ + peopen.h\ + permissions.c\ + pop3_in.c\ + pop3_in.h\ + readsock.c\ + rewrite.c\ + route.c\ + queue.c\ + smtp_in.c\ + smtp_out.c\ + spool.c\ + tables.c\ + timeival.c + +smtpsend_SOURCES=\ + smtpsend.c\ + masqmail.h\ + readsock.h\ + smtp_out.h\ + lookup.h\ + accept.c\ + address.c\ + child.c\ + connect.c\ + header.c\ + interface.c\ + lookup.c\ + message.c\ + parse.c\ + peopen.c\ + readsock.c\ + smtp_out.c + +mservdetect_SOURCES=\ + masqmail.h\ + readsock.h\ + mserver.h\ + mservdetect.c\ + interface.c\ + mserver.c\ + readsock.c\ + peopen.c + +readtest_SOURCES=\ + readsock.c\ + readsock.h\ + readtest.c + +masqmail_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ @LOCKFILE_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ @IDENT_LIBS@ +smtpsend_LDADD=@RESOLV_LIBS@ @GLIB_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ +mservdetect_LDADD=@GLIB_LIBS@ +readtest_LDADD=@GLIB_LIBS@ diff -r 000000000000 -r 08114f7dcc23 src/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,711 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +SUBDIRS = base64 md5 libident + +AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE -DG_DISABLE_DEPRECATED + +sbin_PROGRAMS = masqmail +bin_PROGRAMS = mservdetect +noinst_PROGRAMS = smtpsend readtest + +masqmail_SOURCES = \ + dotlock.h\ + masqmail.h\ + readsock.h\ + smtp_out.h\ + lookup.h\ + mserver.h\ + accept.c\ + address.c\ + alias.c\ + child.c\ + connect.c\ + conf.c\ + deliver.c\ + dotlock.c\ + expand.c\ + fail_msg.c\ + get.c\ + header.c\ + interface.c\ + local.c\ + log.c\ + listen.c\ + lookup.c\ + masqmail.c\ + message.c\ + mserver.c\ + online.c\ + parse.c\ + peopen.c\ + peopen.h\ + permissions.c\ + pop3_in.c\ + pop3_in.h\ + readsock.c\ + rewrite.c\ + route.c\ + queue.c\ + smtp_in.c\ + smtp_out.c\ + spool.c\ + tables.c\ + timeival.c + + +smtpsend_SOURCES = \ + smtpsend.c\ + masqmail.h\ + readsock.h\ + smtp_out.h\ + lookup.h\ + accept.c\ + address.c\ + child.c\ + connect.c\ + header.c\ + interface.c\ + lookup.c\ + message.c\ + parse.c\ + peopen.c\ + readsock.c\ + smtp_out.c + + +mservdetect_SOURCES = \ + masqmail.h\ + readsock.h\ + mserver.h\ + mservdetect.c\ + interface.c\ + mserver.c\ + readsock.c\ + peopen.c + + +readtest_SOURCES = \ + readsock.c\ + readsock.h\ + readtest.c + + +masqmail_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ @LOCKFILE_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ @IDENT_LIBS@ +smtpsend_LDADD = @RESOLV_LIBS@ @GLIB_LIBS@ @MD5_LIBS@ @BASE64_LIBS@ +mservdetect_LDADD = @GLIB_LIBS@ +readtest_LDADD = @GLIB_LIBS@ +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = mservdetect$(EXEEXT) +noinst_PROGRAMS = smtpsend$(EXEEXT) readtest$(EXEEXT) +sbin_PROGRAMS = masqmail$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) + +am_masqmail_OBJECTS = accept.$(OBJEXT) address.$(OBJEXT) alias.$(OBJEXT) \ + child.$(OBJEXT) connect.$(OBJEXT) conf.$(OBJEXT) \ + deliver.$(OBJEXT) dotlock.$(OBJEXT) expand.$(OBJEXT) \ + fail_msg.$(OBJEXT) get.$(OBJEXT) header.$(OBJEXT) \ + interface.$(OBJEXT) local.$(OBJEXT) log.$(OBJEXT) \ + listen.$(OBJEXT) lookup.$(OBJEXT) masqmail.$(OBJEXT) \ + message.$(OBJEXT) mserver.$(OBJEXT) online.$(OBJEXT) \ + parse.$(OBJEXT) peopen.$(OBJEXT) permissions.$(OBJEXT) \ + pop3_in.$(OBJEXT) readsock.$(OBJEXT) rewrite.$(OBJEXT) \ + route.$(OBJEXT) queue.$(OBJEXT) smtp_in.$(OBJEXT) \ + smtp_out.$(OBJEXT) spool.$(OBJEXT) tables.$(OBJEXT) \ + timeival.$(OBJEXT) +masqmail_OBJECTS = $(am_masqmail_OBJECTS) +masqmail_DEPENDENCIES = +masqmail_LDFLAGS = +am_mservdetect_OBJECTS = mservdetect.$(OBJEXT) interface.$(OBJEXT) \ + mserver.$(OBJEXT) readsock.$(OBJEXT) peopen.$(OBJEXT) +mservdetect_OBJECTS = $(am_mservdetect_OBJECTS) +mservdetect_DEPENDENCIES = +mservdetect_LDFLAGS = +am_readtest_OBJECTS = readsock.$(OBJEXT) readtest.$(OBJEXT) +readtest_OBJECTS = $(am_readtest_OBJECTS) +readtest_DEPENDENCIES = +readtest_LDFLAGS = +am_smtpsend_OBJECTS = smtpsend.$(OBJEXT) accept.$(OBJEXT) \ + address.$(OBJEXT) child.$(OBJEXT) connect.$(OBJEXT) \ + header.$(OBJEXT) interface.$(OBJEXT) lookup.$(OBJEXT) \ + message.$(OBJEXT) parse.$(OBJEXT) peopen.$(OBJEXT) \ + readsock.$(OBJEXT) smtp_out.$(OBJEXT) +smtpsend_OBJECTS = $(am_smtpsend_OBJECTS) +smtpsend_DEPENDENCIES = +smtpsend_LDFLAGS = + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/address.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/alias.Po ./$(DEPDIR)/child.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/conf.Po ./$(DEPDIR)/connect.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/deliver.Po ./$(DEPDIR)/dotlock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/expand.Po ./$(DEPDIR)/fail_msg.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/get.Po ./$(DEPDIR)/header.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/interface.Po ./$(DEPDIR)/listen.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/local.Po ./$(DEPDIR)/log.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lookup.Po ./$(DEPDIR)/masqmail.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/message.Po ./$(DEPDIR)/mservdetect.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/mserver.Po ./$(DEPDIR)/online.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/parse.Po ./$(DEPDIR)/peopen.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/permissions.Po ./$(DEPDIR)/pop3_in.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/queue.Po ./$(DEPDIR)/readsock.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/readtest.Po ./$(DEPDIR)/rewrite.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/route.Po ./$(DEPDIR)/smtp_in.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/smtp_out.Po ./$(DEPDIR)/smtpsend.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/spool.Po ./$(DEPDIR)/tables.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/timeival.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(masqmail_SOURCES) $(mservdetect_SOURCES) \ + $(readtest_SOURCES) $(smtpsend_SOURCES) + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(masqmail_SOURCES) $(mservdetect_SOURCES) $(readtest_SOURCES) $(smtpsend_SOURCES) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sbindir) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \ + else :; fi; \ + done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ + rm -f $(DESTDIR)$(sbindir)/$$f; \ + done + +clean-sbinPROGRAMS: + -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) +masqmail$(EXEEXT): $(masqmail_OBJECTS) $(masqmail_DEPENDENCIES) + @rm -f masqmail$(EXEEXT) + $(LINK) $(masqmail_LDFLAGS) $(masqmail_OBJECTS) $(masqmail_LDADD) $(LIBS) +mservdetect$(EXEEXT): $(mservdetect_OBJECTS) $(mservdetect_DEPENDENCIES) + @rm -f mservdetect$(EXEEXT) + $(LINK) $(mservdetect_LDFLAGS) $(mservdetect_OBJECTS) $(mservdetect_LDADD) $(LIBS) +readtest$(EXEEXT): $(readtest_OBJECTS) $(readtest_DEPENDENCIES) + @rm -f readtest$(EXEEXT) + $(LINK) $(readtest_LDFLAGS) $(readtest_OBJECTS) $(readtest_LDADD) $(LIBS) +smtpsend$(EXEEXT): $(smtpsend_OBJECTS) $(smtpsend_DEPENDENCIES) + @rm -f smtpsend$(EXEEXT) + $(LINK) $(smtpsend_LDFLAGS) $(smtpsend_OBJECTS) $(smtpsend_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/address.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/child.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deliver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dotlock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expand.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fail_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masqmail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mservdetect.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mserver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/online.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/permissions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_in.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readsock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp_in.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp_out.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtpsend.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tables.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeival.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + else \ + include_option=--include; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ + clean-sbinPROGRAMS mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS install-sbinPROGRAMS + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ + uninstall-sbinPROGRAMS + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ + clean-recursive clean-sbinPROGRAMS ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-sbinPROGRAMS install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \ + uninstall-info-recursive uninstall-recursive \ + uninstall-sbinPROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 src/accept.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/accept.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,478 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include "readsock.h" + +gchar *prot_names[] = +{ + "local", + "bsmtp", + "smtp", + "esmtp", + "pop3", + "apop", + "(unknown)" /* should not happen, but better than crashing. */ +}; + +static +gchar *string_base62(gchar *res, guint value, gchar len) +{ + static gchar base62_chars[] = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + gchar *p = res + len; + *p = 0; + while (p > res){ + *(--p) = base62_chars[value % 62]; + value /= 62; + } + return res; +} + +static gint _g_list_addr_isequal(gconstpointer a, gconstpointer b) +{ + address *addr1 = (address *)a; + address *addr2 = (address *)b; + int ret; + + if((ret = strcasecmp(addr1->domain, addr2->domain)) == 0) + return strcmp(addr1->local_part, addr2->local_part); + else + return ret; +} + +/* accept message from anywhere. + A locally originating message is indicated by msg->recieved_host == NULL + + If the flags ACC_DEL_RCPTS is set, recipients in the msg->rcpt_list is + copied and items occuring in it will be removed from the newly constructed + (from To/Cc/Bcc headers if ACC_RCPT_TO is set) rcpt_list. +*/ + +accept_error accept_message_stream(FILE *in, message *msg, guint flags) +{ + gchar *line, *line1; + int line_size = MAX_DATALINE; + gboolean in_headers = TRUE; + header *hdr = NULL; + gint line_cnt = 0, data_size = 0; + + line = g_malloc(line_size); + line[0] = 0; + + while(TRUE){ + int len = read_sockline1(in, &line, &line_size, 5*60, READSOCKL_CVT_CRLF); + + line1 = line; + + if((line[0] == '.') && (!(flags & ACC_NODOT_TERM))){ + if(line[1] == '\n'){ + g_free(line); + break; + } + line1++; + } + + if(len <= 0){ + if((len == -1) && ((flags & ACC_NODOT_TERM) || (flags & ACC_NODOT_RELAX))){ + /* we got an EOF, and the last line was not terminated by a CR */ + gint len1 = strlen(line1); + if(len1 > 0){ /* == 0 is 'normal' (EOF after a CR) */ + if(line1[len1-1] != '\n'){ /* some mail clients allow unterminated lines */ + line1[len1] = '\n'; + line1[len1+1] = 0; + msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1)); + data_size += strlen(line1); + line_cnt++; + } + } + break; + }else{ + g_free(line); + if(len == -1){ + return AERR_EOF; + }else if(len == -2){ + /* should not happen any more */ + return AERR_OVERFLOW; + }else if(len == -3){ + return AERR_TIMEOUT; + }else{ + /* does not happen */ + DEBUG(5) debugf("read_sockline returned %d\n", len); + return AERR_UNKNOWN; + } + } + } + else{ + if(in_headers){ + + /* some pop servers send the 'From ' line, skip it: */ + if(msg->hdr_list == NULL) + if(strncmp(line1, "From ", 5) == 0) + continue; + + if(line1[0] == ' ' || line1[0] == '\t'){ + /* continuation of 'folded' header: */ + if(hdr){ + hdr->header = g_strconcat(hdr->header, line1, NULL); + } + + }else if(line1[0] == '\n'){ + /* an empty line marks end of headers */ + in_headers = FALSE; + }else{ + /* in all other cases we expect another header */ + if((hdr = get_header(line1))) + msg->hdr_list = g_list_append(msg->hdr_list, hdr); + else{ + /* if get_header() returns NULL, no header was recognized, + so this seems to be the first data line of a broken mailer + which does not send an empty line after the headers */ + in_headers = FALSE; + msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1)); + } + } + }else{ + msg->data_list = g_list_prepend(msg->data_list, g_strdup(line1)); + data_size += strlen(line1); + line_cnt++; + } + } + } + + if(msg->data_list != NULL) + msg->data_list = g_list_reverse(msg->data_list); + else + /* make sure data list is not NULL: */ + msg->data_list = g_list_append(NULL, g_strdup("")); + + DEBUG(4) debugf("received %d lines of data (%d bytes)\n", + line_cnt, data_size); + /* we get here after we succesfully + received the mail data */ + + msg->data_size = data_size; + msg->received_time = time(NULL); + + return AERR_OK; +} + +accept_error accept_message_prepare(message *msg, guint flags) +{ + struct passwd *passwd = NULL; + GList *non_rcpt_list = NULL; + time_t rec_time = time(NULL); + + DEBUG(5) debugf("accept_message_prepare()\n"); + + /* create unique message id */ + msg->uid = g_malloc(14); + + string_base62(msg->uid, rec_time, 6); + msg->uid[6] = '-'; + string_base62(&(msg->uid[7]), getpid(), 3); + msg->uid[10] = '-'; + string_base62(&(msg->uid[11]), msg->transfer_id, 2); + msg->uid[13] = 0; + + /* if local, get password entry */ + if(msg->received_host == NULL){ + passwd = g_memdup(getpwuid(geteuid()), sizeof(struct passwd)); + msg->ident = g_strdup(passwd->pw_name); + } + + /* set return path if local */ + if(msg->return_path == NULL){ + + if(msg->received_host == NULL){ + gchar *path = g_strdup_printf("<%s@%s>", + passwd->pw_name, conf.host_name); + DEBUG(3) debugf("setting return_path for local accept: %s\n", path); + msg->return_path = create_address(path, TRUE); + g_free(path); + } + } + + /* -t option */ + if(flags & ACC_DEL_RCPTS){ + non_rcpt_list = msg->rcpt_list; + msg->rcpt_list = NULL; + } + + /* scan headers */ + { + gboolean has_id = FALSE; + gboolean has_date = FALSE; + gboolean has_sender = FALSE; + gboolean has_from = FALSE; + gboolean has_rcpt = FALSE; + gboolean has_to_or_cc = FALSE; + GList *hdr_node, *hdr_node_next; + header *hdr; + + for(hdr_node = g_list_first(msg->hdr_list); + hdr_node != NULL; + hdr_node = hdr_node_next){ + hdr_node_next = g_list_next(hdr_node); + hdr = ((header *)(hdr_node->data)); + DEBUG(5) debugf("scanning headers: %s", hdr->header); + switch(hdr->id){ + case HEAD_MESSAGE_ID: + has_id = TRUE; break; + case HEAD_DATE: + has_date = TRUE; break; + case HEAD_FROM: + has_from = TRUE; + break; + case HEAD_SENDER: + has_sender = TRUE; + break; + case HEAD_TO: + case HEAD_CC: + case HEAD_BCC: + has_rcpt = TRUE; + if(flags & ACC_RCPT_FROM_HEAD){ + DEBUG(5) debugf("hdr->value = %s\n", hdr->value); + if(hdr->value){ + msg->rcpt_list = + addr_list_append_rfc822(msg->rcpt_list, hdr->value, conf.host_name); + } + } + if((flags & ACC_DEL_BCC) && (hdr->id == HEAD_BCC)){ + DEBUG(3) debugf("removing 'Bcc' header\n"); + msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node); + g_list_free_1(hdr_node); + destroy_header(hdr); + }else + has_to_or_cc = TRUE; + break; + case HEAD_ENVELOPE_TO: + if(flags & ACC_SAVE_ENVELOPE_TO){ + DEBUG(3) debugf("creating 'X-Orig-Envelope-To' header\n"); + msg->hdr_list = + g_list_prepend(msg->hdr_list, + create_header(HEAD_UNKNOWN, + "X-Orig-Envelope-to: %s", hdr->value)); + } + DEBUG(3) debugf("removing 'Envelope-To' header\n"); + msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node); + g_list_free_1(hdr_node); + destroy_header(hdr); + break; + case HEAD_RETURN_PATH: + if(flags & ACC_MAIL_FROM_HEAD){ + /* usually POP3 accept */ + msg->return_path = create_address_qualified(hdr->value, TRUE, msg->received_host); + DEBUG(3) debugf("setting return_path to %s\n", + addr_string(msg->return_path)); + } + DEBUG(3) debugf("removing 'Return-Path' header\n"); + msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node); + g_list_free_1(hdr_node); + destroy_header(hdr); + break; + default: + break; /* make compiler happy */ + } + } + + if(msg->return_path == NULL){ + /* this can happen for pop3 accept only + and if no Return-path: header was given */ + GList *hdr_list; + header *hdr; + + DEBUG(3) debugf("return_path == NULL\n"); + + hdr_list = find_header(msg->hdr_list, HEAD_SENDER, NULL); + if(!hdr_list) hdr_list = find_header(msg->hdr_list, HEAD_FROM, NULL); + if(hdr_list){ + gchar *addr; + hdr = (header *)(g_list_first(hdr_list)->data); + + DEBUG(5) debugf("hdr->value = '%s'\n", hdr->value); + + addr = g_strdup(hdr->value); + g_strchomp(addr); + + if((msg->return_path = + create_address_qualified(addr, FALSE, msg->received_host)) + != NULL){ + DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path)); + msg->hdr_list = + g_list_append(msg->hdr_list, + create_header(HEAD_UNKNOWN, + "X-Warning: return path set from %s address\n", + hdr->id == HEAD_SENDER ? "Sender:" : "From:")); + } + g_free(addr); + } + if(msg->return_path == NULL){ /* no Sender: or From: or create_address_qualified failed */ + msg->return_path = create_address_qualified("postmaster", TRUE, conf.host_name); + DEBUG(3) debugf("setting return_path to %s\n", addr_string(msg->return_path)); + msg->hdr_list = + g_list_append(msg->hdr_list, + create_header(HEAD_UNKNOWN, + "X-Warning: real return path is unkown\n")); + } + } + + if(flags & ACC_DEL_RCPTS){ + GList *rcpt_node; + foreach(non_rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + GList *node; + if((node = g_list_find_custom(msg->rcpt_list, rcpt, + _g_list_addr_isequal))){ + DEBUG(3) debugf("removing rcpt address %s\n", addr_string(node->data)); + + msg->rcpt_list = g_list_remove_link(msg->rcpt_list, node); + destroy_address((address *)(node->data)); + g_list_free_1(node); + } + } + } + + /* here we should have our recipients, fail if not: */ + if(msg->rcpt_list == NULL){ + logwrite(LOG_WARNING, "no recipients found in message\n"); + return AERR_NORCPT; + } + + if(!(has_sender || has_from)){ + DEBUG(3) debugf("adding 'From' header\n"); + msg->hdr_list = + g_list_append(msg->hdr_list, + msg->full_sender_name ? + create_header(HEAD_FROM, "From: \"%s\" <%s@%s>\n", + msg->full_sender_name, + msg->return_path->local_part, + msg->return_path->domain) : + create_header(HEAD_FROM, "From: <%s@%s>\n", + msg->return_path->local_part, + msg->return_path->domain) + ); + } + if((flags & ACC_HEAD_FROM_RCPT) && !has_rcpt){ + GList *node; + DEBUG(3) debugf("adding 'To' header(s)\n"); + for(node = g_list_first(msg->rcpt_list); + node; + node = g_list_next(node)){ + msg->hdr_list = + g_list_append(msg->hdr_list, + create_header(HEAD_TO, "To: %s\n", addr_string(msg->return_path))); + } + } + if((flags & ACC_DEL_BCC) && !has_to_or_cc){ + /* Bcc headers have been removed, and there are no remaining rcpt headers */ + DEBUG(3) debugf("adding empty 'Bcc:' header\n"); + msg->hdr_list = + g_list_append(msg->hdr_list, create_header(HEAD_BCC, "Bcc:\n")); + } + if(!has_date){ + DEBUG(3) debugf("adding 'Date:' header\n"); + msg->hdr_list = + g_list_append(msg->hdr_list, + create_header(HEAD_DATE, "Date: %s\n", rec_timestamp())); + } + if(!has_id){ + DEBUG(3) debugf("adding 'Message-ID:' header\n"); + msg->hdr_list = + g_list_append(msg->hdr_list, + create_header(HEAD_MESSAGE_ID, + "Message-ID: <%s@%s>\n", + msg->uid, conf.host_name)); + } + } + + /* Received header: */ + /* At this point because we have to know the rcpts for the 'for' part */ + if(!(flags & ACC_NO_RECVD_HDR)){ + gchar *for_string = NULL; + header *hdr = NULL; + + DEBUG(3) debugf("adding 'Received:' header\n"); + + if(g_list_length(msg->rcpt_list) == 1){ + address *addr = (address *)(g_list_first(msg->rcpt_list)->data); + for_string = g_strdup_printf(" for %s", addr_string(addr)); + } + + if(msg->received_host == NULL){ + hdr = create_header(HEAD_RECEIVED, + "Received: from %s by %s" + " with %s (%s %s) id %s%s;" + " %s\n", + passwd->pw_name, conf.host_name, + prot_names[msg->received_prot], + PACKAGE, VERSION, + msg->uid, for_string ? for_string : "", + rec_timestamp()); + }else{ +#ifdef ENABLE_IDENT + DEBUG(5) debugf("adding 'Received:' header (5)\n"); + hdr = create_header(HEAD_RECEIVED, + "Received: from %s (ident=%s) by %s" + " with %s (%s %s) id %s%s;" + " %s\n", + msg->received_host, + msg->ident ? msg->ident : "unknown", + conf.host_name, + prot_names[msg->received_prot], + PACKAGE, VERSION, + msg->uid, for_string ? for_string : "", + rec_timestamp()); +#else + hdr = create_header(HEAD_RECEIVED, + "Received: from %s by %s" + " with %s (%s %s) id %s%s;" + " %s\n", + msg->received_host, + conf.host_name, + prot_names[msg->received_prot], + PACKAGE, VERSION, + msg->uid, for_string ? for_string : "", + rec_timestamp()); +#endif + } + header_fold(hdr); + msg->hdr_list = g_list_prepend(msg->hdr_list, hdr); + + if(for_string) g_free(for_string); + } + + /* write message to spool: */ + /* accept is no longer responsible for this + if(!spool_write(msg, TRUE)) + return AERR_NOSPOOL; + */ + return AERR_OK; +} + +accept_error accept_message(FILE *in, message *msg, guint flags) +{ + accept_error err; + + err = accept_message_stream(in, msg, flags); + if(err == AERR_OK) + err = accept_message_prepare(msg, flags); + + return err; +} + diff -r 000000000000 -r 08114f7dcc23 src/address.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/address.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,189 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include + +address *create_address(gchar *path, gboolean is_rfc821) +{ + address *addr; + addr = _create_address(path, NULL, is_rfc821); + + if(addr != NULL){ + addr_unmark_delivered(addr); + } + return addr; +} + +address *create_address_qualified(gchar *path, gboolean is_rfc821, + gchar *domain) +{ + address *addr = create_address(path, is_rfc821); + if(addr != NULL){ + if(addr->domain == NULL) + addr->domain = g_strdup(domain); + } + + return addr; +} + +/* nothing special about pipes here, + but its only called for that purpose */ +address *create_address_pipe(gchar *path) +{ + address *addr = g_malloc(sizeof(address)); + + if(addr){ + memset(addr, 0, sizeof(address)); + addr->address = g_strchomp(g_strdup(path)); + addr->local_part = g_strdup(addr->address); + + addr->domain = g_strdup("localhost"); /* quick hack */ + } + return addr; +} + +void destroy_address(address *addr) +{ + DEBUG(6) debugf("destroy_address entered\n"); + + g_free(addr->address); + g_free(addr->local_part); + g_free(addr->domain); + + g_free(addr); +} + +address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom) +{ + address *addr = NULL; + + if(orig){ + addr = g_malloc(sizeof(address)); + if(addr){ + addr->address = g_strdup(orig->address); + + if(l_part == NULL) + addr->local_part = g_strdup(orig->local_part); + else + addr->local_part = g_strdup(l_part); + + if(dom == NULL) + addr->domain = g_strdup(orig->domain); + else + addr->domain = g_strdup(dom); + + addr->flags = 0; + addr->children = NULL; + addr->parent = NULL; + } + } + return addr; +} + +gboolean addr_isequal(address *addr1, address *addr2) +{ + return + (strcmp(addr1->local_part, addr2->local_part) == 0) && + (strcasecmp(addr1->domain, addr2->domain) == 0); +} + +/* searches in ancestors of addr1 */ +gboolean addr_isequal_parent(address *addr1, address *addr2) +{ + address *addr; + + for(addr = addr1; addr; addr = addr->parent) + if(addr_isequal(addr, addr2)) + return TRUE; + + return FALSE; +} + +/* careful, this is recursive */ +/* returns TRUE if ALL children have been delivered */ +gboolean addr_is_delivered_children(address *addr) +{ + GList *addr_node; + + if(addr->children == NULL) return addr_is_delivered(addr); + + foreach(addr->children, addr_node){ + address *addr = (address *)(addr_node->data); + if(!addr_is_delivered_children(addr)) + return FALSE; + } + return TRUE; +} + +/* careful, this is recursive */ +/* returns TRUE if ALL children have been either delivered or have failed */ +gboolean addr_is_finished_children(address *addr) +{ + GList *addr_node; + + if(addr->children == NULL) return (addr_is_failed(addr) || addr_is_delivered(addr)); + + foreach(addr->children, addr_node){ + address *addr = (address *)(addr_node->data); + if(!addr_is_finished_children(addr)) + return FALSE; + } + return TRUE; +} + +/* find original address */ +address *addr_find_ancestor(address *addr) +{ + while(addr->parent) addr = addr->parent; + return addr; +} + +gchar *addr_string(address *addr) +{ + static gchar *buffer = NULL; + + if(addr == NULL){ + g_free(buffer); + buffer = NULL; + return NULL; + } + if(buffer) + g_free(buffer); + + if(addr->local_part[0] == 0){ + buffer = g_strdup("<>"); + }else{ + buffer = g_strdup_printf("<%s@%s>", + addr->local_part ? addr->local_part : "", + addr->domain ? addr->domain : ""); + } + return buffer; +} + +gint addr_match(address *addr1, address *addr2) +{ + int res; + + if((res = fnmatch(addr1->local_part, addr2->local_part, 0)) == 0){ + if((res = fnmatch(addr1->domain, addr2->domain, FNM_CASEFOLD)) == 0) + return 0; + } + return res; +} + diff -r 000000000000 -r 08114f7dcc23 src/alias.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alias.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,195 @@ +/* MasqMail + Copyright (C) 2000-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include + +gboolean addr_is_local(address *addr) +{ + GList *dom_node; + GList *addr_node; + address *a; + + foreach(conf.local_hosts, dom_node){ + if(addr->domain == NULL) + return TRUE; + if(fnmatch(dom_node->data, addr->domain, FNM_CASEFOLD) == 0){ + foreach(conf.not_local_addresses,addr_node){ + a = create_address_qualified(addr_node->data, TRUE, conf.host_name); + if(addr_isequal(a,addr)){ + destroy_address(a); + return FALSE; + } + destroy_address(a); + } + return TRUE; + } + } + foreach(conf.local_addresses,addr_node){ + a = create_address_qualified(addr_node->data, TRUE, conf.host_name); + if(addr_isequal(a,addr)){ + destroy_address(a); + return TRUE; + } + destroy_address(a); + } + return FALSE; +} + +static +gboolean addr_isequal_alias(address *addr1, address *addr2) +{ + return + (conf.alias_local_cmp(addr1->local_part, addr2->local_part) == 0) && + (strcasecmp(addr1->domain, addr2->domain) == 0); +} + +static +GList *parse_list(gchar *line) +{ + GList *list = NULL; + gchar buf[256]; + gchar *p, *q; + + p = line; + while(*p != 0){ + q = buf; + while(isspace(*p)) p++; + if(*p != '\"'){ + while(*p && (*p != ',') && (q < buf+255)) + *(q++) = *(p++); + *q = 0; + }else{ + gboolean escape = FALSE; + p++; + while(*p && (*p != '\"' || escape) && (q < buf+255)){ + if((*p == '\\') && !escape) + escape = TRUE; + else{ + escape = FALSE; + *(q++) = *p; + } + p++; + } + *q = 0; + while(*p && (*p != ',')) p++; + } + list = g_list_append(list, g_strdup(g_strchomp(buf))); + if(*p) p++; + } + return list; +} + +GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list) +{ + GList *done_list = NULL; + GList *rcpt_node = g_list_copy(rcpt_list); + + while(rcpt_node != NULL){ + address *addr = (address *)(rcpt_node->data); + DEBUG(5) debugf("alias_expand begin: '%s@%s'\n", addr->local_part, addr->domain); +// if(addr_is_local(addr) && (addr->local_part[0] != '|') && + if(addr_is_local(addr) && + !(addr->flags & ADDR_FLAG_NOEXPAND)){ + gchar *val; + + /* special handling for postmaster */ + if(strcasecmp(addr->local_part, "postmaster") == 0) + val = (gchar *)table_find_func(alias_table, addr->local_part, strcasecmp); + else + val = (gchar *)table_find_func(alias_table, addr->local_part, conf.alias_local_cmp); + + DEBUG(5) debugf("alias: '%s' is local\n", addr->local_part); + if(val != NULL){ + GList *val_list = parse_list(val); + GList *val_node; + GList *alias_list = NULL; + + DEBUG(5) debugf("alias: '%s' -> '%s'\n", addr->local_part, val); + foreach(val_list, val_node){ + gchar *val = (gchar *)(val_node->data); + address *alias_addr; + address *addr_parent = NULL; + + if(val[0] == '|'){ + DEBUG(5) debugf("alias: %s is a pipe address\n", val); + alias_addr = create_address_pipe(val); + DEBUG(5) debugf("alias_pipe: %s is a pipe address\n", alias_addr->local_part); + }else if(val[0] == '\\'){ + DEBUG(5) debugf("alias: shall not be expanded: '%s'\n", val); + alias_addr = create_address_qualified(&(val[1]), TRUE, conf.host_name); + alias_addr->flags |= ADDR_FLAG_NOEXPAND; + DEBUG(5) debugf("alias: not expanded: '%s'\n",alias_addr->local_part); + }else{ + alias_addr = create_address_qualified(val, TRUE, conf.host_name); + + /* search in parents for loops: */ + for(addr_parent = addr; addr_parent; addr_parent = addr_parent->parent){ + if(addr_isequal_alias(alias_addr, addr_parent)){ + logwrite(LOG_ALERT, "detected alias loop, (ignoring): %s@%s -> %s@%s\n", + addr_parent->local_part, addr_parent->domain, + addr->local_part, addr->domain); + break; + } + } + } + if(!addr_parent){ + alias_list = g_list_append(alias_list, alias_addr); + alias_addr->parent = addr; + } + g_free(val); + } + g_list_free(val_list); + addr->children = g_list_copy(alias_list); + rcpt_node = g_list_concat(rcpt_node, alias_list); + }else{ + DEBUG(5) debugf("alias: '%s' is completed\n", addr->local_part); + done_list = g_list_append(done_list, addr); + } + }else{ + DEBUG(5) debugf("alias: '%s@%s' is not local\n", addr->local_part, addr->domain); + done_list = g_list_append(done_list, addr); + } + rcpt_node = g_list_next(rcpt_node); + } + + /* delete addresses from done_list if they are in the non_rcpt_list */ + if(non_rcpt_list){ + GList *rcpt_node_next; + for(rcpt_node = g_list_first(done_list); + rcpt_node; + rcpt_node = rcpt_node_next){ + address *addr = (address *)(rcpt_node->data); + GList *non_node; + + rcpt_node_next = g_list_next(rcpt_node); + + foreach(non_rcpt_list, non_node){ + address *non_addr = (address *)(non_node->data); + if(addr_isequal(addr, non_addr)){ + done_list = g_list_remove_link(done_list, rcpt_node); + g_list_free_1(rcpt_node); + addr_mark_delivered(addr); /* this address is still in the children lists + of the original address */ + break; + } + } + } + } + return done_list; +} diff -r 000000000000 -r 08114f7dcc23 src/base64/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base64/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,21 @@ +AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE + +noinst_LIBRARIES=libbase64.a +noinst_PROGRAMS=base64enc base64dec + +base64enc_SOURCES=\ + base64.h\ + base64enc.c\ + base64.c + +base64dec_SOURCES=\ + base64.h\ + base64dec.c\ + base64.c + +libbase64_a_SOURCES=\ + base64.h\ + base64.c + +base64enc_LDADD=@GLIB_LIBS@ +base64dec_LDADD=@GLIB_LIBS@ diff -r 000000000000 -r 08114f7dcc23 src/base64/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base64/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,421 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE + +noinst_LIBRARIES = libbase64.a +noinst_PROGRAMS = base64enc base64dec + +base64enc_SOURCES = \ + base64.h\ + base64enc.c\ + base64.c + + +base64dec_SOURCES = \ + base64.h\ + base64dec.c\ + base64.c + + +libbase64_a_SOURCES = \ + base64.h\ + base64.c + + +base64enc_LDADD = @GLIB_LIBS@ +base64dec_LDADD = @GLIB_LIBS@ +subdir = src/base64 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libbase64_a_AR = $(AR) cru +libbase64_a_LIBADD = +am_libbase64_a_OBJECTS = base64.$(OBJEXT) +libbase64_a_OBJECTS = $(am_libbase64_a_OBJECTS) +noinst_PROGRAMS = base64enc$(EXEEXT) base64dec$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) + +am_base64dec_OBJECTS = base64dec.$(OBJEXT) base64.$(OBJEXT) +base64dec_OBJECTS = $(am_base64dec_OBJECTS) +base64dec_DEPENDENCIES = +base64dec_LDFLAGS = +am_base64enc_OBJECTS = base64enc.$(OBJEXT) base64.$(OBJEXT) +base64enc_OBJECTS = $(am_base64enc_OBJECTS) +base64enc_DEPENDENCIES = +base64enc_LDFLAGS = + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/base64.Po ./$(DEPDIR)/base64dec.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/base64enc.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libbase64_a_SOURCES) $(base64dec_SOURCES) \ + $(base64enc_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libbase64_a_SOURCES) $(base64dec_SOURCES) $(base64enc_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/base64/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +AR = ar + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libbase64.a: $(libbase64_a_OBJECTS) $(libbase64_a_DEPENDENCIES) + -rm -f libbase64.a + $(libbase64_a_AR) libbase64.a $(libbase64_a_OBJECTS) $(libbase64_a_LIBADD) + $(RANLIB) libbase64.a + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +base64dec$(EXEEXT): $(base64dec_OBJECTS) $(base64dec_DEPENDENCIES) + @rm -f base64dec$(EXEEXT) + $(LINK) $(base64dec_LDFLAGS) $(base64dec_OBJECTS) $(base64dec_LDADD) $(LIBS) +base64enc$(EXEEXT): $(base64enc_OBJECTS) $(base64enc_DEPENDENCIES) + @rm -f base64enc$(EXEEXT) + $(LINK) $(base64enc_LDFLAGS) $(base64enc_OBJECTS) $(base64enc_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64dec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64enc.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) $(PROGRAMS) + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 src/base64/base64.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base64/base64.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,128 @@ +/* base64.c, Copyright 2000 (C) Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + send bugs to: kurth@innominate.de +*/ + +/* see also RFC 1341 */ + +#include +#include +#include "base64.h" + +gchar *base64_encode(guchar *buf, gint len) +{ + guchar *outbuf, *q; + gchar enc[64]; + gint i = 0, j = 0; + guint in0, in1, in2; + + for(; i < 26; i++) enc[i] = (gchar)('A' + j++); j = 0; + for(; i < 52; i++) enc[i] = (gchar)('a' + j++); j = 0; + for(; i < 62; i++) enc[i] = (gchar)('0' + j++); + enc[i++] = '+'; + enc[i++] = '/'; + + outbuf = g_malloc(((len+3) * 8)/6); + q = outbuf; + + i = 0; + while(i < len-2){ + in0 = buf[i++]; + in1 = buf[i++]; + in2 = buf[i++]; + + *(q++) = enc[(in0 >> 2) & 0x3f]; + *(q++) = enc[((in0 << 4) | (in1 >> 4)) & 0x3f]; + *(q++) = enc[((in1 << 2) | (in2 >> 6)) & 0x3f]; + *(q++) = enc[in2 & 0x3f]; + } + if((len - i) == 1){ + in0 = buf[i++]; + *(q++) = enc[(in0 >> 2) & 0x3f]; + *(q++) = enc[(in0 << 4) & 0x3f]; + *(q++) = '='; + *(q++) = '='; + }else if((len - i) == 2){ + in0 = buf[i++]; + in1 = buf[i++]; + *(q++) = enc[(in0 >> 2) & 0x3f]; + *(q++) = enc[((in0 << 4) | (in1 >> 4)) & 0x3f]; + *(q++) = enc[(in1 << 2) & 0x3f]; + *(q++) = '='; + } + *q = 0; + + return outbuf; +} + +gchar *base64_decode(gchar *buf, gint *size) +{ + guchar *p = buf, *q; + guint in[4]; + // gchar *out = g_malloc(((strlen(buf)+3) * 3) / 4 + 1); + gchar *out = g_malloc((strlen(buf)+3) + 1); + + q = out; + *size = 0; + + *q = 0; + + while(*p){ + int i = 0; + while(i < 4){ + if(!*p) break; + if((*p >= 'A') && (*p <= 'Z')) + in[i++] = *p - 'A'; + else if((*p >= 'a') && (*p <= 'z')) + in[i++] = (*p - 'a') + 26; + else if((*p >= '0') && (*p <= '9')) + in[i++] = (*p - '0') + 52; + else if(*p == '+') + in[i++] = 62; + else if(*p == '/') + in[i++] = 63; + else if(*p == '='){ + in[i++] = 0; + p++; + break; + }else if((*p != '\r') && (*p != '\n')){ + p++; + break; + } + p++; + } + if((i == 4) || (p[-1] == '=')){ + *(q++) = ((in[0] << 2) | (in[1] >> 4)); + *(q++) = ((in[1] << 4) | (in[2] >> 2)); + *(q++) = ((in[2] << 6) | in[3]); + if(p[-1] == '='){ + if(i == 3){ + (*size)++; + } + else if(i == 4){ + (*size) += 2; + } + }else{ + *size += 3; + } + } + } + return out; +} + diff -r 000000000000 -r 08114f7dcc23 src/base64/base64.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base64/base64.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,19 @@ +/* base64.h, Copyright 2000 (C) Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +gchar *base64_encode(guchar *buf, gint len); +gchar *base64_decode(gchar *buf, gint *size); diff -r 000000000000 -r 08114f7dcc23 src/base64/base64dec.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base64/base64dec.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,19 @@ +#include +#include +#include + +#include "base64.h" + +int main() +{ + gchar line[100]; + gchar *buf; + gint size; + + while(fgets(line, 100, stdin)){ + buf = base64_decode(line, &size); + fwrite(buf, size, 1, stdout); + g_free(buf); + } + exit(0); +} diff -r 000000000000 -r 08114f7dcc23 src/base64/base64enc.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base64/base64enc.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,24 @@ + +#include +#include +#include + +#include "base64.h" + +int main() +{ + gchar in[58]; + gint size; + + do{ + gchar *out; + + size = fread(in, 1, 54, stdin); + out = base64_encode(in, size); + fputs(out, stdout); + putchar('\n'); + g_free(out); + }while(size == 54); + exit(0); +} + diff -r 000000000000 -r 08114f7dcc23 src/child.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/child.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,79 @@ +/* child.c, Copyright (C) 2000 by Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "masqmail.h" + +int volatile sigchild_seen = 0; + +static +void sigchild_handler(int sig) +{ + sigchild_seen = 1; + signal(SIGHUP, sigchild_handler); +} + +int child(const char *command) +{ + int pipe[2]; + + if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe) == 0){ + pid_t pid; + + /* + sigchild_seen = 0; + signal(SIGCHLD, sigchild_handler); + */ + + pid = fork(); + if(pid == 0){ + int i, max_fd = sysconf(_SC_OPEN_MAX); + /* child */ + dup2(pipe[0], 0); + dup2(pipe[0], 1); + dup2(pipe[0], 2); + + if(max_fd <= 0) max_fd = 64; + for(i = 3; i < max_fd; i++) + close(i); + + { + char *argv [] = { "/bin/sh", "-c", (char*) command, NULL }; + execve (*argv, argv, NULL); + } + logwrite(LOG_ALERT, "execve failed: %s\n", strerror(errno)); + _exit(EXIT_FAILURE); + }else if(pid == -1){ + return -1; + }else{ + close(pipe[0]); + return pipe[1]; + } + } + return -2; +} + + diff -r 000000000000 -r 08114f7dcc23 src/conf.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/conf.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,995 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" + +#include "pwd.h" +#include "grp.h" + +masqmail_conf conf; + +void init_conf() +{ + struct passwd *passwd; + struct group *group; + + memset(&conf, 0, sizeof(masqmail_conf)); + + conf.orig_uid = getuid(); + conf.orig_gid = getgid(); + + if((passwd = getpwnam(DEF_MAIL_USER))) + conf.mail_uid = passwd->pw_uid; + else{ + fprintf(stderr, "user %s not found! (terminating)\n", DEF_MAIL_USER); + exit(EXIT_FAILURE); + } + if((group = getgrnam(DEF_MAIL_GROUP))) + conf.mail_gid = group->gr_gid; + else{ + fprintf(stderr, "group %s not found! (terminating)\n", DEF_MAIL_GROUP); + exit(EXIT_FAILURE); + } +} + +static gchar *true_strings[] = +{ + "yes", "on", "true", NULL +}; + +static gchar *false_strings[] = +{ + "no", "off", "false", NULL +}; + +static +gboolean parse_boolean(gchar *rval) +{ + gchar **str; + + DEBUG(6) fprintf(stderr, "parse_boolean: %s\n", rval); + + str = true_strings; + while(*str){ + if(strncasecmp(*str, rval, strlen(*str)) == 0) + return TRUE; + str++; + } + + str = false_strings; + while(*str){ + if(strncasecmp(*str, rval, strlen(*str)) == 0) + return FALSE; + str++; + } + + fprintf(stderr, "cannot parse value '%s'\n", rval); + exit(EXIT_FAILURE); +} + +/* make a list from each line in a file */ +static +GList *parse_list_file(gchar *fname) +{ + GList *list = NULL; + FILE *fptr; + + if((fptr = fopen(fname, "rt"))){ + gchar buf[256]; + + while(!feof(fptr)){ + fgets(buf, 255, fptr); + if(buf[0] && (buf[0] != '#') && (buf[0] != '\n')){ + g_strchomp(buf); + list = g_list_append(list, g_strdup(buf)); + } + } + fclose(fptr); + }else{ + logwrite(LOG_ALERT, "could not open %s for reading: %s\n", fname, strerror(errno)); + exit(EXIT_FAILURE); + } + + return list; +} + +/* given a semicolon separated string, this function + makes a GList out of it. +*/ +GList *parse_list(gchar *line, gboolean read_file) +{ + GList *list = NULL; + gchar buf[256]; + gchar *p, *q; + + DEBUG(6) fprintf(stderr, "parsing list %s\n", line); + + p = line; + while(*p != 0){ + q = buf; + + while(*p && (*p != ';') && (q < buf+255)) + *(q++) = *(p++); + *q = 0; + + if((buf[0] == '/') && (read_file)) + /* item is a filename, include its contents */ + list = g_list_concat(list, parse_list_file(buf)); + else + /* just a normal item */ + list = g_list_append(list, g_strdup(buf)); + + DEBUG(6) printf("item = %s\n", buf); + + if(*p) p++; + } + return list; +} + +static +GList *parse_address_list(gchar *line, gboolean read_file) +{ + GList *plain_list = parse_list(line, read_file); + GList *node; + GList *list = NULL; + + foreach(plain_list, node){ + gchar *item = (gchar *)(node->data); + address *addr = create_address(item, TRUE); + if(addr) + list = g_list_append(list, addr); + g_free(item); + } + g_list_free(plain_list); + + return list; +} + +static +GList *parse_resolve_list(gchar *line) +{ + GList *list; + GList *list_node; + GList *res_list = NULL; + + list = parse_list(line, FALSE); + if(list){ + foreach(list, list_node){ + gchar *item = (gchar *)(list_node->data); + if(strcmp(item, "byname") == 0){ + res_list = g_list_append(res_list, resolve_byname); +#ifdef ENABLE_RESOLVER + }else if(strcmp(item, "dns_a") == 0){ + res_list = g_list_append(res_list, resolve_dns_a); + }else if(strcmp(item, "dns_mx") == 0){ + res_list = g_list_append(res_list, resolve_dns_mx); +#endif + }else{ + logwrite(LOG_ALERT, "unknown resolver %s\n", item); + exit(EXIT_FAILURE); + } + g_free(item); + } + g_list_free(list); + } + return res_list; +} + +static +interface *parse_interface(gchar *line, gint def_port) +{ + gchar buf[256]; + gchar *p, *q; + interface *iface; + + DEBUG(6) fprintf(stderr, "parse_interface: %s\n", line); + + p = line; + q = buf; + while((*p != 0) && (*p != ':') && (q < buf+255)) + *(q++) = *(p++); + *q = 0; + + iface = g_malloc(sizeof(interface)); + iface->address = g_strdup(buf); + + if(*p){ + p++; + iface->port = atoi(p); + }else + iface->port = def_port; + + return iface; +} + +#ifdef ENABLE_IDENT /* so far used for that only */ +static +struct in_addr *parse_network(gchar *line, gint def_port) +{ + gchar buf[256]; + gchar *p, *q; + struct in_addr addr, mask_addr, net_addr, *p_net_addr; + guint n; + + DEBUG(6) fprintf(stderr, "parse_network: %s\n", line); + + p = line; + q = buf; + while((*p != 0) && (*p != '/') && (q < buf+255)) + *(q++) = *(p++); + *q = 0; + + if((addr.s_addr = inet_addr(buf)) != INADDR_NONE){ + if(*p){ + guint i; + p++; + i = atoi(p); + if((i >= 0) && (i <= 32)) + n = i ? ~((1 << (32 - i)) - 1) : 0; + else{ + fprintf(stderr, "'%d' is not a valid net mask (must be >= 0 and <= 32)\n", i); + exit(EXIT_FAILURE); + } + }else + n = 0; + + mask_addr.s_addr = htonl(n); + net_addr.s_addr = mask_addr.s_addr & addr.s_addr; + }else{ + fprintf(stderr, "'%s' is not a valid address (must be ip)\n", buf); + exit(EXIT_FAILURE); + } + + p_net_addr = g_malloc(sizeof(struct in_addr)); + p_net_addr->s_addr = net_addr.s_addr; + return p_net_addr; +} +#endif + +static +gboolean eat_comments(FILE *in) +{ + gint c; + + for(c = fgetc(in); (c == '#' || isspace(c)) && c != EOF; c = fgetc(in)){ + if(c == '#'){ + gint c; + for(c = fgetc(in); (c != '\n') && (c != EOF); c = fgetc(in)); + } + } + if(c == EOF) return FALSE; + ungetc(c, in); + return TRUE; +} + +/* after parsing, eat trailing character until LF */ +static +gboolean eat_line_trailing(FILE *in) +{ + gint c; + + for(c = fgetc(in); c != EOF && c != '\n'; c = fgetc(in)); + if(c == EOF) return FALSE; + return TRUE; +} + +static +gboolean eat_spaces(FILE *in) +{ + gint c; + + for(c = fgetc(in); c != EOF && isspace(c); c = fgetc(in)); + if(c == EOF) return FALSE; + ungetc(c, in); + return TRUE; +} + +static +gboolean read_lval(FILE *in, gchar *buf, gint size) +{ + gint c; + gchar *ptr = buf; + + DEBUG(6) fprintf(stderr, "read_lval()\n"); + + if(!eat_spaces(in)) return FALSE; + + c = fgetc(in); + DEBUG(6) fprintf(stderr, "read_lval() 2\n"); + while((isalnum(c) || c == '_' || c == '-' || c == '.') + && (ptr < buf+size-1) + && (c != EOF) + ){ + *ptr = c; ptr++; + c = fgetc(in); + } + *ptr = 0; + ungetc(c, in); + + if(c == EOF){ + fprintf(stderr, "unexpected EOF after %s\n", buf); + return FALSE; + }else if(ptr >= buf+size-1){ + fprintf(stderr, "lval too long\n"); + } + + eat_spaces(in); + + DEBUG(6) fprintf(stderr, "lval = %s\n", buf); + + return buf[0] != 0; +} + +static +gboolean read_rval(FILE *in, gchar *buf, gint size) +{ + gint c; + gchar *ptr = buf; + + DEBUG(6) fprintf(stderr, "read_rval()\n"); + + if(!eat_spaces(in)) return FALSE; + + c = fgetc(in); + if(c != '\"'){ + while((isalnum(c) || c == '_' || c == '-' || c == '.' || c == '/' || c == '@' || c == ';') + && (ptr < buf+size-1) + && (c != EOF) + ){ + *ptr = c; ptr++; + c = fgetc(in); + } + *ptr = 0; + ungetc(c, in); + }else{ + gboolean escape = FALSE; + c = fgetc(in); + while(((c != '\"') || escape) && (ptr < buf+size-1)){ + if(c != '\n'){ /* ignore line breaks */ + if((c == '\\') && (!escape)){ + escape = TRUE; + }else{ + *ptr = c; ptr++; + escape = FALSE; + } + } + c = fgetc(in); + } + *ptr = 0; + } + + eat_line_trailing(in); + + DEBUG(6) fprintf(stderr, "rval = %s\n", buf); + + return TRUE; +} + +static +gboolean read_statement(FILE *in, + gchar *lval, gint lsize, + gchar *rval, gint rsize) +{ + gint c; + + DEBUG(6) fprintf(stderr, "read_statement()\n"); + + /* eat comments and empty lines: */ + if(!eat_comments(in)) return FALSE; + + DEBUG(6) fprintf(stderr, "read_statement() 1\n"); + + if(read_lval(in, lval, lsize)){ + DEBUG(6) fprintf(stderr, "lval = %s\n", lval); + if((c = fgetc(in) == '=')){ + if(read_rval(in, rval, rsize)){ + DEBUG(6) fprintf(stderr, "rval = %s\n", rval); + return TRUE; + } + }else{ + fprintf(stderr, "'=' expected after %s, char was '%c'\n", lval, c); + } + } + return FALSE; +} + +gboolean read_conf(gchar *filename) +{ + FILE *in; + + conf.log_max_pri = 7; + + conf.remote_port = 25; + + conf.do_relay = TRUE; + + conf.alias_local_cmp = strcmp; + + conf.max_defer_time = 86400*4; /* 4 days */ + + if((in = fopen(filename, "r"))){ + gchar lval[256], rval[2048]; + while(read_statement(in, lval, 256, rval, 2048)){ + if(strcmp(lval, "debug_level") == 0) + conf.debug_level = atoi(rval); + else if(strcmp(lval, "run_as_user") == 0){ + if(!conf.run_as_user) /* you should not be able + to reset that flag */ + conf.run_as_user = parse_boolean(rval); + }else if(strcmp(lval, "use_syslog") == 0) + conf.use_syslog = parse_boolean(rval); + else if(strcmp(lval, "mail_dir") == 0) + conf.mail_dir = g_strdup(rval); + else if(strcmp(lval, "lock_dir") == 0) + conf.lock_dir = g_strdup(rval); + else if(strcmp(lval, "spool_dir") == 0) + conf.spool_dir = g_strdup(rval); + else if(strcmp(lval, "log_dir") == 0) + conf.log_dir = g_strdup(rval); + else if(strcmp(lval, "host_name") == 0){ + if(rval[0] != '/') + conf.host_name = g_strdup(rval); + else{ + char buf[256]; + FILE *fptr = fopen(rval, "rt"); + if(fptr){ + fgets(buf, 255, fptr); + g_strchomp(buf); + conf.host_name = g_strdup(buf); + fclose(fptr); + }else{ + fprintf(stderr, "could not open %s: %s\n", rval, strerror(errno)); + return FALSE; + } + } + } + else if(strcmp(lval, "remote_port") == 0){ + fprintf(stderr, + "the remote_port option is now deprecated. Use 'mail_host' in the\n" + "route configuration instead. See man masqmail.route\n"); + conf.remote_port = atoi(rval); + }else if(strcmp(lval, "local_hosts") == 0) + conf.local_hosts = parse_list(rval, FALSE); + else if(strcmp(lval, "local_addresses") == 0) + conf.local_addresses = parse_list(rval, TRUE); + else if(strcmp(lval, "not_local_addresses") == 0) + conf.not_local_addresses = parse_list(rval, TRUE); + else if(strcmp(lval, "local_nets") == 0) + conf.local_nets = parse_list(rval, FALSE); + else if(strcmp(lval, "do_save_envelope_to") == 0) + conf.do_save_envelope_to = parse_boolean(rval); + else if(strcmp(lval, "defer_all") == 0) + conf.defer_all = parse_boolean(rval); + else if(strcmp(lval, "do_relay") == 0) + conf.do_relay = parse_boolean(rval); + else if(strcmp(lval, "alias_file") == 0){ + conf.alias_file = g_strdup(rval); + }else if(strcmp(lval, "alias_local_caseless") == 0){ + conf.alias_local_cmp = parse_boolean(rval) ? strcasecmp : strcmp; + }else if(strcmp(lval, "mbox_default") == 0){ + conf.mbox_default = g_strdup(rval); + }else if(strcmp(lval, "mbox_users") == 0){ + conf.mbox_users = parse_list(rval, TRUE); + }else if(strcmp(lval, "mda_users") == 0){ + conf.mda_users = parse_list(rval, TRUE); + }else if(strcmp(lval, "maildir_users") == 0){ + conf.maildir_users = parse_list(rval, TRUE); + }else if(strcmp(lval, "mda") == 0){ + conf.mda = g_strdup(rval); + }else if(strcmp(lval, "mda_fromline") == 0){ + conf.mda_fromline = parse_boolean(rval); + }else if(strcmp(lval, "mda_fromhack") == 0){ + conf.mda_fromhack = parse_boolean(rval); + }else if(strcmp(lval, "pipe_fromline") == 0){ + conf.pipe_fromline = parse_boolean(rval); + }else if(strcmp(lval, "pipe_fromhack") == 0){ + conf.pipe_fromhack = parse_boolean(rval); + }else if(strcmp(lval, "listen_addresses") == 0){ + GList *node; + GList *tmp_list = parse_list(rval, FALSE); + + conf.listen_addresses = NULL; + foreach(tmp_list, node){ + conf.listen_addresses = + g_list_append(conf.listen_addresses, + parse_interface((gchar *)(node->data), 25)); + g_free(node->data); + } + g_list_free(tmp_list); + } + else if(strcmp(lval, "ident_trusted_nets") == 0){ +#ifdef ENABLE_IDENT + GList *node; + GList *tmp_list = parse_list(rval, FALSE); + + conf.ident_trusted_nets = NULL; + foreach(tmp_list, node){ + conf.ident_trusted_nets = + g_list_append(conf.ident_trusted_nets, + parse_network((gchar *)(node->data), 25)); + g_free(node->data); + } + g_list_free(tmp_list); +#else + fprintf(stderr, "%s ignored: not compiled with ident support\n", lval); +#endif + } + else if((strncmp(lval, "connect_route.", 14) == 0) || + (strncmp(lval, "online_routes.", 14) == 0)){ + GList *file_list = parse_list(rval, FALSE); + table_pair *pair = create_pair(&(lval[14]), file_list); + conf.connect_routes = g_list_append(conf.connect_routes, pair); + } + else if(strcmp(lval, "local_net_route") == 0){ + conf.local_net_routes = parse_list(rval, FALSE); + } + else if(strcmp(lval, "online_detect") == 0) + conf.online_detect = g_strdup(rval); + else if(strcmp(lval, "online_file") == 0) + conf.online_file = g_strdup(rval); + else if(strcmp(lval, "online_pipe") == 0) + conf.online_pipe = g_strdup(rval); + else if(strcmp(lval, "mserver_iface") == 0) + conf.mserver_iface = parse_interface(rval, 224); + else if(strcmp(lval, "do_queue") == 0) + conf.do_queue = parse_boolean(rval); + else if(strncmp(lval, "get.", 4) == 0){ +#ifdef ENABLE_POP3 + table_pair *pair = create_pair_string(&(lval[4]), rval); + conf.get_names = g_list_append(conf.get_names, pair); +#else + fprintf(stderr, "get. ignored: not compiled with pop support\n"); +#endif + } + else if(strncmp(lval, "online_gets.", 12) == 0){ +#ifdef ENABLE_POP3 + GList *file_list = parse_list(rval, FALSE); + table_pair *pair = create_pair(&(lval[12]), file_list); + conf.online_gets = g_list_append(conf.online_gets, pair); +#else + fprintf(stderr, "online_gets. ignored: not compiled with pop support\n"); +#endif + } + else if(strcmp(lval, "errmsg_file") == 0) + conf.errmsg_file = g_strdup(rval); + else if(strcmp(lval, "warnmsg_file") == 0) + conf.warnmsg_file = g_strdup(rval); + else if(strcmp(lval, "warn_intervals") == 0) + conf.warn_intervals = parse_list(rval, FALSE); + else if(strcmp(lval, "max_defer_time") == 0){ + gint dummy; + gint ival = time_interval(rval, &dummy); + if(ival < 0) + fprintf(stderr, "invalid time interval for 'max_defer_time': %s\n", rval); + else + conf.max_defer_time = ival; + }else if(strcmp(lval, "log_user") == 0) + conf.log_user = g_strdup(rval); + + else + fprintf(stderr, "var '%s' not (yet) known, ignored\n", lval); + } + fclose(in); + + if(conf.errmsg_file == NULL) + conf.errmsg_file = g_strdup(DATA_DIR"/tpl/failmsg.tpl"); + if(conf.warnmsg_file == NULL) + conf.warnmsg_file = g_strdup(DATA_DIR"/tpl/warnmsg.tpl"); + + if(conf.lock_dir == NULL) + conf.lock_dir = g_strdup_printf("%s/lock/", conf.spool_dir); + + if(conf.mbox_default == NULL) + conf.mbox_default = g_strdup("mbox"); + + if(conf.warn_intervals == NULL) + conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE); + + return TRUE; + }else + fprintf(stderr, "could not open config file %s: %s\n", filename, strerror(errno)); + return FALSE; +} + +connect_route *read_route(gchar *filename, gboolean is_local_net) +{ + gboolean ok = FALSE; + FILE *in; + + connect_route *route = g_malloc(sizeof(connect_route)); + memset(route, 0, sizeof(connect_route)); + + DEBUG(5) debugf("read_route, filename = %s\n", filename); + + route->filename = g_strdup(filename); + route->name = g_strdup(filename); /* quick hack */ + + route->protocol = g_strdup("smtp"); + route->expand_h_sender_address = TRUE; + + route->is_local_net = is_local_net; + + route->do_pipelining = TRUE; + + if((in = fopen(route->filename, "r"))){ + gchar lval[256], rval[2048]; + while(read_statement(in, lval, 256, rval, 2048)){ + if(strcmp(lval, "protocol") == 0) + route->protocol = g_strdup(rval); + else if(strcmp(lval, "mail_host") == 0) + route->mail_host = parse_interface(rval, conf.remote_port); + else if(strcmp(lval, "helo_name") == 0) + route->helo_name = g_strdup(rval); + else if(strcmp(lval, "wrapper") == 0) + route->wrapper = g_strdup(rval); + else if(strcmp(lval, "connect_error_fail") == 0) + route->connect_error_fail = parse_boolean(rval); + else if(strcmp(lval, "do_correct_helo") == 0) + route->do_correct_helo = parse_boolean(rval); + else if(strcmp(lval, "do_pipelining") == 0) + route->do_pipelining = parse_boolean(rval); + else if(strcmp(lval, "allowed_return_paths") == 0) + route->allowed_return_paths = parse_address_list(rval, TRUE); + else if(strcmp(lval, "allowed_mail_locals") == 0) + route->allowed_mail_locals = parse_list(rval, TRUE); + else if(strcmp(lval, "not_allowed_return_paths") == 0) + route->not_allowed_return_paths = parse_address_list(rval, TRUE); + else if(strcmp(lval, "not_allowed_mail_locals") == 0) + route->not_allowed_mail_locals = parse_list(rval, TRUE); + else if(strcmp(lval, "allowed_rcpt_domains") == 0) + route->allowed_rcpt_domains = parse_list(rval, TRUE); + else if(strcmp(lval, "not_allowed_rcpt_domains") == 0) + route->not_allowed_rcpt_domains = parse_list(rval, TRUE); + else if(strcmp(lval, "set_h_from_domain") == 0) + route->set_h_from_domain = g_strdup(rval); + else if(strcmp(lval, "set_h_reply_to_domain") == 0) + route->set_h_reply_to_domain = g_strdup(rval); + else if(strcmp(lval, "set_return_path_domain") == 0) + route->set_return_path_domain = g_strdup(rval); + else if(strcmp(lval, "map_return_path_addresses") == 0){ + GList *node, *list; + + list = parse_list(rval, TRUE); + foreach(list, node){ + gchar *item = (gchar *)(node->data); + table_pair *pair = parse_table_pair(item, ':'); + address *addr = create_address((gchar *)(pair->value), TRUE); + g_free(pair->value); + pair->value = (gpointer *)addr; + route->map_return_path_addresses = + g_list_append(route->map_return_path_addresses, pair); + g_free(item); + } + g_list_free(list); + } + else if(strcmp(lval, "map_h_from_addresses") == 0){ + GList *list, *node; + + list = parse_list(rval, TRUE); + foreach(list, node){ + gchar *item = (gchar *)(node->data); + table_pair *pair = parse_table_pair(item, ':'); + route->map_h_from_addresses = + g_list_append(route->map_h_from_addresses, pair); + g_free(item); + } + g_list_free(list); + } + else if(strcmp(lval, "map_h_reply_to_addresses") == 0){ + GList *list, *node; + + list = parse_list(rval, TRUE); + foreach(list, node){ + gchar *item = (gchar *)(node->data); + table_pair *pair = parse_table_pair(item, ':'); + route->map_h_reply_to_addresses = + g_list_append(route->map_h_reply_to_addresses, pair); + g_free(item); + } + g_list_free(list); + } + else if(strcmp(lval, "map_h_mail_followup_to_addresses") == 0){ + GList *list, *node; + + list = parse_list(rval, TRUE); + foreach(list, node){ + gchar *item = (gchar *)(node->data); + table_pair *pair = parse_table_pair(item, ':'); + route->map_h_mail_followup_to_addresses = + g_list_append(route->map_h_mail_followup_to_addresses, pair); + g_free(item); + } + g_list_free(list); + } + else if(strcmp(lval, "expand_h_sender_domain") == 0){ + route->expand_h_sender_domain = parse_boolean(rval); + } + else if(strcmp(lval, "expand_h_sender_address") == 0){ + route->expand_h_sender_address = parse_boolean(rval); + } + else if(strcmp(lval, "resolve_list") == 0) + route->resolve_list = parse_resolve_list(rval); + else if(strcmp(lval, "do_ssl") == 0){ + /* we ignore this. This option is used by sqilconf */ + ; + } +#ifdef ENABLE_AUTH + else if(strcmp(lval, "auth_name") == 0){ + route->auth_name = g_strdup(rval); + } + else if(strcmp(lval, "auth_login") == 0){ + route->auth_login = g_strdup(rval); + } + else if(strcmp(lval, "auth_secret") == 0){ + route->auth_secret = g_strdup(rval); + } +#else + else if((strcmp(lval, "auth_name") == 0) || + (strcmp(lval, "auth_login") == 0) || + (strcmp(lval, "auth_secret") == 0)){ + logwrite(LOG_WARNING, "%s ignored: not compiled with auth support.\n", lval); + } +#endif + else if(strcmp(lval, "pop3_login") == 0){ +#ifdef ENABLE_POP3 + route->pop3_login = g_strdup(rval); +#else + logwrite(LOG_WARNING, "pop3_login ignored: not compiled with pop support.\n"); +#endif + } + else if(strcmp(lval, "pipe") == 0){ + route->pipe = g_strdup(rval); + } + else if(strcmp(lval, "pipe_fromline") == 0){ + route->pipe_fromline = parse_boolean(rval); + } + else if(strcmp(lval, "pipe_fromhack") == 0){ + route->pipe_fromhack = parse_boolean(rval); + } + else if(strcmp(lval, "last_route") == 0){ + route->last_route = parse_boolean(rval); + } + else + logwrite(LOG_WARNING, "var '%s' not (yet) known, ignored\n", lval); + } + + if(route->resolve_list == NULL){ + if(is_local_net){ + route->resolve_list = + g_list_append(NULL, resolve_byname); + }else{ +#ifdef ENABLE_RESOLVER + route->resolve_list = + g_list_append(route->resolve_list, resolve_dns_mx); + route->resolve_list = + g_list_append(route->resolve_list, resolve_dns_a); +#endif + route->resolve_list = + g_list_append(route->resolve_list, resolve_byname); + } + } + fclose(in); + ok = TRUE; + + /* warn user about misconfigurations: */ + if((route->map_h_from_addresses != NULL) && (route->set_h_from_domain != NULL)){ + logwrite(LOG_WARNING, "'map_h_from_addresses' overrides 'set_h_from_domain'\n"); + g_free(route->set_h_from_domain); + route->set_h_from_domain = NULL; + } + if((route->map_h_reply_to_addresses != NULL) && (route->set_h_reply_to_domain != NULL)){ + logwrite(LOG_WARNING, "'map_h_reply_to_addresses' overrides 'set_h_reply_to_domain'\n"); + g_free(route->set_h_reply_to_domain); + route->set_h_reply_to_domain = NULL; + } + }else{ + logwrite(LOG_ALERT, "could not open route file %s: %s\n", + route->filename, strerror(errno)); + } + + if(!ok){ + g_free(route); + route = NULL; + } + + return route; +} + +static +void _g_list_free_all(GList *list) +{ + GList *node; + if(list){ + foreach(list, node) + g_free(node->data); + g_list_free(list); + } +} + +void destroy_route(connect_route *r) +{ + if(r->filename) g_free(r->filename); + if(r->protocol) g_free(r->protocol); + if(r->mail_host){ + g_free(r->mail_host->address); + g_free(r->mail_host); + } + if(r->wrapper) g_free(r->wrapper); + if(r->helo_name) g_free(r->helo_name); + _g_list_free_all(r->allowed_mail_locals); + _g_list_free_all(r->not_allowed_mail_locals); + _g_list_free_all(r->allowed_rcpt_domains); + _g_list_free_all(r->not_allowed_rcpt_domains); + if(r->set_h_from_domain) g_free(r->set_h_from_domain); + if(r->set_h_reply_to_domain) g_free(r->set_h_reply_to_domain); + if(r->set_return_path_domain) g_free(r->set_return_path_domain); + if(r->map_h_reply_to_addresses) destroy_table(r->map_h_reply_to_addresses); + if(r->resolve_list) g_list_free(r->resolve_list); +#ifdef ENABLE_AUTH + if(r->auth_name) g_free(r->auth_name); + if(r->auth_login) g_free(r->auth_login); + if(r->auth_secret) g_free(r->auth_secret); +#endif +#ifdef ENABLE_POP3 + if(r->pop3_login) g_free(r->pop3_login); +#endif + if(r->pipe) g_free(r->pipe); + g_free(r); +} + +GList *read_route_list(GList *rf_list, gboolean is_local_net) +{ + GList *list = NULL; + GList *node; + uid_t saved_uid, saved_gid; + + if(!conf.run_as_user){ + set_euidgid(0, 0, &saved_uid, &saved_gid); + } + + foreach(rf_list, node){ + gchar *fname = (gchar *)(node->data); + connect_route *route = read_route(fname, is_local_net); + if(route) + list = g_list_append(list, route); + else + logwrite(LOG_ALERT, "could not read route configuration %s\n", fname); + } + + /* set uid and gid back */ + if(!conf.run_as_user){ + set_euidgid(saved_uid, saved_gid, NULL, NULL); + } + + return list; +} + +void destroy_route_list(GList *list) +{ + GList *node; + + foreach(list, node){ + connect_route *route = (connect_route *)(node->data); + destroy_route(route); + } + g_list_free(list); +} + +#ifdef ENABLE_POP3 + +get_conf *read_get_conf(gchar *filename) +{ + FILE *in; + + get_conf *gc = g_malloc(sizeof(get_conf)); + memset(gc, 0, sizeof(get_conf)); + + gc->server_port = 110; + + if((in = fopen(filename, "r"))){ + gchar lval[256], rval[2048]; + while(read_statement(in, lval, 256, rval, 2048)){ + if(strcmp(lval, "protocol") == 0) + gc->protocol = g_strdup(rval); + else if(strcmp(lval, "server") == 0) + gc->server_name = g_strdup(rval); + else if(strcmp(lval, "port") == 0) + gc->server_port = atoi(rval); + else if(strcmp(lval, "wrapper") == 0) + gc->wrapper = g_strdup(rval); + else if(strcmp(lval, "user") == 0) + gc->login_user = g_strdup(rval); + else if(strcmp(lval, "pass") == 0) + gc->login_pass = g_strdup(rval); + else if(strcmp(lval, "address") == 0) + gc->address = create_address_qualified(rval, TRUE, conf.host_name); + else if(strcmp(lval, "return_path") == 0) + gc->return_path = create_address_qualified(rval, TRUE, conf.host_name); + else if(strcmp(lval, "do_ssl") == 0) + /* we ignore this. This option is used by sqilconf */ + ; + else if(strcmp(lval, "do_keep") == 0) + gc->do_keep = parse_boolean(rval); + else if(strcmp(lval, "do_uidl") == 0) + gc->do_uidl = parse_boolean(rval); + else if(strcmp(lval, "do_uidl_dele") == 0) + gc->do_uidl_dele = parse_boolean(rval); + else if(strcmp(lval, "max_size") == 0) + gc->max_size = atoi(rval); + else if(strcmp(lval, "max_size_delete") == 0) + gc->max_size = parse_boolean(rval); + else if(strcmp(lval, "max_count") == 0) + gc->max_count = atoi(rval); + else if(strcmp(lval, "resolve_list") == 0) + gc->resolve_list = parse_resolve_list(rval); + else + logwrite(LOG_WARNING, "var '%s' not (yet) known, ignored\n", lval); + } + fclose(in); + + if(gc->resolve_list == NULL){ +#ifdef ENABLE_RESOLVER + gc->resolve_list = + g_list_append(NULL, resolve_dns_a); +#endif + gc->resolve_list = + g_list_append(NULL, resolve_byname); + } + + if(gc->protocol == NULL) + gc->protocol = g_strdup("pop3"); + return gc; + } + logwrite(LOG_ALERT, "could not open get file %s: %s\n", filename, strerror(errno)); + + g_free(gc); + return NULL; +} + +void destroy_get_conf(get_conf *gc) +{ + if(gc->protocol) g_free(gc->protocol); + if(gc->server_name) g_free(gc->server_name); + if(gc->login_user) g_free(gc->login_user); + if(gc->login_pass) g_free(gc->login_pass); + if(gc->wrapper) g_free(gc->wrapper); + if(gc->address) destroy_address(gc->address); + if(gc->return_path) destroy_address(gc->return_path); + if(gc->resolve_list) g_list_free(gc->resolve_list); + g_free(gc); +} + +#endif + +connect_route *create_local_route() +{ + connect_route *route; + + route = g_malloc(sizeof(connect_route)); + if(route){ + memset(route, 0, sizeof(connect_route)); + route->protocol = g_strdup("smtp"); + route->is_local_net = TRUE; + route->name = g_strdup("local_net (default)"); + route->expand_h_sender_address = TRUE; + route->resolve_list = + g_list_append(NULL, resolve_byname); + route->connect_error_fail = TRUE; + } + return route; +} diff -r 000000000000 -r 08114f7dcc23 src/connect.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/connect.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,151 @@ +/* MasqMail + Copyright (C) 1999 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "masqmail.h" + +static +GList *resolve_ip(GList *list, gchar *ip) +{ + struct in_addr ia; + if(inet_aton(ip, &ia)){ + mxip_addr mxip; + + mxip.name = g_strdup(ip); + mxip.pref = 0; + mxip.ip = (guint32) *(guint32 *)(&ia); + list = g_list_append(list, g_memdup(&mxip, sizeof(mxip))); + } + /* logwrite(LOG_ALERT, "invalid address '%s': inet_aton() failed\n", ip);*/ + return NULL; +} + +mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port, + GList *addr_list) +{ + GList *addr_node; + struct sockaddr_in saddr; + + DEBUG(5) debugf("connect_hostlist entered\n"); + + for(addr_node = g_list_first(addr_list); + addr_node; + addr_node = g_list_next(addr_node)){ + mxip_addr *addr = (mxip_addr *)(addr_node->data); + + *psockfd = socket(PF_INET, SOCK_STREAM, 0); + + memset(&saddr, 0, sizeof(saddr)); + + saddr.sin_family = AF_INET; + saddr.sin_port = htons(port); + + /* clumsy, but makes compiler happy: */ + saddr.sin_addr = *(struct in_addr*)(&(addr->ip)); + DEBUG(5) debugf("trying ip %s port %d\n", inet_ntoa(saddr.sin_addr), port); + if(connect(*psockfd, (struct sockaddr *)(&saddr), sizeof(saddr)) == 0){ + DEBUG(5) debugf("connected to %s\n", inet_ntoa(saddr.sin_addr)); + return addr; + }else{ + int saved_errno = errno; + + close(*psockfd); + + logwrite(LOG_WARNING, "connection to %s failed: %s\n", + inet_ntoa(saddr.sin_addr), strerror(errno)); + + errno = saved_errno; + + if((saved_errno != ECONNREFUSED) && + (saved_errno != ETIMEDOUT) && + (saved_errno != ENETUNREACH) && + (saved_errno != EHOSTUNREACH)) + + return NULL; + } + } + return NULL; +} + +/* Given a list of resolver functions, this function + resolve the host and tries to connect to the addresses + returned. If a connection attemp is timed out or refused, + the next address is tried. + + TODO: the resolver functions might return duplicate addresses, + if attempt failed for one it should not be tried again. +*/ + +mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port, + GList *res_func_list) +{ + GList *res_node; + GList *addr_list; + + DEBUG(5) debugf("connect_resolvelist entered\n"); + + h_errno = 0; + + if(isdigit(host[0])){ + mxip_addr *addr; + + addr_list = resolve_ip(NULL, host); + if(addr_list){ + addr = connect_hostlist(psockfd, host, port, addr_list); + g_list_free(addr_list); + return addr; + } + /* previous versions complained, until someone tried to use a hostname + out there that begins with a digit. eg. '3dwars.de'. */ + } + + if(res_func_list == NULL){ + logwrite(LOG_ALERT, "res_funcs == NULL !!!\n"); + exit(EXIT_FAILURE); + } + + foreach(res_func_list, res_node){ + resolve_func res_func; + DEBUG(6) debugf("connect_resolvelist 1a\n"); + res_func = (resolve_func)(res_node->data); + + if(res_func == NULL){ + logwrite(LOG_ALERT, "res_func == NULL !!!\n"); + exit(EXIT_FAILURE); + } + + errno = 0; + if((addr_list = res_func(NULL, host))){ + + mxip_addr *addr; + if((addr = connect_hostlist(psockfd, host, port, addr_list))) + return addr; + + DEBUG(5){ + debugf("connect_hostlist failed: %s\n", strerror(errno)); + } + + g_list_free(addr_list); + }else{ + if(!g_list_next(res_node)){ + logwrite(LOG_ALERT, "could not resolve %s: %s\n", host, hstrerror(h_errno)); + } + } + } + return NULL; + +} + diff -r 000000000000 -r 08114f7dcc23 src/deliver.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/deliver.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,849 @@ +/* MasqMail + Copyright (C) 1999-2002 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include "smtp_out.h" +#include +#include +#include + +/* collect failed/defered rcpts for failure/warning messages */ +/* returns TRUE if either there are no failures or a + failure message has been successfully sent */ +gboolean delivery_failures(message *msg, GList *rcpt_list, gchar *err_fmt, ...) +{ + gboolean ok_fail = TRUE, ok_warn = TRUE; + time_t now = time(NULL); + + GList *failed_list = NULL, *defered_list = NULL, *rcpt_node; + va_list args; + va_start(args, err_fmt); + + foreach(rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + + if(addr_is_defered(rcpt)){ + if((now - msg->received_time) >= conf.max_defer_time){ + addr_mark_failed(rcpt); + }else + defered_list = g_list_prepend(defered_list, rcpt); + } + if(addr_is_failed(rcpt)) + failed_list = g_list_prepend(failed_list, rcpt); + } + if(failed_list != NULL){ + ok_fail = fail_msg(msg, conf.errmsg_file, failed_list, err_fmt, args); + g_list_free(failed_list); + } + if(defered_list != NULL){ + ok_warn = warn_msg(msg, conf.warnmsg_file, defered_list, err_fmt, args); + g_list_free(defered_list); + } + va_end(args); + return ok_fail && ok_warn; +} + +static gint _g_list_strcasecmp(gconstpointer a, gconstpointer b) +{ + return (gint)strcasecmp(a, b); +} + +gboolean deliver_local(msg_out *msgout) +{ + message *msg = msgout->msg; + GList *rcpt_list = msgout->rcpt_list; + GList *rcpt_node; + gboolean ok = TRUE, flag = FALSE, ok_fail = FALSE; + + DEBUG(5) debugf("deliver_local entered\n"); + + flag = (msg->data_list == NULL); + if(flag){ + if(!(ok = spool_read_data(msg))){ + logwrite(LOG_ALERT, "could not open data spool file for %s\n", + msg->uid); + } + } + if(!ok) return FALSE; + + ok = FALSE; + for(rcpt_node = g_list_first(rcpt_list); + rcpt_node; + rcpt_node = g_list_next(rcpt_node)){ + GList *hdr_list; + address *rcpt = (address *)(rcpt_node->data); + address *env_addr = addr_find_ancestor(rcpt); + address *ret_path = msg->return_path; + header *retpath_hdr, *envto_hdr; + + /* we need a private copy of the hdr list because we add headers here + that belong to the rcpt only. + g_list_copy copies only the nodes, so it is safe to + g_list_free it + */ + hdr_list = g_list_copy(msg->hdr_list); + retpath_hdr = create_header(HEAD_ENVELOPE_TO, + "Envelope-to: %s\n", addr_string(env_addr)); + envto_hdr = create_header(HEAD_RETURN_PATH, + "Return-path: %s\n", addr_string(ret_path)); + + hdr_list = g_list_prepend(hdr_list, envto_hdr); + hdr_list = g_list_prepend(hdr_list, retpath_hdr); + + if(rcpt->local_part[0] == '|'){ + DEBUG(1) debugf("attempting to deliver %s with pipe\n", msg->uid); + if(pipe_out(msg, hdr_list, rcpt, &(rcpt->local_part[1]), + (conf.pipe_fromline ? MSGSTR_FROMLINE : 0) | + (conf.pipe_fromhack ? MSGSTR_FROMHACK : 0))){ + logwrite(LOG_NOTICE, "%s => %s <%s@%s> with pipe\n", + msg->uid, rcpt->local_part, + env_addr->local_part, env_addr->domain + ); + addr_mark_delivered(rcpt); + ok = TRUE; + }else{ + if((errno != (1024 + EX_TEMPFAIL)) && (errno != EAGAIN)){ + addr_mark_failed(rcpt); + }else{ + addr_mark_defered(rcpt); /* has no effect yet, + except that mail remains in spool */ + } + } + }else{ + /* figure out which mailbox type should be used for this user */ + gchar *user = rcpt->local_part; + gchar *mbox_type = conf.mbox_default; + + if(g_list_find_custom(conf.mbox_users, user, _g_list_strcasecmp) != NULL) + mbox_type = "mbox"; + else if(g_list_find_custom(conf.mda_users, user, _g_list_strcasecmp) != NULL) + mbox_type = "mda"; + else if(g_list_find_custom(conf.maildir_users, user, _g_list_strcasecmp) != NULL) + mbox_type = "maildir"; + + if(strcmp(mbox_type, "mbox") == 0){ + DEBUG(1) debugf("attempting to deliver %s with mbox\n", msg->uid); + if(append_file(msg, hdr_list, rcpt->local_part)){ + if(env_addr != rcpt){ + logwrite(LOG_NOTICE, "%s => %s@%s <%s@%s> with mbox\n", + msg->uid, rcpt->local_part, rcpt->domain, + env_addr->local_part, env_addr->domain + ); + }else{ + logwrite(LOG_NOTICE, "%s => <%s@%s> with mbox\n", + msg->uid, rcpt->local_part, rcpt->domain); + } + addr_mark_delivered(rcpt); + ok = TRUE; + }else{ + if(errno != EAGAIN){ /* prevents 'Resource temporarily unavailable (11)' */ + addr_mark_failed(rcpt); + }else{ + addr_mark_defered(rcpt); + } + } + + }else if(strcmp(mbox_type, "mda") == 0){ + if(conf.mda){ + gchar *cmd = g_malloc(256); + GList *var_table = var_table_rcpt(var_table_msg(NULL, msg), rcpt); + + DEBUG(1) debugf("attempting to deliver %s with mda\n", msg->uid); + + if(expand(var_table, conf.mda, cmd, 256)){ + + if(pipe_out(msg, hdr_list, rcpt, cmd, + (conf.mda_fromline ? MSGSTR_FROMLINE : 0) | + (conf.mda_fromhack ? MSGSTR_FROMHACK : 0))){ + logwrite(LOG_NOTICE, "%s => %s@%s with mda (cmd = '%s')\n", + msg->uid, rcpt->local_part, rcpt->domain, cmd + ); + addr_mark_delivered(rcpt); + ok = TRUE; + }else{ + if((errno != (1024 + EX_TEMPFAIL)) && (errno != EAGAIN)){ + addr_mark_failed(rcpt); + }else{ + addr_mark_defered(rcpt); /* has no effect yet, + except that mail remains in spool */ + } + } + }else + logwrite(LOG_ALERT, "could not expand string %s\n", conf.mda); + + destroy_table(var_table); + }else + logwrite(LOG_ALERT, "mbox type is mda, but no mda command given in configuration\n"); + +#ifdef ENABLE_MAILDIR + }else if(strcmp(mbox_type, "maildir") == 0){ + DEBUG(1) debugf("attempting to deliver %s with maildir\n", msg->uid); + if(maildir_out(msg, hdr_list, rcpt->local_part, 0)){ + if(env_addr != rcpt){ + logwrite(LOG_NOTICE, "%s => %s@%s <%s@%s> with local\n", + msg->uid, rcpt->local_part, rcpt->domain, + env_addr->local_part, env_addr->domain + ); + }else{ + logwrite(LOG_NOTICE, "%s => <%s@%s> with maildir\n", + msg->uid, rcpt->local_part, rcpt->domain); + } + addr_mark_delivered(rcpt); + ok = TRUE; + }else + addr_mark_failed(rcpt); +#endif + }else + logwrite(LOG_ALERT, "unknown mbox type '%s'\n", mbox_type); + } + + destroy_header(retpath_hdr); + destroy_header(envto_hdr); + + g_list_free(hdr_list); + } + ok_fail = delivery_failures(msg, rcpt_list, "%s (%d)", ext_strerror(errno), errno); + + if(flag) msg_free_data(msg); + if(ok || ok_fail) deliver_finish(msgout); + + return ok; +} + +/* make a list of rcpt's of a message that are local + return a new copy of the list +*/ +void msg_rcptlist_local(GList *rcpt_list, GList **p_local_list, GList **p_nonlocal_list) +{ + GList *rcpt_node; + + foreach(rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + GList *dom_node; + + DEBUG(5) debugf("checking address %s\n", rcpt->address); + + /* search for local host list: */ + foreach(conf.local_hosts, dom_node){ + if(strcasecmp(dom_node->data, rcpt->domain) == 0){ + *p_local_list = g_list_append(*p_local_list, rcpt); + DEBUG(5) debugf("<%s@%s> is local\n", rcpt->local_part, rcpt->domain); + break; + }else{ + *p_nonlocal_list = g_list_append(*p_nonlocal_list, rcpt); + } + } + } +} + +gboolean deliver_msglist_host_pipe(connect_route *route, GList *msgout_list, gchar *host, GList *res_list) +{ + gboolean ok = TRUE; + GList *msgout_node; + + DEBUG(5) debugf("deliver_msglist_host_pipe entered\n"); + + if(route->pipe == NULL){ + logwrite(LOG_ALERT, "no pipe command given for route (protocol is pipe!)\n"); + return FALSE; + } + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + gboolean flag, ok_msg = TRUE, ok_fail = FALSE; + message *msg = msgout->msg; + GList *rcpt_node, *rcpt_list = msgout->rcpt_list; + + DEBUG(1) debugf("attempting to deliver %s with pipe\n", msg->uid); + + flag = (msg->data_list == NULL); + if(flag){ + if(!(ok_msg = spool_read_data(msg))){ + logwrite(LOG_ALERT, "could not open data spool file for %s\n", + msg->uid); + } + } + if(!ok_msg) continue; + + ok = FALSE; + foreach(rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + gchar *cmd = g_malloc(256); + GList *var_table = var_table_rcpt(var_table_msg(NULL, msg), rcpt); + + DEBUG(1) debugf("attempting to deliver %s to %s@%s with pipe\n", + msg->uid, rcpt->local_part, rcpt->domain); + + if(expand(var_table, route->pipe, cmd, 256)){ + + if(pipe_out(msg, msg->hdr_list, rcpt, cmd, + (route->pipe_fromline ? MSGSTR_FROMLINE : 0) | + (route->pipe_fromhack ? MSGSTR_FROMHACK : 0))){ + logwrite(LOG_NOTICE, "%s => %s@%s with pipe (cmd = '%s')\n", + msg->uid, rcpt->local_part, rcpt->domain, cmd + ); + addr_mark_delivered(rcpt); + ok = TRUE; + }else{ + logwrite(LOG_ALERT, "pipe_out '%s' failed\n", route->pipe); + + if(route->connect_error_fail){ + addr_mark_failed(rcpt); + }else{ + addr_mark_defered(rcpt); + } + } + }else + logwrite(LOG_ALERT, "could not expand string %s\n", route->pipe); + + destroy_table(var_table); + } + ok_fail = delivery_failures(msg, rcpt_list, "%s", strerror(errno)); + + if(flag) msg_free_data(msg); + + if(ok || ok_fail) deliver_finish(msgout); + } + + return ok; +} + +/* deliver list of messages to one host + and finishes them if the message was delivered to at least one + rcpt. + Returns TRUE if at least one msg was delivered to at least one + rcpt. +*/ + +gboolean deliver_msglist_host_smtp(connect_route *route, GList *msgout_list, gchar *host, GList *res_list) +{ + gboolean ok = FALSE; + GList *msgout_node; + smtp_base *psb; + gint port; + + /* paranoid check: */ + if(msgout_list == NULL){ + logwrite(LOG_ALERT, + "Ooops: empty list of messages in deliver_msglist_host()\n"); + return FALSE; + } + + if(host == NULL){ + host = route->mail_host->address; + port = route->mail_host->port; + }else + port = conf.remote_port; + +#ifdef ENABLE_POP3 + if(route->pop3_login){ + if(!(pop_before_smtp(route->pop3_login))) + return FALSE; + } +#endif + + if((psb = (route->wrapper ? + smtp_out_open_child(route->wrapper) : + smtp_out_open(host, port, res_list)))){ + + if(route->wrapper) psb->remote_host = host; + + set_heloname(psb, + route->helo_name ? route->helo_name : conf.host_name, + route->do_correct_helo); + +#ifdef ENABLE_AUTH + if((route->auth_name) && (route->auth_login) && (route->auth_secret)) + set_auth(psb, route->auth_name, route->auth_login, route->auth_secret); +#endif + if(smtp_out_init(psb)){ + + if(!route->do_pipelining) psb->use_pipelining = FALSE; + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + gboolean flag, ok_msg = FALSE, ok_fail = FALSE; + message *msg = msgout->msg; + + /* we may have to read the data at this point + and remember if we did */ + flag = (msg->data_list == NULL); + if(flag){ + if(!spool_read_data(msg)){ + logwrite(LOG_ALERT, "could not open data spool file %s\n", + msg->uid); + break; + } + } + + smtp_out_msg(psb, msg, + msgout->return_path, msgout->rcpt_list, msgout->hdr_list); + + ok_fail = delivery_failures(msg, msgout->rcpt_list, + "while connected with %s, the server replied\n\t%s", + host, psb->buffer); + + if((psb->error == smtp_eof) || + (psb->error == smtp_timeout)){ + /* connection lost */ + break; + } + else if(psb->error != smtp_ok){ + if(g_list_next(msgout_node) != NULL) + if(!smtp_out_rset(psb)) + break; + } + ok_msg = (psb->error == smtp_ok); + + if(flag) msg_free_data(msg); + if(ok_msg) ok = TRUE; + if(ok_msg || ok_fail){ + deliver_finish(msgout); + } + } + if(psb->error == smtp_ok || + (psb->error == smtp_fail) || + (psb->error == smtp_trylater) || + (psb->error == smtp_syntax)){ + + smtp_out_quit(psb); + } + }else{ + /* smtp_out_init() failed */ + if((psb->error == smtp_fail) || + (psb->error == smtp_trylater) || + (psb->error == smtp_syntax)){ + smtp_out_quit(psb); + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + smtp_out_mark_rcpts(psb, msgout->rcpt_list); + + if(delivery_failures(msgout->msg, msgout->rcpt_list, + "while connected with %s, the server replied\n\t%s", + host, psb->buffer)) + deliver_finish(msgout); + } + } + } + destroy_smtpbase(psb); + }else{ + /* smtp_out_open() failed */ + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + GList *rcpt_node; + + for(rcpt_node = g_list_first(msgout->rcpt_list); + rcpt_node; + rcpt_node = g_list_next(rcpt_node)){ + address *rcpt = (address *)(rcpt_node->data); + + addr_unmark_delivered(rcpt); + if(route->connect_error_fail){ + addr_mark_failed(rcpt); + }else{ + addr_mark_defered(rcpt); + } + if(route->wrapper ? + delivery_failures(msgout->msg, msgout->rcpt_list, + "could not open wrapper:\n\t%s", + strerror(errno)) : + delivery_failures(msgout->msg, msgout->rcpt_list, + "could not open connection to %s:%d :\n\t%s", + host, port, h_errno != 0 ? hstrerror(h_errno) : strerror(errno))) + deliver_finish(msgout); + } + } + } + return ok; +} + +gboolean deliver_msglist_host(connect_route *route, GList *msgout_list, gchar *host, GList *res_list) +{ + DEBUG(5) debugf("protocol = %s\n", route->protocol); + + if(strcmp(route->protocol, "pipe") == 0){ + return deliver_msglist_host_pipe(route, msgout_list, host, res_list); + }else{ + return deliver_msglist_host_smtp(route, msgout_list, host, res_list); + } +} + +/* + delivers messages in msgout_list using route +*/ +gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list) +{ + gboolean ok = FALSE; + + DEBUG(5) debugf("deliver_route_msgout_list entered, route->name = %s\n", + route->name); + + if(route->mail_host != NULL){ + /* this is easy... */ + if(deliver_msglist_host(route, msgout_list, + NULL, route->resolve_list)) + ok = TRUE; + + }else{ + /* this is not easy... */ + GList *mo_ph_list; + + mo_ph_list = route_msgout_list(route, msgout_list); + /* okay, now we have ordered our messages by the hosts. */ + if(mo_ph_list != NULL){ + GList *mo_ph_node; + /* TODO: It would be nice to be able to fork for each host. + We cannot do that yet because of complications with finishing the + messages. Threads could be a solution because they use the same + memory. But we are not thread safe yet... + */ + foreach(mo_ph_list, mo_ph_node){ + msgout_perhost *mo_ph = (msgout_perhost *)(mo_ph_node->data); + if(deliver_msglist_host(route, mo_ph->msgout_list, + mo_ph->host, route->resolve_list)) + ok = TRUE; + + destroy_msgout_perhost(mo_ph); + } + g_list_free(mo_ph_list); + } + } + return ok; +} + +/* + calls route_prepare_msg() + delivers messages in msg_list using route + by calling deliver_route_msgout_list() +*/ +gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list) +{ + GList *msgout_list_deliver = NULL; + GList *msgout_node; + gboolean ok = TRUE; + + DEBUG(6) debugf("deliver_route_msg_list()\n"); + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + msg_out *msgout_cloned = clone_msg_out(msgout); + GList *rcpt_list_non_delivered = NULL; + GList *rcpt_node; + + /* we have to delete already delivered rcpt's + because a previous route may have delivered to it */ + foreach(msgout_cloned->rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + /* failed addresses already have been bounced + - there should be a better way to handle those.*/ + if(!addr_is_delivered(rcpt) && !addr_is_failed(rcpt) && !(rcpt->flags & ADDR_FLAG_LAST_ROUTE)) + rcpt_list_non_delivered = g_list_append(rcpt_list_non_delivered, rcpt); + } + g_list_free(msgout_cloned->rcpt_list); + msgout_cloned->rcpt_list = rcpt_list_non_delivered; + + if(msgout_cloned->rcpt_list){ + if(route_is_allowed_mail_local(route, msgout->msg->return_path) && + route_is_allowed_return_path(route, msgout->msg->return_path)){ + GList *rcpt_list_allowed = NULL, *rcpt_list_notallowed = NULL; + msg_rcptlist_route(route, msgout_cloned->rcpt_list, + &rcpt_list_allowed, &rcpt_list_notallowed); + + if(rcpt_list_allowed != NULL){ + logwrite(LOG_NOTICE, "%s using '%s'\n", msgout->msg->uid, route->name); + + g_list_free(msgout_cloned->rcpt_list); + msgout_cloned->rcpt_list = rcpt_list_allowed; + + if(route->last_route){ + GList *rcpt_node; + foreach(msgout_cloned->rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + rcpt->flags |= ADDR_FLAG_LAST_ROUTE; + } + } + + route_prepare_msgout(route, msgout_cloned); + msgout_list_deliver = g_list_append(msgout_list_deliver, msgout_cloned); + }else + destroy_msg_out(msgout_cloned); + } + else + destroy_msg_out(msgout_cloned); + }else + destroy_msg_out(msgout_cloned); + } + + if(msgout_list_deliver != NULL){ + if(deliver_route_msgout_list(route, msgout_list_deliver)) + ok = TRUE; + destroy_msg_out_list(msgout_list_deliver); + } + return ok; +} + +/* copy pointers of delivered addresses to the msg's non_rcpt_list, + to make sure that they will not be delivered again. +*/ +void update_non_rcpt_list(msg_out *msgout) +{ + GList *rcpt_node; + message *msg = msgout->msg; + + foreach(msgout->rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + if(addr_is_delivered(rcpt) || addr_is_failed(rcpt)) + msg->non_rcpt_list = g_list_append(msg->non_rcpt_list, rcpt); + } +} + +/* after delivery attempts, we check if there are any + rcpt addresses left in the message. + If all addresses have been completed, the spool files will + be deleted, otherwise the header spool will be written back. + We never changed the data spool, so there is no need to write that back. + + returns TRUE if all went well. +*/ +gboolean deliver_finish(msg_out *msgout) +{ + GList *rcpt_node; + gboolean ok = FALSE; + message *msg = msgout->msg; + gboolean finished = TRUE; + + update_non_rcpt_list(msgout); + + /* we NEVER made copies of the addresses, flags affecting addresses + were always set on the original address structs */ + foreach(msg->rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + if(!addr_is_finished_children(rcpt)) + finished = FALSE; + else{ + /* if ALL children have been delivered, + mark parent as delivered. + if there is one or more not delivered, + it must have failed, we mark the parent as failed as well. + */ + if(addr_is_delivered_children(rcpt)){ + addr_mark_delivered(rcpt); + }else{ + addr_mark_failed(rcpt); + } + } + } + + if(!finished){ + /* one not delivered address was found */ + if(spool_write(msg, FALSE)){ + ok = TRUE; + DEBUG(2) debugf("spool header for %s written back.\n", msg->uid); + }else + logwrite(LOG_ALERT, "could not write back spool header for %s\n", + msg->uid); + }else{ + ok = spool_delete_all(msg); + if(ok) + logwrite(LOG_NOTICE, "%s completed.\n", msg->uid); + } + return ok; +} + +gboolean deliver_finish_list(GList *msgout_list) +{ + gboolean ok = TRUE; + GList *msgout_node; + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + if(!deliver_finish(msgout)) + ok = FALSE; + } + return ok; +} + +gboolean deliver_msgout_list_online(GList *msgout_list) +{ + GList *rf_list = NULL; + gchar *connect_name = detect_online(); + gboolean ok = FALSE; + + if(connect_name != NULL){ + logwrite(LOG_NOTICE, "detected online configuration %s\n", connect_name); + /* we are online! */ + rf_list = (GList *)table_find(conf.connect_routes, connect_name); + if(rf_list != NULL){ + GList *route_list = read_route_list(rf_list, FALSE); + if(route_list){ + GList *route_node; + foreach(route_list, route_node){ + connect_route *route = (connect_route *)(route_node->data); + ok = deliver_route_msg_list(route, msgout_list); + } + destroy_route_list(route_list); + } + else + logwrite(LOG_ALERT, + "could not read route list '%s'\n", connect_name); + }else{ + logwrite(LOG_ALERT, "route list with name '%s' not found.\n", connect_name); + } + } + return ok; +} + +gboolean deliver_msg_list(GList *msg_list, guint flags){ + GList *msgout_list = create_msg_out_list(msg_list); + GList *local_msgout_list = NULL, *localnet_msgout_list = NULL, *other_msgout_list = NULL; + GList *msgout_node; + GList *alias_table = NULL; + gboolean ok = TRUE; + + if(conf.alias_file){ + if(!(alias_table = table_read(conf.alias_file, ':'))) + return FALSE; + } + + /* sort messages for different deliveries */ + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + GList *rcpt_list; + GList *local_rcpt_list = NULL; + GList *localnet_rcpt_list = NULL; + GList *other_rcpt_list; + + if(!spool_lock(msgout->msg->uid)) continue; + + rcpt_list = g_list_copy(msgout->msg->rcpt_list); + if(conf.log_user){ + address *addr = create_address_qualified(conf.log_user, TRUE, conf.host_name); + if(addr) + rcpt_list = g_list_prepend(rcpt_list, addr); + } + if(alias_table){ + GList *aliased_rcpt_list; + aliased_rcpt_list = alias_expand(alias_table, rcpt_list, + msgout->msg->non_rcpt_list); + g_list_free(rcpt_list); + rcpt_list = aliased_rcpt_list; + } + + /* local recipients */ + other_rcpt_list = NULL; + rcptlist_with_addr_is_local(rcpt_list, &local_rcpt_list, &other_rcpt_list); + + if(flags & DLVR_LOCAL){ + if(local_rcpt_list != NULL){ + msg_out *local_msgout = clone_msg_out(msgout); + local_msgout->rcpt_list = local_rcpt_list; + local_msgout_list = g_list_append(local_msgout_list, local_msgout); + } + } + + g_list_free(rcpt_list); + + /* local net recipients */ + rcpt_list = other_rcpt_list; + other_rcpt_list = NULL; + rcptlist_with_one_of_hostlist(rcpt_list, conf.local_nets, + &localnet_rcpt_list, &other_rcpt_list); + + if(flags & DLVR_LAN){ + if(localnet_rcpt_list != NULL){ + msg_out *localnet_msgout = clone_msg_out(msgout); + localnet_msgout->rcpt_list = localnet_rcpt_list; + localnet_msgout_list = g_list_append(localnet_msgout_list, localnet_msgout); + } + } + + if(flags & DLVR_ONLINE){ + /* the rest, this is online delivery */ + if(other_rcpt_list != NULL){ + msg_out *other_msgout = clone_msg_out(msgout); + other_msgout->rcpt_list = other_rcpt_list; + other_msgout_list = g_list_append(other_msgout_list, other_msgout); + } + } + } + + if(alias_table) + destroy_table(alias_table); + + /* actual delivery */ + if(local_msgout_list != NULL){ + foreach(local_msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + if(!deliver_local(msgout)) ok = FALSE; + } + destroy_msg_out_list(local_msgout_list); + } + + if(localnet_msgout_list != NULL){ + GList *route_list = NULL; + GList *route_node; + + if(conf.local_net_routes) + route_list = read_route_list(conf.local_net_routes, TRUE); + else + route_list = g_list_append(NULL, create_local_route()); + + foreach(route_list, route_node){ + connect_route *route = (connect_route *)(route_node->data); + if(!deliver_route_msg_list(route, localnet_msgout_list)) ok = FALSE; + } + destroy_msg_out_list(localnet_msgout_list); + destroy_route_list(route_list); + } + + if(other_msgout_list != NULL){ + if(!deliver_msgout_list_online(other_msgout_list)) ok = FALSE; + destroy_msg_out_list(other_msgout_list); + } + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + spool_unlock(msgout->msg->uid); + } + + destroy_msg_out_list(msgout_list); + + return ok; +} + +/* This function searches in the list of rcpt addresses + for local and 'local net' addresses. Remote addresses + which are reachable only when online are treated specially + in another function. + + deliver() is called when a message has just been received and should + be delivered immediately. +*/ +gboolean deliver(message *msg) +{ + gboolean ok; + + GList *msg_list = g_list_append(NULL, msg); + + ok = deliver_msg_list(msg_list, DLVR_ALL); + + g_list_free(msg_list); + + return ok; +} + diff -r 000000000000 -r 08114f7dcc23 src/dotlock.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dotlock.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,80 @@ +/* MasqMail + Copyright (C) 2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "masqmail.h" +#include "dotlock.h" + +gboolean dot_lock(gchar *lock_name, gchar *hitch_name) +{ + gboolean ok = FALSE; + int fd; + + fd = open(hitch_name, O_WRONLY | O_CREAT | O_EXCL, 0); + if(fd != -1){ + struct stat stat_buf; + + close(fd); + link(hitch_name, lock_name); + if(stat(hitch_name, &stat_buf) == 0){ + if(stat_buf.st_nlink == 2){ + unlink(hitch_name); + ok = TRUE; + } + else{ + if(stat(lock_name, &stat_buf) == 0){ + if((time(NULL) - stat_buf.st_mtime) > MAX_LOCKAGE){ + /* remove lock if uncredibly old */ + unlink(lock_name); + + link(hitch_name, lock_name); + if(stat(hitch_name, &stat_buf) == 0){ + if(stat_buf.st_nlink == 2){ + unlink(hitch_name); + ok = TRUE; + } + } + } + } + } + } + if(!ok){ + unlink(hitch_name); + } + }else + logwrite(LOG_WARNING, "could not create lock file %s: %s\n", + lock_name, strerror(errno)); + + return ok; +} + +gboolean dot_unlock(gchar *lock_name) +{ + unlink(lock_name); + + return TRUE; +} diff -r 000000000000 -r 08114f7dcc23 src/dotlock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dotlock.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,22 @@ +/* MasqMail + Copyright (C) 2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define MAX_LOCKAGE 300 + +gboolean dot_lock(gchar *lock_name, gchar *hitch_name); +gboolean dot_unlock(gchar *lock_name); diff -r 000000000000 -r 08114f7dcc23 src/expand.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/expand.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,125 @@ +/* MasqMail + Copyright (C) 2000-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" + +#define MAX_VAR 50 + +GList *var_table_rcpt(GList *var_table, address *rcpt) +{ + gchar *tmp_str; + + var_table = g_list_prepend(var_table, create_pair_string("rcpt_local", rcpt->local_part)); + var_table = g_list_prepend(var_table, create_pair_string("rcpt_domain", rcpt->domain)); + + tmp_str = g_strdup_printf("%s@%s", rcpt->local_part, rcpt->domain); + var_table = g_list_prepend(var_table, create_pair_string("rcpt", tmp_str)); + g_free(tmp_str); + + return var_table; +} + +GList *var_table_msg(GList *var_table, message *msg) +{ + address *ret_path = msg->return_path; + gchar *tmp_str; + + var_table = g_list_prepend(var_table, create_pair_string("uid", msg->uid)); + var_table = g_list_prepend(var_table, create_pair_string("received_host", + msg->received_host ? msg->received_host : "")); + var_table = g_list_prepend(var_table, create_pair_string("ident", msg->ident ? msg->ident : "")); + var_table = g_list_prepend(var_table, create_pair_string("return_path_local", ret_path->local_part)); + var_table = g_list_prepend(var_table, create_pair_string("return_path_domain", ret_path->domain)); + + tmp_str = g_strdup_printf("%s@%s", ret_path->local_part, ret_path->domain); + var_table = g_list_prepend(var_table, create_pair_string("return_path", tmp_str)); + g_free(tmp_str); + + return var_table; +} + +GList *var_table_conf(GList *var_table) +{ + var_table = g_list_prepend(var_table, create_pair_string("host_name", conf.host_name)); + var_table = g_list_prepend(var_table, create_pair_string("package", PACKAGE)); + var_table = g_list_prepend(var_table, create_pair_string("version", VERSION)); + + return var_table; +} + +gint expand(GList *var_list, gchar *format, gchar *result, gint result_len) +{ + gchar *p = format, *q = result; + gchar *vq; + gint i = 0; + gboolean escape = FALSE; + + while(*p && (i < (result_len -1))){ + if((*p == '$') && !escape){ + gchar *value; + gchar var[MAX_VAR+1]; + int j = 0; + + p++; /* skip '$' */ + vq = var; + + if(*p == '{'){ + /* ${var} style */ + p++; /* skip '{' */ + while(*p && (*p != '}') && (j < MAX_VAR)){ + *(vq++) = *(p++); + j++; + } + p++; + }else{ + /* $var style */ + while(*p && (isalnum(*p) || (*p == '_') || (*p == '-')) && (j < MAX_VAR)){ + *(vq++) = *(p++); + j++; + } + } + *vq = 0; + + if(j < MAX_VAR){ + /* search var */ + value = (gchar *)table_find(var_list, var); + if(value){ + gchar *vp = value; + while(*vp && (i < (result_len -1))){ + *(q++) = *(vp++); i++; + } + } + } + }else{ + if((*p == '\\') && (!escape)){ + escape = TRUE; + }else{ + *(q++) = *p; i++; + escape = FALSE; + } + p++; + } + } + *q = 0; + + if(i >= (result_len -1)) + return -3; + + return i; +} + diff -r 000000000000 -r 08114f7dcc23 src/fail_msg.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/fail_msg.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,177 @@ +/* MasqMail + Copyright (C) 2000-2001 Oliver Kurth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#include "masqmail.h" +#include "peopen.h" +#include "readsock.h" + +gboolean fail_msg(message *msg, gchar *template, + GList *failed_rcpts, gchar *err_fmt, va_list args) +{ + gboolean ok = FALSE; + address *ret_path = NULL; + + /* do not bounce bounces, send to postmaster instead */ + if(msg->return_path->local_part[0] == 0){ + GList *node; + + ret_path = create_address_qualified("postmaster", TRUE, conf.host_name); + foreach(failed_rcpts, node){ + address *addr = (address *)(node->data); + if(addr_isequal_parent(addr, ret_path)){ + logwrite(LOG_ALERT, "%s == %s: postmaster address failed\n", + msg->uid, addr_string(ret_path)); + return FALSE; + } + } + }else + ret_path = copy_address(msg->return_path); + + DEBUG(1) debugf("sending failure notice to %s.\n", addr_string(ret_path)); + + if(template){ + FILE *file; + GList *var_table = var_table_conf(var_table_msg(NULL, msg)); + gchar *err_msg = g_strdup_vprintf(err_fmt, args); + + var_table = g_list_prepend(var_table, create_pair_string("err_msg", err_msg)); + g_free(err_msg); + + if((file = fopen(template, "r"))){ + FILE *out; + gchar *cmd; + pid_t pid; + + // cmd = g_strdup_printf(SBINDIR"/masqmail -oi -f \"<>\" %s@%s", + // ret_path->local_part, ret_path->domain); + cmd = g_strdup_printf(SBINDIR"/masqmail -oi -f <> %s@%s", + ret_path->local_part, ret_path->domain); + if((out = peidopen(cmd, "w", environ, &pid, conf.mail_uid, conf.mail_gid))){ + gchar fmt[256], line[256]; + int status, ret; + + while((ret = read_sockline(file, fmt, 256, 0, 0)) > 0){ + if(fmt[0] == '@'){ + GList *node; + if(strncmp(fmt, "@failed_rcpts", 13) == 0){ + foreach(failed_rcpts, node){ + address *rcpt = (address *)(node->data); + fprintf(out, "\t%s\n", addr_string(rcpt)); + } + }else if(strncmp(fmt, "@msg_headers", 12) == 0){ + foreach(msg->hdr_list, node){ + header *hdr = (header *)(node->data); + fputs(hdr->header, out); + } + }else if(strncmp(fmt, "@msg_body", 9) == 0){ + /* we may have to read the data at this point + and remember if we did */ + gboolean flag = (msg->data_list == NULL); + if(flag){ + if(!spool_read_data(msg)){ + logwrite(LOG_ALERT, "could not open data spool file %s\n", + msg->uid); + } + } + foreach(msg->data_list, node){ + gchar *line = (gchar *)(node->data); + fputs(line, out); + } + if(flag) msg_free_data(msg); + } + }else{ + expand(var_table, fmt, line, 256); + fputs(line, out); + } + } + + fclose(out); + waitpid(pid, &status, 0); + if((WEXITSTATUS(status) != EXIT_SUCCESS) || WIFSIGNALED(status)){ + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, "child returned %d\n", WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, "child got signal: %d\n", WTERMSIG(status)); + }else ok = TRUE; + }else{ + logwrite(LOG_ERR, "peopen failed: %s\n", strerror(errno)); + } + g_free(cmd); + fclose(file); + }else + logwrite(LOG_ALERT, "could not open failure message template %s: %s\n", + conf.errmsg_file, strerror(errno)); + + destroy_table(var_table); + } + + destroy_address(ret_path); + + return ok; +} + +/* +ival : |--|--|----|--------|--------| +warned: |-------W-------------W------ +result: |nnnyyyynnnnyyyyyyyyyynnnnnnn +*/ + +static +gboolean warn_msg_is_due(message *msg) +{ + time_t now = time(NULL); + gint dummy; + + GList *node; + for(node = g_list_last(conf.warn_intervals); node; node = g_list_previous(node)){ + gchar *str_ival = (gchar *)(node->data); + gint ival = time_interval(str_ival, &dummy); + if(ival >= 0){ + DEBUG(5) debugf("ival = %d\n", ival); + DEBUG(5) debugf("now - msg->received_time = %d\n", now - msg->received_time); + if((now - msg->received_time) > ival){ + if(msg->warned_time != 0){ + if((msg->warned_time - msg->received_time) < ival) + return TRUE; + }else + return TRUE; + } + }else + logwrite(LOG_WARNING, "invalid time interval: %s\n", str_ival); + } + return FALSE; +} + +gboolean warn_msg(message *msg, gchar *template, + GList *defered_rcpts, gchar *err_fmt, va_list args) +{ + time_t now = time(NULL); + + if(warn_msg_is_due(msg)){ + if(fail_msg(msg, template, defered_rcpts, err_fmt, args)){ + msg->warned_time = now; + return TRUE; + }else + return FALSE; + } + return TRUE; +} + + diff -r 000000000000 -r 08114f7dcc23 src/get.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/get.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,410 @@ +/* MasqMail + Copyright (C) 2000-2002 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +#include "masqmail.h" +#include "pop3_in.h" + +#ifdef ENABLE_POP3 + +static int volatile sighup_seen = 0; + +static +void sighup_handler(int sig) +{ + sighup_seen = 1; + signal(SIGHUP, sighup_handler); +} + +static +void sigchld_handler(int sig) +{ + pid_t pid; + int status; + + pid = waitpid(0, &status, 0); + if(pid > 0){ + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, "process %d exited with %d\n", + pid, WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, + "process with pid %d got signal: %d\n", + pid, WTERMSIG(status)); + } + signal(SIGCHLD, sigchld_handler); +} + +static +int get_lock(get_conf *gc) +{ +#ifdef USE_DOTLOCK + gboolean ok = FALSE; + gchar *hitch_name; + gchar *lock_name; + + /* the name of the lock is constructed from the user + and the server name, to prevent more than one connection at the same time + to the same server and the same user. This way concurrent connections + are possible to different servers or different users */ + hitch_name = g_strdup_printf("%s/masqmail-get-%s@%s-%d.lock", + conf.lock_dir, gc->login_user, + gc->server_name, getpid()); + lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", + conf.lock_dir, gc->login_user, gc->server_name); + + ok = dot_lock(lock_name, hitch_name); + if(!ok) logwrite(LOG_WARNING, + "getting mail for %s@%s is locked\n", + gc->login_user, gc->server_name); + + g_free(lock_name); + g_free(hitch_name); + + return ok; +#else + gchar *lock_name; + int fd; + + lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", + conf.lock_dir, gc->login_user, gc->server_name); + + if((fd = open(lock_name, O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600)) >= 0){ + if(flock(fd, LOCK_EX|LOCK_NB) != 0){ + close(fd); + logwrite(LOG_WARNING, + "getting mail for %s@%s is locked\n", + gc->login_user, gc->server_name); + fd = -1; + } + }else + logwrite(LOG_WARNING, + "could not open lock %s: %s\n", lock_name, strerror(errno)); + + g_free(lock_name); + + return fd; +#endif +} + +#ifdef USE_DOTLOCK +static +gboolean get_unlock(get_conf *gc) +{ + gchar *lock_name lock_name = + g_strdup_printf("%s/masqmail-get-%s@%s.lock", + conf.lock_dir, gc->login_user, gc->server_name); + + dot_unlock(lock_name); + + g_free(lock_name); + + return TRUE; +} +#else +static void get_unlock(get_conf *gc, int fd) +{ + gchar *lock_name = + g_strdup_printf("%s/masqmail-get-%s@%s.lock", + conf.lock_dir, gc->login_user, gc->server_name); + + flock(fd, LOCK_UN); + close(fd); + + unlink(lock_name); + g_free(lock_name); +} +#endif + +gboolean get_from_file(gchar *fname) +{ + guint flags = 0; + get_conf *gc = read_get_conf(fname); + gboolean ok = TRUE; + int lock; + + if(gc){ + if(!gc->do_keep) flags |= POP3_FLAG_DELETE; + if(gc->do_uidl) flags |= POP3_FLAG_UIDL; + if(gc->do_uidl_dele) flags |= POP3_FLAG_UIDL_DELE; + + if(!(gc->server_name)){ + logwrite(LOG_ALERT, "no server name given in %s\n", fname); return FALSE; + } + if(!(gc->address)){ + logwrite(LOG_ALERT, "no address given in %s\n", fname); return FALSE; + } + if(!(gc->login_user)){ + logwrite(LOG_ALERT, "no user name given in %s\n", fname); return FALSE; + } + if(!(gc->login_pass)){ + logwrite(LOG_ALERT, "no password given in %s\n", fname); return FALSE; + } + + DEBUG(3) debugf("flags = %d\n", flags); + + if((strcmp(gc->protocol, "pop3") == 0) || (strcmp(gc->protocol, "apop") == 0)){ + pop3_base *popb = NULL; + + if(strcmp(gc->protocol, "apop") == 0){ + flags |= POP3_FLAG_APOP; + DEBUG(3) debugf("attempting to get mail for user %s at host %s" + " for %s@%s with apop\n", + gc->login_user, gc->server_name, + gc->address->local_part, gc->address->domain); + }else{ + DEBUG(3) debugf("attempting to get mail for user %s at host %s" + " for %s@%s with pop3\n", + gc->login_user, gc->server_name, + gc->address->local_part, gc->address->domain); + } +#ifdef USE_DOTLOCK + if((lock = get_lock(gc))){ +#else + if((lock = get_lock(gc)) >= 0){ +#endif + if(gc->wrapper){ + popb = pop3_in_open_child(gc->wrapper, flags); + /* quick hack */ + popb->remote_host = gc->server_name; + }else{ + popb = pop3_in_open(gc->server_name, gc->server_port, + gc->resolve_list, flags); + } + if(popb){ + ok = pop3_get(popb, gc->login_user, gc->login_pass, + gc->address, gc->return_path, + gc->max_count, gc->max_size, gc->max_size_delete); + pop3_in_close(popb); + }else{ + ok = FALSE; + logwrite(LOG_ALERT, "failed to connect to host %s\n", gc->server_name); + } +#ifdef USE_DOTLOCK + get_unlock(gc); +#else + get_unlock(gc, lock); +#endif + } + }else{ + logwrite(LOG_ALERT, "get protocol %s unknown\n", gc->protocol); + ok = FALSE; + } + + destroy_get_conf(gc); + } + return ok; +} + +gboolean get_from_name(gchar *name) +{ + gchar *fname = (gchar *)table_find(conf.get_names, name); + if(fname) + return get_from_file(fname); + return FALSE; +} + +gboolean get_all() +{ + GList *get_table = conf.get_names; + GList *get_node; + void (*old_signal)(int); + + old_signal = signal(SIGCHLD, SIG_DFL); + + foreach(get_table, get_node){ + table_pair *pair = (table_pair *)(get_node->data); + gchar *fname = (gchar *)pair->value; + pid_t pid; + + pid = fork(); + if(pid == 0){ + signal(SIGCHLD, old_signal); + exit(get_from_file(fname) ? EXIT_SUCCESS : EXIT_FAILURE); + }else if(pid > 0){ + int status; + waitpid(pid, &status, 0); + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, "child returned %d\n", WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, "child got signal: %d\n", WTERMSIG(status)); + }else + logwrite(LOG_WARNING, "forking child failed: %s\n", strerror(errno)); + } + + signal(SIGCHLD, old_signal); + + return TRUE; +} + +void get_online() +{ + GList *gf_list = NULL; + gchar *connect_name = detect_online(); + + if(connect_name != NULL){ + void (*old_signal)(int); + + old_signal = signal(SIGCHLD, SIG_DFL); + + logwrite(LOG_NOTICE, "detected online configuration %s\n", connect_name); + /* we are online! */ + gf_list = (GList *)table_find(conf.online_gets, connect_name); + if(gf_list != NULL){ + GList *node; + foreach(gf_list, node){ + gchar *fname = (gchar *)(node->data); + pid_t pid; + + if(fname[0] != '/') + fname = (gchar *)table_find(conf.get_names, fname); + + if(fname != NULL){ + pid = fork(); + if(pid == 0){ + signal(SIGCHLD, old_signal); + exit(get_from_file(fname) ? EXIT_SUCCESS : EXIT_FAILURE); + }else if(pid > 0){ + int status; + waitpid(pid, &status, 0); + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, "child returned %d\n", WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, "child got signal: %d\n", WTERMSIG(status)); + }else + logwrite(LOG_WARNING, "forking child failed: %s\n", strerror(errno)); + } + } + } + signal(SIGCHLD, old_signal); + } +} + +void get_daemon(gint gival, char *argv[]) +{ + struct timeval tm; + time_t time_before, time_now; + int sel_ret; + + /* setup handler for HUP signal: */ + signal(SIGHUP, sighup_handler); + + /* we can give up root privileges */ + if(!conf.run_as_user){ + if(setegid(conf.mail_gid) != 0){ + logwrite(LOG_ALERT, "could not change gid to %d: %s\n", + conf.mail_gid, strerror(errno)); + exit(EXIT_FAILURE); + } + if(seteuid(conf.mail_uid) != 0){ + logwrite(LOG_ALERT, "could not change uid to %d: %s\n", + conf.mail_uid, strerror(errno)); + exit(EXIT_FAILURE); + } + } + + /* sel_ret = 0;*/ + time(&time_before); + time_before -= gival; + sel_ret = -1; + + while (1){ + /* see listen_port() in listen.c */ + if(gival > 0){ + time(&time_now); + if(sel_ret == 0){ /* we are either just starting or did a queue run */ + tm.tv_sec = gival; + tm.tv_usec = 0; + time_before = time_now; + }else{ + tm.tv_sec = gival - (time_now - time_before); + tm.tv_usec = 0; + + /* race condition, very unlikely (but possible): */ + if(tm.tv_sec < 0) + tm.tv_sec = 0; + } + } + + if ((sel_ret = select(0, NULL, NULL, NULL, &tm)) < 0){ + if(errno != EINTR){ + logwrite(LOG_ALERT, "select: (terminating): %s\n", strerror(errno)); + exit (EXIT_FAILURE); + }else{ + if(sighup_seen){ + logwrite(LOG_NOTICE, "HUP signal received. Restarting daemon\n"); + + if(argv == NULL) exit(EXIT_SUCCESS); + + execv(argv[0], &(argv[0])); + logwrite(LOG_ALERT, "restarting failed: %s\n", strerror(errno)); + exit(EXIT_FAILURE); + + } + } + }else{ + /* If select returns 0, the interval time has elapsed. + We start a new get process */ + int pid; + signal(SIGCHLD, sigchld_handler); + if((pid = fork()) == 0){ + get_online(); + + _exit(EXIT_SUCCESS); + } + else if(pid < 0){ + logwrite(LOG_ALERT, "could not fork for get run"); + } + } + } +} + +gboolean pop_before_smtp(gchar *fname) +{ + gboolean ok = FALSE; + GList *resolve_list = NULL; + get_conf *gc = read_get_conf(fname); + guint flags = 0; + +#ifdef ENABLE_RESOLVER + resolve_list = g_list_append(resolve_list, resolve_dns_a); +#endif + resolve_list = g_list_append(resolve_list, resolve_byname); + + if(strcmp(gc->protocol, "pop3") == 0){ + DEBUG(3) debugf("attempting to login for user %s, host = %s with pop3\n", + gc->login_user, gc->server_name); + ok = pop3_login(gc->server_name, gc->server_port, resolve_list, + gc->login_user, gc->login_pass, + flags); + }else if(strcmp(gc->protocol, "apop") == 0){ + DEBUG(3) debugf("attempting to login for user %s, host = %s with apop\n", + gc->login_user, gc->server_name); + ok = pop3_login(gc->server_name, gc->server_port, resolve_list, + gc->login_user, gc->login_pass, + flags | POP3_FLAG_APOP); + }else{ + logwrite(LOG_ALERT, "get protocol %s unknown\n", gc->protocol); + } + return ok; +} + +#endif diff -r 000000000000 -r 08114f7dcc23 src/header.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/header.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,259 @@ +/* MasqMail + Copyright (C) 2000 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "masqmail.h" + +header_name header_names[] = +{ + { "From", HEAD_FROM, }, + { "Sender", HEAD_SENDER, }, + { "To", HEAD_TO, }, + { "Cc", HEAD_CC, }, + { "Bcc", HEAD_BCC, }, + { "Date", HEAD_DATE, }, + { "Message-Id", HEAD_MESSAGE_ID, }, + { "Reply-To", HEAD_REPLY_TO, }, + { "Subject", HEAD_SUBJECT, }, + { "Return-Path", HEAD_RETURN_PATH, }, + { "Envelope-To", HEAD_ENVELOPE_TO, }, + { "Received", HEAD_RECEIVED }, +}; + +/* this was borrowed from exim and slightly changed */ +gchar *rec_timestamp() +{ + static gchar buf[64]; + int len; + + time_t now = time(NULL); + struct tm *t = localtime(&now); + + int diff_hour, diff_min; + struct tm local; + struct tm *gmt; + + memcpy(&local, t, sizeof(struct tm)); + gmt = gmtime(&now); + diff_min = 60*(local.tm_hour - gmt->tm_hour) + local.tm_min - gmt->tm_min; + if (local.tm_year != gmt->tm_year) + diff_min += (local.tm_year > gmt->tm_year)? 1440 : -1440; + else if (local.tm_yday != gmt->tm_yday) + diff_min += (local.tm_yday > gmt->tm_yday)? 1440 : -1440; + diff_hour = diff_min/60; + diff_min = abs(diff_min - diff_hour*60); + + len = strftime(buf, sizeof(buf), "%a, ", &local); + g_snprintf(buf + len, sizeof(buf) - len, "%02d ", local.tm_mday); + len += strlen(buf + len); + len += strftime(buf + len, sizeof(buf) - len, "%b %Y %H:%M:%S", &local); + g_snprintf(buf + len, sizeof(buf) - len, " %+03d%02d", diff_hour, diff_min); + + return buf; +} + +/* finds list of headers matching id + if id == HEAD_UNKNOWN and header == NULL finds all unknown headers + else finds all headers matching header +*/ +GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str) +{ + GList *found_list = NULL; + GList *node; + + if((id != HEAD_UNKNOWN) || (hdr_str == NULL)){ + foreach(hdr_list, node){ + header *hdr = (header *)(node->data); + if(hdr->id == id) + found_list = g_list_append(found_list, hdr); + } + }else{ + foreach(hdr_list, node){ + header *hdr = (header *)(node->data); + gchar buf[64], *q = buf, *p = hdr->header; + + while(*p != ':' && q < buf+63 && *p) *(q++) = *(p++); + *q = 0; + + if(strcasecmp(buf, hdr_str) == 0) + found_list = g_list_append(found_list, hdr); + } + } + return found_list; +} + +void header_unfold(header *hdr) +{ + gchar *tmp_hdr = g_malloc(strlen(hdr->header)); + gchar *p = hdr->header, *q = tmp_hdr; + gboolean flag = FALSE; + + while(*p){ + if(*p != '\n') + *(q++) = *p; + else + flag = TRUE; + p++; + } + *(q++) = '\n'; + + if(flag){ + gchar *new_hdr; + + g_free(hdr->header); + new_hdr = g_strdup(tmp_hdr); + g_free(tmp_hdr); + hdr->value = new_hdr + (hdr->value - hdr->header); + hdr->header = new_hdr; + } +} + +#define MAX_HDR_LEN 72 +void header_fold(header *hdr) +{ + gint len = strlen(hdr->header); + gchar *p, *q; + /* size is probably overestimated, but so we are on the safe side */ + gchar *tmp_hdr = g_malloc(len + 2*len/MAX_HDR_LEN); + + p = hdr->header; + q = tmp_hdr; + + if(p[len-1] == '\n') + p[len-1] = 0; + + while(*p){ + gint i,l; + gchar *pp; + + /* look forward and find potential break points */ + i = 0; l = -1; + pp = p; + while(*pp && (i < MAX_HDR_LEN)){ + if((*pp == ' ') || (*pp == '\t')) + l = i; + pp++; + i++; + } + if(!*pp) l = pp-p; /* take rest, if EOS found */ + + if(l == -1){ + /* no potential break point was found within MAX_HDR_LEN + so advance further until the next */ + while(*pp && *pp != ' ' && *pp != '\t'){ + pp++; + i++; + } + l = i; + } + + /* copy */ + i = 0; + while(i < l){ + *(q++) = *(p++); + i++; + } + *(q++) = '\n'; + *(q++) = *(p++); /* this is either space, tab or 0 */ + } + { + gchar *new_hdr; + + g_free(hdr->header); + new_hdr = g_strdup(tmp_hdr); + g_free(tmp_hdr); + hdr->value = new_hdr + (hdr->value - hdr->header); + hdr->header = new_hdr; + } +} + +header *create_header(header_id id, gchar *fmt, ...) +{ + gchar *p; + header *hdr; + va_list args; + va_start(args, fmt); + + if((hdr = g_malloc(sizeof(header)))){ + + hdr->id = id; + hdr->header = g_strdup_vprintf(fmt, args); + hdr->value = NULL; + + p = hdr->header; + while(*p && *p != ':') p++; + if(*p) + hdr->value = p+1; + } + + va_end(args); + return hdr; +} + +void destroy_header(header *hdr) +{ + if(hdr){ + if(hdr->header) g_free(hdr->header); + g_free(hdr); + } +} + +header *copy_header(header *hdr) +{ + header *new_hdr = NULL; + + if(hdr){ + if((new_hdr = g_malloc(sizeof(header)))){ + new_hdr->id = hdr->id; + new_hdr->header = g_strdup(hdr->header); + new_hdr->value = new_hdr->header + (hdr->value - hdr->header); + } + } + return new_hdr; +} + +header *get_header(gchar *line) +{ + gchar *p = line; + gchar buf[64], *q = buf; + gint i; + header *hdr; + + while(*p && (*p != ':') && (q < buf+63)) *(q++) = *(p++); + *q = 0; + + if(*p != ':') return NULL; + + hdr = g_malloc(sizeof(header)); + + hdr->value = NULL; + p++; + + while(*p && (*p == ' ' || *p == '\t')) p++; + hdr->value = p; + + for(i = 0; i < HEAD_NUM_IDS; i++){ + if(strcasecmp(header_names[i].header, buf) == 0) + break; + } + hdr->id = (header_id)i; + hdr->header = g_strdup(line); + hdr->value = hdr->header + (hdr->value - line); + + DEBUG(4) debugf("header: %d = %s", hdr->id, hdr->header); + + return hdr; +} diff -r 000000000000 -r 08114f7dcc23 src/interface.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/interface.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,99 @@ +/* MasqMail + Copyright (C) 2000 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" + +/* define if you get problems... */ +/*#define SOCKADDR_OLD 1*/ + +gboolean init_sockaddr(struct sockaddr_in *name, interface *iface) +{ + struct hostent *he; + struct in_addr ia; + +#ifdef SOCKADDR_OLD + /* here I tried to be intelligent and failed. */ + if(isalpha(iface->address[0])){ + if ((he = gethostbyname(iface->address)) == NULL) { + logwrite(LOG_ALERT, + "local address '%s' unknown. (deleting)\n", + iface->address); + return FALSE; + } + memcpy(&(name->sin_addr), he->h_addr, sizeof(name->sin_addr)); + }else if(isdigit(iface->address[0])){ + if(inet_aton(iface->address, &ia)){ + memcpy(&(name->sin_addr), &ia, sizeof(name->sin_addr)); + }else{ + logwrite(LOG_ALERT, + "invalid address '%s': inet_aton() failed (deleting)\n", + iface->address); + return FALSE; + } + }else{ + logwrite(LOG_ALERT, + "invalid address '%s', should begin with a aphanumeric (deleting)\n", + iface->address); + return FALSE; + } +#else + /* this is how others to it. I follow the crowd... */ + if(inet_aton(iface->address, &ia) != 0){ + /* IP address */ + memcpy(&(name->sin_addr), &ia, sizeof(name->sin_addr)); + }else{ + if ((he = gethostbyname(iface->address)) == NULL) { + logwrite(LOG_ALERT, "local address '%s' unknown. (deleting)\n", iface->address); + return FALSE; + } + memcpy(&(name->sin_addr), he->h_addr, sizeof(name->sin_addr)); + } +#endif + name->sin_family = AF_INET; + name->sin_port = htons(iface->port); + + return TRUE; +} + +int make_server_socket(interface *iface) +{ + int sock = -1; + struct sockaddr_in server; + + memset(&server, 0, sizeof(struct sockaddr_in)); + + /* Create the socket. */ + sock = socket (PF_INET, SOCK_STREAM, 0); + if (sock < 0){ + logwrite(LOG_ALERT, "socket: %s\n", strerror(errno)); + return -1; + } + + if(init_sockaddr(&server, iface)){ + /* bind the socket */ + if (bind (sock, (struct sockaddr *) &server, sizeof (server)) < 0){ + logwrite(LOG_ALERT, "bind: %s\n", strerror(errno)); + return -1; + } + }else{ + close(sock); + return -1; + } + + return sock; +} diff -r 000000000000 -r 08114f7dcc23 src/libident/INSTALL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/INSTALL Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,14 @@ +To build the libident library for a supported target, just type: + + make + +where target can be one of: + + sunos5, sunos4, svr4, bsd, linux, nextstep3.0 or nextstep3.1 + +For other systems you'll need to hack the Makefile (please do send +me any patches you make so I can include them into the next version!) + + - Peter Eriksson , 18 Oct 1994 + + diff -r 000000000000 -r 08114f7dcc23 src/libident/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,15 @@ +EXTRA_DIST=README_MASQMAIL + +AM_CFLAGS=@CFLAGS@ -D_GNU_SOURCE -DHAVE_ANSIHEADERS + +noinst_LIBRARIES=libident.a + +libident_a_SOURCES=\ + ident.h\ + ident.c\ + id_open.c\ + id_close.c\ + id_query.c\ + id_parse.c\ + support.c\ + version.c diff -r 000000000000 -r 08114f7dcc23 src/libident/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,398 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +EXTRA_DIST = README_MASQMAIL + +AM_CFLAGS = @CFLAGS@ -D_GNU_SOURCE -DHAVE_ANSIHEADERS + +noinst_LIBRARIES = libident.a + +libident_a_SOURCES = \ + ident.h\ + ident.c\ + id_open.c\ + id_close.c\ + id_query.c\ + id_parse.c\ + support.c\ + version.c + +subdir = src/libident +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libident_a_AR = $(AR) cru +libident_a_LIBADD = +am_libident_a_OBJECTS = ident.$(OBJEXT) id_open.$(OBJEXT) \ + id_close.$(OBJEXT) id_query.$(OBJEXT) id_parse.$(OBJEXT) \ + support.$(OBJEXT) version.$(OBJEXT) +libident_a_OBJECTS = $(am_libident_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/id_close.Po ./$(DEPDIR)/id_open.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/id_parse.Po ./$(DEPDIR)/id_query.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ident.Po ./$(DEPDIR)/support.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/version.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libident_a_SOURCES) +DIST_COMMON = README $(srcdir)/Makefile.in INSTALL Makefile.am +SOURCES = $(libident_a_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/libident/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +AR = ar + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libident.a: $(libident_a_OBJECTS) $(libident_a_DEPENDENCIES) + -rm -f libident.a + $(libident_a_AR) libident.a $(libident_a_OBJECTS) $(libident_a_LIBADD) + $(RANLIB) libident.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_close.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id_query.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ident.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 src/libident/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/README Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,77 @@ +COPYRIGHT ISSUES: + + This version of 'libident' is hereby released into the + Public Domain. It may be distributed for a fee or without + a fee. We only ask you not to pretend you wrote it. + +If you make any changes, please send sources or a diff of it to +us (pen@lysator.liu.se or pell@lysator.liu.se), so we can keep +_one_ unified version of libident available... + + +FTP SITE: + +The official FTP site and location for libident is: + + ftp://ftp.lysator.liu.se/pub/ident/libs + + +COMMENTS: + +This is the second stab at a small library to interface to the Ident +protocol server. Maybe this will work correctly on some machines.. :-) + +The ident-tester.c file is a small daemon (to be started from Inetd) +that does an ident lookup on you if you telnet into it. Can be used +to verify that your Ident server is working correctly. + +I'm currently running this "ident-tester" on port 114 at lysator.liu.se +(130.236.254.1) if you wish to test your server. + +/Peter Eriksson , 1 Aug 1992 + + +This library now contains some higher-level routines, as well as a +similar test program to test these (lookup-tester). + +/Pär Emanuelsson , 4 April 1993 + + +Support for NextStep 3.1 added. + +/Michael Kuch , 13 Aug 1993 + + +Updated the ident.h header file to work with Linux, and reorganized the +Makefile for easier compilation... + +/Peter Eriksson, 18 Oct 1994 + + +Added the copyright notice at the top. + +/Peter Eriksson, 29 Nov 1994 + + +For release 0.18: + +Added some bug fixes and improvements from Jean-Philippe Martin-Flatin +(syj@ecmwf.int). + +/Peter Eriksson, 5 Oct 1995 + + +For release 0.20: + +Some cleanup of the distribution, and some bug fixes in the +ident-tester.c source. Perhaps it should be called 1.0? (Perhaps +it should use GNU Autoconf...) + +/Peter Eriksson, 13 Nov 1996 + + +For release 0.21: + +A couple of minor fixes (mainly support for 2.11BSD). + +/Peter Eriksson, 17 Jan 1997 diff -r 000000000000 -r 08114f7dcc23 src/libident/README_MASQMAIL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/README_MASQMAIL Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,10 @@ +This is from libident 0.22 (though the version string says 0.21?). I +have not changed it, except that I replaced the Makefile with a +Makefile.am. + +I also did not include the example programs and the man page in the +masqmail source tarball. + +Oliver Kurth, Fri Oct 6 15:11:07 CEST 2000 +kurth@innominate.de + diff -r 000000000000 -r 08114f7dcc23 src/libident/id_close.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/id_close.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,29 @@ +/* +** id_close.c Close a connection to an IDENT server +** +** Author: Peter Eriksson +*/ + +#ifdef NeXT3 +# include +#endif + +#ifdef HAVE_ANSIHEADERS +# include +# include +#endif + +#define IN_LIBIDENT_SRC +#include "ident.h" + +int id_close __P1(ident_t *, id) +{ + int res; + + res = close(id->fd); + free(id); + + return res; +} + + diff -r 000000000000 -r 08114f7dcc23 src/libident/id_open.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/id_open.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,167 @@ +/* +** id_open.c Establish/initiate a connection to an IDENT server +** +** Author: Peter Eriksson +** Fixes: Pär Emanuelsson +*/ + +#ifdef NeXT3 +# include +#endif + +#include +#include +#include + +#ifdef HAVE_ANSIHEADERS +# include +# include +# include +# if !defined(__sgi) && !defined(VMS) +# define bzero(p,l) memset(p, 0, l) +# endif +#endif + +#include +#include +#include +#include +#include + +#define IN_LIBIDENT_SRC +#include "ident.h" + +#include + +#ifdef _AIX +# include +#endif + + +/* +ident_t *id_open __P3(struct in_addr *, laddr, + struct in_addr *, faddr, + struct timeval *, timeout) +*/ + +ident_t *id_open __P(( __STRUCT_IN_ADDR_P laddr, + __STRUCT_IN_ADDR_P faddr, + __STRUCT_TIMEVAL_P timeout)) +{ + ident_t *id; + int res, tmperrno; + struct sockaddr_in sin_laddr, sin_faddr; + fd_set rs, ws, es; +#ifndef OLD_SETSOCKOPT + int on = 1; + struct linger linger; +#endif + + if ((id = (ident_t *) malloc(sizeof(*id))) == 0) + return 0; + + if ((id->fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) + { + free(id); + return 0; + } + + if (timeout) + { + if ((res = fcntl(id->fd, F_GETFL, 0)) < 0) + goto ERROR; + +#ifndef VMS + if (fcntl(id->fd, F_SETFL, res | FNDELAY) < 0) + goto ERROR; +#endif + } + + /* We silently ignore errors if we can't change LINGER */ +#ifdef OLD_SETSOCKOPT + /* Old style setsockopt() */ + (void) setsockopt(id->fd, SOL_SOCKET, SO_DONTLINGER); + (void) setsockopt(id->fd, SOL_SOCKET, SO_REUSEADDR); +#else + /* New style setsockopt() */ + linger.l_onoff = 0; + linger.l_linger = 0; + + (void) setsockopt(id->fd, SOL_SOCKET, SO_LINGER, (void *) &linger, sizeof(linger)); + (void) setsockopt(id->fd, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)); +#endif + + id->buf[0] = '\0'; + + bzero((char *)&sin_laddr, sizeof(sin_laddr)); + sin_laddr.sin_family = AF_INET; + sin_laddr.sin_addr = *laddr; + sin_laddr.sin_port = 0; + + if (bind(id->fd, (struct sockaddr *) &sin_laddr, sizeof(sin_laddr)) < 0) + { +#ifdef DEBUG + perror("libident: bind"); +#endif + goto ERROR; + } + + bzero((char *)&sin_faddr, sizeof(sin_faddr)); + sin_faddr.sin_family = AF_INET; + sin_faddr.sin_addr = *faddr; + sin_faddr.sin_port = htons(IDPORT); + + errno = 0; + res = connect(id->fd, (struct sockaddr *) &sin_faddr, sizeof(sin_faddr)); + if (res < 0 && errno != EINPROGRESS) + { +#ifdef DEBUG + perror("libident: connect"); +#endif + goto ERROR; + } + + if (timeout) + { + FD_ZERO(&rs); + FD_ZERO(&ws); + FD_ZERO(&es); + + FD_SET(id->fd, &rs); + FD_SET(id->fd, &ws); + FD_SET(id->fd, &es); + +#ifdef __hpux + if ((res = select(FD_SETSIZE, (int *) &rs, (int *) &ws, (int *) &es, timeout)) < 0) +#else + if ((res = select(FD_SETSIZE, &rs, &ws, &es, timeout)) < 0) +#endif + { +#ifdef DEBUG + perror("libident: select"); +#endif + goto ERROR; + } + + if (res == 0) + { + errno = ETIMEDOUT; + goto ERROR; + } + + if (FD_ISSET(id->fd, &es)) + goto ERROR; + + if (!FD_ISSET(id->fd, &rs) && !FD_ISSET(id->fd, &ws)) + goto ERROR; + } + + return id; + + ERROR: + tmperrno = errno; /* Save, so close() won't erase it */ + close(id->fd); + free(id); + errno = tmperrno; + return 0; +} diff -r 000000000000 -r 08114f7dcc23 src/libident/id_parse.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/id_parse.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,229 @@ +/* +** id_parse.c Receive and parse a reply from an IDENT server +** +** Author: Peter Eriksson +** Fiddling: Pär Emanuelsson +*/ + +#ifdef NeXT3 +# include +#endif + +#include +#include +#include +#include + +#ifdef HAVE_ANSIHEADERS +# include +# include +# include +#endif + +#include +#include +#include + +#ifdef _AIX +# include +#endif + +#ifdef _AIX +# include +#endif +#ifdef VMS +# include /* for fd_set */ +#endif +#define IN_LIBIDENT_SRC +#include "ident.h" + + +/* +int id_parse __P7(ident_t *, id, + struct timeval *, timeout, + int *, lport, + int *, fport, + char **, identifier, + char **, opsys, + char **, charset) +*/ + +int id_parse __P(( ident_t *id, + __STRUCT_TIMEVAL_P timeout, + int *lport, + int *fport, + char **identifier, + char **opsys, + char **charset)) +{ + char c, *cp, *tmp_charset; + fd_set rs; + int pos, res=0, lp, fp; + + errno = 0; + + tmp_charset = 0; + + if (!id) + return -1; + if (lport) + *lport = 0; + if (fport) + *fport = 0; + if (identifier) + *identifier = 0; + if (opsys) + *opsys = 0; + if (charset) + *charset = 0; + + pos = strlen(id->buf); + + if (timeout) + { + FD_ZERO(&rs); + FD_SET(id->fd, &rs); + +#ifdef __hpux + if ((res = select(FD_SETSIZE, (int *) &rs, (int *)0, (int *)0, timeout)) < 0) +#else + if ((res = select(FD_SETSIZE, &rs, (fd_set *)0, (fd_set *)0, timeout)) < 0) +#endif + return -1; + + if (res == 0) + { + errno = ETIMEDOUT; + return -1; + } + } + + /* Every octal value is allowed except 0, \n and \r */ + while (pos < sizeof(id->buf) && + (res = read(id->fd, id->buf + pos, 1)) == 1 && + id->buf[pos] != '\n' && id->buf[pos] != '\r') + pos++; + + if (res < 0) + return -1; + + if (res == 0) + { + errno = ENOTCONN; + return -1; + } + + if (id->buf[pos] != '\n' && id->buf[pos] != '\r') + return 0; /* Not properly terminated string */ + + id->buf[pos++] = '\0'; + + /* + ** Get first field ( , ) + */ + cp = id_strtok(id->buf, ":", &c); + if (!cp) + return -2; + + if (sscanf(cp, " %d , %d", &lp, &fp) != 2) + { + if (identifier) + { + *identifier = id_strdup(cp); + if (*identifier == NULL) + return -4; + } + return -2; + } + + if (lport) + *lport = lp; + if (fport) + *fport = fp; + + /* + ** Get second field (USERID or ERROR) + */ + cp = id_strtok((char *)0, ":", &c); + if (!cp) + return -2; + + if (strcmp(cp, "ERROR") == 0) + { + cp = id_strtok((char *)0, "\n\r", &c); + if (!cp) + return -2; + + if (identifier) + { + *identifier = id_strdup(cp); + if (*identifier == NULL) + return -4; + } + + return 2; + } + else if (strcmp(cp, "USERID") == 0) + { + /* + ** Get first subfield of third field + */ + cp = id_strtok((char *) 0, ",:", &c); + if (!cp) + return -2; + + if (opsys) + { + *opsys = id_strdup(cp); + if (*opsys == NULL) + return -4; + } + + /* + ** We have a second subfield () + */ + if (c == ',') + { + cp = id_strtok((char *)0, ":", &c); + if (!cp) + return -2; + + tmp_charset = cp; + if (charset) + { + *charset = id_strdup(cp); + if (*charset == NULL) + return -4; + } + + /* + ** We have even more subfields - ignore them + */ + if (c == ',') + id_strtok((char *)0, ":", &c); + } + + if (tmp_charset && strcmp(tmp_charset, "OCTET") == 0) + cp = id_strtok((char *)0, (char *)0, &c); + else + cp = id_strtok((char *)0, "\n\r", &c); + + if (identifier) + { + *identifier = id_strdup(cp); + if (*identifier == NULL) + return -4; + } + return 1; + } + else + { + if (identifier) + { + *identifier = id_strdup(cp); + if (*identifier == NULL) + return -4; + } + return -3; + } +} diff -r 000000000000 -r 08114f7dcc23 src/libident/id_query.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/id_query.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,88 @@ +/* +** id_query.c Transmit a query to an IDENT server +** +** Author: Peter Eriksson +*/ + +#ifdef NeXT3 +# include +#endif + +#include +#include +#include + +#ifdef HAVE_ANSIHEADERS +# include +# include +# include +#endif + +#include +#include +#include + +#ifdef _AIX +# include +#endif + +#ifdef _AIX +# include +#endif +#ifdef VMS +# include /* for fd_set */ +#endif +#define IN_LIBIDENT_SRC +#include "ident.h" + + +/* +int id_query __P4(ident_t *, id, + int, lport, + int, fport, + struct timeval *, timeout) +*/ + +int id_query __P(( ident_t *id, + int lport, + int fport, + __STRUCT_TIMEVAL_P timeout)) +{ +#ifdef SIGRETURNTYPE + SIGRETURNTYPE (*old_sig)(); +#else + void (*old_sig) __P((int)); +#endif + int res; + char buf[80]; + fd_set ws; + + sprintf(buf, "%d , %d\r\n", lport, fport); + + if (timeout) + { + FD_ZERO(&ws); + FD_SET(id->fd, &ws); + +#ifdef __hpux + if ((res = select(FD_SETSIZE, (int *)0, (int *)&ws, (int *)0, timeout)) < 0) +#else + if ((res = select(FD_SETSIZE, (fd_set *)0, &ws, (fd_set *)0, timeout)) < 0) +#endif + return -1; + + if (res == 0) + { + errno = ETIMEDOUT; + return -1; + } + } + + old_sig = signal(SIGPIPE, SIG_IGN); + + res = write(id->fd, buf, strlen(buf)); + + signal(SIGPIPE, old_sig); + + return res; +} diff -r 000000000000 -r 08114f7dcc23 src/libident/ident.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/ident.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,155 @@ +/* +** ident.c High-level calls to the ident lib +** +** Author: Pär Emanuelsson +** Hacked by: Peter Eriksson +*/ + +#ifdef NeXT3 +# include +#endif + +#include + +#ifdef HAVE_ANSIHEADERS +# include +# include +#endif + +#include + +#include +#include + +#define IN_LIBIDENT_SRC +#include "ident.h" + +#include + + + + +/* Do a complete ident query and return result */ + +IDENT *ident_lookup __P2(int, fd, + int, timeout) +{ + struct sockaddr_in localaddr, remoteaddr; + int len; + + len = sizeof(remoteaddr); + if (getpeername(fd, (struct sockaddr*) &remoteaddr, &len) < 0) + return 0; + + len = sizeof(localaddr); + if (getsockname(fd, (struct sockaddr *) &localaddr, &len) < 0) + return 0; + + return ident_query( &localaddr.sin_addr, &remoteaddr.sin_addr, + ntohs(localaddr.sin_port), ntohs(remoteaddr.sin_port), + timeout); +} + + +IDENT *ident_query __P5(struct in_addr *, laddr, + struct in_addr *, raddr, + int, lport, + int, rport, + int, timeout) +{ + int res; + ident_t *id; + struct timeval timout; + IDENT *ident=0; + + + timout.tv_sec = timeout; + timout.tv_usec = 0; + + if (timeout) + id = id_open( laddr, raddr, &timout); + else + id = id_open( laddr, raddr, (struct timeval *)0); + + if (!id) + { + errno = EINVAL; + return 0; + } + + if (timeout) + res = id_query(id, rport, lport, &timout); + else + res = id_query(id, rport, lport, (struct timeval *) 0); + + if (res < 0) + { + id_close(id); + return 0; + } + + ident = (IDENT *) malloc(sizeof(IDENT)); + if (!ident) { + id_close(id); + return 0; + } + + if (timeout) + res = id_parse(id, &timout, + &ident->lport, + &ident->fport, + &ident->identifier, + &ident->opsys, + &ident->charset); + else + res = id_parse(id, (struct timeval *) 0, + &ident->lport, + &ident->fport, + &ident->identifier, + &ident->opsys, + &ident->charset); + + if (res != 1) + { + free(ident); + id_close(id); + return 0; + } + + id_close(id); + return ident; /* At last! */ +} + + +char *ident_id __P2(int, fd, + int, timeout) +{ + IDENT *ident; + char *id=0; + + ident = ident_lookup(fd, timeout); + if (ident && ident->identifier && *ident->identifier) + { + id = id_strdup(ident->identifier); + if (id == NULL) + return NULL; + } + + ident_free(ident); + return id; +} + + +void ident_free __P1(IDENT *, id) +{ + if (!id) + return; + if (id->identifier) + free(id->identifier); + if (id->opsys) + free(id->opsys); + if (id->charset) + free(id->charset); + free(id); +} + diff -r 000000000000 -r 08114f7dcc23 src/libident/ident.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/ident.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,194 @@ +/* +** ident.h +** +** Author: Peter Eriksson +** Intruder: Pär Emanuelsson +*/ + +#ifndef __IDENT_H__ +#define __IDENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Sigh */ +#ifdef __STDC__ +# if __STDC__ == 1 +# define IS_STDC 1 +# endif +#endif + +#ifdef __P +# undef __P +#endif + +#ifdef IS_STDC +# define __P(AL) AL + +#ifdef IN_LIBIDENT_SRC + +# define __P1(t1,a1) \ + (t1 a1) + +# define __P2(t1,a1,t2,a2) \ + (t1 a1, t2 a2) + +# define __P3(t1,a1,t2,a2,t3,a3) \ + (t1 a1, t2 a2, t3 a3) + +# define __P4(t1,a1,t2,a2,t3,a3,t4,a4) \ + (t1 a1, t2 a2, t3 a3, t4 a4) + +# define __P5(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) \ + (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) + +# define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \ + (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) +#endif + +#else + +# define __P(AL) () + +#ifdef IN_LIBIDENT_SRC + +# define __P1(t1,a1) (a1) \ + t1 a1; +# define __P2(t1,a1,t2,a2) (a1, a2) \ + t1 a1; \ + t2 a2; +# define __P3(t1,a1,t2,a2,t3,a3) (a1, a2, a3) \ + t1 a1; \ + t2 a2; \ + t3 a3; +# define __P4(t1,a1,t2,a2,t3,a3,t4,a4) (a1, a2, a3, a4) \ + t1 a1; \ + t2 a2; \ + t3 a3; \ + t4 a4; +# define __P5(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) (a1, a2, a3, a4, a5) \ + t1 a1; \ + t2 a2; \ + t3 a3; \ + t4 a4; \ + t5 a5; +# define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \ + (a1, a2, a3, a4, a5, a6, a7) \ + t1 a1; \ + t2 a2; \ + t3 a3; \ + t4 a4; \ + t5 a5; \ + t6 a6; \ + t7 a7; +#endif +#endif + +#ifdef IS_STDC +# undef IS_STDC +#endif + +#ifdef _AIX +# include +#endif +#ifdef __sgi +# include +#endif +#include +#include +#include + +#if defined(VMS) && !defined(FD_SETSIZE) +# define FD_SETSIZE 64 +#endif + +/* + * Sigh, GCC v2 complains when using undefined struct tags + * in function prototypes... + */ +#if defined(__GNUC__) && !defined(INADDR_ANY) +# define __STRUCT_IN_ADDR_P void * +#else +# define __STRUCT_IN_ADDR_P struct in_addr * +#endif + +#if defined(__GNUC__) && !defined(DST_NONE) +# define __STRUCT_TIMEVAL_P void * +#else +# define __STRUCT_TIMEVAL_P struct timeval * +#endif + +#if defined(__sgi) && defined(_POSIX_SOURCE) +# undef __STRUCT_TIMEVAL_P +# define __STRUCT_TIMEVAL_P void * +#endif + +#ifndef IDBUFSIZE +# define IDBUFSIZE 2048 +#endif + +#ifndef IDPORT +# define IDPORT 113 +#endif + +typedef struct +{ + int fd; + char buf[IDBUFSIZE]; +} ident_t; + +typedef struct { + int lport; /* Local port */ + int fport; /* Far (remote) port */ + char *identifier; /* Normally user name */ + char *opsys; /* OS */ + char *charset; /* Charset (what did you expect?) */ +} IDENT; /* For higher-level routines */ + +/* Low-level calls and macros */ +#define id_fileno(ID) ((ID)->fd) + +extern ident_t * id_open __P((__STRUCT_IN_ADDR_P laddr, + __STRUCT_IN_ADDR_P faddr, + __STRUCT_TIMEVAL_P timeout)); + +extern int id_close __P((ident_t *id)); + +extern int id_query __P((ident_t *id, + int lport, + int fport, + __STRUCT_TIMEVAL_P timeout)); + +extern int id_parse __P((ident_t *id, + __STRUCT_TIMEVAL_P timeout, + int *lport, + int *fport, + char **identifier, + char **opsys, + char **charset)); + +/* High-level calls */ + +extern IDENT *ident_lookup __P((int fd, int timeout)); + +extern char *ident_id __P((int fd, int timeout)); + +extern IDENT *ident_query __P(( __STRUCT_IN_ADDR_P laddr, __STRUCT_IN_ADDR_P raddr, int lport, int rport, int timeout)); + +extern void ident_free __P((IDENT *id)); + +extern char id_version[]; + +#ifdef IN_LIBIDENT_SRC + +extern char *id_strdup __P((char *str)); +extern char *id_strtok __P((char *cp, char *cs, char *dc)); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -r 000000000000 -r 08114f7dcc23 src/libident/support.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/support.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,86 @@ +/* +** support.c +** +** Author: Pr Emanuelsson +** Hacked by: Peter Eriksson +*/ +#include +#include + +#ifdef HAVE_ANSIHEADERS +# include +# include +#else +# define strchr(str, c) index(str, c) +#endif + +#define IN_LIBIDENT_SRC +#include "ident.h" + + +char *id_strdup __P1(char *, str) +{ + char *cp; + + cp = (char *) malloc(strlen(str)+1); + if (cp == NULL) + { +#ifdef DEBUG + perror("libident: malloc"); +#endif + return NULL; + } + + strcpy(cp, str); + + return cp; +} + + +char *id_strtok __P3(char *, cp, + char *, cs, + char *, dc) +{ + static char *bp = 0; + + if (cp) + bp = cp; + + /* + ** No delimitor cs - return whole buffer and point at end + */ + if (!cs) + { + while (*bp) + bp++; + return cs; + } + + /* + ** Skip leading spaces + */ + while (isspace(*bp)) + bp++; + + /* + ** No token found? + */ + if (!*bp) + return 0; + + cp = bp; + while (*bp && !strchr(cs, *bp)) + bp++; + + /* + ** Remove trailing spaces + */ + *dc = *bp; + for (dc = bp-1; dc > cp && isspace(*dc); dc--) + ; + *++dc = '\0'; + + bp++; + + return cp; +} diff -r 000000000000 -r 08114f7dcc23 src/libident/version.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libident/version.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,1 @@ +char id_version[] = "0.21"; diff -r 000000000000 -r 08114f7dcc23 src/listen.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/listen.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,243 @@ +/* MasqMail + Copyright (C) 1999/2000 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include +#include + +static int volatile sighup_seen = 0; + +static +void sighup_handler(int sig) +{ + sighup_seen = 1; + signal(SIGHUP, sighup_handler); +} + +static +void sigchld_handler(int sig) +{ + pid_t pid; + int status; + + pid = waitpid(0, &status, 0); + if(pid > 0){ + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, "process %d exited with %d\n", + pid, WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, + "process with pid %d got signal: %d\n", + pid, WTERMSIG(status)); + } + signal(SIGCHLD, sigchld_handler); +} + +#ifdef ENABLE_SMTP_SERVER +void accept_connect(int listen_sock, int sock, struct sockaddr_in* sock_addr) +{ + pid_t pid; + int dup_sock = dup(sock); + FILE *out, *in; + gchar *rem_host; + gchar *ident = NULL; + + rem_host = g_strdup(inet_ntoa(sock_addr->sin_addr)); +#ifdef ENABLE_IDENT + { + gchar *id = NULL; + if((id = (gchar *)ident_id(sock, 60))){ + ident = g_strdup(id); + } + logwrite(LOG_NOTICE, "connect from host %s, port %hd ident=%s\n", + rem_host, + ntohs (sock_addr->sin_port), + ident ? ident : "(unknown)"); + } +#else + logwrite(LOG_NOTICE, "connect from host %s, port %hd\n", + rem_host, + ntohs (sock_addr->sin_port)); +#endif + + // start child for connection: + signal(SIGCHLD, sigchld_handler); + pid = fork(); + if(pid == 0){ + close(listen_sock); + out = fdopen(sock, "w"); + in = fdopen(dup_sock, "r"); + + smtp_in(in, out, rem_host, ident); + + _exit(EXIT_SUCCESS); + }else if(pid < 0){ + logwrite(LOG_WARNING, "could not fork for incoming smtp connection: %s\n", + strerror(errno)); + } + +#ifdef ENABLE_IDENT + if(ident != NULL) g_free(ident); +#endif + + close(sock); + close(dup_sock); +} +#endif /*ifdef ENABLE_SMTP_SERVER*/ + +void listen_port(GList *iface_list, gint qival, char *argv[]) +{ + int i; + fd_set active_fd_set, read_fd_set; + struct timeval tm; + time_t time_before, time_now; + struct sockaddr_in clientname; + size_t size; + GList *node, *node_next; + int sel_ret; + + /* Create the sockets and set them up to accept connections. */ + FD_ZERO (&active_fd_set); +#ifdef ENABLE_SMTP_SERVER + for(node = g_list_first(iface_list); + node; + node = node_next){ + interface *iface = (interface *)(node->data); + int sock; + + node_next=g_list_next(node); + if ((sock = make_server_socket (iface))<0){ + iface_list= g_list_remove_link(iface_list, node); + g_list_free_1(node); + continue; + } + if (listen (sock, 1) < 0){ + logwrite(LOG_ALERT, "listen: (terminating): %s\n", strerror(errno)); + exit (EXIT_FAILURE); + } + logwrite(LOG_NOTICE, "listening on interface %s:%d\n", + iface->address, iface->port); + DEBUG(5) debugf("sock = %d\n", sock); + FD_SET (sock, &active_fd_set); + } +#endif + + /* setup handler for HUP signal: */ + signal(SIGHUP, sighup_handler); + signal(SIGCHLD, sigchld_handler); + + /* now that we have our socket(s), + we can give up root privileges */ + if(!conf.run_as_user){ + if(setegid(conf.mail_gid) != 0){ + logwrite(LOG_ALERT, "could not change gid to %d: %s\n", + conf.mail_gid, strerror(errno)); + exit(EXIT_FAILURE); + } + if(seteuid(conf.mail_uid) != 0){ + logwrite(LOG_ALERT, "could not change uid to %d: %s\n", + conf.mail_uid, strerror(errno)); + exit(EXIT_FAILURE); + } + } + + /* sel_ret = 0;*/ + time(&time_before); + time_before -= qival; + sel_ret = -1; + + while (1){ + + /* if we were interrupted by an incoming connection (or a signal) + we have to recalculate the time until the next queue run should + occur. select may put a value into tm, but doc for select() says + we should not use it.*/ + if(qival > 0){ + time(&time_now); + if(sel_ret == 0){ /* we are either just starting or did a queue run */ + tm.tv_sec = qival; + tm.tv_usec = 0; + time_before = time_now; + }else{ + tm.tv_sec = qival - (time_now - time_before); + tm.tv_usec = 0; + + /* race condition, very unlikely (but possible): */ + if(tm.tv_sec < 0) + tm.tv_sec = 0; + } + } + /* Block until input arrives on one or more active sockets, + or signal arrives, + or queuing interval time elapsed (if qival > 0) */ + read_fd_set = active_fd_set; + if ((sel_ret = select(FD_SETSIZE, &read_fd_set, NULL, NULL, + qival > 0 ? &tm : NULL)) < 0){ + if(errno != EINTR){ + logwrite(LOG_ALERT, "select: (terminating): %s\n", strerror(errno)); + exit (EXIT_FAILURE); + }else{ + if(sighup_seen){ + logwrite(LOG_NOTICE, "HUP signal received. Restarting daemon\n"); + + for(i = 0; i < FD_SETSIZE; i++) + if(FD_ISSET(i, &active_fd_set)) + close(i); + + execv(argv[0], &(argv[0])); + logwrite(LOG_ALERT, "restarting failed: %s\n", strerror(errno)); + exit(EXIT_FAILURE); + } + } + } + else if(sel_ret > 0){ +#ifdef ENABLE_SMTP_SERVER + for(i = 0; i < FD_SETSIZE; i++){ + if (FD_ISSET (i, &read_fd_set)){ + int sock = i; + int new; + size = sizeof (clientname); + new = accept (sock, + (struct sockaddr *) &clientname, + &size); + if (new < 0){ + logwrite(LOG_ALERT, "accept: (ignoring): %s\n", + strerror(errno)); + }else + accept_connect(sock, new, &clientname); + } + } +#else + ; +#endif + }else{ + /* If select returns 0, the interval time has elapsed. + We start a new queue runner process */ + int pid; + signal(SIGCHLD, sigchld_handler); + if((pid = fork()) == 0){ + queue_run(); + + _exit(EXIT_SUCCESS); + } + else if(pid < 0){ + logwrite(LOG_ALERT, "could not fork for queue run"); + } + } + } +} diff -r 000000000000 -r 08114f7dcc23 src/local.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/local.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,366 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include "peopen.h" +#include + +static +void message_stream(FILE *out, message *msg, GList *hdr_list, guint flags) +{ + time_t now = time(NULL); + GList *node; + + if(flags & MSGSTR_FROMLINE){ + fprintf(out, "From <%s@%s> %s", msg->return_path->local_part, + msg->return_path->domain, ctime(&now)); + } + + foreach(hdr_list, node){ + header *hdr = (header *)(node->data); + fputs(hdr->header, out); + } + putc('\n', out); + foreach(msg->data_list, node){ + /* From hack: */ + if(flags & MSGSTR_FROMHACK){ + if(strncmp(node->data, "From ", 5) == 0) + putc('>', out); + } + fputs(node->data, out); + } + putc('\n', out); +} + +gboolean append_file(message *msg, GList *hdr_list, gchar *user) +{ + struct passwd *pw; + gboolean ok = FALSE; + + /* headers may be special for a local delivery */ + if(hdr_list == NULL) + hdr_list = msg->hdr_list; + + if((pw = getpwnam(user))){ + uid_t saved_uid = geteuid(); + gid_t saved_gid = getegid(); + gboolean uid_ok = TRUE, gid_ok = TRUE; + + if(!conf.run_as_user){ + uid_ok = (seteuid(0) == 0); + if(uid_ok){ + gid_ok = (setegid(conf.mail_gid) == 0); + uid_ok = (seteuid(pw->pw_uid) == 0); + } + } + + DEBUG(5) debugf("running as euid %d\n", geteuid()); + DEBUG(5) debugf("running as egid %d\n", getegid()); + + if(uid_ok && gid_ok){ + gchar *filename; + FILE *out; + + filename = g_strdup_printf("%s/%s", conf.mail_dir, user); + if((out = fopen(filename, "a"))){ +#ifdef USE_LIBLOCKFILE + gint err; + /* lock file using liblockfile */ + err = maillock(user,3); + if(err == 0){ +#else + /* lock file: */ + struct flock lock; + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_END; + lock.l_start = lock.l_len = 0; + if(fcntl(fileno(out), F_SETLK, &lock) != -1){ +#endif + fchmod(fileno(out), 0600); + + message_stream(out, msg, hdr_list, MSGSTR_FROMLINE|MSGSTR_FROMHACK); + + ok = TRUE; + + /* close when still user */ + fclose(out); +#ifdef USE_LIBLOCKFILE + mailunlock(); +#endif + }else{ + fclose(out); +#ifdef USE_LIBLOCKFILE + DEBUG(3) debugf("could not lock file %s: error %d\n", + filename, err); + } /* XEmacs indenting convenience... */ +#else + DEBUG(3) debugf("could not lock file %s: %s\n", + filename, strerror(errno)); + } +#endif + }else{ + logwrite(LOG_ALERT, "could not open file %s: %s\n", + filename, strerror(errno)); + } + g_free(filename); + + if(!conf.run_as_user){ + uid_ok = (seteuid(0) == 0); + if(uid_ok){ + gid_ok = (setegid(saved_gid) == 0); + uid_ok = (seteuid(saved_uid) == 0); + } + } + + if(!uid_ok || !gid_ok){ + /* FIXME: if this fails we HAVE to exit, because we shall not run + with some users id. But we do not return, and so this message + will not be finished, so the user will get the message again + next time a delivery is attempted... */ + logwrite(LOG_ALERT, + "could not set back uid or gid after local delivery: %s\n", + strerror(errno)); + logwrite(LOG_ALERT, + "uid=%d, gid=%d, euid=%d, egid=%d, want = %d, %d\n", + getuid(), getgid(), geteuid(), getegid(), saved_uid, saved_gid); + exit(EXIT_FAILURE); + } + }else{ + logwrite(LOG_ALERT, + "could not set uid or gid for local delivery, uid = %d: %s\n", + pw->pw_uid, strerror(errno)); + } + }else{ + logwrite(LOG_ALERT, "could not find password entry for user %s\n", user); + errno = ENOENT; /* getpwnam does not set errno correctly */ + } + + return ok; +} + +#ifdef ENABLE_MAILDIR +gboolean maildir_out(message *msg, GList *hdr_list, gchar *user, guint flags) +{ + struct passwd *pw; + gboolean ok = FALSE; + + /* headers may be special for a local delivery */ + if(hdr_list == NULL) + hdr_list = msg->hdr_list; + + if((pw = getpwnam(user))){ + uid_t saved_uid = geteuid(); + gid_t saved_gid = getegid(); + gboolean uid_ok = TRUE, gid_ok = TRUE; + + if(!conf.run_as_user){ + uid_ok = (seteuid(0) == 0); + if(uid_ok){ + gid_ok = (setegid(conf.mail_gid) == 0); + uid_ok = (seteuid(pw->pw_uid) == 0); + } + } + + DEBUG(5) debugf("running as euid %d\n", geteuid()); + DEBUG(5) debugf("running as egid %d\n", getegid()); + + if(uid_ok && gid_ok){ + char *path = g_strdup_printf("%s/Maildir", pw->pw_dir); + struct stat statbuf; + int ret; + + DEBUG(5) debugf("path = %s\n", path); + + ok = TRUE; + ret = stat(path, &statbuf); + if(ret != 0){ + ok = FALSE; + if(errno == ENOENT){ + logwrite(LOG_NOTICE, "directory %s does not exist, creating\n", path); + if(mkdir(path, 0700) == 0) + ok = TRUE; + }else + logwrite(LOG_ALERT, "stat of %s failed: %s\n", path, strerror(errno)); + } + if(ok){ + ok = FALSE; + ret = stat(path, &statbuf); + if(S_ISDIR(statbuf.st_mode)){ + gchar *subdirs[] = {"tmp", "new", "cur"}; + int i; + for(i = 0; i < 3; i++){ + char *path1 = g_strdup_printf("%s/%s", path, subdirs[i]); + ret = stat(path1, &statbuf); + if(ret != 0){ + if(errno == ENOENT){ + logwrite(LOG_NOTICE, "directory %s does not exist, creating\n", path1); + if(mkdir(path1, 0700) != 0) break; + } + } + g_free(path1); + } + if(i == 3){ + FILE *out; + mode_t saved_mode = umask(066); + /* the qmail style unique works only if delivering + with different process. We do not fork for each delivery, + so our uid is more unique. Hope it is compatible with all + MUAs. + */ + gchar *filename = g_strdup_printf("%s/tmp/%s.%s", path, msg->uid, conf.host_name); + + DEBUG(5) debugf("filename = %s\n", filename); + + if((out = fopen(filename, "w"))){ + gchar *newname = + g_strdup_printf("%s/new/%s.%s", path, msg->uid, conf.host_name); + message_stream(out, msg, hdr_list, flags); + ok = TRUE; + if(fflush(out) == EOF) ok = FALSE; + else if(fdatasync(fileno(out)) != 0){ + if(errno != EINVAL) /* some fs do not support this.. + I hope this also means that it is not necessary */ + ok = FALSE; + } + fclose(out); + if(rename(filename, newname) != 0){ + ok = FALSE; + logwrite(LOG_ALERT, "moving %s to %s failed: %s", + filename, newname, strerror(errno)); + } + g_free(newname); + } + umask(saved_mode); + g_free(filename); + } + }else{ + logwrite(LOG_ALERT, "%s is not a directory\n", path); + errno = ENOTDIR; + } + } + if(!conf.run_as_user){ + uid_ok = (seteuid(0) == 0); + if(uid_ok){ + gid_ok = (setegid(saved_gid) == 0); + uid_ok = (seteuid(saved_uid) == 0); + } + } + if(!uid_ok || !gid_ok){ + /* FIXME: if this fails we HAVE to exit, because we shall not run + with some users id. But we do not return, and so this message + will not be finished, so the user will get the message again + next time a delivery is attempted... */ + logwrite(LOG_ALERT, + "could not set back uid or gid after local delivery: %s\n", + strerror(errno)); + exit(EXIT_FAILURE); + } + g_free(path); + }else{ + logwrite(LOG_ALERT, + "could not set uid or gid for local delivery, uid = %d: %s\n", + pw->pw_uid, strerror(errno)); + } + }else{ + logwrite(LOG_ALERT, "could not find password entry for user %s\n", user); + errno = ENOENT; /* getpwnam does not set errno correctly */ + } + return ok; +} +#endif + +gboolean +pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags) +{ + gchar *envp[40]; + FILE *out; + uid_t saved_uid = geteuid(); + gid_t saved_gid = getegid(); + gboolean ok = FALSE; + gint i, n; + pid_t pid; + void (*old_signal)(int); + int status; + + /* set uid and gid to the mail ids */ + if(!conf.run_as_user){ + set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); + } + + /* set environment */ + { + gint i = 0; + address *ancestor = addr_find_ancestor(rcpt); + + envp[i++] = g_strdup_printf("SENDER=%s@%s", msg->return_path->local_part, msg->return_path->domain); + envp[i++] = g_strdup_printf("SENDER_DOMAIN=%s", msg->return_path->domain); + envp[i++] = g_strdup_printf("SENDER_LOCAL=%s", msg->return_path->local_part); + envp[i++] = g_strdup_printf("RECEIVED_HOST=%s", msg->received_host ? msg->received_host : ""); + + envp[i++] = g_strdup_printf("RETURN_PATH=%s@%s", + msg->return_path->local_part, msg->return_path->domain); + envp[i++] = g_strdup_printf("DOMAIN=%s", ancestor->domain); + + envp[i++] = g_strdup_printf("LOCAL_PART=%s", ancestor->local_part); + envp[i++] = g_strdup_printf("USER=%s", ancestor->local_part); + envp[i++] = g_strdup_printf("LOGNAME=%s", ancestor->local_part); + + envp[i++] = g_strdup_printf("MESSAGE_ID=%s", msg->uid); + envp[i++] = g_strdup_printf("QUALIFY_DOMAIN=%s", conf.host_name); + + envp[i] = NULL; + n = i; + } + + old_signal = signal(SIGCHLD, SIG_DFL); + + out = peidopen(cmd, "w", envp, &pid, conf.mail_uid, conf.mail_gid); + if(out != NULL){ + message_stream(out, msg, hdr_list, flags); + + fclose(out); + + waitpid(pid, &status, 0); + + if(WEXITSTATUS(status) != 0){ + int exstat = WEXITSTATUS(status); + logwrite(LOG_ALERT, "process returned %d (%s)\n", exstat, ext_strerror(1024 + exstat)); + errno = 1024 + exstat; + }else if(WIFSIGNALED(status)){ + logwrite(LOG_ALERT, "process got signal %d\n", WTERMSIG(status)); + }else + ok = TRUE; + + }else + logwrite(LOG_ALERT, "could not open pipe '%s': %s\n", cmd, strerror(errno)); + + signal(SIGCHLD, old_signal); + + /* free environment */ + for(i = 0; i < n; i++){ + g_free(envp[i]); + } + + /* set uid and gid back */ + if(!conf.run_as_user){ + set_euidgid(saved_uid, saved_gid, NULL, NULL); + } + + return ok; +} + diff -r 000000000000 -r 08114f7dcc23 src/log.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/log.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,211 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" + +#include "sysexits.h" + +static char *_sysexit_strings[] = { + "command line usage error", + "data format error", + "cannot open input", + "addressee unknown", + "host name unknown", + "service unavailable", + "internal software error", + "system error (e.g., can't fork)", + "critical OS file missing", + "can't create (user) output file", + "input/output error", + "temp failure; user is invited to retry", + "remote error in protocol", + "permission denied", + "configuration error" +}; + +gchar *ext_strerror(int err) +{ + if(err < 1024) + return strerror(err); + else + if(err > 1024 + EX__BASE && + (err - 1024 - EX__BASE < sizeof(_sysexit_strings)/sizeof(_sysexit_strings[0]))) + return _sysexit_strings[err - 1024 - EX__BASE]; + + return "unknown error"; +} + +static FILE *logfile = NULL; +static FILE *debugfile = NULL; + +gboolean logopen() +{ + gchar *filename; + mode_t saved_mode = umask(066); + + if(conf.use_syslog){ + openlog(PACKAGE, LOG_PID, LOG_MAIL); + }else{ + uid_t saved_uid; + gid_t saved_gid; + + saved_gid = setegid(conf.mail_gid); + saved_uid = seteuid(conf.mail_uid); + + filename = g_strdup_printf("%s/masqmail.log", conf.log_dir); + logfile = fopen(filename, "a"); + if(!logfile){ + fprintf(stderr, "could not open log '%s': %s\n", filename, strerror(errno)); + return FALSE; + } + g_free(filename); + + seteuid(saved_uid); + setegid(saved_gid); + } + +#ifdef ENABLE_DEBUG + if(conf.debug_level > 0){ + filename = g_strdup_printf("%s/debug.log", conf.log_dir); + debugfile = fopen(filename, "a"); + if(!debugfile){ + fprintf(stderr, "could not open debug log '%s'\n", filename); + return FALSE; + } + g_free(filename); + } +#endif + umask(saved_mode); + return TRUE; +} + +void logclose() +{ + if(conf.use_syslog) + closelog(); + else + if(logfile) fclose(logfile); + if(debugfile) fclose(debugfile); +} + +void vlogwrite(int pri, const char *fmt, va_list args) +{ + if((conf.do_verbose && (pri & LOG_VERBOSE)) || (pri == LOG_ALERT) || (pri == LOG_WARNING)){ + va_list args_copy; + va_copy(args_copy, args); + vfprintf(stdout, fmt, args_copy); + va_end(args_copy); + fflush(stdout); /* is this necessary? */ + } + + pri &= ~LOG_VERBOSE; + if(pri){ + + if(conf.use_syslog) + vsyslog(pri, fmt, args); + else{ + if(pri <= conf.log_max_pri){ + FILE *file = logfile ? logfile : stderr; + time_t now = time(NULL); + struct tm *t = localtime(&now); + gchar buf[24]; + uid_t saved_uid; + gid_t saved_gid; + + saved_gid = setegid(conf.mail_gid); + saved_uid = seteuid(conf.mail_uid); + + strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t); + fprintf(file, "%s [%d] ", buf, getpid()); + + vfprintf(file, fmt, args); + fflush(file); + + seteuid(saved_uid); + setegid(saved_gid); + } + } + } +} + +#ifdef ENABLE_DEBUG +void vdebugwrite(int pri, const char *fmt, va_list args) +{ + time_t now = time(NULL); + struct tm *t = localtime(&now); + gchar buf[24]; + strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t); + + if(debugfile){ + fprintf(debugfile, "%s [%d] ", buf, getpid()); + + vfprintf(debugfile, fmt, args); + fflush(debugfile); + }else{ + fprintf(stderr, "no debug file, msg was:\n"); + vfprintf(stderr, fmt, args); + } +} +#endif + +void logwrite(int pri, const char *fmt, ...) +{ + va_list args, args_copy; + int saved_errno = errno; /* somewhere this is changed to EBADF */ + + va_start(args, fmt); +#ifdef ENABLE_DEBUG + va_copy(args_copy, args); +#endif + vlogwrite(pri, fmt, args); +#ifdef ENABLE_DEBUG + if(debugfile) + vdebugwrite(pri, fmt, args_copy); + va_end(args_copy); +#endif + va_end(args); + + errno = saved_errno; +} + +#ifdef ENABLE_DEBUG +void debugf(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + vdebugwrite(LOG_DEBUG, fmt, args); + + va_end(args); +} + +void vdebugf(const char *fmt, va_list args) +{ + vdebugwrite(LOG_DEBUG, fmt, args); +} +#endif + +void maillog(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + vlogwrite(LOG_NOTICE, fmt, args); + + va_end(args); +} diff -r 000000000000 -r 08114f7dcc23 src/lookup.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lookup.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,376 @@ +/* MasqMail Copyright (C) Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include + +#include "masqmail.h" + +#ifdef RESOLV_TEST + +#undef DEBUG +#define DEBUG(x) if(x > 0) + +#define debugf g_print +#endif + +#ifdef ENABLE_RESOLVER + +static union { + HEADER hdr; + unsigned char buf[PACKETSZ]; +} response; +static unsigned char *resp_end; +static unsigned char *resp_pos; + +static int num_answers; +static char name[MAX_DNSNAME]; + +unsigned short rr_type; +unsigned short rr_dlen; + +static +unsigned short getshort(unsigned char *c) +{ + unsigned short u; + u = c[0]; + return (u << 8) + c[1]; +} + +static +int dns_resolve(char *domain, int type, gboolean do_search) +{ + int n; + int i; + + int resp_len; + /*errno = 0;*/ + + /* + if (!stralloc_copy(&glue,domain)) return DNS_MEM; + if (!stralloc_0(&glue)) return DNS_MEM; + */ + + // resp_len = res_query(domain, C_IN, type, response.buf, sizeof(response)); + DEBUG(5) debugf("DNS: before res_search()\n"); + if(do_search) + resp_len = res_search(domain, C_IN, type, response.buf, sizeof(response)); + else + resp_len = res_query(domain, C_IN, type, response.buf, sizeof(response)); + DEBUG(5) debugf("DBG: after res_search()\n"); + + if (resp_len <= 0){ + /* + if (errno == ECONNREFUSED) return DNS_SOFT; + if (h_errno == TRY_AGAIN) return DNS_SOFT; + return DNS_HARD; + */ + return -1; + } + if (resp_len >= sizeof(response)) + resp_len = sizeof(response); + + resp_end = response.buf + resp_len; + resp_pos = response.buf + sizeof(HEADER); + n = ntohs(response.hdr.qdcount); + + while (n-- > 0){ + i = dn_expand(response.buf, resp_end, resp_pos, name, MAX_DNSNAME); + if (i < 0) + return -1; + DEBUG(5) debugf("DBG: resolve name = %s\n", name); + resp_pos += i; + i = resp_end - resp_pos; + if (i < QFIXEDSZ) + return -1; + resp_pos += QFIXEDSZ; + } + num_answers = ntohs(response.hdr.ancount); + + return 0; +} + +static int dns_next() +{ + int i; + + if (num_answers <= 0) return 2; + num_answers--; + + if (resp_pos == resp_end) + return -1 /* soft */; + + i = dn_expand(response.buf, resp_end, resp_pos, name, 256); + if (i < 0) + return -1; /* soft */ + resp_pos += i; + + i = resp_end - resp_pos; + if (i < 4 + 3 * 2) + return -1; /* soft */ + + rr_type = getshort(resp_pos); + rr_dlen = getshort(resp_pos + 8); + resp_pos += 10; + + return 0; +} + +static +int dns_getip(guint32 *ip) +{ + int ret; + + if((ret = dns_next())) return ret; + + if (rr_type == T_A){ + if (rr_dlen < 4) + return -1; /* soft */ + *ip = *(guint32 *)(resp_pos); + DEBUG(5) debugf("DNS: dns_getip(): ip = %s\n", inet_ntoa(*(struct in_addr*)ip)); + resp_pos += rr_dlen; + + return 1; + } + resp_pos += rr_dlen; + return 0; +} + +static +int dns_getmx(int *pref) +{ + int ret; + + if((ret = dns_next())) return ret; + + if (rr_type == T_MX){ + if (rr_dlen < 3) + return -1; /* soft */ + + *pref = (resp_pos[0] << 8) + resp_pos[1]; + if (dn_expand(response.buf, resp_end, resp_pos + 2, name, MAX_DNSNAME) < 0) + return -1; + + resp_pos += rr_dlen; + + return 1; + } + resp_pos += rr_dlen; + return 0; +} + +/* +static +int dns_getname(int type) +{ + int ret; + + if((ret = dns_next())) return ret; + + if (rr_type == type){ + if (dn_expand(response.buf, resp_end, resp_pos, name, MAX_DNSNAME) < 0) + return -1; + + resp_pos += rr_dlen; + + return 1; + } + resp_pos += rr_dlen; + return 0; +} +*/ + +static +int dns_look_ip(gchar *domain, guint32 *ip) +{ + gchar *n = domain; + + while(TRUE){ + if(dns_resolve(n, T_A, FALSE) == 0){ + dns_next(); + if(rr_type == T_A){ + if (rr_dlen < 4) + return -1; /* soft */ + *ip = *(guint32 *)(resp_pos); + + DEBUG(5) debugf("DNS: dns_look_ip(): ip = %s\n", + inet_ntoa(*(struct in_addr*)ip)); + + resp_pos += rr_dlen; + return 0; + }else if(rr_type == T_CNAME){ + if (dn_expand(response.buf, resp_end, resp_pos, name, MAX_DNSNAME) < 0) + return -1; + + DEBUG(5) debugf("DNS: (CNAME) dns_look_ip(): name = %s\n", name); + + resp_pos += rr_dlen; + n = name; + }else + return -1; + }else + return -1; + } +} + +GList *resolve_dns_a(GList *list, gchar *domain) +{ + int ret; + + DEBUG(5) debugf("DNS: resolve_dns_a entered\n"); + + if(dns_resolve(domain, T_A, TRUE) == 0){ + mxip_addr mxip; + while((ret = dns_getip(&(mxip.ip))) != 2){ + if(ret == 1){ + mxip.name = g_strdup(name); + mxip.pref = 0; + list = g_list_append(list, g_memdup(&mxip, sizeof(mxip))); + } + } + } + return list; +} + +static +gint _mx_sort_func(gconstpointer aa, gconstpointer bb) +{ + const mxip_addr *a = (mxip_addr *)aa; + const mxip_addr *b = (mxip_addr *)bb; + + if(a->pref == b->pref) + return a->ip - b->ip; + else + return a->pref - b->pref; +} + +GList *resolve_dns_mx(GList *list, gchar *domain) +{ + GList *node; + int ret; + int cnt = 0; + + DEBUG(5) debugf("DNS: resolve_dns_mx entered\n"); + + if(dns_resolve(domain, T_MX, TRUE) == 0){ + GList *node_next; + mxip_addr mxip; + while((ret = dns_getmx(&(mxip.pref))) != 2){ + if(ret == 1){ + mxip.name = g_strdup(name); + mxip.ip = rand(); + list = g_list_append(list, g_memdup(&mxip, sizeof(mxip))); + cnt++; + } + } + + DEBUG(5) debugf("DNS: found %d mx records\n", cnt); + + /* to randomize sequences with equal pref values, + we temporarily 'misused' the ip field and + put a random number in it as a secondary sort key. + */ + list = g_list_sort(list, _mx_sort_func); + + /* CNAME resolving has to be added as well. */ + + for(node = g_list_first(list); + node != NULL; + node = node_next){ + + mxip_addr *p_mxip = (mxip_addr *)(node->data); + node_next = g_list_next(node); + + if(dns_look_ip(p_mxip->name, &(p_mxip->ip)) != 0){ + DEBUG(1) debugf("DNS: could not resolve target of mx %s\n", p_mxip->name); + list = g_list_remove_link(list, node); + g_free(node->data); + g_list_free_1(node); + } + } + } + return list; +} + +#endif + +/* now something completely different... */ + +GList *resolve_byname(GList *list, gchar *domain) +{ + struct hostent *hent; + + DEBUG(5) debugf("DNS: resolve_byname entered\n"); + + if((hent = gethostbyname(domain))){ + char *haddr; + int i = 0; + while((haddr = hent->h_addr_list[i++])){ + mxip_addr mxip; + mxip.ip = *(guint32 *)(haddr); + mxip.pref = 0; + mxip.name = g_strdup(hent->h_name); + list = g_list_append(list, g_memdup(&mxip, sizeof(mxip))); + } + } + return list; +} + +#ifdef RESOLV_TEST +int main(int argc, char *argv[]) +{ + GList *addr_list = NULL, *node; + + g_print("starting res_init()\n"); + + g_print("retrans = %d, retry = %d\n", _res.retrans, _res.retry); + + if(res_init() == 0){ + + addr_list = resolve_dns_a(NULL, argv[1]); + g_print("A:\n"); + + foreach(addr_list, node){ + mxip_addr *p_mxip = (mxip_addr *)(node->data); + + printf("name = %s\n IP = %s\n", + p_mxip->name, + inet_ntoa(*(struct in_addr *)&(p_mxip->ip))); + } + addr_list = resolve_dns_mx(NULL, argv[1]); + g_print("MX:\n"); + + foreach(addr_list, node){ + mxip_addr *p_mxip = (mxip_addr *)(node->data); + + printf("name = %s\n IP = %s pref = %d\n", + p_mxip->name, + inet_ntoa(*(struct in_addr *)&(p_mxip->ip)), + p_mxip->pref); + } + { + guint32 ip; + dns_look_ip(argv[1], &ip); + printf("dns_look_ip: %s\n", inet_ntoa(*((struct in_addr *)(&ip)))); + } + }else + printf("res_init() failed.\n"); + +} +#endif diff -r 000000000000 -r 08114f7dcc23 src/lookup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lookup.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,33 @@ +/* MasqMail + * Copyright (C) Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#define MAX_DNSNAME MAXDNAME + +typedef +struct{ + guint32 ip; + int pref; + guchar *name; +} mxip_addr; + + +typedef GList *(*resolve_func)(GList *, gchar *); + +GList *resolve_dns_a(GList *list, gchar *domain); +GList *resolve_dns_mx(GList *list, gchar *domain); +GList *resolve_byname(GList *list, gchar *domain); diff -r 000000000000 -r 08114f7dcc23 src/masqmail.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/masqmail.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,828 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "masqmail.h" + +/* mutually exclusive modes. Note that there is neither a 'get' mode + nor a 'queue daemon' mode. These, as well as the distinction beween + the two (non exclusive) daemon (queue and listen) modes are handled + by flags.*/ +typedef enum _mta_mode +{ + MODE_ACCEPT = 0, /* accept message on stdin */ + MODE_DAEMON, /* run as daemon */ + MODE_RUNQUEUE, /* single queue run, online or offline */ + MODE_GET_DAEMON, /* run as get (retrieve) daemon */ + MODE_SMTP, /* accept SMTP on stdin */ + MODE_LIST, /* list queue */ + MODE_MCMD, /* do queue manipulation */ + MODE_VERSION, /* show version */ + MODE_BI, /* fake ;-) */ + MODE_NONE /* to prevent default MODE_ACCEPT */ +}mta_mode; + +char *pidfile = NULL; +volatile int sigterm_in_progress = 0; + +static +void sigterm_handler(int sig) +{ + if(sigterm_in_progress) + raise(sig); + sigterm_in_progress = 1; + + if(pidfile){ + uid_t uid; + uid = seteuid(0); + if(unlink(pidfile) != 0) + logwrite(LOG_WARNING, "could not delete pid file %s: %s\n", + pidfile, strerror(errno)); + seteuid(uid); /* we exit anyway after this, just to be sure */ + } + + signal(sig, SIG_DFL); + raise(sig); +} + +#ifdef ENABLE_IDENT /* so far used for that only */ +static +gboolean is_in_netlist(gchar *host, GList *netlist) +{ + guint hostip = inet_addr(host); + struct in_addr addr; + + addr.s_addr = hostip; + if(addr.s_addr != INADDR_NONE){ + GList *node; + foreach(netlist, node){ + struct in_addr *net = (struct in_addr *)(node->data); + if((addr.s_addr & net->s_addr) == net->s_addr) + return TRUE; + } + } + return FALSE; +} +#endif + +gchar *get_optarg(char *argv[], gint argc, gint *argp, gint *pos) +{ + if(argv[*argp][*pos]) + return &(argv[*argp][*pos]); + else{ + if(*argp+1 < argc){ + if(argv[(*argp)+1][0] != '-'){ + (*argp)++; + *pos = 0; + return &(argv[*argp][*pos]); + } + } + } + return NULL; +} + +gchar *get_progname(gchar *arg0) +{ + gchar *p = arg0 + strlen(arg0) - 1; + while(p > arg0){ + if(*p == '/') + return p+1; + p--; + } + return p; +} + +gboolean write_pidfile(gchar *name) +{ + FILE *fptr; + + if((fptr = fopen(name, "wt"))){ + fprintf(fptr, "%d\n", getpid()); + fclose(fptr); + pidfile = strdup(name); + return TRUE; + } + logwrite(LOG_WARNING, "could not write pid file: %s\n", strerror(errno)); + return FALSE; +} + +static +void mode_daemon(gboolean do_listen, gint queue_interval, char *argv[]) +{ + guint pid; + + /* daemon */ + if(!conf.run_as_user){ + if((conf.orig_uid != 0) && (conf.orig_uid != conf.mail_uid)){ + fprintf(stderr, "must be root or %s for daemon.\n", DEF_MAIL_USER); + exit(EXIT_FAILURE); + } + } + + if((pid = fork()) > 0){ + exit(EXIT_SUCCESS); + }else if(pid < 0){ + logwrite(LOG_ALERT, "could not fork!"); + exit(EXIT_FAILURE); + } + + signal(SIGTERM, sigterm_handler); + write_pidfile(PIDFILEDIR"/masqmail.pid"); + + conf.do_verbose = FALSE; + + fclose(stdin); + fclose(stdout); + fclose(stderr); + + listen_port(do_listen ? conf.listen_addresses : NULL, + queue_interval, argv); +} + +#ifdef ENABLE_POP3 +static +void mode_get_daemon(gint get_interval, char *argv[]) +{ + guint pid; + + /* daemon */ + if(!conf.run_as_user){ + if((conf.orig_uid != 0) && (conf.orig_uid != conf.mail_uid)){ + fprintf(stderr, "must be root or %s for daemon.\n", DEF_MAIL_USER); + exit(EXIT_FAILURE); + } + } + + if((pid = fork()) > 0){ + exit(EXIT_SUCCESS); + }else if(pid < 0){ + logwrite(LOG_ALERT, "could not fork!"); + exit(EXIT_FAILURE); + } + + signal(SIGTERM, sigterm_handler); + write_pidfile(PIDFILEDIR"/masqmail-get.pid"); + + conf.do_verbose = FALSE; + + fclose(stdin); + fclose(stdout); + fclose(stderr); + + get_daemon(get_interval, argv); +} +#endif + +#ifdef ENABLE_SMTP_SERVER +static void mode_smtp() +{ + /* accept smtp message on stdin */ + /* write responses to stderr. */ + + struct sockaddr_in saddr; + gchar *peername = NULL; + int dummy = sizeof(saddr); +#ifdef ENABLE_IDENT + gchar *ident = NULL; +#endif + + conf.do_verbose = FALSE; + + if(!conf.run_as_user){ + seteuid(conf.orig_uid); + setegid(conf.orig_gid); + } + + DEBUG(5) debugf("accepting smtp message on stdin\n"); + + if(getpeername(0, (struct sockaddr *)(&saddr), &dummy) == 0){ + peername = g_strdup(inet_ntoa(saddr.sin_addr)); +#ifdef ENABLE_IDENT + { + gchar *id = NULL; + if((id = (gchar *)ident_id(0, 60))){ + ident = g_strdup(id); + } + } +#endif + }else if(errno != ENOTSOCK) + exit(EXIT_FAILURE); + + //smtp_in(stdin, stdout, peername); + smtp_in(stdin, stderr, peername, NULL); + +#ifdef ENABLE_IDENT + if(ident) g_free(ident); +#endif +} +#endif + +static void mode_accept(address *return_path, gchar *full_sender_name, + guint accept_flags, char **addresses, int addr_cnt) +{ + /* accept message on stdin */ + accept_error err; + message *msg = create_message(); + gint i; + + if(return_path != NULL){ + if((conf.orig_uid != 0) && + (conf.orig_uid != conf.mail_uid) && + (!is_ingroup(conf.orig_uid, conf.mail_gid))){ + fprintf(stderr, + "must be in root, %s or in group %s for setting return path.\n", + DEF_MAIL_USER, DEF_MAIL_GROUP); + exit(EXIT_FAILURE); + } + } + + if(!conf.run_as_user){ + seteuid(conf.orig_uid); + setegid(conf.orig_gid); + } + + DEBUG(5) debugf("accepting message on stdin\n"); + + msg->received_prot = PROT_LOCAL; + for(i = 0; i < addr_cnt; i++){ + if(addresses[i][0] != '|') + msg->rcpt_list = + g_list_append(msg->rcpt_list, + create_address_qualified(addresses[i], TRUE, conf.host_name)); + else{ + logwrite(LOG_ALERT, "no pipe allowed as recipient address: %s\n", addresses[i]); + exit(EXIT_FAILURE); + } + } + + /* -f option */ + msg->return_path = return_path; + + /* -F option */ + msg->full_sender_name = full_sender_name; + + if((err = accept_message(stdin, msg, accept_flags)) == AERR_OK){ + if(spool_write(msg, TRUE)){ + pid_t pid; + logwrite(LOG_NOTICE, "%s <= %s with %s\n", + msg->uid, addr_string(msg->return_path), + prot_names[PROT_LOCAL]); + + if(!conf.do_queue){ + + if((pid = fork()) == 0){ + + conf.do_verbose = FALSE; + + fclose(stdin); + fclose(stdout); + fclose(stderr); + + if(deliver(msg)){ + exit(EXIT_SUCCESS); + }else + exit(EXIT_FAILURE); + }else if(pid < 0){ + logwrite(LOG_ALERT, "could not fork for delivery, id = %s", + msg->uid); + } + } + }else{ + fprintf(stderr, "Could not write spool file\n"); + exit(EXIT_FAILURE); + } + }else{ + switch(err){ + case AERR_EOF: + fprintf(stderr, "unexpected EOF.\n"); + exit(EXIT_FAILURE); + case AERR_NORCPT: + fprintf(stderr, "no recipients.\n"); + exit(EXIT_FAILURE); + default: + /* should never happen: */ + fprintf(stderr, "Unknown error (%d)\r\n", err); + exit(EXIT_FAILURE); + } + exit(EXIT_FAILURE); + } +} + +int +main(int argc, char *argv[]) +{ + /* cmd line flags */ + gchar *conf_file = CONF_FILE; + gint arg = 1; + gboolean do_get = FALSE; + gboolean do_get_online = FALSE; + + gboolean do_listen = FALSE; + gboolean do_runq = FALSE; + gboolean do_runq_online = FALSE; + + gboolean do_queue = FALSE; + + gboolean do_verbose = FALSE; + gint debug_level = -1; + + mta_mode mta_mode = MODE_ACCEPT; + + gint queue_interval = 0; + gint get_interval = 0; + gboolean opt_t = FALSE; + gboolean opt_i = FALSE; + gboolean opt_odb = FALSE; + gboolean opt_oem = FALSE; + gboolean exit_failure = FALSE; + + gchar *M_cmd = NULL; + + gint exit_code = EXIT_SUCCESS; + gchar *route_name = NULL; + gchar *get_name = NULL; + gchar *progname; + gchar *f_address = NULL; + gchar *full_sender_name = NULL; + address *return_path = NULL; /* may be changed by -f option */ + + progname = get_progname(argv[0]); + + if(strcmp(progname, "mailq") == 0) + { mta_mode = MODE_LIST; } + else if(strcmp(progname, "mailrm") == 0) + { mta_mode = MODE_MCMD; M_cmd = "rm"; } + else if(strcmp(progname, "runq") == 0) + { mta_mode = MODE_RUNQUEUE; do_runq = TRUE; } + else if(strcmp(progname, "rmail") == 0) + { mta_mode = MODE_ACCEPT; opt_i = TRUE; } + else if(strcmp(progname, "smtpd") == 0 || strcmp(progname, "in.smtpd") == 0) + { mta_mode = MODE_SMTP; } + + /* parse cmd line */ + while(arg < argc){ + gint pos = 0; + if((argv[arg][pos] == '-') && (argv[arg][pos+1] != '-')){ + pos++; + switch(argv[arg][pos++]){ + case 'b': + switch(argv[arg][pos++]){ + case 'd': + do_listen = TRUE; + mta_mode = MODE_DAEMON; + break; + case 'i': + /* ignored */ + mta_mode = MODE_BI; + break; + case 's': + mta_mode = MODE_SMTP; + break; + case 'p': + mta_mode = MODE_LIST; + break; + case 'V': + mta_mode = MODE_VERSION; + break; + default: + fprintf(stderr, "unrecognized option '%s'\n", argv[arg]); + exit(EXIT_FAILURE); + } + break; + case 'B': + /* we ignore this and throw the argument away */ + get_optarg(argv, argc, &arg, &pos); + break; + case 'C': + if(!(conf_file = get_optarg(argv, argc, &arg, &pos))){ + fprintf(stderr, "-C requires a filename as argument.\n"); + exit(EXIT_FAILURE); + } + break; + case 'F': + { + full_sender_name = get_optarg(argv, argc, &arg, &pos); + if(!full_sender_name){ + fprintf(stderr, "-F requires a name as an argument\n"); + exit(EXIT_FAILURE); + } + } + break; + case 'd': + if(getuid() == 0){ + char *lvl = get_optarg(argv, argc, &arg, &pos); + if(lvl) + debug_level = atoi(lvl); + else{ + fprintf(stderr, "-d requires a number as an argument.\n"); + exit(EXIT_FAILURE); + } + }else{ + fprintf(stderr, "only root may set the debug level.\n"); + exit(EXIT_FAILURE); + } + break; + case 'f': + /* set return path */ + { + gchar *address; + address = get_optarg(argv, argc, &arg, &pos); + if(address){ + f_address = g_strdup(address); + }else{ + fprintf(stderr, "-f requires an address as an argument\n"); + exit(EXIT_FAILURE); + } + } + break; + case 'g': + do_get = TRUE; + if(!mta_mode) mta_mode = MODE_NONE; /* to prevent default MODE_ACCEPT */ + if(argv[arg][pos] == 'o'){ + pos++; + do_get_online = TRUE; + /* can be NULL, then we use online detection method */ + route_name = get_optarg(argv, argc, &arg, &pos); + + if(route_name != NULL){ + if(isdigit(route_name[0])){ + get_interval = time_interval(route_name, &pos); + route_name = get_optarg(argv, argc, &arg, &pos); + mta_mode = MODE_GET_DAEMON; + do_get = FALSE; + } + } + }else{ + if((optarg = get_optarg(argv, argc, &arg, &pos))){ + get_name = get_optarg(argv, argc, &arg, &pos); + } + } + break; + case 'i': + if(argv[arg][pos] == 0){ + opt_i = TRUE; + exit_failure = FALSE; /* may override -oem */ + }else{ + fprintf(stderr, "unrecognized option '%s'\n", argv[arg]); + exit(EXIT_FAILURE); + } + break; + case 'M': + { + mta_mode = MODE_MCMD; + M_cmd = g_strdup(&(argv[arg][pos])); + } + break; + case 'o': + switch(argv[arg][pos++]){ + case 'e': + if(argv[arg][pos++] == 'm') /* -oem */ + if(!opt_i) exit_failure = TRUE; + opt_oem = TRUE; + break; + case 'd': + if(argv[arg][pos] == 'b') /* -odb */ + opt_odb = TRUE; + else if(argv[arg][pos] == 'q') /* -odq */ + do_queue = TRUE; + break; + case 'i': + opt_i = TRUE; + exit_failure = FALSE; /* may override -oem */ + break; + } + break; + + case 'q': + { + gchar *optarg; + + do_runq = TRUE; + mta_mode = MODE_RUNQUEUE; + if(argv[arg][pos] == 'o'){ + pos++; + do_runq = FALSE; + do_runq_online = TRUE; + /* can be NULL, then we use online detection method */ + route_name = get_optarg(argv, argc, &arg, &pos); + }else if((optarg = get_optarg(argv, argc, &arg, &pos))){ + mta_mode = MODE_DAEMON; + queue_interval = time_interval(optarg, &pos); + } + } + break; + case 't': + if(argv[arg][pos] == 0){ + opt_t = TRUE; + }else{ + fprintf(stderr, "unrecognized option '%s'\n", argv[arg]); + exit(EXIT_FAILURE); + } + break; + case 'v': + do_verbose = TRUE; + break; + default: + fprintf(stderr, "unrecognized option '%s'\n", argv[arg]); + exit(EXIT_FAILURE); + } + }else{ + if(argv[arg][pos+1] == '-'){ + if(argv[arg][pos+2] != '\0'){ + fprintf(stderr, "unrecognized option '%s'\n", argv[arg]); + exit(EXIT_FAILURE); + } + arg++; + } + break; + } + arg++; + } + + if(mta_mode == MODE_VERSION){ + gchar *with_resolver = "", *with_smtp_server = "", *with_pop3 = "", *with_auth = "", + *with_maildir = "", *with_ident = "", *with_mserver = ""; + +#ifdef ENABLE_RESOLVER + with_resolver = " +resolver"; +#endif +#ifdef ENABLE_SMTP_SERVER + with_smtp_server = " +smtp-server"; +#endif +#ifdef ENABLE_POP3 + with_pop3 = " +pop3"; +#endif +#ifdef ENABLE_AUTH + with_auth = " +auth"; +#endif +#ifdef ENABLE_MAILDIR + with_maildir = " +maildir"; +#endif +#ifdef ENABLE_IDENT + with_ident = " +ident"; +#endif +#ifdef ENABLE_MSERVER + with_mserver = " +mserver"; +#endif + + printf("%s %s%s%s%s%s%s%s%s\n", PACKAGE, VERSION, + with_resolver, with_smtp_server, with_pop3, with_auth, + with_maildir, with_ident, with_mserver); + + exit(EXIT_SUCCESS); + } + + /* initialize random generator */ + srand(time(NULL)); + /* ignore SIGPIPE signal */ + signal(SIGPIPE, SIG_IGN); + + /* close all possibly open file descriptors */ + { + int i, max_fd = sysconf(_SC_OPEN_MAX); + + if(max_fd <= 0) max_fd = 64; + for(i = 3; i < max_fd; i++) + close(i); + } + + init_conf(); + + /* if we are not privileged, and the config file was changed we + implicetely set the the run_as_user flag and give up all + privileges. + + So it is possible for a user to run his own daemon without + breaking security. + */ + if(strcmp(conf_file, CONF_FILE) != 0){ + if(conf.orig_uid != 0){ + conf.run_as_user = TRUE; + seteuid(conf.orig_uid); + setegid(conf.orig_gid); + setuid(conf.orig_uid); + setgid(conf.orig_gid); + } + } + + read_conf(conf_file); + + if(do_queue) conf.do_queue = TRUE; + if(do_verbose) conf.do_verbose = TRUE; + if(debug_level >= 0) /* if >= 0, it was given by argument */ + conf.debug_level = debug_level; + + chdir("/"); + + if(!conf.run_as_user){ + if(setgid(0) != 0){ + fprintf(stderr, + "could not set gid to 0. Is the setuid bit set? : %s\n", + strerror(errno)); + exit(EXIT_FAILURE); + } + if(setuid(0) != 0){ + fprintf(stderr, + "could not gain root privileges. Is the setuid bit set? : %s\n", + strerror(errno)); + exit(EXIT_FAILURE); + } + } + + if(!logopen()){ + fprintf(stderr, "could not open log file\n"); + exit(EXIT_FAILURE); + } + + DEBUG(1) debugf("masqmail %s starting\n", VERSION); + + DEBUG(5){ + gchar **str = argv; + debugf("args: \n"); + while(*str){ + debugf("%s \n", *str); + str++; + } + } + DEBUG(5) debugf("queue_interval = %d\n", queue_interval); + + if(f_address){ + return_path = create_address_qualified(f_address, TRUE, conf.host_name); + g_free(f_address); + if(!return_path){ + fprintf(stderr, "invalid RFC821 address: %s\n", f_address); + exit(EXIT_FAILURE); + } + } + + if(do_get){ +#ifdef ENABLE_POP3 + if((mta_mode == MODE_NONE) || (mta_mode == MODE_RUNQUEUE)){ + + set_identity(conf.orig_uid, "getting mail"); + + if(do_get_online){ + if(route_name != NULL){ + conf.online_detect = g_strdup("argument"); + set_online_name(route_name); + } + get_online(); + }else{ + if(get_name) + get_from_name(get_name); + else + get_all(); + } + }else{ + logwrite(LOG_ALERT, "get (-g) only allowed alone or together with queue run (-q)\n"); + } +#else + fprintf(stderr, "get (pop) support not compiled in\n"); +#endif + } + + switch(mta_mode){ + case MODE_DAEMON: + mode_daemon(do_listen, queue_interval, argv); + break; + case MODE_RUNQUEUE: + { + /* queue runs */ + set_identity(conf.orig_uid, "queue run"); + + if(do_runq) + exit_code = queue_run() ? EXIT_SUCCESS : EXIT_FAILURE; + + if(do_runq_online){ + if(route_name != NULL){ + conf.online_detect = g_strdup("argument"); + set_online_name(route_name); + } + exit_code = queue_run_online() ? EXIT_SUCCESS : EXIT_FAILURE; + } + } + break; + case MODE_GET_DAEMON: +#ifdef ENABLE_POP3 + if(route_name != NULL){ + conf.online_detect = g_strdup("argument"); + set_online_name(route_name); + } + mode_get_daemon(get_interval, argv); +#endif + break; + + case MODE_SMTP: +#ifdef ENABLE_SMTP_SERVER + mode_smtp(); +#else + fprintf(stderr, "smtp server support not compiled in\n"); +#endif + break; + case MODE_LIST: + + queue_list(); + break; + + case MODE_BI: + + exit(EXIT_SUCCESS); + break; /* well... */ + + case MODE_MCMD: + if(strcmp(M_cmd, "rm") == 0){ + gboolean ok = FALSE; + + set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL); + + if(is_privileged_user(conf.orig_uid)){ + for(; arg < argc; arg++){ + if(queue_delete(argv[arg])) + ok = TRUE; + } + }else{ + struct passwd *pw = getpwuid(conf.orig_uid); + if(pw){ + for(; arg < argc; arg++){ + message *msg = msg_spool_read(argv[arg], FALSE); +#ifdef ENABLE_IDENT + if(((msg->received_host == NULL) && (msg->received_prot == PROT_LOCAL)) || + is_in_netlist(msg->received_host, conf.ident_trusted_nets)){ +#else + if((msg->received_host == NULL) && (msg->received_prot == PROT_LOCAL)){ +#endif + if(msg->ident){ + if(strcmp(pw->pw_name, msg->ident) == 0){ + if(queue_delete(argv[arg])) + ok = TRUE; + }else{ + fprintf(stderr, "you do not own message id %s\n", argv[arg]); + } + }else + fprintf(stderr, "message %s does not have an ident.\n", argv[arg]); + }else{ + fprintf(stderr, "message %s was not received locally or from a trusted network.\n", argv[arg]); + } + } + }else{ + fprintf(stderr, "could not find a passwd entry for uid %d: %s\n", conf.orig_uid, strerror(errno)); + } + } + exit(ok ? EXIT_SUCCESS : EXIT_FAILURE); + }else{ + fprintf(stderr, "unknown command %s\n", M_cmd); + exit(EXIT_FAILURE); + } + break; + + case MODE_ACCEPT: + { + guint accept_flags = + (opt_t ? ACC_DEL_RCPTS|ACC_DEL_BCC|ACC_RCPT_FROM_HEAD : ACC_HEAD_FROM_RCPT) | + (opt_i ? ACC_NODOT_TERM : ACC_NODOT_RELAX); + + mode_accept(return_path, full_sender_name, accept_flags, &(argv[arg]), argc - arg); + + exit(exit_failure ? EXIT_FAILURE : EXIT_SUCCESS); + } + break; + case MODE_NONE: + break; + default: + fprintf(stderr, "unknown mode: %d\n", mta_mode); + break; + } + + logclose(); + + exit(exit_code); +} diff -r 000000000000 -r 08114f7dcc23 src/masqmail.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/masqmail.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,656 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef ENABLE_IDENT +#include "libident/ident.h" +#endif + +#include "lookup.h" + +typedef +struct _interface +{ + gchar *address; + gint port; +} interface; + +#define ADDR_FLAG_DELIVERED 0x01 +#define ADDR_FLAG_DEFERED 0x02 +#define ADDR_FLAG_FAILED 0x04 +#define ADDR_FLAG_LAST_ROUTE 0x40 +#define ADDR_FLAG_NOEXPAND 0x80 + +typedef struct _address +{ + gchar *address; + gchar *local_part; + gchar *domain; + gint flags; + GList *children; + struct _address *parent; +} address; + +#define addr_mark_delivered(addr) { addr->flags |= ADDR_FLAG_DELIVERED; } +#define addr_unmark_delivered(addr) { addr->flags &= ~ADDR_FLAG_DELIVERED; } +#define addr_is_delivered(addr) ((addr->flags & ADDR_FLAG_DELIVERED) != 0 ) + +#define addr_mark_defered(addr) { addr->flags |= ADDR_FLAG_DEFERED; } +#define addr_unmark_defered(addr) { addr->flags &= ~ADDR_FLAG_DEFERED; } +#define addr_is_defered(addr) ((addr->flags & ADDR_FLAG_DEFERED) != 0 ) + +#define addr_mark_failed(addr) { addr->flags |= ADDR_FLAG_FAILED; } +#define addr_unmark_failed(addr) { addr->flags &= ~ADDR_FLAG_FAILED; } +#define addr_is_failed(addr) ((addr->flags & ADDR_FLAG_FAILED) != 0 ) + +typedef +struct _connect_route +{ + gchar *name; + gchar *filename; + + gchar *protocol; + + gboolean is_local_net; + gboolean last_route; + + GList *allowed_return_paths; + GList *not_allowed_return_paths; + GList *allowed_mail_locals; + GList *not_allowed_mail_locals; + GList *allowed_rcpt_domains; + GList *not_allowed_rcpt_domains; + + interface *mail_host; + gchar *wrapper; + gboolean connect_error_fail; + + gchar *helo_name; + gboolean do_correct_helo; + gboolean do_pipelining; + + gchar *set_h_from_domain; + gchar *set_h_reply_to_domain; + gchar *set_return_path_domain; + + GList *map_h_from_addresses; + GList *map_h_reply_to_addresses; + GList *map_h_mail_followup_to_addresses; + GList *map_return_path_addresses; + + gboolean expand_h_sender_domain; + gboolean expand_h_sender_address; + + GList *resolve_list; + + gchar *auth_name; + gchar *auth_login; + gchar *auth_secret; + + gchar *pop3_login; + + gchar *pipe; + + gboolean pipe_fromline; + gboolean pipe_fromhack; +} connect_route; + +typedef struct _get_conf +{ + gchar *protocol; + gchar *server_name; + guint server_port; + gchar *wrapper; + gchar *login_user; + gchar *login_pass; + address *address; + address *return_path; + gboolean do_keep; + gboolean do_uidl; + gboolean do_uidl_dele; + gint max_size; + gboolean max_size_delete; + gint max_count; + + GList *resolve_list; + +} get_conf; + +typedef +struct _masqmail_conf +{ + gint mail_uid; + gint mail_gid; + + gint orig_uid; + gint orig_gid; + + gboolean run_as_user; + + gchar *mail_dir; + gchar *lock_dir; + gchar *spool_dir; + gchar *log_dir; + + gint debug_level; + gboolean use_syslog; + guint log_max_pri; + + gchar *host_name; + GList *local_hosts; + GList *local_addresses; + GList *not_local_addresses; + GList *local_nets; + GList *listen_addresses; + + guint remote_port; + + gboolean do_save_envelope_to; + + gboolean defer_all; + gboolean do_relay; + + GList *ident_trusted_nets; + + gboolean do_queue; + + gboolean do_verbose; + + gchar *mbox_default; + GList *mbox_users; + GList *mda_users; + GList *maildir_users; + + gchar *mda; + gboolean mda_fromline; + gboolean mda_fromhack; + + gboolean pipe_fromline; + gboolean pipe_fromhack; + + gchar *alias_file; + int (*alias_local_cmp)(const char *, const char *); + + GList *local_net_routes; + GList *connect_routes; /* list of pairs which point to lists */ + + gchar *online_detect; + gchar *online_file; + gchar *online_pipe; + interface *mserver_iface; + + GList *get_names; + GList *online_gets; /* list of pairs which point to lists */ + + gchar *errmsg_file; + gchar *warnmsg_file; + GList *warn_intervals; + gint max_defer_time; + + gchar *log_user; +} masqmail_conf; + +extern masqmail_conf conf; + +typedef +struct _table_pair +{ + gchar *key; + gpointer *value; +} table_pair; + + +typedef +enum _prot_id +{ + PROT_LOCAL = 0, + PROT_BSMTP, + PROT_SMTP, + PROT_ESMTP, + PROT_POP3, + PROT_APOP, + PROT_NUM +}prot_id; + +extern gchar *prot_names[]; + +typedef +enum _header_id +{ + HEAD_FROM = 0, + HEAD_SENDER, + HEAD_TO, + HEAD_CC, + HEAD_BCC, + HEAD_DATE, + HEAD_MESSAGE_ID, + HEAD_REPLY_TO, + HEAD_SUBJECT, + HEAD_RETURN_PATH, + HEAD_ENVELOPE_TO, + HEAD_RECEIVED, + HEAD_NUM_IDS, + HEAD_STATUS, + HEAD_UNKNOWN = HEAD_NUM_IDS, + HEAD_NONE = -1, +}header_id; + +typedef +struct _header_name +{ + gchar *header; + header_id id; +}header_name; + +typedef +struct _header +{ + header_id id; + gchar *header; + gchar *value; +}header; + + +typedef +struct _message +{ + gchar *uid; + + gchar *received_host; + prot_id received_prot; + gchar *ident; + gint transfer_id; /* for multiple messages per transfer */ + + address *return_path; + GList *rcpt_list; + GList *non_rcpt_list; + + GList *hdr_list; + GList *data_list; + + gint data_size; + time_t received_time; + time_t warned_time; + + gchar *full_sender_name; +}message; + +typedef +struct _msg_out +{ + message *msg; + + address *return_path; + GList *rcpt_list; + + GList *hdr_list; + GList *xtra_hdr_list; +}msg_out; + +typedef +struct _msgout_perhost +{ + gchar *host; + GList *msgout_list; +} msgout_perhost; + +/* flags for accept() */ +/*#define ACC_LOCAL 0x01 (we better use received_host == NULL) */ +#define ACC_HEAD_FROM_RCPT 0x01 /* create To: Header from rcpt_list (cmd line) */ +#define ACC_DEL_RCPTS 0x02 /* -t option, delete rcpts */ +#define ACC_DEL_BCC 0x04 /* -t option, delete Bcc header */ +#define ACC_RCPT_FROM_HEAD 0x08 /* -t option, get rcpts from headers */ +#define ACC_NODOT_TERM 0x10 /* a dot on a line itself does not end + the message (-oi option) */ +#define ACC_NO_RECVD_HDR 0x20 /* do not create a Received: header */ +#define ACC_MAIL_FROM_HEAD 0x40 /* get return path from header */ +#define ACC_NODOT_RELAX 0x80 /* do not be picky if message ist not terminated by a dot on a line */ +#define ACC_SAVE_ENVELOPE_TO 0x0100 /* save an existent Envelope-to header as X-Orig-Envelope-to */ + +#define DLVR_LOCAL 0x01 +#define DLVR_LAN 0x02 +#define DLVR_ONLINE 0x04 +#define DLVR_ALL (DLVR_LOCAL|DLVR_LAN|DLVR_ONLINE) + +/* transport flags */ +#define MSGSTR_FROMLINE 0x01 +#define MSGSTR_FROMHACK 0x02 + +typedef +enum _accept_error +{ + AERR_OK = 0, + AERR_TIMEOUT, + AERR_EOF, + AERR_OVERFLOW, + AERR_SYNTAX, + AERR_NOSPOOL, + AERR_NORCPT, + AERR_UNKNOWN +}accept_error; + +#define BUF_LEN 1024 +#define MAX_ADDRESS 256 +#define MAX_DATALINE 4096 + +typedef +enum _smtp_cmd_id +{ + SMTP_HELO = 0, + SMTP_EHLO, + SMTP_MAIL_FROM, + SMTP_RCPT_TO, + SMTP_DATA, + SMTP_QUIT, + SMTP_RSET, + SMTP_NOOP, + SMTP_HELP, + SMTP_NUM_IDS, + SMTP_EOF = -1, + SMTP_ERROR = -2, +} smtp_cmd_id; + +typedef +struct _smtp_cmd +{ + smtp_cmd_id id; + gchar *cmd; +} smtp_cmd; + +typedef +struct _smtp_connection +{ + gchar *remote_host; + + prot_id prot; + gint next_id; + + gboolean helo_seen; + gboolean from_seen; + gboolean rcpt_seen; + + message *msg; +}smtp_connection; + +/* alias.c*/ +gboolean addr_is_local(address *addr); +GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list); + +/* child.c */ +int child(const char *command); + +/* conf.c */ +void init_conf(); +gboolean read_conf(gchar *filename); +connect_route *read_route(gchar *filename, gboolean is_local_net); +GList *read_route_list(GList *rf_list, gboolean is_local_net); +void destroy_route(connect_route *r); +void destroy_route_list(GList *list); +get_conf *read_get_conf(gchar *filename); +void destroy_get_conf(get_conf *gc); +connect_route *create_local_route(); + +/* expand.c */ +GList *var_table_rcpt(GList *var_table, address *rcpt); +GList *var_table_msg(GList *var_table, message *msg); +GList *var_table_conf(GList *var_table); +gint expand(GList *var_list, gchar *format, gchar *result, gint result_len); + +/* message.c */ +message *create_message(void); +void destroy_message(message *msg); +void destroy_msg_list(GList *msg_list); +void msg_free_data(message *msg); +gint msg_calc_size(message *msg, gboolean is_smtp); + +msg_out *create_msg_out(message *msg); +msg_out *clone_msg_out(msg_out *msgout_orig); +GList *create_msg_out_list(GList *msg_list); +void destroy_msg_out(msg_out *msgout); +void destroy_msg_out_list(GList *msgout_list); + +/* address.c */ +address *create_address(gchar *path, gboolean is_rfc821); +address *create_address_qualified(gchar *path, gboolean is_rfc821, + gchar *domain); +address *create_address_pipe(gchar *path); +void destroy_address(address *addr); +address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom); +#define copy_address(addr) copy_modify_address(addr, NULL, NULL) +gboolean addr_isequal(address *addr1, address *addr2); +gboolean addr_isequal_parent(address *addr1, address *addr2); +address *addr_find_ancestor(address *addr); +gboolean addr_is_delivered_children(address *addr); +gboolean addr_is_finished_children(address *addr); +gchar *addr_string(address *addr); +gint addr_match(address *addr1, address *addr2); + +/* accept.c */ +accept_error accept_message(FILE *in, message *msg, + guint flags); +accept_error accept_message_prepare(message *msg, guint flags); + +/* header.c */ +gchar *rec_timestamp(); +GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str); +void header_unfold(header *hdr); +void header_fold(header *hdr); +header *create_header(header_id id, gchar *fmt, ...); +void destroy_header(header *hdr); +header *copy_header(header *hdr); +header *get_header(gchar *line); + +/* smtp_in.c */ +void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident); + +/* listen.c */ +void listen_port(GList *addr_list, gint qival, char *argv[]); + +/* parse.c */ +gboolean split_address(const gchar *path, gchar **local_part, gchar **domain, + gboolean is_rfc821); +gboolean parse_address_rfc822(gchar *string, + gchar **local_begin, gchar **local_end, + gchar **domain_begin, gchar **domain_end, + gchar **address_end); +gboolean parse_address_rfc821(gchar *string, + gchar **local_begin, gchar **local_end, + gchar **domain_begin, gchar **domain_end, + gchar **address_end); +address *_create_address(gchar *string, gchar **end, gboolean is_rfc821); +address *create_address_rfc821(gchar *string, gchar **end); +address *create_address_rfc822(gchar *string, gchar **end); +GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain); +gboolean addr_isequal(address *addr1, address *addr2); + +/* connect.c */ +mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port, + GList *addr_list); +mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port, + GList *res_funcs); + +/* deliver.c */ +void msg_rcptlist_local(GList *rcpt_list, GList **, GList **); +gboolean deliver_local(msg_out *msgout); +gboolean deliver_msglist_host(connect_route *route, GList *msg_list, gchar *host, GList *res_list); +gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list); +gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list); +gboolean deliver_finish(msg_out *msgout); +gboolean deliver_finish_list(GList *msgout_list); +gboolean deliver_msg_list(GList *msg_list, guint flags); +gboolean deliver(message *msg); + +/* fail_msg.c */ +gboolean fail_msg(message *msg, gchar *template, + GList *failed_rcpts, gchar *err_fmt, va_list args); +gboolean warn_msg(message *msg, gchar *template, + GList *failed_rcpts, gchar *err_fmt, va_list args); + +/* get.c */ +gboolean get_from_file(gchar *fname); +gboolean get_from_name(gchar *name); +gboolean get_all(void); +void get_online(void); +void get_daemon(gint gival, char *argv[]); +gboolean pop_before_smtp(gchar *fname); + +/* interface.c */ +gboolean init_sockaddr(struct sockaddr_in *name, interface *iface); +int make_server_socket(interface *iface); + +/* local.c */ +gboolean append_file(message *msg, GList *hdr_list, gchar *user); +gboolean maildir_out(message *msg, GList *hdr_list, gchar *user, guint flags); +gboolean pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags); + +/* log.c */ +gchar *ext_strerror(int err); +gboolean logopen(void); +void logclose(void); +void vlogwrite(int pri, const char *fmt, va_list args); +void logwrite(int pri, const char *fmt, ...); +void debugf(const char *fmt, ...); +void vdebugf(const char *fmt, va_list args); +void maillog(const char *fmt, ...); + +/* spool.c */ +gboolean spool_read_data(message *msg); +gboolean spool_read_data(message *msg); +message *msg_spool_read(gchar *uid, gboolean do_readdata); +gboolean spool_write(message *msg, gboolean do_writedata); +gboolean spool_lock(gchar *uid); +gboolean spool_unlock(gchar *uid); +gboolean spool_delete_all(message *msg); + +/* queue.c */ +GList *read_queue(gboolean do_readdata); +gboolean queue_run(void); +gboolean queue_run_online(void); +void queue_list(void); +gboolean queue_delete(gchar *uid); + +/* online.c */ +gchar *detect_online(); +void set_online_name(gchar *name); + +/* permissions.c */ +gboolean is_ingroup(uid_t uid, gid_t gid); +void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid); +void set_identity(uid_t old_uid, gchar *task_name); + +/* rewrite.c */ +gboolean set_address_header_domain(header *hdr, gchar *domain); +gboolean map_address_header(header *hdr, GList *table); + +/* route.c */ +msgout_perhost *create_msgout_perhost(gchar *host); +void destroy_msgout_perhost(msgout_perhost *mo_ph); +void rewrite_headers(msg_out *msgout, connect_route *route); +void rcptlist_with_one_of_hostlist(GList *rcpt_list, GList *host_list, + GList **, GList **); +void rcptlist_with_addr_is_local(GList *rcpt_list, + GList **p_rcpt_list, GList **p_non_rcpt_list); +gboolean route_strip_msgout(connect_route *route, msg_out *msgout); +msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout); +GList *route_msgout_list(connect_route *route, GList *msgout_list); +gboolean route_is_allowed_return_path(connect_route *route, address *ret_path); +gboolean route_is_allowed_mail_local(connect_route *route, address *ret_path); +void msg_rcptlist_route(connect_route *route, GList *rcpt_list, + GList **p_rcpt_list, GList **p_non_rcpt_list); + +/* tables.c */ +table_pair *create_pair(gchar *key, gpointer value); +table_pair *create_pair_string(gchar *key, gpointer value); +table_pair *parse_table_pair(gchar *line, char delim); +gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func)(const char *, const char *)); +gpointer *table_find(GList *table_list, gchar *key); +gpointer *table_find_case(GList *table_list, gchar *key); +gpointer *table_find_fnmatch(GList *table_list, gchar *key); +GList *table_read(gchar *fname, gchar delim); +void destroy_table(GList *table); + +/* timeival.c */ +gint time_interval(gchar *str, gint *pos); + +/* permissions.c */ +gboolean is_privileged_user(uid_t uid); + +/* other things */ + +#define foreach(list, node)\ +for((node) = g_list_first(list);\ + (node);\ + (node) = g_list_next(node)) + +#ifdef ENABLE_DEBUG +#define DEBUG(level) if(level <= conf.debug_level) +#else +/* hopefully the compiler optmizes this away... */ +#define DEBUG(level) if(0) +#endif + +#define LOG_VERBOSE 0x100 + +#ifndef HAVE_GETLINE +#define getline(buf, size, file) getdelim(buf, size, '\n', file) +#endif + +#ifndef HAVE_FDATASYNC +#define fdatasync(fd) fsync(fd) +#endif + +#ifndef CONF_DIR +#define CONF_DIR "/etc/masqmail" +#endif + +#define CONF_FILE CONF_DIR"/masqmail.conf" + +#define PIDFILEDIR "/var/run/masqmail/" + +#ifndef va_copy +#ifdef __va_copy +#define va_copy(ap1, ap2) __va_copy(ap1, ap2) +#else +#define va_copy(ap1, ap2) G_VA_COPY(ap1, ap2) +#endif +#endif + +/* *BSD needs this: */ +extern char **environ; diff -r 000000000000 -r 08114f7dcc23 src/md5/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,19 @@ +AM_CFLAGS=@CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE + +noinst_LIBRARIES=libmd5c.a +noinst_PROGRAMS=hmactest + +hmactest_SOURCES=\ + md5.h\ + global.h\ + md5c.c\ + hmac_md5.h\ + hmac_md5.c\ + hmactest.c + +libmd5c_a_SOURCES=\ + md5.h\ + global.h\ + md5c.c\ + hmac_md5.h\ + hmac_md5.c \ No newline at end of file diff -r 000000000000 -r 08114f7dcc23 src/md5/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,412 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ +AM_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -D_GNU_SOURCE + +noinst_LIBRARIES = libmd5c.a +noinst_PROGRAMS = hmactest + +hmactest_SOURCES = \ + md5.h\ + global.h\ + md5c.c\ + hmac_md5.h\ + hmac_md5.c\ + hmactest.c + + +libmd5c_a_SOURCES = \ + md5.h\ + global.h\ + md5c.c\ + hmac_md5.h\ + hmac_md5.c + +subdir = src/md5 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libmd5c_a_AR = $(AR) cru +libmd5c_a_LIBADD = +am_libmd5c_a_OBJECTS = md5c.$(OBJEXT) hmac_md5.$(OBJEXT) +libmd5c_a_OBJECTS = $(am_libmd5c_a_OBJECTS) +noinst_PROGRAMS = hmactest$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) + +am_hmactest_OBJECTS = md5c.$(OBJEXT) hmac_md5.$(OBJEXT) \ + hmactest.$(OBJEXT) +hmactest_OBJECTS = $(am_hmactest_OBJECTS) +hmactest_LDADD = $(LDADD) +hmactest_DEPENDENCIES = +hmactest_LDFLAGS = + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/hmac_md5.Po ./$(DEPDIR)/hmactest.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/md5c.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libmd5c_a_SOURCES) $(hmactest_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libmd5c_a_SOURCES) $(hmactest_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/md5/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +AR = ar + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libmd5c.a: $(libmd5c_a_OBJECTS) $(libmd5c_a_DEPENDENCIES) + -rm -f libmd5c.a + $(libmd5c_a_AR) libmd5c.a $(libmd5c_a_OBJECTS) $(libmd5c_a_LIBADD) + $(RANLIB) libmd5c.a + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +hmactest$(EXEEXT): $(hmactest_OBJECTS) $(hmactest_DEPENDENCIES) + @rm -f hmactest$(EXEEXT) + $(LINK) $(hmactest_LDFLAGS) $(hmactest_OBJECTS) $(hmactest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmac_md5.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmactest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5c.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) $(PROGRAMS) + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 src/md5/global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/global.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,30 @@ +/* GLOBAL.H - RSAREF types and constants + */ + +/* PROTOTYPES should be set to one if and only if the compiler supports + function argument prototyping. + The following makes PROTOTYPES default to 0 if it has not already + been defined with C compiler flags. + */ +#ifndef PROTOTYPES +#define PROTOTYPES 0 +#endif + +/* POINTER defines a generic pointer type */ +typedef unsigned char *POINTER; + +/* UINT2 defines a two byte word */ +typedef unsigned short int UINT2; + +/* UINT4 defines a four byte word */ +typedef unsigned long int UINT4; + +/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. +If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it + returns an empty list. + */ +#if PROTOTYPES +#define PROTO_LIST(list) list +#else +#define PROTO_LIST(list) () +#endif diff -r 000000000000 -r 08114f7dcc23 src/md5/hmac_md5.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/hmac_md5.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,80 @@ +/* +** Function: hmac_md5 +*/ + +#include +#include "global.h" +#include "md5.h" +#include "hmac_md5.h" + +void hmac_md5(unsigned char *text, int text_len, + unsigned char* key, int key_len, unsigned char *digest) + /* text; pointer to data stream */ + /* text_len; length of data stream */ + /* key; pointer to authentication key */ + /* key_len; length of authentication key */ + /* digest; caller digest to be filled in */ + +{ + MD5_CTX context; + unsigned char k_ipad[65]; /* inner padding - + * key XORd with ipad + */ + unsigned char k_opad[65]; /* outer padding - + * key XORd with opad + */ + unsigned char tk[16]; + int i; + /* if key is longer than 64 bytes reset it to key=MD5(key) */ + if (key_len > 64) { + + MD5_CTX tctx; + + MD5Init(&tctx); + MD5Update(&tctx, key, key_len); + MD5Final(tk, &tctx); + + key = tk; + key_len = 16; + } + + /* + * the HMAC_MD5 transform looks like: + * + * MD5(K XOR opad, MD5(K XOR ipad, text)) + * + * where K is an n byte key + * ipad is the byte 0x36 repeated 64 times + * opad is the byte 0x5c repeated 64 times + * and text is the data being protected + */ + + /* start out by storing key in pads */ + bzero( k_ipad, sizeof k_ipad); + bzero( k_opad, sizeof k_opad); + bcopy( key, k_ipad, key_len); + bcopy( key, k_opad, key_len); + + /* XOR key with ipad and opad values */ + for (i=0; i<64; i++) { + k_ipad[i] ^= 0x36; + k_opad[i] ^= 0x5c; + } + /* + * perform inner MD5 + */ + MD5Init(&context); /* init context for 1st + * pass */ + MD5Update(&context, k_ipad, 64); /* start with inner pad */ + MD5Update(&context, text, text_len); /* then text of datagram */ + MD5Final(digest, &context); /* finish up 1st pass */ + /* + * perform outer MD5 + */ + MD5Init(&context); /* init context for 2nd + * pass */ + MD5Update(&context, k_opad, 64); /* start with outer pad */ + MD5Update(&context, digest, 16); /* then results of 1st + * hash */ + MD5Final(digest, &context); /* finish up 2nd pass */ +} diff -r 000000000000 -r 08114f7dcc23 src/md5/hmac_md5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/hmac_md5.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,7 @@ +void hmac_md5(unsigned char *text, int text_len, + unsigned char* key, int key_len, unsigned char *digest); + /* text; pointer to data stream */ + /* text_len; length of data stream */ + /* key; pointer to authentication key */ + /* key_len; length of authentication key */ + /* digest; caller digest to be filled in */ diff -r 000000000000 -r 08114f7dcc23 src/md5/hmactest.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/hmactest.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,46 @@ +#include +#include +#include +#include +#include "global.h" +#include "md5.h" +#include "hmac_md5.h" + +static +void pad0_copy(char *d, char *s, int sz) +{ + int i = 0; + while(*s && (i < sz)) { *(d++) = *(s++); i++; } + while(i <= sz) { *(d++) = 0; i++; } +} + +int main() +{ + int i; + // unsigned char digest[16]; + char digest[16]; + char *msgid = "<1896.697170952@postoffice.reston.mci.net>"; + char secret[65]; + + hmac_md5("<48157.953508124@mail.class-c.net>", 34, + "no!SpamAtAll", 12, digest); + for(i = 0; i < 16; i++) + printf("%x", (unsigned int)digest[i]); + printf("\n"); + + hmac_md5(msgid, strlen(msgid), + "tanstaaftanstaaf", 16, digest); + for(i = 0; i < 16; i++) + printf("%x", (unsigned int)digest[i]); + printf("\n"); + + pad0_copy(secret, "tanstaaftanstaaf", 64); + hmac_md5(msgid, strlen(msgid), + secret, 64, digest); + for(i = 0; i < 16; i++) + printf("%x", (unsigned int)digest[i]); + printf("\n"); + + exit(0); +} + diff -r 000000000000 -r 08114f7dcc23 src/md5/md5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/md5.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,36 @@ +/* MD5.H - header file for MD5C.C + */ + +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +/* MD5 context. */ +typedef struct { + UINT4 state[4]; /* state (ABCD) */ + UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} MD5_CTX; + +void MD5Init PROTO_LIST ((MD5_CTX *)); +void MD5Update PROTO_LIST + ((MD5_CTX *, unsigned char *, unsigned int)); +void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); diff -r 000000000000 -r 08114f7dcc23 src/md5/md5c.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/md5/md5c.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,334 @@ +/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + */ + +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +#include "global.h" +#include "md5.h" + +/* Constants for MD5Transform routine. + */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + +static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); +static void Encode PROTO_LIST + ((unsigned char *, UINT4 *, unsigned int)); +static void Decode PROTO_LIST + ((UINT4 *, unsigned char *, unsigned int)); +static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); +static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); + +static unsigned char PADDING[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* F, G, H and I are basic MD5 functions. + */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits. + */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. +Rotation is separate from addition to prevent recomputation. + */ +#define FF(a, b, c, d, x, s, ac) { \ + (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) { \ + (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) { \ + (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) { \ + (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +/* MD5 initialization. Begins an MD5 operation, writing a new context. + */ +void MD5Init (context) +MD5_CTX *context; /* context */ +{ + context->count[0] = context->count[1] = 0; + /* Load magic initialization constants. +*/ + context->state[0] = 0x67452301; + context->state[1] = 0xefcdab89; + context->state[2] = 0x98badcfe; + context->state[3] = 0x10325476; +} + +/* MD5 block update operation. Continues an MD5 message-digest + operation, processing another message block, and updating the + context. + */ +void MD5Update (context, input, inputLen) +MD5_CTX *context; /* context */ +unsigned char *input; /* input block */ +unsigned int inputLen; /* length of input block */ +{ + unsigned int i, index, partLen; + + /* Compute number of bytes mod 64 */ + index = (unsigned int)((context->count[0] >> 3) & 0x3F); + + /* Update number of bits */ + if ((context->count[0] += ((UINT4)inputLen << 3)) + < ((UINT4)inputLen << 3)) + context->count[1]++; + context->count[1] += ((UINT4)inputLen >> 29); + + partLen = 64 - index; + + /* Transform as many times as possible. +*/ + if (inputLen >= partLen) { + MD5_memcpy + ((POINTER)&context->buffer[index], (POINTER)input, partLen); + MD5Transform (context->state, context->buffer); + + for (i = partLen; i + 63 < inputLen; i += 64) + MD5Transform (context->state, &input[i]); + + index = 0; + } + else + i = 0; + + /* Buffer remaining input */ + MD5_memcpy + ((POINTER)&context->buffer[index], (POINTER)&input[i], + inputLen-i); +} + +/* MD5 finalization. Ends an MD5 message-digest operation, writing the + the message digest and zeroizing the context. + */ +void MD5Final (digest, context) +unsigned char digest[16]; /* message digest */ +MD5_CTX *context; /* context */ +{ + unsigned char bits[8]; + unsigned int index, padLen; + + /* Save number of bits */ + Encode (bits, context->count, 8); + + /* Pad out to 56 mod 64. +*/ + index = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + MD5Update (context, PADDING, padLen); + + /* Append length (before padding) */ + MD5Update (context, bits, 8); + + /* Store state in digest */ + Encode (digest, context->state, 16); + + /* Zeroize sensitive information. +*/ + MD5_memset ((POINTER)context, 0, sizeof (*context)); +} + +/* MD5 basic transformation. Transforms state based on block. + */ +static void MD5Transform (state, block) +UINT4 state[4]; +unsigned char block[64]; +{ + UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + Decode (x, block, 64); + + /* Round 1 */ + FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + /* Round 2 */ + GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ + HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + /* Round 4 */ + II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + + /* Zeroize sensitive information. +*/ + MD5_memset ((POINTER)x, 0, sizeof (x)); +} + +/* Encodes input (UINT4) into output (unsigned char). Assumes len is + a multiple of 4. + */ +static void Encode (output, input, len) +unsigned char *output; +UINT4 *input; +unsigned int len; +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) { + output[j] = (unsigned char)(input[i] & 0xff); + output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); + output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); + output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); + } +} + +/* Decodes input (unsigned char) into output (UINT4). Assumes len is + a multiple of 4. + */ +static void Decode (output, input, len) +UINT4 *output; +unsigned char *input; +unsigned int len; +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) + output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | + (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); +} + +/* Note: Replace "for loop" with standard memcpy if possible. + */ + +static void MD5_memcpy (output, input, len) +POINTER output; +POINTER input; +unsigned int len; +{ + unsigned int i; + + for (i = 0; i < len; i++) + output[i] = input[i]; +} + +/* Note: Replace "for loop" with standard memset if possible. + */ +static void MD5_memset (output, value, len) +POINTER output; +int value; +unsigned int len; +{ + unsigned int i; + + for (i = 0; i < len; i++) + ((char *)output)[i] = (char)value; +} diff -r 000000000000 -r 08114f7dcc23 src/message.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/message.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,210 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" + +message *create_message() +{ + message *msg = (message *)g_malloc(sizeof(message)); + if(msg){ + memset(msg, 0, sizeof(message)); + msg->data_size = -1; + } + return msg; +} + +gint msg_calc_size(message *msg, gboolean is_smtp) +{ + GList *node; + gint l_cnt = 0, c_cnt = 0; + + /* header size */ + if(msg->hdr_list){ + for(node = g_list_first(msg->hdr_list); node; node = g_list_next(node)){ + if(node->data){ + header *hdr = (header *)(node->data); + if(hdr->header){ + char *p = hdr->header; + while(*p){ + if(*p++ == '\n') l_cnt++; + c_cnt++; + } + } + } + } + } + + /* empty line separating headers from data: */ + c_cnt++; + l_cnt++; + + /* data size */ + if(msg->data_list){ + for(node = g_list_first(msg->data_list); node; node = g_list_next(node)){ + if(node->data){ + char *p = node->data; + while(*p){ + if(*p++ == '\n') l_cnt++; + c_cnt++; + } + } + } + } + + return is_smtp ? c_cnt + l_cnt : c_cnt; +} + +void msg_free_data(message *msg) +{ + GList *node; + + if(msg->data_list){ + for(node = g_list_first(msg->data_list); node; node = g_list_next(node)){ + if(node->data) + g_free(node->data); + } + g_list_free(msg->data_list); + msg->data_list = NULL; + } +} + +void destroy_message(message *msg) +{ + GList *node; + + if(msg->uid) g_free(msg->uid); + if(msg->ident) g_free(msg->ident); + if(msg->return_path) g_free(msg->return_path); + + if(msg->rcpt_list){ + for(node = g_list_first(msg->rcpt_list); node; node = g_list_next(node)){ + if(node->data) + g_free(node->data); + } + g_list_free(msg->rcpt_list); + } + if(msg->hdr_list){ + for(node = g_list_first(msg->hdr_list); node; node = g_list_next(node)){ + if(node->data){ + header *hdr = (header *)(node->data); + if(hdr->header) + g_free(hdr->header); + g_free(node->data); + } + } + g_list_free(msg->hdr_list); + } + + if(msg->full_sender_name) + g_free(msg->full_sender_name); + + msg_free_data(msg); + + g_free(msg); +} + +void destroy_msg_list(GList *msg_list) +{ + GList *msg_node; + + foreach(msg_list, msg_node){ + message *msg = (message *)(msg_node->data); + destroy_message(msg); + } + g_list_free(msg_list); +} + +msg_out *create_msg_out(message *msg) +{ + msg_out *msgout = NULL; + + msgout = g_malloc(sizeof(msg_out)); + if(msgout){ + msgout->msg = msg; + msgout->return_path = NULL; + msgout->rcpt_list = NULL; + + msgout->hdr_list = NULL; + msgout->xtra_hdr_list = NULL; + } + return msgout; +} + +msg_out *clone_msg_out(msg_out *msgout_orig) +{ + if(msgout_orig){ + msg_out *msgout = create_msg_out(msgout_orig->msg); + if(msgout){ + msgout->msg = msgout_orig->msg; + if(msgout_orig->return_path) + msgout->return_path = copy_address(msgout_orig->return_path); + if(msgout_orig->hdr_list) + msgout->hdr_list = g_list_copy(msgout_orig->hdr_list); + /* FIXME: if this lives longer than the original + and we access one of the xtra hdrs, we will segfault + or cause some weird bugs: */ + msgout->xtra_hdr_list = NULL; + if(msgout_orig->rcpt_list) + msgout->rcpt_list = g_list_copy(msgout_orig->rcpt_list); + } + return msgout; + } + return NULL; +} + +GList *create_msg_out_list(GList *msg_list) +{ + GList *msgout_list = NULL; + GList *msg_node; + + foreach(msg_list, msg_node){ + message *msg = (message *)(msg_node->data); + msgout_list = g_list_append(msgout_list, create_msg_out(msg)); + } + return msgout_list; +} + +void destroy_msg_out(msg_out *msgout) +{ + if(msgout){ + if(msgout->return_path) + destroy_address(msgout->return_path); + if(msgout->hdr_list) + g_list_free(msgout->hdr_list); + if(msgout->xtra_hdr_list){ + GList *hdr_node; + foreach(msgout->xtra_hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + destroy_header(hdr); + } + g_list_free(msgout->xtra_hdr_list); + } + g_free(msgout); + } +} + +void destroy_msg_out_list(GList *msgout_list) +{ + GList *msgout_node; + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + destroy_msg_out(msgout); + } + g_list_free(msgout_list); +} diff -r 000000000000 -r 08114f7dcc23 src/mservdetect.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mservdetect.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,76 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* +#include "masqmail.h" +#include "readsock.h" +#include "mserver.h" +*/ + +#include "config.h" + +/* ugly hack */ +#ifndef ENABLE_MSERVER +#define ENABLE_MSERVER 1 +#include "mserver.c" +#else +#include "masqmail.h" +#include "readsock.h" +#include "mserver.h" +#endif /* ENABLE_MSERVER */ + +void logwrite(int pri, const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + vfprintf(stdout, fmt, args); + + va_end(args); +} + +void debugf(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + vfprintf(stdout, fmt, args); + + va_end(args); +} + +int main(int argc, char *argv[]) +{ + if(argc == 3){ + interface iface; + gchar *name; + + iface.address = g_strdup(argv[1]); + iface.port = atoi(argv[2]); + + name = mserver_detect_online(&iface); + + printf("%s\n", name); + + exit(EXIT_SUCCESS); + }else{ + fprintf(stderr, "usage %s \n", argv[0]); + exit(EXIT_FAILURE); + } +} + diff -r 000000000000 -r 08114f7dcc23 src/mserver.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mserver.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,78 @@ +/* MasqMail + Copyright (C) 1999/2000/2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include "readsock.h" +#include "mserver.h" + +#ifdef ENABLE_MSERVER + +gchar *mserver_detect_online(interface *iface) +{ + struct sockaddr_in saddr; + gchar *ret = NULL; + + if(init_sockaddr(&saddr, iface)){ + int sock = socket(PF_INET, SOCK_STREAM, 0); + int dup_sock; + if(connect(sock, (struct sockaddr *)(&saddr), sizeof(saddr)) == 0){ + FILE *in, *out; + char buf[256]; + + dup_sock = dup(sock); + out = fdopen(sock, "w"); + in = fdopen(dup_sock, "r"); + + if(read_sockline(in, buf, 256, 15, READSOCKL_CHUG)){ + if(strncmp(buf, "READY", 5) == 0){ + fprintf(out, "STAT\n"); fflush(out); + if(read_sockline(in, buf, 256, 15, READSOCKL_CHUG)){ + if(strncmp(buf, "DOWN", 4) == 0){ + ret = NULL; + }else if(strncmp(buf, "UP", 2) == 0){ + gchar *p = buf+3; + while((*p != ':') && *p) p++; + if(*p){ + *p = 0; + p++; + if((atoi(p) >= 0) && *p) + ret = g_strdup(buf+3); + }else + logwrite(LOG_ALERT, + "unexpected response from mserver after STAT cmd: %s", + buf); + }else{ + logwrite(LOG_ALERT, + "unexpected response from mserver after STAT cmd: %s", + buf); + } + } + } + fprintf(out, "QUIT"); fflush(out); + + close(sock); + close(dup_sock); + fclose(in); + fclose(out); + } + } + } + return ret; +} + +#endif diff -r 000000000000 -r 08114f7dcc23 src/mserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mserver.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,19 @@ +/* MasqMail + Copyright (C) 2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +gchar *mserver_detect_online(interface *iface); diff -r 000000000000 -r 08114f7dcc23 src/online.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/online.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,119 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include "masqmail.h" +#include "mserver.h" +#include "peopen.h" + +gchar *connection_name; + +void set_online_name(gchar *name) +{ + connection_name = g_strdup(name); +} + +static +gchar *detect_online_pipe(const gchar *pipe) +{ + pid_t pid; + void (*old_signal)(int); + int status; + FILE *in; + gchar *name = NULL; + + old_signal = signal(SIGCHLD, SIG_DFL); + + in = peopen(pipe, "r", environ, &pid); + if(in != NULL){ + gchar output[256]; + if(fgets(output, 255, in)){ + g_strchomp(output); + name = g_strdup(output); + } + fclose(in); + waitpid(pid, &status, 0); + if(WEXITSTATUS(status) != EXIT_SUCCESS){ + g_free(name); + name = NULL; + } + }else + logwrite(LOG_ALERT, "could not open pipe '%s': %s\n", pipe, strerror(errno)); + + signal(SIGCHLD, old_signal); + + return name; +} + +gchar *detect_online() +{ + if(conf.online_detect != NULL){ + if(strcmp(conf.online_detect, "file") == 0){ + DEBUG(3) debugf("online detection method 'file'\n"); + if(conf.online_file != NULL){ + struct stat st; + if(stat(conf.online_file, &st) == 0){ + FILE *fptr = fopen(conf.online_file, "r"); + if(fptr){ + char buf[256]; + fgets(buf, 256, fptr); + g_strchomp(buf); + fclose(fptr); + return g_strdup(buf); + }else{ + logwrite(LOG_ALERT, "opening of %s failed: %s\n", + conf.online_file, strerror(errno)); + return NULL; + } + } + else if(errno == ENOENT){ + logwrite(LOG_NOTICE, "not online.\n"); + return NULL; + }else{ + logwrite(LOG_ALERT, "stat of %s failed: %s", + conf.online_file, strerror(errno)); + return NULL; + } + }else + logwrite(LOG_ALERT, + "online detection mode is 'file', " + "but online_file is undefined\n"); +#ifdef ENABLE_MSERVER + }else if(strcmp(conf.online_detect, "mserver") == 0){ + DEBUG(3) debugf("connection method 'mserver'\n"); + return mserver_detect_online(conf.mserver_iface); +#endif + }else if(strcmp(conf.online_detect, "pipe") == 0){ + DEBUG(3) debugf("connection method 'pipe'\n"); + if(conf.online_pipe) + return detect_online_pipe(conf.online_pipe); + else{ + logwrite(LOG_ALERT, + "online detection mode is 'pipe', " + "but online_pipe is undefined\n"); + return NULL; + } + }else if(strcmp(conf.online_detect, "argument") == 0){ + return connection_name; + }else{ + DEBUG(3) debugf("no connection method selected\n"); + } + } + return NULL; +} diff -r 000000000000 -r 08114f7dcc23 src/parse.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parse.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,450 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef PARSE_TEST +#include "masqmail.h" +#endif + +/* This is really dangerous. I hope that I was careful enough, + but maybe there is some malformed address possible that causes + this to segfault or be caught in endless loops. + + If you find something like that, PLEASE mail the string to me + (no matter how idiotic it is), so that I can debug that. + Those things really should not happen. +*/ + +static gchar *specials = "()<>@,;:\\\".[]`"; + +char *parse_error = NULL; + +static +gchar *skip_comment(gchar *p) +{ + +#ifdef PARSE_TEST + g_print("skip_comment: %s\n", p); +#endif + + p++; + while(*p && *p != ')'){ + p++; + if(*p == '(') + p = skip_comment(p); + } + p++; + + return p; +} + +static +gboolean read_word(gchar *p, gchar **b, gchar **e) +{ +#ifdef PARSE_TEST + g_print("read_word: %s\n", p); +#endif + /* eat leading spaces */ + while(*p && isspace(*p)) p++; + + *b = p; + /* b = &p;*/ + if(*p == '\"'){ + /* quoted-string */ + p++; + while(*p && (*p != '\"')) p++; + p++; + }else{ + /* atom */ + while(*p && !strchr(specials, *p) && !iscntrl(*p) && !isspace(*p)) + p++; + } + *e = p; + return TRUE; +} + +static +gboolean read_word_with_dots(gchar *p, gchar **b, gchar **e) +{ + gchar *b0 = p; + +#ifdef PARSE_TEST + g_print("read_word_with_dots: %s\n", p); +#endif + while(TRUE){ + if(!read_word(p, b, e)) + return FALSE; + p = *e; + if(*p != '.') break; + p++; + } + *b = b0; + *e = p; + return TRUE; +} + +static +gboolean read_domain(gchar *p, gchar **b, gchar **e) +{ +#ifdef PARSE_TEST + g_print("read_domain: %s\n", p); +#endif + *b = p; + if(*p != '['){ + while(isalnum(*p) || (*p == '-') || (*p == '.')) + p++; + }else{ + p++; + while(isalpha(*p) || (*p == '.')) + p++; + if(*p != ']'){ + parse_error = + g_strdup_printf("']' expected at end of literal address %s", *b); + return FALSE; + } + p++; + } + *e = p; + return TRUE; +} + +gboolean parse_address_rfc822(gchar *string, + gchar **local_begin, gchar **local_end, + gchar **domain_begin, gchar **domain_end, + gchar **address_end) +{ + gint angle_brackets = 0; + + gchar *p = string; + gchar *b, *e; + + *local_begin = *local_end = NULL; + *domain_begin = *domain_end = NULL; + + /* might be some memory left from previous call: */ + if(parse_error != NULL){ + g_free(parse_error); + parse_error = NULL; + } + + /* leading spaces and angle brackets */ + while(*p && (isspace(*p) || (*p == '<'))){ + if(*p == '<') + angle_brackets++; + p++; + } + + if(*p){ + while(TRUE){ + if(read_word_with_dots(p, &b, &e)){ + p = e; +#ifdef PARSE_TEST + g_print("after read_word_with_dots: %s\n", p); +#endif + /* eat white spaces and comments */ + while((*p && (isspace(*p))) || (*p == '(')){ + if(*p == '('){ + if(!(p = skip_comment(p))){ + parse_error = + g_strdup("missing right bracket ')'"); + return FALSE; + } + }else + p++; + } + /* we now have a non-space char that is not + the beginning of a comment */ + + if(*p == '@'){ + /* the last word was the local_part + of an addr-spec */ + *local_begin = b; + *local_end = e; +#ifdef PARSE_TEST + g_print("found local part: %s\n", *local_begin); +#endif + if(*p == '@'){ + p++; /* skip @ */ + /* now the domain */ + if(read_domain(p, &b, &e)){ + p = e; + *domain_begin = b; + *domain_end = e; + } + else + return FALSE; + }else{ + /* unqualified? */ + *domain_begin = *domain_end = NULL; + } + break; + }else if(*p == '<'){ + /* addr-spec follows */ + while(isspace(*p) || (*p == '<')){ + if(*p == '<') + angle_brackets++; + p++; + } + if(read_word_with_dots(p, &b, &e)){ + p = e; + *local_begin = b; + *local_end = e; +#ifdef PARSE_TEST + g_print("found local part: %s\n", *local_begin); +#endif + }else + return FALSE; + if(*p == '@'){ + p++; + if(read_domain(p, &b, &e)){ + p = e; + *domain_begin = b; + *domain_end = e; + }else + return FALSE; + }else{ + /* may be unqualified address */ + *domain_begin = *domain_end = NULL; + } + break; + }else if(!*p || *p == '>'){ + *local_begin = b; + *local_end = e; +#ifdef PARSE_TEST + g_print("found local part: %s\n", *local_begin); +#endif + *domain_begin = *domain_end = NULL; + break; + }else if(strchr(specials, *p) || iscntrl(*p) || isspace(*p)){ + parse_error = g_strdup_printf("unexpected character: %c", *p); + return FALSE; + } + }else + return FALSE; + } + /* trailing spaces and angle brackets */ +#ifdef PARSE_TEST + g_print("down counting trailing '>'\n"); +#endif + while(*p && (isspace(*p) || (*p == '>'))){ + if(*p == '>') + angle_brackets--; + p++; + } + + *address_end = p; + + if(angle_brackets != 0){ + if(angle_brackets > 0) + parse_error = g_strdup("missing '>' at end of string"); + else + parse_error = g_strdup("superfluous '>' at end of string"); + return FALSE; + }else{ + /* we successfully parsed the address */ + return TRUE; + } + /* we never get here */ + } + return FALSE; +} + +gboolean parse_address_rfc821(gchar *string, + gchar **local_begin, gchar **local_end, + gchar **domain_begin, gchar **domain_end, + gchar **address_end) +{ + gint angle_brackets = 0; + + gchar *p = string; + gchar *b, *e; + + *local_begin = *local_end = NULL; + *domain_begin = *domain_end = NULL; + + /* might be some memory left from previous call: */ + if(parse_error != NULL){ + g_free(parse_error); + parse_error = NULL; + } + + /* leading spaces and angle brackets */ + while(*p && (isspace(*p) || (*p == '<'))){ + if(*p == '<') + angle_brackets++; + p++; + } + + if(*p){ + while(TRUE){ + if(read_word_with_dots(p, &b, &e)){ + p = e; +#ifdef PARSE_TEST + g_print("after read_word_with_dots: %s\n", p); +#endif + *local_begin = b; + *local_end = e; +#ifdef PARSE_TEST + g_print("found local part: %s\n", *local_begin); + g_print("local_end = %s\n", *local_end); +#endif + if(!(*p) || isspace(*p) || (*p == '>')){ + /* unqualified ?*/ + domain_begin = domain_end = NULL; + break; + }else if(*p == '@'){ + p++; + if(read_domain(p, &b, &e)){ + p = e; + *domain_begin = b; + *domain_end = e; + } + break; + }else{ + parse_error = + g_strdup_printf("unexpected character after local part '%c'",*p); + return FALSE; + } + } else + return FALSE; + } + + /* trailing spaces and angle brackets */ +#ifdef PARSE_TEST + g_print("down counting trailing '>'\n"); +#endif + while(*p && (isspace(*p) || (*p == '>'))){ + if(*p == '>') + angle_brackets--; + p++; + } + *address_end = p; + + if(angle_brackets != 0){ + if(angle_brackets > 0) + parse_error = g_strdup("missing '>' at end of string"); + else + parse_error = g_strdup("superfluous '>' at end of string"); + return FALSE; + }else{ + /* we successfully parsed the address */ + return TRUE; + } + /* we never get here */ + } + return FALSE; +} + +/* + allocate address, reading from string. + On failure, returns NULL. + after call, end contatins a pointer to the end of the parsed string + end may be NULL, if we are not interested. + + parses both rfc 821 and rfc 822 addresses, depending on flag is_rfc821 +*/ + +address *_create_address(gchar *string, gchar **end, gboolean is_rfc821) +{ + gchar *loc_beg, *loc_end; + gchar *dom_beg, *dom_end; + gchar *addr_end; + + if (string && (string[0] == 0)) { + address *addr = g_malloc(sizeof(address)); + addr->address = g_strdup(""); + addr->local_part = g_strdup(""); + addr->domain = g_strdup(""); /* 'NULL' address (failure notice), + "" makes sure it will not be qualified with a hostname */ + return addr; + } + + if(is_rfc821 ? + parse_address_rfc821(string, + &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end) : + parse_address_rfc822(string, + &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end)){ + address *addr = g_malloc(sizeof(address)); + gchar *p = addr_end; + + + memset(addr, 0, sizeof(address)); + + if(loc_beg[0] == '|'){ + parse_error = g_strdup("no pipe allowed for RFC 822/821 address"); + return NULL; + } + + while(*p && (*p != ',')) p++; + addr->address = g_strndup(string, p - string); + + addr->local_part = g_strndup(loc_beg, loc_end - loc_beg); + +#ifdef PARSE_TEST + g_print("addr->local_part = %s\n", addr->local_part); +#endif + + if(dom_beg != NULL){ + addr->domain = g_strndup(dom_beg, dom_end - dom_beg); + }else{ + if(addr->local_part[0] == 0) + addr->domain = g_strdup(""); /* 'NULL' address (failure notice), + "" makes sure it will not be qualified with a hostname */ + else + addr->domain = NULL; + } + + if(end != NULL) + *end = p; + +#ifndef PARSE_TEST + addr_unmark_delivered(addr); +#endif + + return addr; + } + return NULL; +} + +address *create_address_rfc822(gchar *string, gchar **end){ + return _create_address(string, end, FALSE); +} + +address *create_address_rfc821(gchar *string, gchar **end){ + return _create_address(string, end, TRUE); +} + +GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain) +{ + gchar *p = string; + gchar *end; + + while(*p){ + address *addr = _create_address(p, &end, FALSE); + if(addr){ + if(domain) + if(addr->domain == NULL) + addr->domain = g_strdup(domain); + + addr_list = g_list_append(addr_list, addr); + p = end; + }else + break; + while(*p == ',' || isspace(*p)) p++; + } + return addr_list; +} diff -r 000000000000 -r 08114f7dcc23 src/peopen.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/peopen.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,136 @@ +/* This a snippet I found in sourceforge. I just changed the identing + style to my own and deleted the main function. */ + +#include +#include +#include +#include +#include +#include + +#include "peopen.h" +#include "sysexits.h" + +#include "masqmail.h" + +static +void destroy_argv(char **arr) +{ + char *p = arr[0]; + int i = 0; + + while(p){ + free(p); + p = arr[i++]; + } + free(arr); +} + +static +char **create_argv(const char *cmd, int count) +{ + char buf[strlen(cmd)+1]; + char **arr, *q; + const char *p; + int i = 0; + + arr = (char **)malloc(sizeof(char *) * count); + + p = cmd; + while(*p && i < (count-1)){ + while(*p && isspace(*p)) p++; + q = buf; + while(*p && !isspace(*p)) *q++ = *p++; + *q = 0; + arr[i++] = strdup(buf); + while(*p && isspace(*p)) p++; + } + arr[i] = NULL; + + return arr; +} + +FILE* peidopen(const char *command, + const char *type, + char *const envp [], + int *ret_pid, + uid_t uid, gid_t gid + ) +{ + enum { Read, Write } mode; + int pipe_fd [2]; + pid_t pid; + + if (command == NULL || type == NULL) { + errno = EINVAL; + return NULL; + } + + if (strcmp (type, "r")) { + if (strcmp (type, "w")) { + errno = EINVAL; + return NULL; + } else + mode = Write; + } else + mode = Read; + + if (pipe (pipe_fd) == -1) + return NULL; + + switch (pid = fork ()) { + case 0: /* child thread */ + + { + int i, max_fd = sysconf(_SC_OPEN_MAX); + + if(max_fd <= 0) max_fd = 64; + for(i = 0; i < max_fd; i++) + if((i != pipe_fd[0]) && (i != pipe_fd[1])) close(i); + } + if (close (pipe_fd [mode == Read ? 0 : 1]) != -1 && + dup2 (pipe_fd [mode == Read ? 1 : 0], mode == Read ? STDOUT_FILENO : STDIN_FILENO) != -1) { + // char *argv [] = { "/bin/sh", "-c", (char*) command, NULL }; + char **argv = create_argv(command, 10); + int ret; + + if(uid != (uid_t)-1){ + if((ret = seteuid(0)) != 0){ + exit(EX_NOPERM); + } + } + if(gid != (gid_t)-1){ + if((ret = setgid(gid)) != 0){ + exit(EX_NOPERM); + } + } + if(uid != (uid_t)-1){ + if((ret = setuid(uid)) != 0){ + exit(EX_NOPERM); + } + } + execve (*argv, argv, envp); + } + + _exit (errno); + + default: /* parent thread */ + *ret_pid = pid; + close (pipe_fd [mode == Read ? 1 : 0]); + return fdopen (pipe_fd [mode == Read ? 0 : 1], type); + + case -1: + close (pipe_fd [0]); + close (pipe_fd [1]); + return NULL; + } +} + +FILE* peopen(const char *command, + const char *type, + char *const envp [], + int *ret_pid + ) +{ + return peidopen(command, type, envp, ret_pid, -1 ,-1); +} diff -r 000000000000 -r 08114f7dcc23 src/peopen.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/peopen.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,13 @@ +FILE* peopen(const char *command, + const char *type, + char *const envp [], + int *ret_pid +); + +FILE* peidopen(const char *command, + const char *type, + char *const envp [], + int *ret_pid, + uid_t uid, gid_t gid +); + diff -r 000000000000 -r 08114f7dcc23 src/permissions.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/permissions.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,78 @@ +/* MasqMail + Copyright (C) 2000 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include +#include + +/* is there really no function in libc for this? */ +gboolean is_ingroup(uid_t uid, gid_t gid) +{ + struct group *grent = getgrgid(gid); + + if(grent){ + struct passwd *pwent = getpwuid(uid); + if(pwent){ + char *entry; + int i = 0; + while((entry = grent->gr_mem[i++])){ + if(strcmp(pwent->pw_name, entry) == 0) + return TRUE; + } + } + } + return FALSE; +} + +gboolean is_privileged_user(uid_t uid) +{ + return (uid == 0) || (uid == conf.mail_uid) || (is_ingroup(uid, conf.mail_gid)); +} + +void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid) +{ + if(old_uid) *old_uid = geteuid(); + if(old_gid) *old_gid = getegid(); + + seteuid(0); + + if(setegid(gid) != 0){ + logwrite(LOG_ALERT, "could not change gid to %d: %s\n", + gid, strerror(errno)); + exit(EXIT_FAILURE); + } + if(seteuid(uid) != 0){ + logwrite(LOG_ALERT, "could not change uid to %d: %s\n", + uid, strerror(errno)); + exit(EXIT_FAILURE); + } +} + +void set_identity(uid_t old_uid, gchar *task_name) +{ + if(!conf.run_as_user){ + if(!is_privileged_user(old_uid)){ + fprintf(stderr, + "must be root, %s or in group %s for %s.\n", + DEF_MAIL_USER, DEF_MAIL_GROUP, task_name); + exit(EXIT_FAILURE); + } + + set_euidgid(conf.mail_uid, conf.mail_gid, NULL, NULL); + } +} diff -r 000000000000 -r 08114f7dcc23 src/pop3_in.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pop3_in.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,820 @@ +/* pop3_in.c, Copyright (C) 2000 by Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* see RFC 1725 */ + +#include "masqmail.h" +#include "pop3_in.h" +#include "readsock.h" + +#include +#include + +#ifdef USE_LIB_CRYPTO +#include +#else +#include "md5/global.h" +#include "md5/md5.h" +#endif + +#ifdef ENABLE_POP3 + +/* experimental feature */ +#define DO_WRITE_UIDL_EARLY 1 + +static +gchar *MD5String (char *string) +{ + MD5_CTX context; + unsigned char digest[16]; + char str_digest[33]; + int i; + +#ifdef USE_LIB_CRYPTO + MD5(string, strlen(string), digest); +#else + MD5Init(&context); + MD5Update(&context, string, strlen(string)); + MD5Final(digest, &context); +#endif + for (i = 0; i < 16; i++) + sprintf(str_digest+2*i, "%02x", digest[i]); + + return g_strdup(str_digest); +} + +static +pop3_base *create_pop3base(gint sock, guint flags) +{ + gint dup_sock; + + pop3_base *popb = (pop3_base *)g_malloc(sizeof(pop3_base)); + if(popb){ + memset(popb, 0, sizeof(pop3_base)); + + popb->error = pop3_ok; + + popb->buffer = (gchar *)g_malloc(POP3_BUF_LEN); + + dup_sock = dup(sock); + popb->out = fdopen(sock, "w"); + popb->in = fdopen(dup_sock, "r"); + + popb->flags = flags; + } + return popb; +} + +static +void pop3_printf(FILE *out, gchar *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + DEBUG(4){ + gchar buf[256]; + va_list args_copy; + + va_copy(args_copy, args); + vsnprintf(buf, 255, fmt, args_copy); + va_end(args_copy); + + debugf(">>>%s", buf); + } + + vfprintf(out, fmt, args); fflush(out); + + va_end(args); +} + +static +gboolean find_uid(pop3_base *popb, gchar *str) +{ + GList *node, *node_next; + + for(node = popb->list_uid_old; node; node=node_next){ + gchar *uid = (gchar *)(node->data); + node_next = node->next; + if(strcmp(uid, str) == 0){ +#if 1 + popb->list_uid_old = g_list_remove_link(popb->list_uid_old, node); + g_list_free_1(node); + g_free(uid); +#endif + return TRUE; + } + } + return FALSE; +} + +static +gboolean write_uidl(pop3_base *popb, gchar *user) +{ + gboolean ok = FALSE; + GList *node; + gchar *filename = g_strdup_printf("%s/popuidl/%s@%s", + conf.spool_dir, + user, popb->remote_host); + gchar *tmpname = g_strdup_printf("%s.tmp", filename); + FILE *fptr = fopen(tmpname, "wt"); + + if(fptr){ + foreach(popb->drop_list, node){ + msg_info *info = (msg_info *)(node->data); + if(info->is_fetched || info->is_in_uidl) + fprintf(fptr, "%s\n", info->uid); + } + fclose(fptr); + ok = (rename(tmpname, filename) != -1); + } + + g_free(tmpname); + g_free(filename); + return ok; +} + +static +gboolean read_uidl_fname(pop3_base *popb, gchar *filename) +{ + gboolean ok = FALSE; + FILE *fptr = fopen(filename, "rt"); + gchar buf[256]; + + if(fptr){ + popb->list_uid_old = NULL; + while(fgets(buf, 255, fptr)){ + if(buf[strlen(buf)-1] == '\n'){ + g_strchomp(buf); + popb->list_uid_old = + g_list_append(popb->list_uid_old, g_strdup(buf)); + }else{ + logwrite(LOG_ALERT, "broken uid: %s\n", buf); + break; + } + } + fclose(fptr); + ok = TRUE; + }else + logwrite(LOG_ALERT, "opening of %s failed: %s", filename, strerror(errno)); + return ok; +} + +static +gboolean read_uidl(pop3_base *popb, gchar *user) +{ + gboolean ok = FALSE; + struct stat statbuf; + gchar *filename = g_strdup_printf("%s/popuidl/%s@%s", + conf.spool_dir, + user, popb->remote_host); + + if(stat(filename, &statbuf) == 0){ + ok = read_uidl_fname(popb, filename); + if(ok){ + GList *drop_node; + foreach(popb->drop_list, drop_node){ + msg_info *info = (msg_info *)(drop_node->data); + if(find_uid(popb, info->uid)){ + DEBUG(5) debugf("msg with uid '%s' already known\n", info->uid); + info->is_in_uidl = TRUE; + popb->uidl_known_cnt++; + }else + DEBUG(5) debugf("msg with uid '%s' not known\n", info->uid); + } + } + }else{ + logwrite(LOG_DEBUG, "no uidl file '%s' found\n", filename); + ok = TRUE; + } + + g_free(filename); + return ok; /* return code is irrelevant, do not check... */ +} + +static +gboolean read_response(pop3_base *popb, int timeout) +{ + gint len; + + len = read_sockline(popb->in, popb->buffer, POP3_BUF_LEN, timeout, READSOCKL_CHUG); + + if(len == -3){ + popb->error = pop3_timeout; + return FALSE; + } + else if(len == -2){ + popb->error = pop3_syntax; + return FALSE; + } + else if(len == -1){ + popb->error = pop3_eof; + return FALSE; + } + + return TRUE; +} + +static +gboolean check_response(pop3_base *popb) +{ + char c = popb->buffer[0]; + + if(c == '+'){ + popb->error = pop3_ok; + return TRUE; + }else if(c == '-') + popb->error = pop3_fail; + else + popb->error = pop3_syntax; + return FALSE; +} + +static +gboolean strtoi(gchar *p, gchar **pend, gint *val) +{ + gchar buf[12]; + gint i = 0; + + while(*p && isspace(*p)) p++; + if(*p){ + while((i < 11) && isdigit(*p)) + buf[i++] = *(p++); + buf[i] = 0; + *val = atoi(buf); + *pend = p; + return TRUE; + } + return FALSE; +} + +static +gboolean check_response_int_int(pop3_base *popb, gint *arg0, gint *arg1) +{ + if(check_response(popb)){ + gchar *p = &(popb->buffer[3]); + gchar *pe; + + if(strtoi(p, &pe, arg0)){ + DEBUG(5) debugf("arg0 = %d\n", *arg0); + p = pe; + if(strtoi(p, &pe, arg1)) + DEBUG(5) debugf("arg1 = %d\n", *arg1); + return TRUE; + } + popb->error = pop3_syntax; + } + return FALSE; +} + +static +gboolean get_drop_listing(pop3_base *popb) +{ + gchar buf[64]; + + DEBUG(5) debugf("get_drop_listing() entered\n"); + + while(1){ + gint len = read_sockline(popb->in, buf, 64, POP3_CMD_TIMEOUT, READSOCKL_CHUG); + if(len > 0){ + if(buf[0] == '.') + return TRUE; + else{ + gint number, msg_size; + gchar *p = buf, *pe; + if(strtoi(p, &pe, &number)){ + p = pe; + if(strtoi(p, &pe, &msg_size)){ + msg_info *info = g_malloc(sizeof(msg_info)); + info->number = number; + info->size = msg_size; + + DEBUG(5) debugf("get_drop_listing(), number = %d, msg_size = %d\n", number, msg_size); + + info->uid = NULL; + info->is_fetched = FALSE; + info->is_in_uidl = FALSE; + popb->drop_list = g_list_append(popb->drop_list, info); + }else{ + popb->error = pop3_syntax; + break; + } + }else{ + popb->error = pop3_syntax; + break; + } + } + }else{ + popb->error = (len == -1) ? pop3_eof : pop3_timeout; + return FALSE; + } + } + return FALSE; +} + +static +gboolean get_uid_listing(pop3_base *popb) +{ + gchar buf[64]; + + while(1){ + gint len = read_sockline(popb->in, buf, 64, POP3_CMD_TIMEOUT, READSOCKL_CHUG); + if(len > 0){ + if(buf[0] == '.') + return TRUE; + else{ + gint number; + gchar *p = buf, *pe; + if(strtoi(p, &pe, &number)){ + msg_info *info = NULL; + GList *drop_node; + + p = pe; + while(*p && isspace(*p)) p++; + + foreach(popb->drop_list, drop_node){ + msg_info *curr_info = (msg_info *)(drop_node->data); + if(curr_info->number == number){ + info = curr_info; + break; + } + } + if(info){ + info->uid = g_strdup(p); + g_strchomp(info->uid); + } + + }else{ + popb->error = pop3_syntax; + break; + } + } + } + } + return FALSE; +} + +static +gboolean check_init_response(pop3_base *popb) +{ + if(check_response(popb)){ + gchar buf[256]; + gchar *p = popb->buffer; + gint i = 0; + if(*p){ + while(*p && (*p != '<')) p++; + while(*p && (*p != '>') && (i < 254)) + buf[i++] = *(p++); + buf[i++] = '>'; + buf[i] = 0; + + popb->timestamp = g_strdup(buf); + + return TRUE; + } + } + return FALSE; +} + +void pop3_in_close(pop3_base *popb) +{ + GList *node; + + fclose(popb->in); + fclose(popb->out); + + close(popb->sock); + + foreach(popb->list_uid_old, node){ + gchar *uid = (gchar *)(node->data); + g_free(uid); + } + g_list_free(popb->list_uid_old); + + foreach(popb->drop_list, node){ + msg_info *info = (msg_info *)(node->data); + if(info->uid) g_free(info->uid); + g_free(info); + } + g_list_free(popb->drop_list); + + if(popb->buffer) g_free(popb->buffer); + if(popb->timestamp) g_free(popb->timestamp); +} + +pop3_base *pop3_in_open(gchar *host, gint port, GList *resolve_list, guint flags) +{ + pop3_base *popb; + gint sock; + mxip_addr *addr; + + DEBUG(5) debugf("pop3_in_open entered, host = %s\n", host); + + if((addr = connect_resolvelist(&sock, host, port, resolve_list))){ + /* create structure to hold status data: */ + popb = create_pop3base(sock, flags); + popb->remote_host = addr->name; + + DEBUG(5){ + struct sockaddr_in name; + int len; + getsockname(sock, (struct sockaddr *)(&name), &len); + debugf("socket: name.sin_addr = %s\n", inet_ntoa(name.sin_addr)); + } + return popb; + } + return NULL; +} + +pop3_base *pop3_in_open_child(gchar *cmd, guint flags) +{ + pop3_base *popb; + gint sock; + + DEBUG(5) debugf("pop3_in_open_child entered, cmd = %s\n", cmd); + + sock = child(cmd); + + if(sock > 0){ + + popb = create_pop3base(sock, flags); + popb->remote_host = NULL; + + return popb; + } + logwrite(LOG_ALERT, "child failed (sock = %d): %s\n", sock, strerror(errno)); + + return NULL; +} + +gboolean pop3_in_init(pop3_base *popb) +{ + gboolean ok; + + if((ok = read_response(popb, POP3_INITIAL_TIMEOUT))){ + ok = check_init_response(popb); + } + if(!ok) + /* pop3_in_log_failure(popb, NULL);*/ + logwrite(LOG_ALERT, "pop3 failed\n"); + return ok; +} + +gboolean pop3_in_login(pop3_base *popb, gchar *user, gchar *pass) +{ + if(popb->flags & POP3_FLAG_APOP){ + + gchar *string = g_strdup_printf("%s%s", popb->timestamp, pass); + gchar *digest = MD5String(string); + pop3_printf(popb->out, "APOP %s %s\r\n", user, digest); + g_free(string); + g_free(digest); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + if(check_response(popb)) + return TRUE; + else + popb->error = pop3_login_failure; + } + + }else{ + + pop3_printf(popb->out, "USER %s\r\n", user); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + if(check_response(popb)){ + pop3_printf(popb->out, "PASS %s\r\n", pass); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + if(check_response(popb)) + return TRUE; + else + popb->error = pop3_login_failure; + } + }else{ + popb->error = pop3_login_failure; + } + } + } + return FALSE; +} + +gboolean pop3_in_stat(pop3_base *popb) +{ + pop3_printf(popb->out, "STAT\r\n"); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + gint msg_cnt, mbox_size; + if(check_response_int_int(popb, &msg_cnt, &mbox_size)){ + popb->msg_cnt = msg_cnt; + popb->mbox_size = mbox_size; + + return TRUE; + } + } + return FALSE; +} + +gboolean pop3_in_list(pop3_base *popb) +{ + pop3_printf(popb->out, "LIST\r\n"); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + if(get_drop_listing(popb)){ + return TRUE; + } + } + return FALSE; +} + +gboolean pop3_in_dele(pop3_base *popb, gint number) +{ + pop3_printf(popb->out, "DELE %d\r\n", number); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + return TRUE; + } + return FALSE; +} + +message *pop3_in_retr(pop3_base *popb, gint number, address *rcpt) +{ + accept_error err; + + pop3_printf(popb->out, "RETR %d\r\n", number); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + message *msg = create_message(); + msg->received_host = popb->remote_host; + msg->received_prot = (popb->flags & POP3_FLAG_APOP) ? PROT_APOP : PROT_POP3; + msg->transfer_id = (popb->next_id)++; + msg->rcpt_list = g_list_append(NULL, copy_address(rcpt)); + + if((err = accept_message(popb->in, msg, + ACC_MAIL_FROM_HEAD|(conf.do_save_envelope_to ? ACC_SAVE_ENVELOPE_TO : 0))) + == AERR_OK) + return msg; + + destroy_message(msg); + } + return NULL; +} + +gboolean pop3_in_uidl(pop3_base *popb) +{ + pop3_printf(popb->out, "UIDL\r\n"); + if(read_response(popb, POP3_CMD_TIMEOUT)){ + if(get_uid_listing(popb)){ + return TRUE; + } + } + return FALSE; +} + +gboolean pop3_in_quit(pop3_base *popb) +{ + pop3_printf(popb->out, "QUIT\r\n"); + + DEBUG(4) debugf("QUIT\n"); + + signal(SIGALRM, SIG_DFL); + + return TRUE; +} + +/* Send a DELE command for each message in (the old) uid listing. + This is to prevent mail from to be kept on server, if a previous + transaction was interupted. */ +gboolean pop3_in_uidl_dele(pop3_base *popb) +{ + GList *drop_node; + + foreach(popb->drop_list, drop_node){ + msg_info *info = (msg_info *)(drop_node->data); + /* if(find_uid(popb, info->uid)){*/ + if(info->is_in_uidl){ + if(!pop3_in_dele(popb, info->number)) + return FALSE; + /* TODO: it probably makes sense to also + delete this uid from the listing */ + } + } + return TRUE; +} + +gboolean pop3_get(pop3_base *popb, + gchar *user, gchar *pass, address *rcpt, address *return_path, + gint max_count, gint max_size, gboolean max_size_delete) +{ + gboolean ok = FALSE; + gint num_children = 0; + + DEBUG(5) debugf("rcpt = %s@%s\n", rcpt->local_part, rcpt->domain); + + signal(SIGCHLD, SIG_DFL); + + if(pop3_in_init(popb)){ + if(pop3_in_login(popb, user, pass)){ + if(pop3_in_stat(popb)){ + if(popb->msg_cnt > 0){ + + logwrite(LOG_NOTICE|LOG_VERBOSE, "%d message(s) for user %s at %s\n", + popb->msg_cnt, user, popb->remote_host); + + if(pop3_in_list(popb)){ + gboolean do_get = !(popb->flags & POP3_FLAG_UIDL); + if(!do_get) do_get = pop3_in_uidl(popb); + if(do_get){ + gint count = 0; + GList *drop_node; + + if(popb->flags & POP3_FLAG_UIDL){ + read_uidl(popb, user); + logwrite(LOG_VERBOSE|LOG_NOTICE, "%d message(s) already in uidl.\n", + popb->uidl_known_cnt); + } + if((popb->flags & POP3_FLAG_UIDL) && (popb->flags & POP3_FLAG_UIDL_DELE)) + pop3_in_uidl_dele(popb); + + foreach(popb->drop_list, drop_node){ + + msg_info *info = (msg_info *)(drop_node->data); + gboolean do_get_this = !(popb->flags & POP3_FLAG_UIDL); + /* if(!do_get_this) do_get_this = !find_uid(popb, info->uid);*/ + if(!do_get_this) do_get_this = !(info->is_in_uidl); + if(do_get_this){ + + if((info->size < max_size) || (max_size == 0)){ + message *msg; + + logwrite(LOG_VERBOSE|LOG_NOTICE, "receiving message %d\n", info->number); + msg = pop3_in_retr(popb, info->number, rcpt); + + if(msg){ + if(return_path) + msg->return_path = copy_address(return_path); + if(spool_write(msg, TRUE)){ + pid_t pid; + logwrite(LOG_NOTICE, "%s <= %s host=%s with %s\n", + msg->uid, + addr_string(msg->return_path), + popb->remote_host, + (popb->flags & POP3_FLAG_APOP) ? + prot_names[PROT_APOP] : prot_names[PROT_POP3] + ); + info->is_fetched = TRUE; + count++; +#if DO_WRITE_UIDL_EARLY + if(popb->flags & POP3_FLAG_UIDL) write_uidl(popb, user); +#endif + if(!conf.do_queue){ + + /* wait for child processes. If there are too many, + we wait blocking, before we fork another one */ + while(num_children > 0){ + int status, options = WNOHANG; + pid_t pid; + + if(num_children >= POP3_MAX_CHILDREN){ + logwrite(LOG_NOTICE, "too many children - waiting\n"); + options = 0; + } + if((pid = waitpid(0, &status, options)) > 0){ + num_children--; + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, + "delivery process with pid %d returned %d\n", + pid, WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, + "delivery process with pid %d got signal: %d\n", + pid, WTERMSIG(status)); + }else if(pid < 0){ + logwrite(LOG_WARNING, "wait got error: %s\n", strerror(errno)); + } + } + + if((pid = fork()) == 0){ + deliver(msg); + _exit(EXIT_SUCCESS); + }else if(pid < 0){ + logwrite(LOG_ALERT|LOG_VERBOSE, + "could not fork for delivery, id = %s: %s\n", + msg->uid, strerror(errno)); + }else + num_children++; + }else{ + DEBUG(1) debugf("queuing forced by configuration or option.\n"); + } + if(popb->flags & POP3_FLAG_DELETE) + pop3_in_dele(popb, info->number); + + destroy_message(msg); + }/* if(spool_write(msg, TRUE)) */ + }else{ + logwrite(LOG_ALERT, + "retrieving of message %d failed: %d\n", + info->number, popb->error); + } + }/* if((info->size > max_size) ... */ + else{ + logwrite(LOG_NOTICE|LOG_VERBOSE, "size of message #%d (%d) > max_size (%d)\n", + info->number, info->size, max_size); + if(max_size_delete) + if(popb->flags & POP3_FLAG_DELETE) + pop3_in_dele(popb, info->number); + } + }/* if(do_get_this) ... */ + else{ + if(popb->flags & POP3_FLAG_UIDL){ + info->is_fetched = TRUE; /* obsolete? */ + logwrite(LOG_VERBOSE, "message %d already known\n", + info->number); + DEBUG(1) debugf("message %d (uid = %s) not fetched\n", + info->number, info->uid); +#if 0 +#if DO_WRITE_UIDL_EARLY + write_uidl(popb, user); /* obsolete? */ +#endif +#endif + } + } + if((max_count != 0) && (count >= max_count)) + break; + }/* foreach() */ +#if DO_WRITE_UIDL_EARLY +#else + if(popb->flags & POP3_FLAG_UIDL) write_uidl(popb, user); +#endif + }/* if(pop3_in_uidl(popb) ... */ + }/* if(pop3_in_list(popb)) */ + }/* if(popb->msg_cnt > 0) */ + else{ + logwrite(LOG_NOTICE|LOG_VERBOSE, + "no messages for user %s at %s\n", user, popb->remote_host); + } + ok = TRUE; + } + pop3_in_quit(popb); + }else{ + logwrite(LOG_ALERT|LOG_VERBOSE, + "pop3 login failed for user %s, host = %s\n", user, popb->remote_host); + } + } + if(!ok){ + logwrite(LOG_ALERT|LOG_VERBOSE, "pop3 failed, error = %d\n", popb->error); + } + + while(num_children > 0){ + int status; + pid_t pid; + if((pid = wait(&status)) > 0){ + num_children--; + if(WEXITSTATUS(status) != EXIT_SUCCESS) + logwrite(LOG_WARNING, + "delivery process with pid %d returned %d\n", + pid, WEXITSTATUS(status)); + if(WIFSIGNALED(status)) + logwrite(LOG_WARNING, + "delivery process with pid %d got signal: %d\n", + pid, WTERMSIG(status)); + }else{ + logwrite(LOG_WARNING, "wait got error: %s\n", strerror(errno)); + } + } + + return ok; +} + +/* function just to log into a pop server, + for pop_before_smtp (or is it smtp_after_pop?) +*/ + +gboolean pop3_login(gchar *host, gint port, GList *resolve_list, + gchar *user, gchar *pass, guint flags) +{ + gboolean ok = FALSE; + pop3_base *popb; + + signal(SIGCHLD, SIG_IGN); + + if((popb = pop3_in_open(host, port, resolve_list, flags))){ + if(pop3_in_init(popb)){ + if(pop3_in_login(popb, user, pass)) + ok = TRUE; + else + logwrite(LOG_ALERT|LOG_VERBOSE, + "pop3 login failed for user %s, host = %s\n", user, host); + } + pop3_in_close(popb); + } + return ok; +} + +#endif diff -r 000000000000 -r 08114f7dcc23 src/pop3_in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pop3_in.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,87 @@ +/* pop3_in.h, Copyright 2000 (C) Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifdef ENABLE_POP3 + +#define POP3_BUF_LEN 1024 + +#define POP3_INITIAL_TIMEOUT 5*60 +#define POP3_CMD_TIMEOUT 5*60 +#define POP3_DATA_TIMEOUT 5*60 +#define POP3_FINAL_TIMEOUT 10*60 + +#define POP3_FLAG_DELETE 0x01 +#define POP3_FLAG_UIDL 0x02 +#define POP3_FLAG_UIDL_DELE 0x04 +#define POP3_FLAG_APOP 0x08 + +#define POP3_MAX_CHILDREN 2 + +typedef +enum _pop3_error{ + pop3_ok = 0, + pop3_fail, + pop3_eof, + pop3_timeout, + pop3_login_failure, + pop3_syntax +} pop3_error; + +typedef struct pop3_base{ + FILE *in; + FILE *out; + gint sock; + gint dup_sock; + + gchar *remote_host; + gchar *buffer; + + gint next_id; + gint msg_cnt; + gint uidl_known_cnt; + gint mbox_size; + + GList *list_uid_old; + GList *drop_list; + + gchar* timestamp; + + guint flags; + + pop3_error error; +} pop3_base; + +typedef struct _msg_info{ + gint number; + gint size; + gchar *uid; + gboolean is_fetched; + gboolean is_in_uidl; +} msg_info; + +pop3_base *pop3_in_open(gchar *host, gint port, GList *resolve_list, guint flags); +pop3_base *pop3_in_open_child(gchar *cmd, guint flags); +void pop3_in_close(pop3_base *popb); +gboolean pop3_get(pop3_base *popb, + gchar *user, gchar *pass, address *rcpt, address *return_path, + gint max_count, gint max_size, gboolean max_size_delete); +gboolean pop3_login(gchar *host, gint port, GList *resolve_list, + gchar *user, gchar *pass, guint flags); + + + +#endif diff -r 000000000000 -r 08114f7dcc23 src/queue.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/queue.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,224 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" + +#include +#include + +static +void mix_arr(int *buf, int len) +{ + int i; + + for(i = 0; i < len; i++) + buf[i] = i; + for(i = 0; i < len-1; i++){ + int j = (int)((float)(len-i) * ((float)rand())/(RAND_MAX + 1.0)); + int tmp; + + if(i != j){ + tmp = buf[i]; buf[i] = buf[j]; buf[j] = tmp; + } + } +} + +GList *read_queue(gboolean do_readdata) +{ + GList *msg_list = NULL; + glob_t gl; + gchar *pattern; + int i, *idx_arr; + + pattern = g_strdup_printf("%s/input/??????-???-??-H", conf.spool_dir); + gl.gl_offs = 0; + glob(pattern, 0, NULL, &gl); + + g_free(pattern); + + DEBUG(4){ + int i; + for(i = 0; i < gl.gl_pathc; i++){ + debugf("spoolfile: %s\n", gl.gl_pathv[i]); + } + } + + idx_arr = g_malloc(sizeof(int) * gl.gl_pathc); + mix_arr(idx_arr, gl.gl_pathc); + + for(i = 0; i < gl.gl_pathc; i++){ + gchar *uid; + + /* copy 13 chars, offset spooldir path + 7 chars for /input/ */ + /* uid length = 6 chars + '-' + 3 chars + '-' + 2 = 13 chars */ + uid = g_strndup(&(gl.gl_pathv[idx_arr[i]][strlen(conf.spool_dir) + 7]), 13); + + DEBUG(5) debugf("uid: %s\n", uid); + + msg_list = g_list_append(msg_list, msg_spool_read(uid, do_readdata)); + + DEBUG(5) debugf("after read spool file for %s\n", uid); + + g_free(uid); + } + return msg_list; +} + +gboolean queue_run() +{ + GList *msg_list; + gboolean ok = TRUE; + + logwrite(LOG_NOTICE, "Starting queue run.\n"); + + msg_list = read_queue(FALSE); + + if(msg_list != NULL){ + ok = deliver_msg_list(msg_list, DLVR_ALL); + destroy_msg_list(msg_list); + } + logwrite(LOG_NOTICE, "Finished queue run.\n"); + + return ok; +} + +gboolean queue_run_online() +{ + GList *msg_list = read_queue(FALSE); + gboolean ok = TRUE; + + logwrite(LOG_NOTICE, "Starting online queue run.\n"); + if(msg_list != NULL){ + ok = deliver_msg_list(msg_list, DLVR_ONLINE); + destroy_msg_list(msg_list); + } + logwrite(LOG_NOTICE, "Finished online queue run.\n"); + + return ok; +} + +static +gchar *format_difftime(double secs) +{ + if(secs > 86400) + return g_strdup_printf("%.1fd", secs/86400); + else if(secs > 3600) + return g_strdup_printf("%.1fh", secs/3600); + else if(secs > 60) + return g_strdup_printf("%.1fm", secs/60); + else + return g_strdup_printf("%.0fs", secs); +} + +void queue_list() +{ + GList *msg_list; + GList *msg_node; + + msg_list = read_queue(FALSE); + + if(msg_list != NULL){ + foreach(msg_list, msg_node){ + message *msg = (message *)(msg_node->data); + GList *rcpt_node; + gchar *size_str = NULL; + gchar *time_str = NULL; + gchar *host_str = NULL; + gchar *ident_str = NULL; + + if(msg->data_size >= 0) + size_str = g_strdup_printf(" size=%d", msg->data_size); + if(msg->received_time > 0){ + gchar *tmp_str; + time_str = + g_strdup_printf(" age=%s", + tmp_str = format_difftime(difftime(time(NULL), + msg->received_time))); + g_free(tmp_str); + } + if(msg->received_host != NULL) + host_str = g_strdup_printf(" host=%s", msg->received_host); + if(msg->ident != NULL) + ident_str = g_strdup_printf(" ident=%s", msg->ident); + + printf("%s <= %s%s%s%s%s\n", msg->uid, + addr_string(msg->return_path), + size_str ? size_str : "", + time_str ? time_str : "", + host_str ? host_str : "", + ident_str ? ident_str : "" + ); + + if(size_str) g_free(size_str); + if(time_str) g_free(time_str); + if(host_str) g_free(host_str); + if(ident_str) g_free(ident_str); + + foreach(msg->rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + + printf(" %s %s\n", + addr_is_delivered(rcpt) ? "=>" : (addr_is_failed(rcpt) ? "!=" : "=="), + addr_string(rcpt)); + } + g_free(msg); + } + }else + printf("mail queue is empty.\n"); +} + +gboolean queue_delete(gchar *uid) +{ + gboolean hdr_ok = TRUE; + gboolean dat_ok = TRUE; + gchar *hdr_name = g_strdup_printf("%s/input/%s-H", conf.spool_dir, uid); + gchar *dat_name = g_strdup_printf("%s/input/%s-D", conf.spool_dir, uid); + struct stat stat_buf; + + if(spool_lock(uid)){ + + if(stat(hdr_name, &stat_buf) == 0){ + if(unlink(hdr_name) != 0){ + fprintf(stderr, "could not unlink %s: %s\n", hdr_name, strerror(errno)); + hdr_ok = FALSE; + } + }else{ + fprintf(stderr, "could not stat file %s: %s\n", hdr_name, strerror(errno)); + hdr_ok = FALSE; + } + if(stat(dat_name, &stat_buf) == 0){ + if(unlink(dat_name) != 0){ + fprintf(stderr, "could not unlink %s: %s\n", dat_name, strerror(errno)); + dat_ok = FALSE; + } + }else{ + fprintf(stderr, "could not stat file %s: %s\n", dat_name, strerror(errno)); + dat_ok = FALSE; + } + printf("message %s deleted\n", uid); + + spool_unlock(uid); + + }else{ + + fprintf(stderr, "message %s is locked.\n", uid); + return FALSE; + } + + return (dat_ok && hdr_ok); +} diff -r 000000000000 -r 08114f7dcc23 src/readsock.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/readsock.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,182 @@ +/* MasqMail + Copyright (C) 2000 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/*#include "masqmail.h"*/ +#include +#include +#include +#include +#include +#include +#include "readsock.h" + +jmp_buf jmp_timeout; + +static +void sig_timeout_handler(int sig) +{ + longjmp(jmp_timeout, 1); +} + +static struct sigaction old_sa_alrm; + +static +void alarm_on(int timeout) +{ + struct sigaction sa; + + sa.sa_handler = sig_timeout_handler; + sigemptyset(&(sa.sa_mask)); + sa.sa_flags = 0; + sigaction(SIGALRM, &sa, &old_sa_alrm); + + if(timeout > 0) + alarm(timeout); +} + +static +void alarm_off() +{ + alarm(0); + + sigaction(SIGALRM, &old_sa_alrm, NULL); +} + +static +void _read_chug(FILE *in) +{ + int c = 0; + + c = fgetc(in); + while(isspace(c) && (c != EOF)) c = fgetc(in); + ungetc(c, in); +} + +static +int _read_line(FILE *in, char *buf, int buf_len, int timeout) +{ + int p = 0; + int c = 0; + + c = fgetc(in); + while((c != '\n') && (c != EOF) && (p < buf_len-1)){ + buf[p++] = c; + c = fgetc(in); + } + + buf[p] = 0; + + if(c == EOF) + return -1; + else if(p >= buf_len){ + ungetc(c, in); + return -2; + } + + buf[p++] = c; /* \n */ + buf[p] = 0; + + return p; +} + +int read_sockline(FILE *in, char *buf, int buf_len, int timeout, unsigned int flags) +{ + int p = 0; + + if(setjmp(jmp_timeout) != 0){ + alarm_off(); + return -3; + } + + alarm_on(timeout); + + /* strip leading spaces */ + if(flags & READSOCKL_CHUG){ + _read_chug(in); + } + + p = _read_line(in, buf, buf_len, timeout); + + alarm_off(); + + if(p > 1){ + /* here we are sure that buf[p-1] == '\n' */ + if(flags & READSOCKL_CVT_CRLF){ + if((buf[p-2] == '\r') && (buf[p-1] == '\n')){ + buf[p-2] = '\n'; + buf[p-1] = 0; + p--; + } + } + } + return p; +} + +int read_sockline1(FILE *in, char **pbuf, int *buf_len, int timeout, unsigned int flags) +{ + int p = 0, size = *buf_len; + char *buf; + + if(setjmp(jmp_timeout) != 0){ + alarm_off(); + return -3; + } + + alarm_on(timeout); + + /* strip leading spaces */ + if(flags & READSOCKL_CHUG){ + _read_chug(in); + } + + if(!*pbuf) *pbuf = malloc(size); + buf = *pbuf; + + while(1){ + int pp; + + pp = _read_line(in, buf, size, timeout); + if(pp == -2){ + *pbuf = realloc(*pbuf, *buf_len + size); + buf = *pbuf + *buf_len; + *buf_len += size; + p += size; + } + else{ + if(pp > 0) p += pp; + else p = pp; + break; + } + } + + alarm_off(); + + if(p > 1){ + buf = *pbuf; + /* here we are sure that buf[p-1] == '\n' */ + if(flags & READSOCKL_CVT_CRLF){ + if((buf[p-2] == '\r') && (buf[p-1] == '\n')){ + buf[p-2] = '\n'; + buf[p-1] = 0; + p--; + } + } + } + return p; +} + diff -r 000000000000 -r 08114f7dcc23 src/readsock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/readsock.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,24 @@ +/* MasqMail + Copyright (C) 2000 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define READSOCKL_CHUG 0x01 +#define READSOCKL_CVT_CRLF 0x02 + + +int read_sockline(FILE *in, char *buf, int buf_len, int timeout, unsigned int flags); +int read_sockline1(FILE *in, char **pbuf, int *size, int timeout, unsigned int flags); diff -r 000000000000 -r 08114f7dcc23 src/readtest.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/readtest.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,19 @@ + +#include "masqmail.h" +#include "readsock.h" + +int main() +{ + char *buf = g_malloc(20); + int size = 20, ret; + + ret = read_sockline1(stdin, &buf, &size, 60, READSOCKL_CVT_CRLF); + // ret = read_sockline(stdin, buf, size, 60, READSOCKL_CHUG); + + printf("%s\n", buf); + printf("ret = %d, size = %d, strlen = %d\n", ret, size, strlen(buf)); + + return 0; +} + + diff -r 000000000000 -r 08114f7dcc23 src/rewrite.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/rewrite.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,100 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef REWRITE_TEST +#include "masqmail.h" +#endif + +gboolean set_address_header_domain(header *hdr, gchar *domain) +{ + gchar *p = hdr->value; + gchar *new_hdr = g_strndup(hdr->header, hdr->value - hdr->header); + gint tmp; + + while(*p){ + gchar *loc_beg, *loc_end; + gchar *dom_beg, *dom_end; + gchar *addr_end; + gchar *rewr_string; + + if(parse_address_rfc822(p, + &loc_beg, &loc_end, &dom_beg, &dom_end, &addr_end)){ + gchar *left, *right; + + if(dom_beg != NULL){ + left = g_strndup(p, dom_beg - p); + right = g_strndup(dom_end, addr_end - dom_end); + + rewr_string = g_strconcat(left, domain, right, NULL); + }else{ + left = g_strndup(p, loc_end - p); + right = g_strndup(loc_end, addr_end - loc_end); + + rewr_string = g_strconcat(left, "@", domain, right, NULL); + } + g_free(left); + g_free(right); + + p = addr_end; + if(*p == ',') p++; + + new_hdr = + g_strconcat(new_hdr, rewr_string, + *p != 0 ? "," : NULL, NULL); + + }else + return FALSE; + } + tmp = (hdr->value - hdr->header); + g_free(hdr->header); + hdr->header = new_hdr; + hdr->value = hdr->header + tmp; + + return TRUE; +} + +gboolean map_address_header(header *hdr, GList *table) +{ + GList *addr_list = addr_list_append_rfc822(NULL, hdr->value, conf.host_name); + GList *addr_node; + gchar *new_hdr = g_strndup(hdr->header, hdr->value - hdr->header); + gboolean did_change = FALSE; + + foreach(addr_list, addr_node){ + address *addr = (address *)(addr_node->data); + gchar *rewr_string = (gchar *)table_find_fnmatch(table, addr->local_part); + + if(rewr_string == NULL) + rewr_string = addr->address; + else + did_change = TRUE; + + if(rewr_string) + new_hdr = + g_strconcat(new_hdr, rewr_string, + g_list_next(addr_node) ? "," : "\n", NULL); + } + if(did_change){ + g_free(hdr->header); + hdr->header = new_hdr; + }else + g_free(new_hdr); + + return did_change; +} + diff -r 000000000000 -r 08114f7dcc23 src/route.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/route.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,436 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include + +msgout_perhost *create_msgout_perhost(gchar *host) +{ + msgout_perhost *mo_ph = g_malloc(sizeof(msgout_perhost)); + if(mo_ph){ + mo_ph->host = g_strdup(host); + mo_ph->msgout_list = NULL; + } + return mo_ph; +} + +void destroy_msgout_perhost(msgout_perhost *mo_ph) +{ + GList *mo_node; + + foreach(mo_ph->msgout_list, mo_node){ + msg_out *mo = (msg_out *)(mo_node->data); + /* the rcpt_list is owned by the msgout's, + but not the rcpt's themselves */ + g_list_free(mo->rcpt_list); + g_free(mo); + } + g_list_free(mo_ph->msgout_list); + g_free(mo_ph); +} + +void rewrite_headers(msg_out *msgout, connect_route *route) +{ + /* if set_h_from_domain is set, replace domain in all + From: headers. + */ + msgout->hdr_list = g_list_copy(msgout->msg->hdr_list); + + /* map from addresses */ + if(route->map_h_from_addresses != NULL){ + GList *hdr_node; + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(hdr->id == HEAD_FROM){ + header *new_hdr = copy_header(hdr); + if(map_address_header(new_hdr, route->map_h_from_addresses)){ + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + msgout->xtra_hdr_list = + g_list_append(msgout->xtra_hdr_list, new_hdr); + }else + g_free(new_hdr); + } + } + }else{ + /* replace from domain */ + if(route->set_h_from_domain != NULL){ + GList *hdr_node; + + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(hdr->id == HEAD_FROM){ + header *new_hdr = copy_header(hdr); + + DEBUG(5) debugf("setting From: domain to %s\n", + route->set_h_from_domain); + if(set_address_header_domain(new_hdr, route->set_h_from_domain)){ + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + DEBUG(6) debugf("header = %s\n", + new_hdr->header); + msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr); + }else{ + logwrite(LOG_ALERT, "error in set_address_header_domain(%s, %s)\n", + new_hdr->value, route->set_h_from_domain); + } + } + } + } + } + + /* map reply-to addresses */ + if(route->map_h_reply_to_addresses != NULL){ + GList *hdr_node; + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(hdr->id == HEAD_REPLY_TO){ + header *new_hdr = copy_header(hdr); + if(map_address_header(new_hdr, route->map_h_reply_to_addresses)){ + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + msgout->xtra_hdr_list = + g_list_append(msgout->xtra_hdr_list, new_hdr); + }else + g_free(new_hdr); + } + } + }else{ + /* replace Reply-to domain */ + if(route->set_h_reply_to_domain != NULL){ + GList *hdr_node; + + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(hdr->id == HEAD_REPLY_TO){ + header *new_hdr = copy_header(hdr); + + set_address_header_domain(new_hdr, route->set_h_reply_to_domain); + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr); + } + } + } + } + + /* map Mail-Followup-To addresses */ + if(route->map_h_mail_followup_to_addresses != NULL){ + GList *hdr_node; + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(strncasecmp(hdr->header, "Mail-Followup-To", 16) == 0){ + header *new_hdr = copy_header(hdr); + if(map_address_header(new_hdr, route->map_h_mail_followup_to_addresses)){ + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + msgout->xtra_hdr_list = + g_list_append(msgout->xtra_hdr_list, new_hdr); + }else + g_free(new_hdr); + } + } + } + + /* set Sender: domain to return_path->domain */ + if(route->expand_h_sender_domain){ + GList *hdr_node; + + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(hdr->id == HEAD_SENDER){ + header *new_hdr = copy_header(hdr); + + set_address_header_domain(new_hdr, msgout->return_path->domain); + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr); + } + } + } + + /* set Sender: domain to return_path->domain */ + if(route->expand_h_sender_address){ + GList *hdr_node; + + foreach(msgout->hdr_list, hdr_node){ + header *hdr = (header *)(hdr_node->data); + if(hdr->id == HEAD_SENDER){ + header *new_hdr; + + new_hdr = + create_header(HEAD_SENDER, "Sender: %s@%s\n", + msgout->return_path->local_part, msgout->return_path->domain); + hdr_node->data = new_hdr; + /* we need this list only to carefully free the extra headers: */ + msgout->xtra_hdr_list = g_list_append(msgout->xtra_hdr_list, new_hdr); + } + } + } + + if(msgout->xtra_hdr_list == NULL){ + /* nothing was changed */ + g_list_free(msgout->hdr_list); + msgout->hdr_list = NULL; + } + DEBUG(5) debugf("rewrite_headers() returning\n"); +} + +void rcptlist_with_one_of_hostlist(GList *rcpt_list, GList *host_list, + GList **p_rcpt_list, GList **p_non_rcpt_list) +{ + GList *rcpt_node; + + if(rcpt_list == NULL) + return; + + foreach(rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + GList *host_node = NULL; + + foreach(host_list, host_node){ + gchar *host = (gchar *)(host_node->data); + if(fnmatch(host, rcpt->domain, FNM_CASEFOLD) == 0) + break; + } + if(host_node){ + if(p_rcpt_list) + *p_rcpt_list = g_list_append(*p_rcpt_list, rcpt); + }else{ + if(p_non_rcpt_list) + *p_non_rcpt_list = g_list_append(*p_non_rcpt_list, rcpt); + } + + } +} + +void rcptlist_with_addr_is_local(GList *rcpt_list, + GList **p_rcpt_list, GList **p_non_rcpt_list) +{ + GList *rcpt_node; + + if(rcpt_list == NULL) + return; + + foreach(rcpt_list, rcpt_node){ + address *rcpt = (address *)(rcpt_node->data); + if(addr_is_local(rcpt)){ + if(p_rcpt_list) + *p_rcpt_list = g_list_append(*p_rcpt_list, rcpt); + }else{ + if(p_non_rcpt_list) + *p_non_rcpt_list = g_list_append(*p_non_rcpt_list, rcpt); + } + + } +} + +static gint _g_list_addrcmp(gconstpointer a, gconstpointer b) +{ + return addr_match((address *)a, (address *)b); +} + +gboolean route_is_allowed_return_path(connect_route *route, address *ret_path) +{ + if(route->not_allowed_return_paths != NULL){ + if(g_list_find_custom(route->not_allowed_return_paths, ret_path, + _g_list_addrcmp) != NULL){ + return FALSE; + } + } + if(route->allowed_return_paths != NULL){ + if(g_list_find_custom(route->allowed_return_paths, ret_path, + _g_list_addrcmp) != NULL){ + return TRUE; + }else{ + return FALSE; + } + } + return TRUE; +} + +static gint _g_list_strcmp(gconstpointer a, gconstpointer b) +{ + return (gint)strcmp(a, b); +} + +gboolean route_is_allowed_mail_local(connect_route *route, address *ret_path) +{ + gchar *loc_part = ret_path->local_part; + + if(route->not_allowed_mail_locals != NULL){ + if(g_list_find_custom(route->not_allowed_mail_locals, loc_part, + _g_list_strcmp) != NULL) + return FALSE; + } + if(route->allowed_mail_locals != NULL){ + if(g_list_find_custom(route->allowed_mail_locals, loc_part, + _g_list_strcmp) != NULL) + return TRUE; + else + return FALSE; + } + return TRUE; +} + +/* + Make lists of matching/not matching rcpts. + Local domains are NOT regared here, these should be sorted out previously +*/ +void msg_rcptlist_route(connect_route *route, GList *rcpt_list, + GList **p_rcpt_list, GList **p_non_rcpt_list) +{ + GList *tmp_list = NULL; + /* sort out those domains that can be sent over this connection: */ + if(route->allowed_rcpt_domains){ + DEBUG(5) debugf("testing for route->allowed_rcpt_domains\n"); + rcptlist_with_one_of_hostlist(rcpt_list, route->allowed_rcpt_domains, &tmp_list, p_non_rcpt_list); + }else{ + DEBUG(5) debugf("route->allowed_rcpt_domains == NULL\n"); + tmp_list = g_list_copy(rcpt_list); + } + + /* sort out those domains that cannot be sent over this connection: */ + rcptlist_with_one_of_hostlist(tmp_list, route->not_allowed_rcpt_domains, p_non_rcpt_list, p_rcpt_list); + g_list_free(tmp_list); +} + +msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout) +{ + message *msg = msgout->msg; + GList *rcpt_list = msgout->rcpt_list; + + if(rcpt_list != NULL){ + /* found a few */ + DEBUG(5){ + GList *node; + debugf("rcpts for routed delivery, route = %s, id = %s\n", route->name, msg->uid); + foreach(rcpt_list, node){ + address *rcpt = (address *)(node->data); + debugf("rcpt for routed delivery: <%s@%s>\n", + rcpt->local_part, rcpt->domain); + } + } + + /* rewrite return path + if there is a table, use that + if an address is found and if it has a domain, use that + */ + if(route->map_return_path_addresses){ + address *ret_path = NULL; + DEBUG(5) debugf("looking up %s in map_return_path_addresses\n", + msg->return_path->local_part); + ret_path = + (address *)table_find_fnmatch(route->map_return_path_addresses, + msg->return_path->local_part); + if(ret_path){ + DEBUG(5) debugf("found <%s@%s>\n", + ret_path->local_part, ret_path->domain); + if(ret_path->domain == NULL) + ret_path->domain = + route->set_return_path_domain ? + route->set_return_path_domain : msg->return_path->domain; + msgout->return_path = copy_address(ret_path); + } + } + if(msgout->return_path == NULL){ + DEBUG(5) debugf("setting return path to %s\n", + route->set_return_path_domain); + msgout->return_path = + copy_modify_address(msg->return_path, + NULL, route->set_return_path_domain); + } + rewrite_headers(msgout, route); + + return msgout; + } + return NULL; +} + +/* put msgout's is msgout_list into bins (msgout_perhost structs) for each + host. Used if there is no mail_host. + route param is not used, we leave it here because that may change. + */ + +GList *route_msgout_list(connect_route *route, GList *msgout_list) +{ + GList *mo_ph_list = NULL; + GList *msgout_node; + + foreach(msgout_list, msgout_node){ + msg_out *msgout = (msg_out *)(msgout_node->data); + msg_out *msgout_new; + GList *rcpt_list = msgout->rcpt_list; + GList *rcpt_node; + + foreach(rcpt_list, rcpt_node){ + address *rcpt = rcpt_node->data; + msgout_perhost *mo_ph = NULL; + GList *mo_ph_node = NULL; + + /* search host in mo_ph_list */ + foreach(mo_ph_list, mo_ph_node){ + mo_ph = (msgout_perhost *)(mo_ph_node->data); + if(strcasecmp(mo_ph->host, rcpt->domain) == 0) + break; + } + if(mo_ph_node != NULL){ + /* there is already a rcpt for this host */ + msg_out *msgout_last = + (msg_out *)((g_list_last(mo_ph->msgout_list))->data); + if(msgout_last->msg == msgout->msg){ + /* if it is also the same message, it must be the last one + appended to mo_ph->msgout_list (since outer loop goes through + msgout_list) */ + msgout_last->rcpt_list = + g_list_append(msgout_last->rcpt_list, rcpt); + }else{ + /* if not, we append a new msgout */ + /* make a copy of msgout */ + msgout_new = create_msg_out(msgout->msg); + msgout_new->return_path = msgout->return_path; + msgout_new->hdr_list = msgout->hdr_list; + + /* append our rcpt to it */ + /* It is the 1st rcpt for this msg to this host, + therefore we safely give NULL */ + msgout_new->rcpt_list = g_list_append(NULL, rcpt); + mo_ph->msgout_list = + g_list_append(mo_ph->msgout_list, msgout_new); + } + }else{ + /* this rcpt to goes to another host */ + mo_ph = create_msgout_perhost(rcpt->domain); + mo_ph_list = g_list_append(mo_ph_list, mo_ph); + + /* make a copy of msgout */ + msgout_new = create_msg_out(msgout->msg); + msgout_new->return_path = msgout->return_path; + msgout_new->hdr_list = msgout->hdr_list; + + /* append our rcpt to it */ + /* It is the 1st rcpt for this msg to this host, + therefore we safely give NULL */ + msgout_new->rcpt_list = g_list_append(NULL, rcpt); + mo_ph->msgout_list = g_list_append(mo_ph->msgout_list, msgout_new); + }/* if mo_ph != NULL */ + }/* foreach(rcpt_list, ... */ + }/* foreach(msgout_list, ... */ + + return mo_ph_list; +} diff -r 000000000000 -r 08114f7dcc23 src/smtp_in.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/smtp_in.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,358 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include "readsock.h" + +/* + I always forget these rfc numbers: + RFC 821 (SMTP) + RFC 1869 (ESMTP) + RFC 1870 (ESMTP SIZE) + RFC 2197 (ESMTP PIPELINE) + RFC 2554 (ESMTP AUTH) +*/ + +#ifdef ENABLE_SMTP_SERVER + +smtp_cmd smtp_cmds[] = +{ + { SMTP_HELO, "HELO", }, + { SMTP_EHLO, "EHLO", }, + { SMTP_MAIL_FROM, "MAIL FROM:", }, + { SMTP_RCPT_TO, "RCPT TO:", }, + { SMTP_DATA, "DATA", }, + { SMTP_QUIT, "QUIT", }, + { SMTP_RSET, "RSET", }, + { SMTP_NOOP, "NOOP", }, + { SMTP_HELP, "HELP" }, +}; + +static +smtp_cmd_id get_id(const gchar *line) +{ + gint i; + for(i = 0; i < SMTP_NUM_IDS; i++){ + if(strncasecmp(smtp_cmds[i].cmd, line, strlen(smtp_cmds[i].cmd)) == 0) + return (smtp_cmd_id)i; + } + return SMTP_ERROR; +} + +/* this is a quick hack: we expect the address to be syntactically correct + and containing the mailbox only: +*/ + +static +gboolean get_address(gchar *line, gchar *addr) +{ + gchar *p = line, *q = addr; + + /* skip MAIL FROM: and RCPT TO: */ + while(*p && (*p != ':')) p++; + p++; + + /* skip spaces: */ + while(*p && isspace(*p)) p++; + + /* get address: */ + while(*p && !isspace(*p) && (q < addr+MAX_ADDRESS-1)) *(q++) = *(p++); + *q = 0; + + return TRUE; +} + +static +smtp_connection *create_base(gchar *remote_host) +{ + smtp_connection *base = g_malloc(sizeof(smtp_connection)); + if(base){ + base->remote_host = g_strdup(remote_host); + + base->prot = PROT_SMTP; + base->next_id = 0; + base->helo_seen = 0; + base->from_seen = 0; + base->rcpt_seen = 0; + base->msg = NULL; + + return base; + } + return NULL; +} + +static +void smtp_printf(FILE *out, gchar *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + DEBUG(4){ + gchar buf[256]; + va_list args_copy; + + va_copy(args_copy, args); + vsnprintf(buf, 255, fmt, args_copy); + va_end(args_copy); + + debugf(">>>%s", buf); + } + + vfprintf(out, fmt, args); fflush(out); + + va_end(args); +} + +void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident) +{ + gchar *buffer; + smtp_cmd_id cmd_id; + message *msg = NULL; + smtp_connection *psc; + int len; + + DEBUG(5) debugf("smtp_in entered, remote_host = %s\n", remote_host); + + psc = create_base(remote_host); + psc->msg = msg; + + buffer = (gchar *)g_malloc(BUF_LEN); + if(buffer){ + /* send greeting string, containing ESMTP: */ + smtp_printf(out, "220 %s MasqMail %s ESMTP\r\n", + conf.host_name, VERSION); + + while((len = read_sockline(in, buffer, BUF_LEN, 5*60, READSOCKL_CHUG)) >= 0){ + cmd_id = get_id(buffer); + + switch(cmd_id){ + case SMTP_EHLO: + psc->prot = PROT_ESMTP; + /* fall through */ + case SMTP_HELO: + psc->helo_seen = TRUE; + + if(!conf.defer_all){ /* I need this to debug delivery failures */ + if(psc->prot == PROT_ESMTP){ + smtp_printf(out, "250-%s Nice to meet you with ESMTP\r\n", + conf.host_name); + /* not yet: fprintf(out, "250-SIZE\r\n"); */ + smtp_printf(out, + "250-PIPELINING\r\n" + "250 HELP\r\n"); + }else{ + smtp_printf(out, "250 %s pretty old mailer, huh?\r\n", + conf.host_name); + } + break; + }else{ + smtp_printf(out, "421 %s service temporarily unavailable.\r\n", + conf.host_name); + } + + case SMTP_MAIL_FROM: + if(psc->helo_seen && !psc->from_seen){ + gchar buf[MAX_ADDRESS]; + address *addr; + + msg = create_message(); + msg->received_host = remote_host ? g_strdup(remote_host) : NULL; + msg->received_prot = psc->prot; + msg->ident = ident ? g_strdup(ident) : NULL; + /* get transfer id and increment for next one */ + msg->transfer_id = (psc->next_id)++; + + get_address(buffer, buf); + if((addr = remote_host ? + create_address(buf, TRUE) : + create_address_qualified(buf, TRUE, conf.host_name))){ + if(addr->domain != NULL){ + psc->from_seen = TRUE; + msg->return_path = addr; + smtp_printf(out, "250 OK %s is a nice guy.\r\n", addr->address); + }else{ + smtp_printf(out, + "501 return path must be qualified.\r\n", buf); + } + }else{ + smtp_printf(out, "501 %s: syntax error.\r\n", buf); + } + }else{ + if(!psc->helo_seen) + smtp_printf(out, "503 need HELO or EHLO\r\n"); + else + smtp_printf(out, "503 MAIL FROM: already given.\r\n"); + } + break; + + case SMTP_RCPT_TO: + + if(psc->helo_seen && psc->from_seen){ + char buf[MAX_ADDRESS]; + address *addr; + + get_address(buffer, buf); + if((addr = remote_host ? + create_address(buf, TRUE) : + create_address_qualified(buf, TRUE, conf.host_name))){ + if(addr->local_part[0] != '|'){ + if(addr->domain != NULL){ + gboolean do_relay = conf.do_relay; + if(!do_relay){ + if((do_relay = addr_is_local(msg->return_path))); + if(!do_relay){ + do_relay = addr_is_local(addr); + } + } + if(do_relay){ + psc->rcpt_seen = TRUE; + msg->rcpt_list = g_list_append(msg->rcpt_list, addr); + smtp_printf(out, "250 OK %s is our friend.\r\n", addr->address); + }else{ + smtp_printf(out, "550 relaying to %s denied.\r\n", + addr_string(addr)); + } + }else{ + smtp_printf(out, + "501 recipient address must be qualified.\r\n", buf); + } + }else + smtp_printf(out, "501 %s: no pipe allowed for SMTP connections\r\n", buf); + }else{ + smtp_printf(out, "501 %s: syntax error in address.\r\n", buf); + } + }else{ + + if(!psc->helo_seen) + smtp_printf(out, "503 need HELO or EHLO.\r\n"); + else + smtp_printf(out, "503 need MAIL FROM: before RCPT TO:\r\n"); + } + break; + + case SMTP_DATA: + if(psc->helo_seen && psc->rcpt_seen){ + accept_error err; + + smtp_printf(out, "354 okay, and do not forget the dot\r\n"); + + if((err = accept_message(in, msg, conf.do_save_envelope_to ? ACC_SAVE_ENVELOPE_TO : 0)) + == AERR_OK){ + if(spool_write(msg, TRUE)){ + pid_t pid; + smtp_printf(out, "250 OK id=%s\r\n", msg->uid); + + if(remote_host != NULL) + logwrite(LOG_NOTICE, "%s <= <%s@%s> host=%s with %s\n", + msg->uid, msg->return_path->local_part, + msg->return_path->domain, remote_host, + prot_names[psc->prot]); + else + logwrite(LOG_NOTICE, "%s <= <%s@%s> with %s\n", + msg->uid, msg->return_path->local_part, + msg->return_path->domain, + prot_names[psc->prot]); + + if(!conf.do_queue){ + if((pid = fork()) == 0){ + + if(deliver(msg)) + _exit(EXIT_SUCCESS); + else + _exit(EXIT_FAILURE); + + }else if(pid < 0){ + logwrite(LOG_ALERT, "could not fork for delivery, id = %s", + msg->uid); + } + }else{ + DEBUG(1) debugf("queuing forced by configuration or option.\n"); + } + }else{ + smtp_printf(out, "451 Could not write spool file\r\n"); + return; + } + }else{ + switch(err){ + case AERR_TIMEOUT: + return; + case AERR_EOF: + return; + default: + /* should never happen: */ + smtp_printf(out, "451 Unknown error\r\n"); + return; + } + } + psc->rcpt_seen = psc->from_seen = FALSE; + destroy_message(msg); + msg = NULL; + }else{ + if(!psc->helo_seen) + smtp_printf(out, "503 need HELO or EHLO.\r\n"); + else + smtp_printf(out, "503 need RCPT TO: before DATA\r\n"); + } + break; + case SMTP_QUIT: + smtp_printf(out, "221 goodbye\r\n"); + if(msg != NULL) destroy_message(msg); + return; + case SMTP_RSET: + psc->from_seen = psc->rcpt_seen = FALSE; + if(msg != NULL) + destroy_message(msg); + msg = NULL; + smtp_printf(out, "250 OK\r\n"); + break; + case SMTP_NOOP: + smtp_printf(out, "250 OK\r\n"); + break; + case SMTP_HELP: + { + int i; + + smtp_printf(out, "214-supported commands:\r\n"); + for(i = 0; i < SMTP_NUM_IDS-1; i++){ + smtp_printf(out, "214-%s\r\n", smtp_cmds[i].cmd); + } + smtp_printf(out, "214 %s\r\n", smtp_cmds[i].cmd); + } + break; + default: + smtp_printf(out, "501 command not recognized\r\n"); + DEBUG(1) debugf("command not recognized, was '%s'\n", buffer); + break; + } + } + switch(len){ + case -3: + logwrite(LOG_NOTICE, "connection timed out\n"); + break; + case -2: + logwrite(LOG_NOTICE, "line overflow\n"); + break; + case -1: + logwrite(LOG_NOTICE, "received EOF\n"); + break; + default: + break; + } + } +} +#endif diff -r 000000000000 -r 08114f7dcc23 src/smtp_out.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/smtp_out.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,918 @@ +/* smtp_out.c, Copyright (C) 1999-2001 Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + send bugs to: kurth@innominate.de +*/ + +/* + I always forget these rfc numbers: + RFC 821 (SMTP) + RFC 1869 (ESMTP) + RFC 1870 (ESMTP SIZE) + RFC 2197 (ESMTP PIPELINE) + RFC 2554 (ESMTP AUTH) +*/ + +#include "masqmail.h" +#include "smtp_out.h" +#include "readsock.h" + +#ifdef ENABLE_AUTH + +#ifdef USE_LIB_CRYPTO +#include +#include +#include +#else +#include "md5/global.h" +#include "md5/md5.h" +#include "md5/hmac_md5.h" +#endif + +#include "base64/base64.h" +#endif + +void destroy_smtpbase(smtp_base *psb) +{ + fclose(psb->in); + fclose(psb->out); + + close(psb->sock); + + if(psb->helo_name) g_free(psb->helo_name); + if(psb->buffer) g_free(psb->buffer); + if(psb->auth_names) g_strfreev(psb->auth_names); + + if(psb->auth_name) g_free(psb->auth_name); + if(psb->auth_login) g_free(psb->auth_login); + if(psb->auth_secret) g_free(psb->auth_secret); +} + +gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct) +{ + struct sockaddr_in sname; + int len = sizeof(struct sockaddr_in); + struct hostent *host_entry; + + if(do_correct){ + getsockname(psb->sock, (struct sockaddr *)(&sname), &len); + DEBUG(5) debugf("socket: name.sin_addr = %s\n", inet_ntoa(sname.sin_addr)); + host_entry = + gethostbyaddr((const char *)&(sname.sin_addr), + sizeof(sname.sin_addr), AF_INET); + if(host_entry){ + psb->helo_name = g_strdup(host_entry->h_name); + }else{ + /* we failed to look up our own name. Instead of giving our local hostname, + we may give our IP number to show the server that we are at least + willing to be honest. For the really picky ones.*/ + DEBUG(5) debugf("failed to look up own host name.\n"); + psb->helo_name = g_strdup_printf("[%s]", inet_ntoa(sname.sin_addr)); + } + DEBUG(5) debugf("helo_name = %s\n", psb->helo_name); + } + if(psb->helo_name == NULL){ + psb->helo_name = g_strdup(default_name); + } + return psb->helo_name; +} + +#ifdef ENABLE_AUTH + +gboolean set_auth(smtp_base *psb, gchar *name, gchar *login, gchar *secret) +{ + if((strcasecmp(name, "CRAM-MD5") == 0) || + (strcasecmp(name, "LOGIN") == 0)) { + psb->auth_name = g_strdup(name); + psb->auth_login = g_strdup(login); + psb->auth_secret = g_strdup(secret); + + return TRUE; + } + return FALSE; +} + +#endif + +static +smtp_base *create_smtpbase(gint sock) +{ + gint dup_sock; + + smtp_base *psb = (smtp_base *)g_malloc(sizeof(smtp_base)); + + psb->sock = sock; + + psb->use_esmtp = FALSE; + psb->use_size = FALSE; + psb->use_pipelining = FALSE; + psb->use_auth = FALSE; + + psb->max_size = 0; + psb->auth_names = NULL; + + psb->buffer = (gchar *)g_malloc(SMTP_BUF_LEN); + + dup_sock = dup(sock); + psb->out = fdopen(sock, "w"); + psb->in = fdopen(dup_sock, "r"); + + psb->error = smtp_ok; + + psb->helo_name = NULL; + + psb->auth_name = psb->auth_login = psb->auth_secret = NULL; + + return psb; +} + +static +gboolean read_response(smtp_base *psb, int timeout) +{ + gint buf_pos = 0; + gchar code[5]; + gint i, len; + + do{ + len = read_sockline(psb->in, &(psb->buffer[buf_pos]), + SMTP_BUF_LEN - buf_pos, timeout, READSOCKL_CHUG); + if(len == -3){ + psb->error = smtp_timeout; + return FALSE; + } + else if(len == -2){ + psb->error = smtp_syntax; + return FALSE; + } + else if(len == -1){ + psb->error = smtp_eof; + return FALSE; + } + for(i = 0; i < 4; i++) + code[i] = psb->buffer[buf_pos+i]; + code[i] = 0; + psb->last_code = atoi(code); + + buf_pos += len; + + }while(code[3] == '-'); + + return TRUE; +} + +static +gboolean check_response(smtp_base *psb, gboolean after_data) +{ + char c = psb->buffer[0]; + + if(((c == '2') && !after_data) || ((c == '3') && after_data)){ + psb->error = smtp_ok; + DEBUG(6) debugf("response OK:'%s' after_date = %d\n", psb->buffer, (int)after_data); + return TRUE; + }else{ + if(c == '4') + psb->error = smtp_trylater; + else if(c == '5') + psb->error = smtp_fail; + else + psb->error = smtp_syntax; + DEBUG(6) debugf("response failure:'%s' after_date = %d\n", psb->buffer, (int)after_data); + return FALSE; + } +} + +static +gboolean check_init_response(smtp_base *psb) +{ + if(check_response(psb, FALSE)){ + psb->use_esmtp = (strstr(psb->buffer, "ESMTP") != NULL); + + DEBUG(4) debugf(psb->use_esmtp ? "uses esmtp\n" : "no esmtp\n"); + + return TRUE; + } + return FALSE; +} + +static +gchar *get_response_arg(gchar *response) +{ + gchar buf[SMTP_BUF_LEN]; + gchar *p = response, *q = buf; + + while(*p && (*p != '\n') && isspace(*p)) p++; + if(*p && (*p != '\n')){ + while(*p && (*p != '\n') && (*p != '\r') && (q < buf+SMTP_BUF_LEN-1)) *(q++) = *(p++); + *q = 0; + return g_strdup(buf); + } + return NULL; +} + +static +gboolean check_helo_response(smtp_base *psb) +{ + gchar *ptr = psb->buffer; + + if(!check_response(psb, FALSE)) + return FALSE; + + while(*ptr){ + if(strncasecmp(&(ptr[4]), "SIZE", 4) == 0){ + gchar *arg; + psb->use_size = TRUE; + arg = get_response_arg(&(ptr[8])); + if(arg){ + psb->max_size = atoi(arg); + g_free(arg); + } + } + + if(strncasecmp(&(ptr[4]), "PIPELINING", 10) == 0) + psb->use_pipelining = TRUE; + + if(strncasecmp(&(ptr[4]), "AUTH", 4) == 0){ + if((ptr[8] == ' ') || (ptr[8] == '=') || (ptr[8] == '\t')){ /* not sure about '\t' */ + gchar *arg; + psb->use_auth = TRUE; + arg = get_response_arg(&(ptr[9])); /* after several years I finally learnt to count */ + if(arg){ + psb->auth_names = g_strsplit(arg, " " , 0); + g_free(arg); + + DEBUG(4){ + gint i = 0; + while(psb->auth_names[i]){ + debugf("offered AUTH %s\n", psb->auth_names[i]); + i++; + } + } + } + } + } + + while(*ptr != '\n') ptr++; + ptr++; + } + + DEBUG(4){ + debugf(psb->use_size ? "uses SIZE\n" : "no size\n"); + debugf(psb->use_pipelining ? "uses PIPELINING\n" : "no pipelining\n"); + debugf(psb->use_auth ? "uses AUTH\n" : "no auth\n"); + } + + return TRUE; +} + +static +gboolean smtp_helo(smtp_base *psb, gchar *helo) +{ + while(TRUE){ + if(psb->use_esmtp){ + fprintf(psb->out, "EHLO %s\r\n", helo); fflush(psb->out); + + DEBUG(4) debugf("EHLO %s\r\n", helo); + + }else{ + fprintf(psb->out, "HELO %s\r\n", helo); fflush(psb->out); + + DEBUG(4) debugf("HELO %s\r\n", helo); + + } + + if(!read_response(psb, SMTP_CMD_TIMEOUT)) + return FALSE; + + if(check_helo_response(psb)) + return TRUE; + else{ + if(psb->error == smtp_fail){ + if(psb->use_esmtp){ + /* our guess that server understands EHLO was wrong, + try again with HELO + */ + psb->use_esmtp = FALSE; + }else{ + /* what sort of server ist THAT ?! + give up... + */ + return FALSE; + } + }else + return FALSE; + } + } +} + +static +void smtp_cmd_mailfrom(smtp_base *psb, address *return_path, guint size) +{ + if(psb->use_size){ + fprintf(psb->out, "MAIL FROM:%s SIZE=%d\r\n", + addr_string(return_path), size); + fflush(psb->out); + + DEBUG(4) debugf("MAIL FROM:%s SIZE=%d\r\n", + addr_string(return_path), size); + + }else{ + fprintf(psb->out, "MAIL FROM:%s\r\n", addr_string(return_path)); + fflush(psb->out); + + DEBUG(4) debugf("MAIL FROM:%s\r\n", addr_string(return_path)); + } +} + +static +void smtp_cmd_rcptto(smtp_base *psb, address *rcpt) +{ + fprintf(psb->out, "RCPT TO:%s\r\n", addr_string(rcpt)); + fflush(psb->out); + DEBUG(4) debugf("RCPT TO:%s\n", addr_string(rcpt)); +} + +static +void send_data_line(smtp_base *psb, gchar *data) +{ + /* According to RFC 821 each line should be terminated with CRLF. + Since a dot on a line itself marks the end of data, each line + beginning with a dot is prepended with another dot. + */ + gchar *ptr; + gboolean new_line = TRUE; /* previous versions assumed that each item was + exactly one line. This is no longer the case */ + + ptr = data; + while(*ptr){ + int c = (int)(*ptr); + if(c == '.') + if(new_line) + putc('.', psb->out); + if(c == '\n'){ + putc('\r', psb->out); + putc('\n', psb->out); + new_line = TRUE; + }else{ + putc(c, psb->out); + new_line = FALSE; + } + ptr++; + } +} + +static +void send_header(smtp_base *psb, GList *hdr_list) +{ + GList *node; + gint num_hdrs = 0; + + /* header */ + if(hdr_list){ + foreach(hdr_list, node){ + if(node->data){ + header *hdr = (header *)(node->data); + if(hdr->header){ + send_data_line(psb, hdr->header); + num_hdrs++; + } + } + } + } + + /* empty line separating headers from data: */ + putc('\r', psb->out); + putc('\n', psb->out); + + DEBUG(4) debugf("sent %d headers\n", num_hdrs); +} + +static +void send_data(smtp_base *psb, message *msg) +{ + GList *node; + gint num_lines = 0; + + /* data */ + if(msg->data_list){ + for(node = g_list_first(msg->data_list); node; node = g_list_next(node)){ + if(node->data){ + send_data_line(psb, node->data); + num_lines++; + } + } + } + + DEBUG(4) debugf("sent %d lines of data\n", num_lines); + + fprintf(psb->out, ".\r\n"); + fflush(psb->out); +} + +void smtp_out_mark_rcpts(smtp_base *psb, GList *rcpt_list) +{ + GList *rcpt_node; + for(rcpt_node = g_list_first(rcpt_list); + rcpt_node; + rcpt_node = g_list_next(rcpt_node)){ + address *rcpt = (address *)(rcpt_node->data); + + addr_unmark_delivered(rcpt); + + if((psb->error == smtp_trylater) || (psb->error == smtp_timeout) || + (psb->error == smtp_eof)){ + addr_mark_defered(rcpt); + }else{ + addr_mark_failed(rcpt); + } + } +} + +void smtp_out_log_failure(smtp_base *psb, message *msg) +{ + gchar *err_str; + + if(psb->error == smtp_timeout) + err_str = g_strdup("connection timed out."); + else if(psb->error == smtp_eof) + err_str = g_strdup("connection terminated prematurely."); + else if(psb->error == smtp_syntax) + err_str = g_strdup_printf("got unexpected response: %s", psb->buffer); + else if(psb->error == smtp_cancel) + err_str = g_strdup("delivery was canceled.\n"); + else + /* error message should still be in the buffer */ + err_str = g_strdup_printf("failed: %s\n", psb->buffer); + + if(msg == NULL) + logwrite(LOG_NOTICE, "host=%s %s\n", + psb->remote_host, err_str); + else + logwrite(LOG_NOTICE, "%s == host=%s %s\n", + msg->uid, psb->remote_host, err_str); + + g_free(err_str); +} + +smtp_base *smtp_out_open(gchar *host, gint port, GList *resolve_list) +{ + smtp_base *psb; + gint sock; + mxip_addr *addr; + + DEBUG(5) debugf("smtp_out_open entered, host = %s\n", host); + + if((addr = connect_resolvelist(&sock, host, port, resolve_list))){ + /* create structure to hold status data: */ + psb = create_smtpbase(sock); + psb->remote_host = addr->name; + + DEBUG(5){ + struct sockaddr_in name; + int len = sizeof(struct sockaddr); + getsockname(sock, (struct sockaddr *)(&name), &len); + debugf("socket: name.sin_addr = %s\n", inet_ntoa(name.sin_addr)); + } + return psb; + }else{ + DEBUG(5) debugf("connect_resolvelist failed: %s %s\n", strerror(errno), hstrerror(h_errno)); + } + + return NULL; +} + +smtp_base *smtp_out_open_child(gchar *cmd) +{ + smtp_base *psb; + gint sock; + + DEBUG(5) debugf("smtp_out_open_child entered, cmd = %s\n", cmd); + + sock = child(cmd); + + if(sock > 0){ + psb = create_smtpbase(sock); + psb->remote_host = NULL; + + return psb; + } + + return NULL; +} + +gboolean smtp_out_rset(smtp_base *psb) +{ + gboolean ok; + + fprintf(psb->out, "RSET\r\n"); fflush(psb->out); + DEBUG(4) debugf("RSET\n"); + + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) + if(check_response(psb, FALSE)) + return TRUE; + + smtp_out_log_failure(psb, NULL); + + return FALSE; +} + +#ifdef ENABLE_AUTH + +static +gboolean smtp_out_auth_cram_md5(smtp_base *psb) +{ + gboolean ok = FALSE; + + fprintf(psb->out, "AUTH CRAM-MD5\r\n"); fflush(psb->out); + DEBUG(4) debugf("AUTH CRAM-MD5\n"); + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){ + if((ok = check_response(psb, TRUE))){ + gchar *chall64 = get_response_arg(&(psb->buffer[4])); + gint chall_size; + gchar *chall = base64_decode(chall64, &chall_size); + guchar digest[16], *reply64, *reply; + gchar digest_string[33]; + gint i; +#ifdef USE_LIB_CRYPTO + unsigned int digest_len; +#endif + + DEBUG(5) debugf("encoded challenge = %s\n", chall64); + DEBUG(5) debugf("decoded challenge = %s, size = %d\n", chall, chall_size); + + DEBUG(5) debugf("secret = %s\n", psb->auth_secret); + +#ifdef USE_LIB_CRYPTO + HMAC(EVP_md5(), psb->auth_secret, strlen(psb->auth_secret), chall, chall_size, digest, &digest_len); +#else + hmac_md5(chall, chall_size, psb->auth_secret, strlen(psb->auth_secret), digest); +#endif + + for(i = 0; i < 16; i++) + sprintf(&(digest_string[i+i]), "%02x", (unsigned int)(digest[i])); + digest_string[32] = 0; + + DEBUG(5) debugf("digest = %s\n", digest_string); + + reply = g_strdup_printf("%s %s", psb->auth_login, digest_string); + DEBUG(5) debugf("unencoded reply = %s\n", reply); + + reply64 = base64_encode(reply, strlen(reply)); + DEBUG(5) debugf("encoded reply = %s\n", reply64); + + fprintf(psb->out, "%s\r\n", reply64); fflush(psb->out); + DEBUG(4) debugf("%s\n", reply64); + + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) + ok = check_response(psb, FALSE); + + g_free(reply64); + g_free(reply); + g_free(chall); + g_free(chall64); + } + } + return ok; +} + +static +gboolean smtp_out_auth_login(smtp_base *psb) +{ + gboolean ok = FALSE; + fprintf(psb->out, "AUTH LOGIN\r\n"); fflush(psb->out); + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){ + if((ok = check_response(psb, TRUE))){ + gchar *resp64; + guchar *resp; + gint resp_size; + gchar *reply64; + + resp64 = get_response_arg(&(psb->buffer[4])); + DEBUG(5) debugf("encoded response = %s\n", resp64); + resp = base64_decode(resp64, &resp_size); + g_free(resp64); + DEBUG(5) debugf("decoded response = %s, size = %d\n", + resp, resp_size); + g_free(resp); + reply64 = base64_encode(psb->auth_login, + strlen(psb->auth_login)); + fprintf(psb->out, "%s\r\n", reply64); fflush(psb->out); + g_free(reply64); + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) { + if ((ok = check_response(psb, TRUE))) { + resp64 = get_response_arg(&(psb->buffer[4])); + DEBUG(5) debugf("encoded response = %s\n", resp64); + resp = base64_decode(resp64, &resp_size); + g_free(resp64); + DEBUG(5) debugf("decoded response = %s, size = %d\n", + resp, resp_size); + g_free(resp); + reply64 = base64_encode(psb->auth_secret, + strlen(psb->auth_secret)); + fprintf(psb->out, "%s\r\n", reply64); fflush(psb->out); + g_free(reply64); + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) + ok = check_response(psb, FALSE); + } + } + } + } + return ok; +} + +gboolean smtp_out_auth(smtp_base *psb) +{ + gboolean ok = FALSE; + gint i = 0; + while(psb->auth_names[i]){ + if(strcasecmp(psb->auth_names[i], psb->auth_name) == 0) + break; + i++; + } + if(psb->auth_names[i]){ + if(strcasecmp(psb->auth_name, "cram-md5") == 0){ + smtp_out_auth_cram_md5(psb); + }else if(strcasecmp(psb->auth_name, "login") == 0){ + smtp_out_auth_login(psb); + }else{ + logwrite(LOG_ERR, "auth method %s not supported\n", psb->auth_name); + } + }else{ + logwrite(LOG_ERR, "no auth method %s found.\n", psb->auth_name); + } + return ok; +} + +#endif + +gboolean smtp_out_init(smtp_base *psb) +{ + gboolean ok; + + if((ok = read_response(psb, SMTP_INITIAL_TIMEOUT))){ + if((ok = check_init_response(psb))){ + + if((ok = smtp_helo(psb, psb->helo_name))){ +#ifdef ENABLE_AUTH + if(psb->auth_name && psb->use_auth){ + /* we completely disregard the response of server here. If + authentication fails, the server will complain later + anyway. I know, this is not polite... */ + smtp_out_auth(psb); + } +#endif + } + } + } + if(!ok) + smtp_out_log_failure(psb, NULL); + return ok; +} + +gint smtp_out_msg(smtp_base *psb, + message *msg, address *return_path, GList *rcpt_list, + GList *hdr_list) +{ + gint i, size; + gboolean ok = TRUE; + int rcpt_cnt; + int rcpt_accept = 0; + + DEBUG(5) debugf("smtp_out_msg entered\n"); + + /* defaults: */ + if(return_path == NULL) + return_path = msg->return_path; + if(hdr_list == NULL) + hdr_list = msg->hdr_list; + if(rcpt_list == NULL) + rcpt_list = msg->rcpt_list; + rcpt_cnt = g_list_length(rcpt_list); + + size = msg_calc_size(msg, TRUE); + + /* respect maximum size given by server: */ + if((psb->max_size > 0) && (size > psb->max_size)){ + logwrite(LOG_WARNING, + "%s == host=%s message size (%d) > fixed maximum message size of server (%d)", + msg->uid, psb->remote_host, size, psb->max_size); + psb->error = smtp_cancel; + ok = FALSE; + } + + if(ok){ + smtp_cmd_mailfrom(psb, return_path, + psb->use_size ? + size + SMTP_SIZE_ADD : 0); + + if(!psb->use_pipelining){ + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) + ok = check_response(psb, FALSE); + } + } + if(ok){ + GList *rcpt_node; + rcpt_accept = 0; + + for(rcpt_node = g_list_first(rcpt_list); + rcpt_node != NULL; + rcpt_node = g_list_next(rcpt_node)){ + address *rcpt = (address *)(rcpt_node->data); + smtp_cmd_rcptto(psb, rcpt); + if(!psb->use_pipelining){ + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))) + if(check_response(psb, FALSE)){ + rcpt_accept++; + addr_mark_delivered(rcpt); + } + else{ + /* if server returned an error for one recp. we + may still try the others. But if it is a timeout, eof + or unexpected response, it is more serious and we should + give up. */ + if((psb->error != smtp_trylater) && + (psb->error != smtp_fail)){ + ok = FALSE; + break; + }else{ + logwrite(LOG_NOTICE, "%s == %s host=%s failed: %s", + msg->uid, addr_string(rcpt), + psb->remote_host, psb->buffer); + if(psb->error == smtp_trylater){ + addr_mark_defered(rcpt); + }else{ + addr_mark_failed(rcpt); + } + } + } + else + break; + } + } + + /* There is no point in going on if no recp.s were accpted. + But we can check that at this point only if not pipelining: */ + ok = (ok && (psb->use_pipelining || (rcpt_accept > 0))); + if(ok){ + + fprintf(psb->out, "DATA\r\n"); fflush(psb->out); + + DEBUG(4) debugf("DATA\r\n"); + + if(psb->use_pipelining){ + /* the first pl'ed command was MAIL FROM + the last was DATA, whose response can be handled by the 'normal' code + all in between were RCPT TO: + */ + /* response to MAIL FROM: */ + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){ + if((ok = check_response(psb, FALSE))){ + + /* response(s) to RCPT TO: + this is very similar to the sequence above for no pipeline + */ + for(i = 0; i < rcpt_cnt; i++){ + if((ok = read_response(psb, SMTP_CMD_TIMEOUT))){ + address *rcpt = g_list_nth_data(rcpt_list, i); + if(check_response(psb, FALSE)){ + rcpt_accept++; + addr_mark_delivered(rcpt); + } + else{ + /* if server returned an error 4xx or 5xx for one recp. we + may still try the others. But if it is a timeout, eof + or unexpected response, it is more serious and we + should give up. */ + if((psb->error != smtp_trylater) && + (psb->error != smtp_fail)){ + ok = FALSE; + break; + }else{ + logwrite(LOG_NOTICE, "%s == %s host=%s failed: %s", + msg->uid, addr_string(rcpt), + psb->remote_host, psb->buffer); + if(psb->error == smtp_trylater){ + addr_mark_defered(rcpt); + }else{ + addr_mark_failed(rcpt); + } + } + } + }else{ + DEBUG(5) debugf("check_response failed after RCPT TO\n"); + break; + } + } + if(rcpt_accept == 0) + ok = FALSE; + }else{ + DEBUG(5) debugf("check_response failed after MAIL FROM\n"); + } + }else{ + DEBUG(5) debugf("read_response failed after MAIL FROM\n"); + } + } /* if(psb->use_pipelining) */ + + /* response to the DATA cmd */ + if(ok){ + if(read_response(psb, SMTP_DATA_TIMEOUT)){ + if(check_response(psb, TRUE)){ + send_header(psb, hdr_list); + send_data(psb, msg); + + if(read_response(psb, SMTP_FINAL_TIMEOUT)) + ok = check_response(psb, FALSE); + } + } + } + } + } + + DEBUG(5){ + debugf("psb->error = %d\n", psb->error); + debugf("ok = %d\n", ok); + debugf("rcpt_accept = %d\n", rcpt_accept); + } + + if(psb->error == smtp_ok){ + GList *rcpt_node; + for(rcpt_node = g_list_first(rcpt_list); + rcpt_node; + rcpt_node = g_list_next(rcpt_node)){ + address *rcpt = (address *)(rcpt_node->data); + if(addr_is_delivered(rcpt)) + logwrite(LOG_NOTICE, "%s => %s host=%s with %s\n", + msg->uid, addr_string(rcpt), psb->remote_host, + psb->use_esmtp ? "esmtp" : "smtp"); + } + }else{ + /* if something went wrong, + we have to unmark the rcpts prematurely marked as delivered + and mark the status */ + smtp_out_mark_rcpts(psb, rcpt_list); + + /* log the failure: */ + smtp_out_log_failure(psb, msg); + } + return rcpt_accept; +} + +gboolean smtp_out_quit(smtp_base *psb) +{ + fprintf(psb->out, "QUIT\r\n"); fflush(psb->out); + + DEBUG(4) debugf("QUIT\n"); + + signal(SIGALRM, SIG_DFL); + + return TRUE; +} + +gint smtp_deliver(gchar *host, gint port, GList *resolve_list, + message *msg, + address *return_path, + GList *rcpt_list) +{ + smtp_base *psb; + smtp_error err; + + DEBUG(5) debugf("smtp_deliver entered\n"); + + if(return_path == NULL) + return_path = msg->return_path; + + if((psb = smtp_out_open(host, port, resolve_list))){ + set_heloname(psb, return_path->domain, TRUE); + /* initiate connection, send message and quit: */ + if(smtp_out_init(psb)){ + smtp_out_msg(psb, msg, return_path, rcpt_list, NULL); + if(psb->error == smtp_ok || + (psb->error == smtp_fail) || + (psb->error == smtp_trylater) || + (psb->error == smtp_syntax) || + (psb->error == smtp_cancel)) + + smtp_out_quit(psb); + } + + err = psb->error; + destroy_smtpbase(psb); + + return err; + } + return -1; +} diff -r 000000000000 -r 08114f7dcc23 src/smtp_out.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/smtp_out.h Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,91 @@ +/* smtp_out.h, Copyright (C) Oliver Kurth, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include + +#define SMTP_BUF_LEN 1024 +#define SMTP_SIZE_ADD 1024 + +#define SMTP_INITIAL_TIMEOUT 5*60 +#define SMTP_CMD_TIMEOUT 5*60 +#define SMTP_DATA_TIMEOUT 5*60 +#define SMTP_FINAL_TIMEOUT 10*60 + +typedef +enum _smtp_error{ + smtp_ok = 0, /* mail was delivered to at least one recpient */ + smtp_trylater, /* server responded with 4xx */ + smtp_fail, /* server responded with 5xx */ + smtp_timeout, /* connection timed out */ + smtp_eof, /* got unexpected EOF */ + smtp_syntax, /* unexpected response */ + smtp_cancel /* we gave up (eg. size) */ +} smtp_error; + + +typedef +struct _smtp_base{ + FILE *in; + FILE *out; + + gint sock; + gint dup_sock; + + gchar *remote_host; + gchar *helo_name; + + gchar *buffer; + gint last_code; + + gboolean use_esmtp; + gboolean use_size; + gboolean use_pipelining; + gboolean use_auth; + + gint max_size; + + gchar **auth_names; + + gchar *auth_name; + gchar *auth_login; + gchar *auth_secret; + + smtp_error error; + +} smtp_base; + +gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct); +gboolean set_auth(smtp_base *psb, gchar *name, gchar *login, gchar *secret); +void destroy_smtpbase(smtp_base *psb); +smtp_base *smtp_out_open(gchar *host, gint port, GList *resolve_list); +smtp_base *smtp_out_open_child(gchar *cmd); +gboolean smtp_out_rset(smtp_base *psb); +gboolean smtp_out_init(smtp_base *psb); +gint smtp_out_msg(smtp_base *psb, + message *msg, address *return_path, + GList *rcpt_list, GList *hdr_list); +gboolean smtp_out_quit(smtp_base *psb); + +gint smtp_deliver(gchar *host, gint port, GList *resolve_list, + message *msg, + address *return_path, + GList *rcpt_list); diff -r 000000000000 -r 08114f7dcc23 src/smtpsend.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/smtpsend.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,114 @@ +/* MasqMail + Copyright (C) 1999 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include + +#include + +#include "masqmail.h" +#include "smtp_out.h" + +masqmail_conf conf; + +extern char *optarg; +extern int optind, opterr, optopt; + +void logwrite(int pri, const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + vfprintf(stdout, fmt, args); + + va_end(args); +} + +void debugf(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + vfprintf(stdout, fmt, args); + + va_end(args); +} + +int +main(int argc, char *argv[]) +{ + gchar *helo_name = g_malloc(64); + gchar *server_name = g_strdup("localhost"); + gint server_port = 25; + GList *resolve_list = g_list_append(NULL, resolve_byname); + + gethostname(helo_name, 63); + + conf.host_name = g_strdup(helo_name); + + while(1){ + int c; + c = getopt(argc, argv, "d:p:s:H:"); + if(c == -1) + break; + switch(c){ + case 'd': + conf.debug_level = atoi(optarg); + break; + case 'p': + server_port = atoi(optarg); + break; + case 's': + g_free(server_name); + server_name = g_strdup(optarg); + break; + case 'H': + g_free(helo_name); + helo_name = g_strdup(optarg); + break; + default: + break; + } + } + + if (optind < argc){ + gint ret; + message *msg = create_message(); + + while (optind < argc){ + msg->rcpt_list = + g_list_append(msg->rcpt_list, + create_address_qualified(argv[optind++], TRUE, conf.host_name)); + } + + if((ret = accept_message(stdin, msg, ACC_NODOT_TERM|ACC_HEAD_FROM_RCPT)) == AERR_OK){ + if((ret = smtp_deliver(server_name, server_port, resolve_list, msg, NULL, NULL)) == smtp_ok){ + exit(EXIT_SUCCESS); + } + fprintf(stderr, "deliver failed: %d\n", ret); + } + fprintf(stderr, "accept failed: %d\n", ret); + exit(ret); + }else{ + fprintf(stderr, "no recipients given.\n"); + exit(-1); + } +} diff -r 000000000000 -r 08114f7dcc23 src/spool.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/spool.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,437 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include +#include "dotlock.h" + +static +gint read_line(FILE *in, gchar *buf, gint buf_len) +{ + gint p = 0; + gint c; + + while((c = getc(in)) != '\n' && (c != EOF)){ + if(p >= buf_len-1) { return 0; } + buf[p++] = c; + } + + if(c == EOF){ + return -1; + } + if((p > 0) && (buf[p-1] == '\r')) + p--; + buf[p++] = '\n'; + buf[p] = 0; + + return p; +} + +static +void spool_write_rcpt(FILE *out, address *rcpt) +{ + gchar dlvrd_char = addr_is_delivered(rcpt) ? 'X' : (addr_is_failed(rcpt) ? 'F' : ' '); + + if(rcpt->local_part[0] != '|'){ + /* this is a paranoid check, in case it slipped through: */ + /* if this happens, it is a bug */ + if(rcpt->domain == NULL){ + logwrite(LOG_WARNING, "BUG: null domain for address %s, setting to %s\n", + rcpt->local_part, conf.host_name); + logwrite(LOG_WARNING, "please report this bug.\n"); + rcpt->domain = g_strdup(conf.host_name); + } + fprintf(out, "RT:%c%s\n", dlvrd_char, addr_string(rcpt)); + }else{ + fprintf(out, "RT:%c%s\n", dlvrd_char, rcpt->local_part); + } +} + +static +address *spool_scan_rcpt(gchar *line) +{ + address *rcpt = NULL; + + if(line[3] != 0){ + if(line[4] != '|'){ + rcpt = create_address(&(line[4]), TRUE); + }else{ + rcpt = create_address_pipe(&(line[4])); + } + if(line[3] == 'X'){ + addr_mark_delivered(rcpt); + }else if(line[3] == 'F'){ + addr_mark_failed(rcpt); + } + } + return rcpt; +} + +gboolean spool_read_data(message *msg) +{ + FILE *in; + gboolean ok = FALSE; + gchar *spool_file; + + DEBUG(5) debugf("spool_read_data entered\n"); + spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid); + DEBUG(5) debugf("reading data spool file '%s'\n", spool_file); + if((in = fopen(spool_file, "r"))){ + char buf[MAX_DATALINE]; + int len; + + /* msg uid */ + read_line(in, buf, MAX_DATALINE); + + /* data */ + msg->data_list = NULL; + while((len = read_line(in, buf, MAX_DATALINE)) > 0){ + msg->data_list = g_list_prepend(msg->data_list, g_strdup(buf)); + } + msg->data_list = g_list_reverse(msg->data_list); + fclose(in); + ok = TRUE; + }else + logwrite(LOG_ALERT, "could not open spool data file %s: %s\n", + spool_file, strerror(errno)); + return ok; +} + +gboolean spool_read_header(message *msg) +{ + FILE *in; + gboolean ok = FALSE; + gchar *spool_file; + + /* header spool: */ + spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid); + if((in = fopen(spool_file, "r"))){ + header *hdr = NULL; + char buf[MAX_DATALINE]; + int len; + + /* msg uid */ + read_line(in, buf, MAX_DATALINE); + + /* envelope header */ + while((len = read_line(in, buf, MAX_DATALINE)) > 0){ + if(buf[0] == '\n') + break; + else if(strncasecmp(buf, "MF:", 3) == 0){ + msg->return_path = create_address(&(buf[3]), TRUE); + DEBUG(3) debugf("spool_read: MAIL FROM: %s", + msg->return_path->address); + }else if(strncasecmp(buf, "RT:", 3) == 0){ + address *addr; + addr = spool_scan_rcpt(buf); + if(!addr_is_delivered(addr) && !addr_is_failed(addr)){ + msg->rcpt_list = g_list_append(msg->rcpt_list, addr); + }else{ + msg->non_rcpt_list = g_list_append(msg->non_rcpt_list, addr); + } + }else if(strncasecmp(buf, "PR:", 3) == 0){ + prot_id i; + for(i = 0; i < PROT_NUM; i++){ + if(strncasecmp(prot_names[i], &(buf[3]), + strlen(prot_names[i])) == 0){ + break; + } + } + msg->received_prot = i; + }else if(strncasecmp(buf, "RH:", 3) == 0){ + g_strchomp(buf); + msg->received_host = g_strdup(&(buf[3])); + }else if(strncasecmp(buf, "ID:", 3) == 0){ + g_strchomp(buf); + msg->ident = g_strdup(&(buf[3])); + }else if(strncasecmp(buf, "DS:", 3) == 0){ + msg->data_size = atoi(&(buf[3])); + }else if(strncasecmp(buf, "TR:", 3) == 0){ + msg->received_time = (time_t)(atoi(&(buf[3]))); + }else if(strncasecmp(buf, "TW:", 3) == 0){ + msg->warned_time = (time_t)(atoi(&(buf[3]))); + } + /* so far ignore other tags */ + } + + /* mail headers */ + while((len = read_line(in, buf, MAX_DATALINE)) > 0){ + if(strncasecmp(buf, "HD:", 3) == 0){ + hdr = get_header(&(buf[3])); + msg->hdr_list = g_list_append(msg->hdr_list, hdr); + }else if((buf[0] == ' ' || buf[0] == '\t') && hdr){ + char *tmp = hdr->header; + /* header continuation */ + hdr->header = g_strconcat(hdr->header, buf, NULL); + hdr->value = hdr->header + (hdr->value - tmp); + }else + break; + } + fclose(in); + ok = TRUE; + }else + logwrite(LOG_ALERT, "could not open spool header file %s: %s\n", + spool_file, strerror(errno)); + return ok; +} + +message *msg_spool_read(gchar *uid, gboolean do_readdata) +{ + message *msg; + gboolean ok = FALSE; + + msg = create_message(); + msg->uid = g_strdup(uid); + + /* header spool: */ + ok = spool_read_header(msg); + if(ok && do_readdata){ + /* data spool: */ + ok = spool_read_data(msg); + } + return msg; +} + +/* write header. uid and gid should already be set to the + mail ids. Better call spool_write(msg, FALSE). +*/ +static +gboolean spool_write_header(message *msg) +{ + GList *node; + gchar *spool_file, *tmp_file; + FILE *out; + gboolean ok = TRUE; + + /* header spool: */ + tmp_file = g_strdup_printf("%s/input/%d-H.tmp", conf.spool_dir, getpid()); + DEBUG(4) debugf("tmp_file = %s\n", tmp_file); + + if((out = fopen(tmp_file, "w"))){ + DEBUG(6) debugf("opened tmp_file %s\n", tmp_file); + + fprintf(out, "%s\n", msg->uid); + fprintf(out, "MF:%s\n", addr_string(msg->return_path)); + + DEBUG(6) debugf("after MF\n"); + foreach(msg->rcpt_list, node){ + address *rcpt = (address *)(node->data); + spool_write_rcpt(out, rcpt); + } + foreach(msg->non_rcpt_list, node){ + address *rcpt = (address *)(node->data); + spool_write_rcpt(out, rcpt); + } + DEBUG(6) debugf("after RT\n"); + fprintf(out, "PR:%s\n", prot_names[msg->received_prot]); + if(msg->received_host != NULL) + fprintf(out, "RH:%s\n", msg->received_host); + + if(msg->ident != NULL) + fprintf(out, "ID:%s\n", msg->ident); + + if(msg->data_size >= 0) + fprintf(out, "DS: %d\n", msg->data_size); + + if(msg->received_time > 0) + fprintf(out, "TR: %u\n", (int)(msg->received_time)); + + if(msg->warned_time > 0) + fprintf(out, "TW: %u\n", (int)(msg->warned_time)); + + DEBUG(6) debugf("after RH\n"); + fprintf(out, "\n"); + + foreach(msg->hdr_list, node){ + header *hdr = (header *)(node->data); + fprintf(out, "HD:%s", hdr->header); + } + if(fflush(out) == EOF) ok = FALSE; + else if(fdatasync(fileno(out)) != 0){ + if(errno != EINVAL) /* some fs do not support this.. + I hope this also means that it is not necessary */ + ok = FALSE; + } + fclose(out); + if(ok){ + spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid); + DEBUG(4) debugf("spool_file = %s\n", spool_file); + ok = (rename(tmp_file, spool_file) != -1); + g_free(spool_file); + } + }else{ + logwrite(LOG_ALERT, "could not open temporary header spool file '%s': %s\n", tmp_file, strerror(errno)); + DEBUG(1) debugf("euid = %d, egid = %d\n", geteuid(), getegid()); + ok = FALSE; + } + + g_free(tmp_file); + + return ok; +} + +gboolean spool_write(message *msg, gboolean do_write_data) +{ + GList *list; + gchar *spool_file, *tmp_file; + FILE *out; + gboolean ok = TRUE; + uid_t saved_uid, saved_gid; + /* user can read/write, group can read, others cannot do anything: */ + mode_t saved_mode = saved_mode = umask(026); + + /* set uid and gid to the mail ids */ + if(!conf.run_as_user){ + set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); + } + + /* header spool: */ + ok = spool_write_header(msg); + + if(ok){ + + if(do_write_data){ + /* data spool: */ + tmp_file = g_strdup_printf("%s/input/%d-D.tmp", + conf.spool_dir, getpid()); + DEBUG(4) debugf("tmp_file = %s\n", tmp_file); + + if((out = fopen(tmp_file, "w"))){ + fprintf(out, "%s\n", msg->uid); + for(list = g_list_first(msg->data_list); + list != NULL; + list = g_list_next(list)){ + fprintf(out, "%s", (gchar *)(list->data)); + } + + /* possibly paranoid ;-) */ + if(fflush(out) == EOF) ok = FALSE; + else if(fdatasync(fileno(out)) != 0){ + if(errno != EINVAL) /* some fs do not support this.. + I hope this also means that it is not necessary */ + ok = FALSE; + } + fclose(out); + if(ok){ + spool_file = g_strdup_printf("%s/input/%s-D", + conf.spool_dir, msg->uid); + DEBUG(4) debugf("spool_file = %s\n", spool_file); + ok = (rename(tmp_file, spool_file) != -1); + g_free(spool_file); + } + }else{ + logwrite(LOG_ALERT, "could not open temporary data spool file: %s\n", + strerror(errno)); + ok = FALSE; + } + g_free(tmp_file); + } + } + + /* set uid and gid back */ + if(!conf.run_as_user){ + set_euidgid(saved_uid, saved_gid, NULL, NULL); + } + + umask(saved_mode); + + return ok; +} + +#define MAX_LOCKAGE 300 + +gboolean spool_lock(gchar *uid) +{ + uid_t saved_uid, saved_gid; + gchar *hitch_name; + gchar *lock_name; + gboolean ok = FALSE; + + hitch_name = g_strdup_printf("%s/%s-%d.lock", conf.lock_dir, uid, getpid()); + lock_name = g_strdup_printf("%s/%s.lock", conf.lock_dir, uid); + + /* set uid and gid to the mail ids */ + if(!conf.run_as_user){ + set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); + } + + ok = dot_lock(lock_name, hitch_name); + if(!ok) logwrite(LOG_WARNING, "spool file %s is locked\n", uid); + + /* set uid and gid back */ + if(!conf.run_as_user){ + set_euidgid(saved_uid, saved_gid, NULL, NULL); + } + + g_free(lock_name); + g_free(hitch_name); + + return ok; +} + +gboolean spool_unlock(gchar *uid) +{ + uid_t saved_uid, saved_gid; + gchar *lock_name; + + /* set uid and gid to the mail ids */ + if(!conf.run_as_user){ + set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); + } + + lock_name = g_strdup_printf("%s/%s.lock", conf.lock_dir, uid); + dot_unlock(lock_name); + g_free(lock_name); + + /* set uid and gid back */ + if(!conf.run_as_user){ + set_euidgid(saved_uid, saved_gid, NULL, NULL); + } + return TRUE; +} + +gboolean spool_delete_all(message *msg) +{ + uid_t saved_uid, saved_gid; + gchar *spool_file; + + /* set uid and gid to the mail ids */ + if(!conf.run_as_user){ + set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); + } + + /* header spool: */ + spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid); + if(unlink(spool_file) != 0) + logwrite(LOG_ALERT, "could not delete spool file %s: %s\n", + spool_file, strerror(errno)); + g_free(spool_file); + + /* data spool: */ + spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid); + if(unlink(spool_file) != 0) + logwrite(LOG_ALERT, "could not delete spool file %s: %s\n", + spool_file, strerror(errno)); + g_free(spool_file); + + /* set uid and gid back */ + if(!conf.run_as_user){ + set_euidgid(saved_uid, saved_gid, NULL, NULL); + } + return TRUE; +} diff -r 000000000000 -r 08114f7dcc23 src/tables.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/tables.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,138 @@ +/* MasqMail + Copyright (C) 1999-2001 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "masqmail.h" +#include + +table_pair *create_pair(gchar *key, gpointer value) +{ + table_pair *pair; + + pair = g_malloc(sizeof(table_pair)); + pair->key = g_strdup(key); + pair->value = value; + + return pair; +} + +table_pair *create_pair_string(gchar *key, gpointer value) +{ + table_pair *pair; + + pair = g_malloc(sizeof(table_pair)); + pair->key = g_strdup(key); + pair->value = (gpointer)(g_strdup(value)); + + return pair; +} + +table_pair *parse_table_pair(gchar *line, char delim) +{ + gchar buf[256]; + gchar *p, *q; + table_pair *pair; + + p = line; + q = buf; + while((*p != 0) && (*p != delim) && q < buf+255) + *(q++) = *(p++); + *q = 0; + + pair = g_malloc(sizeof(table_pair)); + pair->key = g_strdup(g_strstrip(buf)); + + if(*p){ + p++; + /* while(isspace(*p)) p++; */ + pair->value = (gpointer *)(g_strdup(g_strstrip(p))); + }else + pair->value = (gpointer *)g_strdup(""); + + return pair; +} + +gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func)(const char *, const char *)) +{ + GList *node; + + foreach(table_list, node){ + table_pair *pair = (table_pair *)(node->data); + if(cmp_func(pair->key, key) == 0) + return pair->value; + } + return NULL; +} + +gpointer *table_find(GList *table_list, gchar *key) +{ + return table_find_func(table_list, key, strcmp); +} + +gpointer *table_find_case(GList *table_list, gchar *key) +{ + return table_find_func(table_list, key, strcasecmp); +} + +static +int fnmatch0(const char *pattern, const char *string) +{ + return fnmatch(pattern, string, 0); +} + +gpointer *table_find_fnmatch(GList *table_list, gchar *key) +{ + return table_find_func(table_list, key, fnmatch0); +} + +GList *table_read(gchar *fname, gchar delim) +{ + GList *list = NULL; + FILE *fptr; + + if((fptr = fopen(fname, "rt"))){ + gchar buf[256]; + + while(fgets(buf, 255, fptr)){ + if(buf[0] && (buf[0] != '#') && (buf[0] != '\n')){ + table_pair *pair; + g_strchomp(buf); + pair = parse_table_pair(buf, delim); + list = g_list_append(list, pair); + } + } + fclose(fptr); + return list; + } + logwrite(LOG_ALERT, "could not open table file %s: %s\n", fname, strerror(errno)); + + return NULL; +} + +void destroy_table(GList *table) +{ + GList *node; + + foreach(table, node){ + table_pair *p = (table_pair *)(node->data); + g_free(p->key); + g_free(p->value); + g_free(p); + } + g_list_free(table); +} + diff -r 000000000000 -r 08114f7dcc23 src/timeival.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/timeival.c Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,54 @@ +/* MasqMail + Copyright (C) 1999-2002 Oliver Kurth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include + +#include "masqmail.h" + +gint time_interval(gchar *str, gint *pos) +{ + gchar buf[16]; + gchar *p = str, *q = buf; + gint factor = 1, val; + + while(*p && isdigit(*p) && (q < buf+15)){ + *(q++) = *(p++); + (*pos)++; + } + (*pos)++; + *q = 0; + val = atoi(buf); + + /* fall through: */ + switch(*p){ + case 'w': + factor *= 7; + case 'd': + factor *= 24; + case 'h': + factor *= 60; + case 'm': + factor *= 60; + case 's': + break; + default: + return -1; + } + return val * factor; +} diff -r 000000000000 -r 08114f7dcc23 suse/masqmail --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suse/masqmail Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,83 @@ +#! /bin/sh +# Author: Oliver Kurth +# +# /sbin/init.d/masqmail +# + +. /etc/rc.config + +# Determine the base and follow a runlevel link name. +base=${0##*/} +link=${base#*[SK][0-9][0-9]} + +# Force execution if not called by a runlevel directory. +test $link = $base && SMTP=yes +test "$SMTP" = yes || exit 0 + +if test -z "$MASQMAIL_ARGS" ; then + MASQMAIL_ARGS="-bd -q30m" +fi + +# The echo return value for success (defined in /etc/rc.config). +return=$rc_done +case "$1" in + start) + echo -n "Starting SMTP (MasqMail)" + ## Start daemon with startproc(8). If this fails + ## the echo return value is set appropriate. + + startproc /usr/sbin/sendmail $MASQMAIL_ARGS || return=$rc_failed + + echo -e "$return" + ;; + stop) + echo -n "Shutting down SMTP (MasqMail)" + ## Stop daemon with killproc(8) and if this fails + ## set echo the echo return value. + + killproc -TERM /usr/sbin/sendmail || return=$rc_failed + + echo -e "$return" + ;; + restart) + ## If first returns OK call the second, if first or + ## second command fails, set echo return value. + $0 stop && $0 start || return=$rc_failed + ;; + reload) + ## Choose ONE of the following two cases: + + ## First possibility: A few services accepts a signal + ## to reread the (changed) configuration. + + #echo -n "Reload service MasqMail" + #killproc -HUP /usr/sbin/sendmail || return=$rc_failed + #echo -e "$return" + + ## Exclusive possibility: Some services must be stopped + ## and started to force a new load of the configuration. + + $0 stop && $0 start || return=$rc_failed + ;; + status) + echo -n "Checking for service SMTP (MasqMail): " + ## Check status with checkproc(8), if process is running + ## checkproc will return with exit status 0. + + checkproc /usr/sbin/sendmail && echo OK || echo No process + ;; +# probe) + ## Optional: Probe for the necessity of a reload, + ## give out the argument which is required for a reload. + +# test /usr/exim/configure -nt /var/lock/exim.pid && echo reload +# ;; + *) + echo "Usage: $0 {start|stop|status|restart|reload|probe}" + exit 1 + ;; +esac + +# Inform the caller not only verbosely and set an exit status. +test "$return" = "$rc_done" || exit 1 +exit 0 diff -r 000000000000 -r 08114f7dcc23 suse/masqmail.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suse/masqmail.spec Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,124 @@ +Summary: An offline mail server with pop3 client support +Name: masqmail +Version: 0.2.21 +Release: 1 +Copyright: GPL +Group: Networking/Daemons +Distribution: innominate +Packager: Oliver Kurth +Source: http://masqmail.cx/masqmail/download/masqmail-0.2.21.tar.gz +BuildRoot: /var/tmp/masqmail-root/ + +%description +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. + +%prep + +%setup -n masqmail-0.2.21 + +%build +# +#choose a line or a combination: +# +#CFLAGS="$RPM_OPT_FLAGS" ./configure --disable-pop3 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-ident +CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth --enable-ident + +CFLAGS="$RPM_OPT_FLAGS" make + +%install +if [ -d $RPM_BUILD_ROOT ] ; then + rm -rf $RPM_BUILD_ROOT +fi + +# setup directory environment: +mkdir $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/lock +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl +mkdir -p $RPM_BUILD_ROOT/usr/sbin +mkdir -p $RPM_BUILD_ROOT/usr/bin +mkdir -p $RPM_BUILD_ROOT/usr/lib +mkdir -p $RPM_BUILD_ROOT/etc +mkdir -p $RPM_BUILD_ROOT/etc/masqmail +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl +mkdir -p $RPM_BUILD_ROOT/var/masqmail + +# install +make DESTDIR=$RPM_BUILD_ROOT install +/usr/bin/strip --remove-section=.comment --remove-section=.note --strip-unneeded $RPM_BUILD_ROOT/usr/sbin/masqmail + +# sendmail links +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailrm +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail + +# SuSE specific startup stuff: +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/ +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc2.d/ +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc3.d/ +cp -p suse/masqmail $RPM_BUILD_ROOT/sbin/init.d/ +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/S20masqmail +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/K20masqmail +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/S20masqmail +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/K20masqmail +ln -fs '../../sbin/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail + +# configuration examples: +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/masqmail/ +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/ +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/ +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl/ + +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/ +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/ + +# gzip the man pages: +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5 + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +/usr/sbin/masqmail +/usr/sbin/sendmail +/usr/bin/mailq +/usr/bin/mailrm +/usr/lib/sendmail +%config /sbin/init.d/masqmail +/sbin/init.d/rc2.d/S20masqmail +/sbin/init.d/rc2.d/K20masqmail +/sbin/init.d/rc3.d/S20masqmail +/sbin/init.d/rc3.d/K20masqmail +/usr/sbin/rcmasqmail +%config /etc/masqmail/masqmail.conf +%config /etc/masqmail/tpl/failmsg.tpl +%doc README INSTALL COPYING NEWS +/usr/man/man8/masqmail.8.gz +/usr/man/man5/masqmail.conf.5.gz +/usr/man/man5/masqmail.route.5.gz +/usr/man/man5/masqmail.get.5.gz +/usr/man/man5/masqmail.aliases.5.gz + +%defattr(-,mail,trusted) +%dir /var/masqmail/ +%dir /var/spool/masqmail/ +%dir /var/spool/masqmail/popuidl/ +%dir /var/spool/masqmail/lock/ +%dir /var/spool/masqmail/input/ + + diff -r 000000000000 -r 08114f7dcc23 suse/masqmail.spec.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suse/masqmail.spec.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,124 @@ +Summary: An offline mail server with pop3 client support +Name: masqmail +Version: @VERSION@ +Release: 1 +Copyright: GPL +Group: Networking/Daemons +Distribution: innominate +Packager: Oliver Kurth +Source: http://masqmail.cx/masqmail/download/masqmail-@VERSION@.tar.gz +BuildRoot: /var/tmp/masqmail-root/ + +%description +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. + +%prep + +%setup -n masqmail-@VERSION@ + +%build +# +#choose a line or a combination: +# +#CFLAGS="$RPM_OPT_FLAGS" ./configure --disable-pop3 +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth +#CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-ident +CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-auth --enable-ident + +CFLAGS="$RPM_OPT_FLAGS" make + +%install +if [ -d $RPM_BUILD_ROOT ] ; then + rm -rf $RPM_BUILD_ROOT +fi + +# setup directory environment: +mkdir $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/input +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/lock +mkdir -p $RPM_BUILD_ROOT/var/spool/masqmail/popuidl +mkdir -p $RPM_BUILD_ROOT/usr/sbin +mkdir -p $RPM_BUILD_ROOT/usr/bin +mkdir -p $RPM_BUILD_ROOT/usr/lib +mkdir -p $RPM_BUILD_ROOT/etc +mkdir -p $RPM_BUILD_ROOT/etc/masqmail +mkdir -p $RPM_BUILD_ROOT/etc/masqmail/tpl +mkdir -p $RPM_BUILD_ROOT/var/masqmail + +# install +make DESTDIR=$RPM_BUILD_ROOT install +/usr/bin/strip --remove-section=.comment --remove-section=.note --strip-unneeded $RPM_BUILD_ROOT/usr/sbin/masqmail + +# sendmail links +ln -fs './masqmail' $RPM_BUILD_ROOT/usr/sbin/sendmail +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailq +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/bin/mailrm +ln -fs '../sbin/masqmail' $RPM_BUILD_ROOT/usr/lib/sendmail + +# SuSE specific startup stuff: +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/ +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc2.d/ +mkdir -p $RPM_BUILD_ROOT/sbin/init.d/rc3.d/ +cp -p suse/masqmail $RPM_BUILD_ROOT/sbin/init.d/ +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/S20masqmail +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc2.d/K20masqmail +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/S20masqmail +ln -fs '../masqmail' $RPM_BUILD_ROOT/sbin/init.d/rc3.d/K20masqmail +ln -fs '../../sbin/init.d/masqmail' $RPM_BUILD_ROOT/usr/sbin/rcmasqmail + +# configuration examples: +cp examples/masqmail.conf $RPM_BUILD_ROOT/etc/masqmail/ +cp examples/example.route $RPM_BUILD_ROOT/etc/masqmail/ +cp examples/example.get $RPM_BUILD_ROOT/etc/masqmail/ +cp tpl/failmsg.tpl $RPM_BUILD_ROOT/etc/masqmail/tpl/ + +#cp docs/man/masqmail.8 $RPM_BUILD_ROOT/usr/man/man8/ +#cp docs/man/masqmail.conf.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.route.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.get.5 $RPM_BUILD_ROOT/usr/man/man5/ +#cp docs/man/masqmail.aliases.5 $RPM_BUILD_ROOT/usr/man/man5/ + +# gzip the man pages: +gzip $RPM_BUILD_ROOT/usr/man/man8/masqmail.8 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.conf.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.route.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.get.5 +gzip $RPM_BUILD_ROOT/usr/man/man5/masqmail.aliases.5 + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +/usr/sbin/masqmail +/usr/sbin/sendmail +/usr/bin/mailq +/usr/bin/mailrm +/usr/lib/sendmail +%config /sbin/init.d/masqmail +/sbin/init.d/rc2.d/S20masqmail +/sbin/init.d/rc2.d/K20masqmail +/sbin/init.d/rc3.d/S20masqmail +/sbin/init.d/rc3.d/K20masqmail +/usr/sbin/rcmasqmail +%config /etc/masqmail/masqmail.conf +%config /etc/masqmail/tpl/failmsg.tpl +%doc README INSTALL COPYING NEWS +/usr/man/man8/masqmail.8.gz +/usr/man/man5/masqmail.conf.5.gz +/usr/man/man5/masqmail.route.5.gz +/usr/man/man5/masqmail.get.5.gz +/usr/man/man5/masqmail.aliases.5.gz + +%defattr(-,mail,trusted) +%dir /var/masqmail/ +%dir /var/spool/masqmail/ +%dir /var/spool/masqmail/popuidl/ +%dir /var/spool/masqmail/lock/ +%dir /var/spool/masqmail/input/ + + diff -r 000000000000 -r 08114f7dcc23 tests/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/Makefile.am Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,20 @@ +test.conf: $(srcdir)/conf.templ + sed s/SMTP_HOST/`hostname`/ $(srcdir)/conf.templ > test.conf + +local.sh: $(srcdir)/test.templ + sed s/RECV_HOST/localhost/ $(srcdir)/test.templ > local.sh + chmod ugo+x local.sh + +smtpout.sh: $(srcdir)/test.templ + sed s/RECV_HOST/`hostname`/ $(srcdir)/test.templ > smtpout.sh + chmod ugo+x smtpout.sh + +input/: + mkdir input + +all: test.conf local.sh smtpout.sh input/ + +EXTRA_DIST=conf.templ test.templ + +conf.templ: +test.templ: diff -r 000000000000 -r 08114f7dcc23 tests/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/Makefile.in Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,282 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE64_LIBS = @BASE64_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +IDENT_LIBS = @IDENT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LOCKFILE_LIBS = @LOCKFILE_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MD5_LIBS = @MD5_LIBS@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +RESOLV_LIBS = @RESOLV_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_LIBLOCKFILE = @USE_LIBLOCKFILE@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +has_ident = @has_ident@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +with_confdir = @with_confdir@ +with_group = @with_group@ +with_logdir = @with_logdir@ +with_spooldir = @with_spooldir@ +with_user = @with_user@ + +EXTRA_DIST = conf.templ test.templ +subdir = tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +test.conf: $(srcdir)/conf.templ + sed s/SMTP_HOST/`hostname`/ $(srcdir)/conf.templ > test.conf + +local.sh: $(srcdir)/test.templ + sed s/RECV_HOST/localhost/ $(srcdir)/test.templ > local.sh + chmod ugo+x local.sh + +smtpout.sh: $(srcdir)/test.templ + sed s/RECV_HOST/`hostname`/ $(srcdir)/test.templ > smtpout.sh + chmod ugo+x smtpout.sh + +input/: + mkdir input + +all: test.conf local.sh smtpout.sh input/ + +conf.templ: +test.templ: +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r 000000000000 -r 08114f7dcc23 tests/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/README Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,37 @@ +Here a two test programs: local.sh and smtpout.sh. They both send +three mails, using different options. Run them from within this +directory, preferably NOT as root, but you got to have write +permission for this directory. + +local.sh sends mail accepted from stdin and sends them to a fake local +mailbox, using your login name. If it works, there should be a file +named with your login name with the mails. You can look at it with cat +or less, or with an ordinary mail program. + +smtpout.sh sends mail accepted from stdin and sends them to your local +MTA, so use it only if you have an MTA running on your box (sendmail, +exim, qmail or whatever, or masqmail when you have it already +installed). If it works, you should get three mails. + +The scripts assume that your login name corresponds to your mailbox +(quite probable) and that your MTA listens on port 25 with the +interface which corresponds to the hostname as returned by the shell +command "hostname" (without quotes...), also very probable. They are +created with make from test.templ. They use a special configuration +(test.conf) for masqmail, which is also created with make from +conf.templ. + +Two log files, masqmail.log and debug.log will also be created within +this directory. They may give some information if anything went wrong. + +If the log files reveal that your MTA is not willing to relay, you may +have to qualify the hostname: Say + +sed s/RECV_HOST/foo.bar.com/ test.templ > smtpout.sh + +where you set your fully qualified host name for foo.bar.com. + +If they do not work, there could be some problem with either the test +programs, the configuration file or masqmail itself. If you have +installed masqmail successfully and these scripts do not work, do not +worry too much :-). diff -r 000000000000 -r 08114f7dcc23 tests/conf.templ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/conf.templ Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,66 @@ +# Example configuration for MasqMail +# Copyright (C) 1999 Oliver Kurth +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# this is just for testing. In real life it does not make much sense: +run_as_user=true + +# set debug level (0 = no debugging, 5 = very much, 6 = too much) +# can also be set with the -d option on the cmd line +debug_level = 5 + +do_queue = false + +# The name with which MasqMail identifies itself to others: +host_name="blue.patchwork.net" + +# Hosts considered local: +#local_hosts="localhost;blue.patchwork.net;blue" +local_hosts="localhost" + +# Nets considered local, for immediate delivery attempts: +# ALL hosts not included in either local_host or local_nets are +# considered to be 'outside', meaning that messages to them will be queued +local_nets="SMTP_HOST" + +# accept connections on these interfaces: +listen_addresses="localhost:2525" + +# send messages to this port: +# probably this will also be configurable on host basis +remote_port=25 + +# where MasqMail stores its spool files and other stuff: +#spool_dir="/var/spool/masqmail" +spool_dir="." + +# where local mail will be written to: +#mail_dir="/var/spool/mail" +mail_dir="." + +# use syslogd for logs? +use_syslog=false + +# directory for log files if not using syslogd: +#log_dir="/var/masqmail" +log_dir="." + +# special routes: + +connect_route.GWDG = "src/gwdg.route" +connect_route.Argon = "src/argon.route" + diff -r 000000000000 -r 08114f7dcc23 tests/test.templ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test.templ Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,81 @@ +#! /bin/bash + +# should be run from within tests dir +# set if you move this: +mm_src_dir=../src +mm_bin=$mm_src_dir/masqmail + +# +hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>" +hto=$hfrom +to=`logname`@RECV_HOST +hsubject="MasqMail stdin Test" + +# +# Testing with rcpt on cmd line +# (dot does end) +# +# the command to be run: +cmd="$mm_bin -C ./test.conf $to" + +$cmd <. + +Your message follows attached, including all headers: + +--${uid}/${host_name} +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +@msg_headers + +@msg_body + +--${uid}/${host_name}-- diff -r 000000000000 -r 08114f7dcc23 tpl/failmsg.tpl.de --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpl/failmsg.tpl.de Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,52 @@ +Subject: Mail Delivery Failure Notice +From: MAILER-DAEMON@${host_name} +To: ${return_path} +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="${uid}/${host_name}" + +Dies ist eine MIME-formatierte Nachricht. +This is a MIME-encapsulated message. + +--${uid}/${host_name} +Content-Description: Notification +Content-Type: text/plain; + charset=iso-8859-1 + +Diese Nachricht wurde Ihnen von dem Mail Agenten +(${package} ${version}) auf ${host_name} geschickt. +(This message was sent to you by the mailer daemon (${package} ${version}) +at ${host_name}.) + +Bedauerlicherweise konnte Ihre Mail nicht an alle Empfänger weitergeleitet +werden. +(Sorry, but your mail could not be delivered to all recipients.) + +Die Zustellung zu den folgenden Empfängern ist permanent +fehlgeschlagen. Es wird kein weiterer Versuch unternommen: +(Delivery to the following recipients failed permanently and has been given +up:) + +@failed_rcpts + +Diese Fehlermeldung könnte einen Hinweis über die Ursache geben: +(This error message may give you a hint about what caused the +failure:) + +${err_msg} + +Für weitere Hilfe, schreiben Sie an . +(If you need help, write to .) + +Ihre Nachricht folgt im Anhang, einschliesslich aller Header: +(Your message follows attached, including all headers:) + +--${uid}/${host_name} +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +@msg_headers + +@msg_body + +--${uid}/${host_name}-- diff -r 000000000000 -r 08114f7dcc23 tpl/failmsg.tpl.fr --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpl/failmsg.tpl.fr Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,52 @@ +Subject: Mail Delivery Failure Notice +From: MAILER-DAEMON@${host_name} +To: ${return_path} +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="${uid}/${host_name}" + +Ce message est encapsule avec le format MIME. +This is a MIME-encapsulated message. + +--${uid}/${host_name} +Content-Description: Notification +Content-Type: text/plain; + charset=iso-8859-1 + +Ce message vous a été envoyé par le serveur de messagerie +(${package} ${version}) sur ${host_name}. +(This message was sent to you by the mailer daemon (${package} ${version}) +at ${host_name}.) + +J'ai le regret de vous informer que votre courrier n'a pas pu être transmis à +tous ses destinataires. +(Sorry, but your mail could not be delivered to all recipients.) + +L'expédition vers les destinataires suivants a échoué et a été définitivement +abandonnée: +(Delivery to the following recipients failed permanently and has been given +up:) + +@failed_rcpts + +Ce message d'erreur peut vous aider à déterminer la cause de l'échec: +(This error message may give you a hint about what caused the +failure:) + +${err_msg} + +Si vous avez besoin d'aide, veuillez écrire à . +(If you need help, write to .) + +Votre message original est attaché, avec tous ces entêtes: +(Your message follows attached, including all headers:) + +--${uid}/${host_name} +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +@msg_headers + +@msg_body + +--${uid}/${host_name}-- diff -r 000000000000 -r 08114f7dcc23 tpl/failmsg.tpl.it --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpl/failmsg.tpl.it Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,50 @@ +From: MAILER-DAEMON@${host_name} +To: ${return_path} +Subject: invio messaggio FALLITO / Mail Delivery Failure Notice + +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="${uid}/${host_name}" + +Messaggio in formato MIME multi-parti. +This is a MIME-encapsulated message. + +--${uid}/${host_name}-- +Content-Description: Notifica-Notify +Content-Type: text/plain + +Questo messaggio ti e' stato spedito dal demone: + (This message was sent to you by the mailer daemon:) +(${package} ${version}) @ ${host_name}: + +Spiacente ma non e' stato possibile spedire il tuo msg a tutti +i destinatari. L'invio ai seguenti destinatari e' fallito in modo +permanente e non verra' ritentato: + (Sorry, but your mail could not be delivered to all recipients. + Delivery to the following recipients failed permanently and has + been given up:) + +@failed_rcpts + +Il seguente msg d'errore potrebbe aiutarti a capire la causa +dell'errore: + (This error message may give you a hint about what caused the + failure:) + +${err_msg} + +In caso ti serva aiuto scrivi a . +Il tuo msg segue in allegato. + (If you need help, write to . + Your message follows attached, including all headers:) + +--${uid}/${host_name} +Content-Description: Messaggio non spedito - Unsent message +Content-Type: message/rfc822 + +@msg_headers + +[corpo del messaggio - tralasciato] + ([message body - stripped off]) + +--${uid}/${host_name}-- diff -r 000000000000 -r 08114f7dcc23 tpl/warnmsg.tpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpl/warnmsg.tpl Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,42 @@ +Subject: Warning: could not yet send message +From: MAILER-DAEMON@${host_name} +To: ${return_path} +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="${uid}/${host_name}" + +This is a MIME-encapsulated message. + +--${uid}/${host_name} +Content-Description: Notification +Content-Type: text/plain + +This message was sent to you by the mailer daemon (${package} ${version}) +at ${host_name}. + +Sorry, but your mail could not yet be delivered to all recipients. +Delivery to the following recipients has been defered: + +@failed_rcpts + +Delivery will be tried again, until it is either successful or a +timeout has been reached. If the latter happens, you will get a +delivery failure notice. + + +This error message may give you a hint about what caused the +delay: + +${err_msg} + +If you need help, write to . + +The headers of your message follow attached: + +--${uid}/${host_name} +Content-Description: Undelivered Message Headers +Content-Type: message/rfc822 + +@msg_headers + +--${uid}/${host_name}-- diff -r 000000000000 -r 08114f7dcc23 tpl/warnmsg.tpl.de --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpl/warnmsg.tpl.de Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,54 @@ +Subject: Warning: could not yet send message +From: MAILER-DAEMON@${host_name} +To: ${return_path} +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="${uid}/${host_name}" + +This is a MIME-encapsulated message. + +--${uid}/${host_name} +Content-Description: Notification +Content-Type: text/plain; + charset=iso-8859-1 + +Diese Nachricht wurde Ihnen von dem Mail Agenten +(${package} ${version}) auf ${host_name} geschickt. +(This message was sent to you by the mailer daemon (${package} ${version}) +at ${host_name}.) + +Bedauerlicherweise konnte Ihre Mail noch nicht an alle Empfänger +zugestellt werden. +(Sorry, but your mail could not yet be delivered to all recipients.) + +Die Mail konnte bis jetzt zu folgenden Empfängern nicht zugestellt werden: +(Delivery to the following recipients has been defered:) + +@failed_rcpts + +Die Zustellung wird weiterhin versucht, bis sie entweder erfolgreich +ist oder ein Zeitlimit eingetreten ist. In letzterem Fall wird +Ihnen eine Fehlermeldung zugestellt. +(Delivery will be tried again, until it is either successfull or a +timeout has been reached. If the latter happens, you will get a +delivery failure notice.) + +Diese Fehlermeldung könnte einen Hinweis über die Ursache geben: +(This error message may give you a hint about what caused the +delay:) + +${err_msg} + +Für weitere Hilfe, schreiben Sie an . +(If you need help, write to .) + +Die header Ihrer Mail folgen im Anhang: +(The headers of your message follow attached:) + +--${uid}/${host_name} +Content-Description: Undelivered Message Headers +Content-Type: message/rfc822 + +@msg_headers + +--${uid}/${host_name}-- diff -r 000000000000 -r 08114f7dcc23 tpl/warnmsg.tpl.fr --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tpl/warnmsg.tpl.fr Fri Sep 26 17:05:23 2008 +0200 @@ -0,0 +1,74 @@ +Subject: Attention: impossible d'envoyer un message +From: MAILER-DAEMON@${host_name} +To: ${return_path} +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="${uid}/${host_name}" + +Ce message est encapsule avec le format MIME. +This is a MIME-encapsulated message. + +--${uid}/${host_name} +Content-Description: Notification +Content-Type: text/plain; + charset=iso-8859-1 + +[ENGLISH BELOW] + +------------------------------[ FRANCAIS ]------------------------------ + +Ce message vous a été envoyé par le serveur de messagerie +(${package} ${version}) sur ${host_name}. + +J'ai le regret de vous informer que votre courrier n'a pas pu être transmis +à tous ses destinataires. L'expédition vers les destinataires suivants a été +différée: + +@failed_rcpts + +D'autres tentatives d'envoi vont être effectuées, jusqu'à ce que cela +réussisse ou dépasse une certaine limite dans le temps. Dans ce cas, vous +recevrez une notification d'échec d'expédition. + + +Ce message d'erreur peut peut-être vous aider à déterminer l'origine du +délai: + +${err_msg} + +Si vous avez besoin d'aide, écrivez à . + +Les entêtes de votre message sont inclus en pièce jointe. + + +------------------------------[ ENGLISH ]------------------------------ + +This message was sent to you by the mailer daemon (${package} ${version}) +at ${host_name}. + +Sorry, but your mail could not yet be delivered to all recipients. +Delivery to the following recipients has been defered: + +@failed_rcpts + +Delivery will be tried again, until it is either successfull or a +timeout has been reached. If the latter happens, you will get a +delivery failure notice. + + +This error message may give you a hint about what caused the +delay: + +${err_msg} + +If you need help, write to . + +The headers of your message follow attached: + +--${uid}/${host_name} +Content-Description: Undelivered Message Headers +Content-Type: message/rfc822 + +@msg_headers + +--${uid}/${host_name}--